Scalar.h¶
Note
The documentation on this page was automatically extracted from the DOLFIN C++ code and may need to be edited or expanded.
-
class
Scalar
¶ Parent class(es)
This class represents a real-valued scalar quantity and implements the GenericTensor interface for scalars.
-
Scalar
()¶ Create zero scalar
-
void
resize
(std::size_t rank, const std::size_t *dims)¶ Resize tensor to given dimensions
-
void
init
(const TensorLayout &tensor_layout)¶ Initialize zero tensor using sparsity pattern
-
std::size_t
rank
() const¶ Return tensor rank (number of dimensions)
-
std::size_t
size
(std::size_t dim) const¶ Return size of given dimension
-
std::pair<std::size_t, std::size_t>
local_range
(std::size_t dim) const¶ Return local ownership range
-
void
get
(double *block, const dolfin::la_index *num_rows, const dolfin::la_index *const *rows) const¶ Get block of values
-
void
set
(const double *block, const dolfin::la_index *num_rows, const dolfin::la_index *const *rows)¶ Set block of values
-
void
add
(const double *block, const dolfin::la_index *num_rows, const dolfin::la_index *const *rows)¶ Add block of values
-
void
add
(const double *block, const std::vector<const std::vector<dolfin::la_index> *> &rows)¶ Add block of values
-
void
add
(const double *block, const std::vector<std::vector<dolfin::la_index>> &rows)¶ Add block of values
-
void
zero
()¶ Set all entries to zero and keep any sparse structure
-
void
apply
(std::string mode)¶ Finalize assembly of tensor
-
std::string
str
(bool verbose) const¶ Return informal string representation (pretty-print)
-
operator double
() const¶ Cast to double
-
GenericLinearAlgebraFactory &
factory
() const¶ Return a factory for the default linear algebra backend
-
double
getval
() const¶ Get value
-