MultiMesh

class dolfin.cpp.mesh.MultiMesh(*args)

Bases: dolfin.cpp.common.Variable

This class represents a collection of meshes with arbitrary overlaps. A multimesh may be created from a set of standard meshes spaces by repeatedly calling add , followed by a call to build . Note that a multimesh is not useful until build has been called.

Create multimesh from three meshes.

Parameters:
  • const Mesh > mesh_0 (std::shared_ptr<) –
  • const Mesh > mesh_1 (std::shared_ptr<) –
  • const Mesh > mesh_2 (std::shared_ptr<) –
  • quadrature_order (std::size_t) –
add()

Add mesh Arguments mesh (Mesh ) The mesh

Parameters:const Mesh > mesh (std::shared_ptr<) –
Return type:void
bounding_box_tree()

Return the bounding box tree for the mesh of the given part Arguments part (std::size_t) The part number Returns std::shared_ptr<const BoundingBoxTree> The bounding box tree

Parameters:part (std::size_t) –
Return type:std::shared_ptr< const BoundingBoxTree >
bounding_box_tree_boundary()

Return the bounding box tree for the boundary mesh of the given part Arguments part (std::size_t) The part number Returns std::shared_ptr<const BoundingBoxTree> The bounding box tree

Parameters:part (std::size_t) –
Return type:std::shared_ptr< const BoundingBoxTree >
build()

Build multimesh.

Parameters:quadrature_order (std::size_t) –
Return type:void
clear()

Clear multimesh.

Return type:void
collision_map_cut_cells()

Return the collision map for cut cells of the given part Arguments part (std::size_t) The part number Returns std::map<unsigned int, std::vector<std::pair<std::size_t, unsigned int> > > A map from cell indices of cut cells to a list of cutting cells. Each cutting cell is represented as a pair (part_number, cutting_cell_index).

Parameters:part (std::size_t) –
Return type:const std::map< unsigned int, std::vector< std::pair< std::size_t, unsigned int > > > &
compute_area()

Compute total interface area or the total volume of multimesh by summing up quadrature weights. If the area or volume of the domain mesh is known, this is a good test to verify that the mesh-mesh intersections and quadrature are correct.

Return type:double
compute_volume()

Corresponding function for volume.

Return type:double
covered_cells()

Return the list of covered cells for given part. The covered cells are defined as all cells that collide with the domain of any part with higher part number, but not with the boundary of that part; in other words cells that are completely covered by any other part (and which therefore are inactive). Arguments part (std::size_t) The part number Returns std::vector<unsigned int> List of covered cell indices for given part

Parameters:part (std::size_t) –
Return type:const std::vector< unsigned int > &
cut_cells()

Return the list of cut cells for given part. The cut cells are defined as all cells that collide with the boundary of any part with higher part number. FIXME: Figure out whether this makes sense; a cell may collide with the boundary of part j but may still be covered completely by the domain of part j + 1. Possible solution is to for each part i check overlapping parts starting from the top and working back down to i + 1. Arguments part (std::size_t) The part number Returns std::vector<unsigned int> List of cut cell indices for given part

Parameters:part (std::size_t) –
Return type:const std::vector< unsigned int >
static default_parameters()
facet_normals()

Return facet normals for the interface on the given part Arguments part (std::size_t) The part number Returns std::map<unsigned int, std::vector<std::vector<double> > > A map from cell indices of cut cells to facet normals on an interface part cutting through the cell. A separate list of facet normals, one for each quadrature point, is given for each cutting cell and stored in the same order as in the collision map. The facet normals for each set of quadrature points is stored as a contiguous flattened array, the length of which should be equal to the number of quadrature points multiplied by the geometric dimension. Puh!

Parameters:part (std::size_t) –
Return type:const std::map< unsigned int, std::vector< std::vector< double > > > &
is_built()

Check whether multimesh has been built.

Return type:bool
mpi_comm()
num_parts()

Return the number of meshes (parts) of the multimesh Returns std::size_t The number of meshes (parts) of the multimesh.

Return type:std::size_t
part()

Return mesh (part) number i Arguments i (std::size_t) The part number Returns:cpp:any:Mesh Mesh (part) number i

Parameters:i (std::size_t) –
Return type:std::shared_ptr< const Mesh >
plot_matplotlib()

Create matplotlib string to plot 2D multimesh (small meshes only)

Parameters:
  • delta_z (double) –
  • std::string & filename (const) –
Return type:

std::string

quadrature_rules_cut_cells()
quadrature_rules_interface()
quadrature_rules_overlap()
thisown

The membership flag

type()
ufl_cell()

Returns the ufl cell of the mesh.

ufl_coordinate_element()

Return the finite element of the coordinate vector field of this domain.

ufl_domain()

Returns the ufl domain corresponding to the mesh.

ufl_id()

Returns an id that UFL can use to decide if two objects are the same.

uncut_cells()

Return the list of uncut cells for given part. The uncut cells are defined as all cells that don’t collide with any cells in any other part with higher part number. Arguments part (std::size_t) The part number Returns std::vector<unsigned int> List of uncut cell indices for given part

Parameters:part (std::size_t) –
Return type:const std::vector< unsigned int > &