MeshFunction.h¶
Note
The documentation on this page was automatically extracted from the DOLFIN C++ code and may need to be edited or expanded.
-
class
MeshFunction¶ Parent class(es)
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.
-
MeshFunction()¶ Create empty mesh function
Create empty mesh function on given mesh
- @param mesh (Mesh)
- The mesh to create mesh function on.
Create mesh function of given dimension on given mesh
- @param mesh (Mesh)
- The mesh to create mesh function on.
- @param dim (std::size_t)
- The mesh entity dimension for the mesh function.
Create mesh of given dimension on given mesh and initialize to a value
- @param mesh (
Mesh) - The mesh to create mesh function on.
- @param dim (std::size_t)
- The mesh entity dimension.
- @param value (T)
- The value.
- @param mesh (
Create function from data file (shared_ptr version)
- @param mesh (
Mesh) - The mesh to create mesh function on.
- @param filename (std::string)
- The filename to create mesh function from.
- @param mesh (
Create function from a MeshValueCollecion (shared_ptr version)
- @param mesh (
Mesh) - The mesh to create mesh function on.
- @param value_collection (
MeshValueCollection) - The mesh value collection for the mesh function data.
- @param mesh (
Create function from MeshDomains
- @param mesh (
Mesh) - The mesh to create mesh function on.
- @param dim (std::size_t)
- The dimension of the MeshFunction
- @param domains (_MeshDomains)
- The domains from which to extract the domain markers
- @param mesh (
-
MeshFunction(const MeshFunction<T> &f)¶ Copy constructor
- @param f (
MeshFunction) - The object to be copied.
- @param f (
-
MeshFunction<T> &
operator=(const MeshFunction<T> &f)¶ Assign mesh function to other mesh function Assignment operator
- @param f (
MeshFunction) - A
MeshFunctionobject to assign to another MeshFunction.
- @param f (
-
MeshFunction<T> &
operator=(const MeshValueCollection<T> &mesh)¶ Assignment operator
- @param mesh (
MeshValueCollection) - A
MeshValueCollectionobject used to construct a MeshFunction.
- @param mesh (
-
std::shared_ptr<const Mesh>
mesh() const¶ Return mesh associated with mesh function
- @return
Mesh - The mesh.
- @return
-
std::size_t
dim() const¶ Return topological dimension
- @return std::size_t
- The dimension.
-
bool
empty() const¶ Return true if empty
- @return bool
- True if empty.
-
std::size_t
size() const¶ Return size (number of entities)
- @return std::size_t
- The size.
-
const T *
values() const¶ Return array of values (const. version)
- return T
- The values.
-
T *
values()¶ Return array of values
- return T
- The values.
-
T &
operator[](const MeshEntity &entity)¶ Return value at given mesh entity
- @param entity (
MeshEntity) - The mesh entity.
- return T
- The value at the given entity.
- @param entity (
-
const T &
operator[](const MeshEntity &entity) const¶ Return value at given mesh entity (const version)
- @param entity (
MeshEntity) - The mesh entity.
- @return T
- The value at the given entity.
- @param entity (
-
T &
operator[](std::size_t index)¶ Return value at given index
- @param index (std::size_t)
- The index.
- @return T
- The value at the given index.
-
const T &
operator[](std::size_t index) const¶ Return value at given index (const version)
- @param index (std::size_t)
- The index.
- @return T
- The value at the given index.
-
const MeshFunction<T> &
operator=(const T &value)¶ Set all values to given value @param value (T)
-
void
init(std::size_t dim)¶ Initialize mesh function for given topological dimension
- @param dim (std::size_t)
- The dimension.
-
void
init(std::size_t dim, std::size_t size)¶ Initialize mesh function for given topological dimension of given size
- @param dim (std::size_t)
- The dimension.
- @param size (std::size_t)
- The size.
Initialize mesh function for given topological dimension
- @param mesh (
Mesh) - The mesh.
- @param dim (std::size_t)
- The dimension.
- @param mesh (
Initialize mesh function for given topological dimension of given size (shared_ptr version)
- @param mesh (
Mesh) - The mesh.
- @param dim (std::size_t)
- The dimension.
- @param size (std::size_t)
- The size.
- @param mesh (
-
void
set_value(std::size_t index, const T &value)¶ Set value at given index
- @param index (std::size_t)
- The index.
- @param value (T)
- The 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)¶ Set values
- @param values (std::vector<T>)
- The values.
-
void
set_all(const T &value)¶ Set all values to given value
- @param value (T)
- The value to set all values to.
-
std::vector<std::size_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.
-
std::string
str(bool verbose) const¶ Return informal string representation (pretty-print)
- @param verbose (bool)
- Flag to turn on additional output.
- @return std::string
- An informal representation.
-