MeshValueCollectionSizet¶
-
class
dolfin.cpp.mesh.
MeshValueCollectionSizet
(*args)¶ Bases:
dolfin.cpp.common.Variable
The MeshValueCollection class can be used to store data associated with a subset of the entities of a mesh of a given topological dimension. It differs from the MeshFunction class in two ways. First, data does not need to be associated with all entities (only a subset). Second, data is associated with entities through the corresponding cell index and local entity number (relative to the cell), not by global entity index, which means that data may be stored robustly to file.
Overloaded versions
MeshValueCollection()
Create empty mesh value collection
MeshValueCollection(mesh)
Create an empty mesh value collection on a given mesh
- Arguments
- mesh (
Mesh
) The mesh.
- mesh (
MeshValueCollection(mesh_function)
Create a mesh value collection from a MeshFunction
- Arguments
- mesh_function (
MeshFunction
) The mesh function for creating a MeshValueCollection.
- mesh_function (
MeshValueCollection(mesh, dim)
Create a mesh value collection of entities of given dimension on a given mesh
- Arguments
- mesh (
Mesh
) The mesh associated with the collection.
- dim (int)
The mesh entity dimension for the mesh value collection.
- mesh (
MeshValueCollection(mesh, dim)
Create a mesh value collection of entities of given dimension on a given mesh (shared_ptr version)
- Arguments
- mesh (
Mesh
) The mesh associated with the collection.
- dim (int)
The mesh entity dimension for the mesh value collection.
- mesh (
MeshValueCollection(mesh, filename)
Create a mesh value collection from a file.
- Arguments
- mesh (Mesh)
A mesh associated with the collection. The mesh is used to map collection values to the appropriate process.
- filename (str)
The XML file name.
- dim (int)
The mesh entity dimension for the mesh value collection.
-
assign
()¶ Missing docstring
-
clear
()¶ Clear all values
-
dim
()¶ Return topological dimension
- Returns
- int
- The dimension.
-
empty
()¶ Return true if the subset is empty
- Returns
- bool
- True if the subset is empty.
-
get_value
()¶ Get marker value for given entity defined by a cell index and a local entity index
- Arguments
- cell_index (int)
- The index of the cell.
- local_entity (int)
- The local index of the entity relative to the cell.
- Returns
- marker_value (T)
- The value of the marker.
-
init
()¶ Overloaded versions
init(mesh, dim)
Initialise MeshValueCollection wirth mesh and dimension
- Arguments
- mesh (_mesh)
The mesh on which the value collection is defined
- dim (int)
The mesh entity dimension for the mesh value collection.
init(mesh, dim)
Initialise MeshValueCollection wirth mesh and dimension (shared_ptr version)
- Arguments
- mesh (_mesh)
The mesh on which the value collection is defined
- dim (int)
The mesh entity dimension for the mesh value collection.
init(dim)
Set dimension. This function should not generally be used. It is for reading MeshValueCollections as the dimension is not generally known at construction.
- Arguments
- dim (int)
The mesh entity dimension for the mesh value collection.
-
set_value
()¶ Overloaded versions
set_value(cell_index, local_entity, value)
Set marker value for given entity defined by a cell index and a local entity index
- Arguments
- cell_index (int)
The index of the cell.
- local_entity (int)
The local index of the entity relative to the cell.
- marker_value (T)
The value of the marker.
- Returns
- bool
True is a new value is inserted, false if overwriting an existing value.
set_value(entity_index, value)
Set value for given entity index
- Arguments
- entity_index (int)
Index of the entity.
- value (T)
The value of the marker.
- mesh (
Mesh
) The mesh.
- Returns
- bool
True is a new value is inserted, false if overwriting an existing value.
-
size
()¶ Return size (number of entities in subset)
- Returns
- int
- The size.
-
thisown
¶ The membership flag
-
values
()¶ Overloaded versions
values()
Get all values
- Returns
- std::map<std::pair<std::size_t, std::size_t>, T>
A map from positions to values.
values()
Get all values (const version)
- Returns
- std::map<std::pair<std::size_t, std::size_t>, T>
A map from positions to values.