Register an element type to the given VTK cell type and give it a domain builder callback function.
- Parameters
-
vtkCellType | The type of VTK cell for which we want the builder to be use |
builder | A callback function that will be called with the mesh being created and the list of element node indices. The builder is responsible to create the Domain and add it to the mesh. The list of element node indices is given as a NxM matrix where N is the number of elements, and M is the number of nodes per elements. Domain created domain should be returned by the callback, or nullptr if the creation failed. |
DomainBuilder Signature:
builder(Mesh<Dimension> &
mesh,
const ElementsIndices & indices) -> BaseDomain *;
Where mesh is the current mesh being created and ElementsIndices is an array of the following form:
* // Node 1 Node 2 Node 3 ... Node M
* [[ e1n1, e1n2, e1n3, ..., e1nM ], // Element 1
* [ e2n1, e2n2, e2n3, ..., e2nM ], // Element 2
* ...
* [ eNn1, eNn2, eNn3, ..., eNnM] ] // Element N
*
Here, for example, e2n4 means the indice of the second node of the fourth element of the mesh.
Example:
reader.register_element_type(VTK_HEXAHEDRON, [](Mesh<_3D> &
mesh,
const Mesh<_3D>::ElementsIndices &indices)) {
return m.add_domain<Hexahedron>("my_hexahdral_domain", indices);
});
auto mesh = reader.mesh();