DOLFIN
DOLFIN C++ interface
Public Member Functions | List of all members
dolfin::Scalar Class Reference

#include <Scalar.h>

Inheritance diagram for dolfin::Scalar:
Inheritance graph
[legend]
Collaboration diagram for dolfin::Scalar:
Collaboration graph
[legend]

Public Member Functions

 Scalar ()
 Create zero scalar.
 
 Scalar (MPI_Comm comm)
 Create zero scalar.
 
virtual ~Scalar ()
 Destructor.
 
virtual void init (const TensorLayout &tensor_layout)
 Initialize zero tensor using sparsity pattern.
 
virtual bool empty () const
 Return true if empty.
 
virtual std::size_t rank () const
 Return tensor rank (number of dimensions)
 
virtual std::size_t size (std::size_t dim) const
 Return size of given dimension.
 
virtual std::pair< std::int64_t, std::int64_t > local_range (std::size_t dim) const
 Return local ownership range.
 
virtual void get (double *block, const dolfin::la_index *num_rows, const dolfin::la_index *const *rows) const
 Get block of values.
 
virtual void set (const double *block, const dolfin::la_index *num_rows, const dolfin::la_index *const *rows)
 Set block of values using global indices.
 
virtual void set_local (const double *block, const dolfin::la_index *num_rows, const dolfin::la_index *const *rows)
 Set block of values using local indices.
 
virtual void add (const double *block, const dolfin::la_index *num_rows, const dolfin::la_index *const *rows)
 Add block of values using global indices.
 
virtual void add_local (const double *block, const dolfin::la_index *num_rows, const dolfin::la_index *const *rows)
 Add block of values using local indices.
 
virtual void add (const double *block, const std::vector< ArrayView< const dolfin::la_index >> &rows)
 Add block of values using global indices.
 
virtual void add_local (const double *block, const std::vector< ArrayView< const dolfin::la_index >> &rows)
 Add block of values using local indices.
 
virtual void zero ()
 Set all entries to zero and keep any sparse structure.
 
virtual void apply (std::string mode)
 Finalize assembly of tensor.
 
virtual MPI_Comm mpi_comm () const
 Return MPI communicator.
 
virtual std::string str (bool verbose) const
 Return informal string representation (pretty-print)
 
virtual std::shared_ptr< Scalarcopy () const
 Return copy of scalar.
 
virtual GenericLinearAlgebraFactoryfactory () const
 Return a factory for the default linear algebra backend.
 
double get_scalar_value () const
 
void add_local_value (double value)
 
- Public Member Functions inherited from dolfin::GenericTensor
virtual ~GenericTensor ()
 Destructor.
 
- Public Member Functions inherited from dolfin::LinearAlgebraObject
virtual const LinearAlgebraObjectinstance () const
 Return concrete instance / unwrap (const version)
 
virtual LinearAlgebraObjectinstance ()
 Return concrete instance / unwrap (non-const version)
 
virtual std::shared_ptr< const LinearAlgebraObjectshared_instance () const
 Return concrete shared ptr instance / unwrap (const version)
 
virtual std::shared_ptr< LinearAlgebraObjectshared_instance ()
 Return concrete shared ptr instance / unwrap (non-const version)
 
- Public Member Functions inherited from dolfin::Variable
 Variable ()
 Create unnamed variable.
 
 Variable (const std::string name, const std::string label)
 Create variable with given name and label.
 
 Variable (const Variable &variable)
 Copy constructor.
 
virtual ~Variable ()
 Destructor.
 
const Variableoperator= (const Variable &variable)
 Assignment operator.
 
void rename (const std::string name, const std::string label)
 Rename variable.
 
std::string name () const
 Return name.
 
std::string label () const
 Return label (description)
 
std::size_t id () const
 

Additional Inherited Members

- Public Attributes inherited from dolfin::Variable
Parameters parameters
 Parameters.
 

Detailed Description

This class represents a real-valued scalar quantity and implements the GenericTensor interface for scalars.

Member Function Documentation

◆ add_local_value()

void dolfin::Scalar::add_local_value ( double  value)
inline

Add to local increment (added for testing, remove if we add a better way from python)

◆ get_scalar_value()

double dolfin::Scalar::get_scalar_value ( ) const
inline

Get final value (assumes prior apply(), not part of GenericTensor interface)


The documentation for this class was generated from the following file: