DOLFIN
DOLFIN C++ interface
|
#include <MeshFunction.h>
Public Member Functions | |
MeshFunction () | |
Create empty mesh function. | |
MeshFunction (std::shared_ptr< const Mesh > mesh) | |
MeshFunction (std::shared_ptr< const Mesh > mesh, std::size_t dim) | |
MeshFunction (std::shared_ptr< const Mesh > mesh, std::size_t dim, const T &value) | |
MeshFunction (std::shared_ptr< const Mesh > mesh, const std::string filename) | |
MeshFunction (std::shared_ptr< const Mesh > mesh, const MeshValueCollection< T > &value_collection) | |
MeshFunction (std::shared_ptr< const Mesh > mesh, std::size_t dim, const MeshDomains &domains) | |
MeshFunction (const MeshFunction< T > &f) | |
~MeshFunction () | |
Destructor. | |
MeshFunction< T > & | operator= (const MeshFunction< T > &f) |
MeshFunction< T > & | operator= (const MeshValueCollection< T > &mesh) |
std::shared_ptr< const Mesh > | mesh () const |
std::size_t | dim () const |
bool | empty () const |
std::size_t | size () const |
const T * | values () const |
T * | values () |
T & | operator[] (const MeshEntity &entity) |
const T & | operator[] (const MeshEntity &entity) const |
T & | operator[] (std::size_t index) |
const T & | operator[] (std::size_t index) const |
const MeshFunction< T > & | operator= (const T &value) |
void | init (std::size_t dim) |
void | init (std::size_t dim, std::size_t size) |
void | init (std::shared_ptr< const Mesh > mesh, std::size_t dim) |
void | init (std::shared_ptr< const Mesh > mesh, std::size_t dim, std::size_t size) |
void | set_value (std::size_t index, const T &value) |
void | set_value (std::size_t index, const T &value, const Mesh &mesh) |
Compatibility function for use in SubDomains. | |
void | set_values (const std::vector< T > &values) |
void | set_all (const T &value) |
std::vector< std::size_t > | where_equal (T value) |
std::string | str (bool verbose) const |
template<> | |
std::string | str (bool verbose) const |
Return informal string representation (pretty-print) | |
template<> | |
std::string | str (bool verbose) const |
Return informal string representation (pretty-print) | |
template<> | |
std::string | str (bool verbose) const |
Return informal string representation (pretty-print) | |
template<> | |
std::string | str (bool verbose) const |
Return informal string representation (pretty-print) | |
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 Variable & | operator= (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 |
Public Member Functions inherited from dolfin::Hierarchical< MeshFunction< T > > | |
Hierarchical (MeshFunction< T > &self) | |
Constructor. | |
virtual | ~Hierarchical () |
Destructor. | |
std::size_t | depth () const |
bool | has_parent () const |
bool | has_child () const |
MeshFunction< T > & | parent () |
const MeshFunction< T > & | parent () const |
Return parent in hierarchy (const version). | |
std::shared_ptr< MeshFunction< T > > | parent_shared_ptr () |
std::shared_ptr< const MeshFunction< T > > | parent_shared_ptr () const |
Return shared pointer to parent (const version). | |
MeshFunction< T > & | child () |
const MeshFunction< T > & | child () const |
Return child in hierarchy (const version). | |
std::shared_ptr< MeshFunction< T > > | child_shared_ptr () |
std::shared_ptr< const MeshFunction< T > > | child_shared_ptr () const |
Return shared pointer to child (const version). | |
MeshFunction< T > & | root_node () |
const MeshFunction< T > & | root_node () const |
Return root node object in hierarchy (const version). | |
std::shared_ptr< MeshFunction< T > > | root_node_shared_ptr () |
std::shared_ptr< const MeshFunction< T > > | root_node_shared_ptr () const |
Return shared pointer to root node object in hierarchy (const version). | |
MeshFunction< T > & | leaf_node () |
const MeshFunction< T > & | leaf_node () const |
Return leaf node object in hierarchy (const version). | |
std::shared_ptr< MeshFunction< T > > | leaf_node_shared_ptr () |
std::shared_ptr< const MeshFunction< T > > | leaf_node_shared_ptr () const |
Return shared pointer to leaf node object in hierarchy (const version). | |
void | set_parent (std::shared_ptr< MeshFunction< T > > parent) |
Set parent. | |
void | clear_child () |
Clear child. | |
void | set_child (std::shared_ptr< MeshFunction< T > > child) |
Set child. | |
const Hierarchical & | operator= (const Hierarchical &hierarchical) |
Assignment operator. | |
void | _debug () const |
Function useful for debugging the hierarchy. | |
Additional Inherited Members | |
Public Attributes inherited from dolfin::Variable | |
Parameters | parameters |
Parameters. | |
A MeshFunction is a function that can be evaluated at a set of mesh entities. A MeshFunction is discrete and is only defined at the set of mesh entities of a fixed topological dimension. A MeshFunction may for example be used to store a global numbering scheme for the entities of a (parallel) mesh, marking sub domains or boolean markers for mesh refinement.
|
explicit |
Create empty mesh function on given mesh
mesh | (Mesh) The mesh to create mesh function on. |
dolfin::MeshFunction< T >::MeshFunction | ( | std::shared_ptr< const Mesh > | mesh, |
std::size_t | dim | ||
) |
Create mesh function of given dimension on given mesh
mesh | (Mesh) The mesh to create mesh function on. |
dim | (std::size_t) The mesh entity dimension for the mesh function. |
dolfin::MeshFunction< T >::MeshFunction | ( | std::shared_ptr< const Mesh > | mesh, |
std::size_t | dim, | ||
const T & | value | ||
) |
Create mesh of given dimension on given mesh and initialize to a value
mesh | (Mesh) The mesh to create mesh function on. |
dim | (std::size_t) The mesh entity dimension. |
value | (T) The value. |
dolfin::MeshFunction< T >::MeshFunction | ( | std::shared_ptr< const Mesh > | mesh, |
const std::string | filename | ||
) |
Create function from data file (shared_ptr version)
mesh | (Mesh) The mesh to create mesh function on. |
filename | (std::string) The filename to create mesh function from. |
dolfin::MeshFunction< T >::MeshFunction | ( | std::shared_ptr< const Mesh > | mesh, |
const MeshValueCollection< T > & | value_collection | ||
) |
Create function from a MeshValueCollecion (shared_ptr version)
mesh | (Mesh) The mesh to create mesh function on. |
value_collection | (MeshValueCollection) The mesh value collection for the mesh function data. |
dolfin::MeshFunction< T >::MeshFunction | ( | std::shared_ptr< const Mesh > | mesh, |
std::size_t | dim, | ||
const MeshDomains & | domains | ||
) |
Create function from MeshDomains
mesh | (Mesh) The mesh to create mesh function on. |
dim | (std::size_t) The dimension of the MeshFunction |
domains | (_MeshDomains) The domains from which to extract the domain markers |
dolfin::MeshFunction< T >::MeshFunction | ( | const MeshFunction< T > & | f | ) |
Copy constructor
f | (MeshFunction) The object to be copied. |
std::size_t dolfin::MeshFunction< T >::dim | ( | ) | const |
Return topological dimension
bool dolfin::MeshFunction< T >::empty | ( | ) | const |
Return true if empty
void dolfin::MeshFunction< T >::init | ( | std::size_t | dim | ) |
Initialize mesh function for given topological dimension
dim | (std::size_t) The dimension. |
void dolfin::MeshFunction< T >::init | ( | std::size_t | dim, |
std::size_t | size | ||
) |
Initialize mesh function for given topological dimension of given size
dim | (std::size_t) The dimension. |
size | (std::size_t) The size. |
void dolfin::MeshFunction< T >::init | ( | std::shared_ptr< const Mesh > | mesh, |
std::size_t | dim | ||
) |
Initialize mesh function for given topological dimension
mesh | (Mesh) The mesh. |
dim | (std::size_t) The dimension. |
void dolfin::MeshFunction< T >::init | ( | std::shared_ptr< const Mesh > | mesh, |
std::size_t | dim, | ||
std::size_t | size | ||
) |
Initialize mesh function for given topological dimension of given size (shared_ptr version)
mesh | (Mesh) The mesh. |
dim | (std::size_t) The dimension. |
size | (std::size_t) The size. |
std::shared_ptr< const Mesh > dolfin::MeshFunction< T >::mesh | ( | ) | const |
Return mesh associated with mesh function
MeshFunction< T > & dolfin::MeshFunction< T >::operator= | ( | const MeshFunction< T > & | f | ) |
Assign mesh function to other mesh function Assignment operator
f | (MeshFunction) A MeshFunction object to assign to another MeshFunction. |
MeshFunction< T > & dolfin::MeshFunction< T >::operator= | ( | const MeshValueCollection< T > & | mesh | ) |
Assignment operator
mesh | (MeshValueCollection) A MeshValueCollection object used to construct a MeshFunction. |
const MeshFunction< T > & dolfin::MeshFunction< T >::operator= | ( | const T & | value | ) |
Set all values to given value
value | (T) |
T & dolfin::MeshFunction< T >::operator[] | ( | const MeshEntity & | entity | ) |
Return value at given mesh entity
entity | (MeshEntity) The mesh entity. |
return T The value at the given entity.
const T & dolfin::MeshFunction< T >::operator[] | ( | const MeshEntity & | entity | ) | const |
Return value at given mesh entity (const version)
entity | (MeshEntity) The mesh entity. |
T & dolfin::MeshFunction< T >::operator[] | ( | std::size_t | index | ) |
Return value at given index
index | (std::size_t) The index. |
const T & dolfin::MeshFunction< T >::operator[] | ( | std::size_t | index | ) | const |
Return value at given index (const version)
index | (std::size_t) The index. |
void dolfin::MeshFunction< T >::set_all | ( | const T & | value | ) |
Set all values to given value
value | (T) The value to set all values to. |
void dolfin::MeshFunction< T >::set_value | ( | std::size_t | index, |
const T & | value | ||
) |
Set value at given index
index | (std::size_t) The index. |
value | (T) The value. |
void dolfin::MeshFunction< T >::set_values | ( | const std::vector< T > & | values | ) |
Set values
values | (std::vector<T>) The values. |
std::size_t dolfin::MeshFunction< T >::size | ( | ) | const |
Return size (number of entities)
|
virtual |
Return informal string representation (pretty-print)
verbose | (bool) Flag to turn on additional output. |
Reimplemented from dolfin::Variable.
const T * dolfin::MeshFunction< T >::values | ( | ) | const |
Return array of values (const. version)
return T The values.
T * dolfin::MeshFunction< T >::values | ( | ) |
Return array of values
return T The values.
std::vector< std::size_t > dolfin::MeshFunction< T >::where_equal | ( | T | value | ) |
Get indices where meshfunction is equal to given value
Arguments value (T) The value. Returns std::vector<T> The indices.