Caribou
|
A Domain is a subspace of a Mesh containing a set of points and the topological relation between them. It does not contain any world positions of the points, but only their connectivity.
The Domain class supports either internal storing of the node connectivity, or external storing ( for example when the vector of node indices for every elements are stored externally).
In a Domain, all the elements are of the same type. For example, a Domain can not contain both hexahedrons and tetrahedrons.
A Domain can only reside inside one and only one Mesh. In fact, only a Mesh can create a Domain instance. The Mesh will typically contain one or more domains.
Example of a domain that stores internally its connectivity:
Example of a domain that uses the connectivity stored externally:
Element | See caribou::geometry::Element |
NodeIndex | The type of integer used for a node index |
#include <Domain.h>
Public Types | |
using | MeshType = Mesh |
using | ElementType = Element |
using | NodeIndexType = NodeIndex |
using | ElementsIndices = Eigen::Matrix< NodeIndex, Eigen::Dynamic, geometry::traits< Element >::NumberOfNodesAtCompileTime, Eigen::RowMajor > |
using | ElementIndices = Eigen::Matrix< NodeIndex, geometry::traits< Element >::NumberOfNodesAtCompileTime, 1 > |
Public Member Functions | |
Domain ()=delete | |
Domain (const Domain &other) noexcept | |
auto | operator= (Domain other) noexcept -> Domain & |
~Domain () final=default | |
auto | canonical_dimension () const -> UNSIGNED_INTEGER_TYPE final |
Get the canonical dimension of the element contained in this domain, ie, the number of coordinates of a point relative to the element basis. More... | |
auto | number_of_nodes_per_elements () const -> UNSIGNED_INTEGER_TYPE final |
Get the number of nodes an element of this domain has. More... | |
auto | number_of_elements () const -> UNSIGNED_INTEGER_TYPE final |
Get the number of elements contained in the domain. More... | |
template<typename EigenMatrix > | |
auto | element (const UNSIGNED_INTEGER_TYPE &element_id, const Eigen::DenseBase< EigenMatrix > &positions) const -> Element |
auto | element (const UNSIGNED_INTEGER_TYPE &element_id) const -> Element |
auto | element_indices (const UNSIGNED_INTEGER_TYPE &index) const |
auto | mesh () const -> const Mesh & |
template<typename Derived > | |
auto | embed (const Eigen::MatrixBase< Derived > &points) const -> BarycentricContainer< Domain > |
Embed a set of nodes (in world coordinates) inside this domain. More... | |
Public Member Functions inherited from caribou::topology::BaseDomain | |
virtual | ~BaseDomain ()=default |
Destructor. | |
Static Public Attributes | |
static constexpr INTEGER_TYPE | Dimension = geometry::traits<Element>::Dimension |
Protected Member Functions | |
Domain (const Mesh *mesh, const ElementsIndices &elements) | |
Domain (const Mesh *mesh, ElementsIndices &elements) | |
Domain (const Mesh *mesh, const ElementsIndices *elements) | |
Domain (const Mesh *mesh, const NodeIndex *data, const Eigen::Index &number_of_elements, const Eigen::Index &number_of_nodes_per_elements) | |
Domain (const Mesh *mesh, const NodeIndex *data, const Eigen::Index &number_of_elements, const Eigen::Index &number_of_nodes_per_elements, Eigen::Index outer_stride, Eigen::Index inner_stride) | |
Protected Attributes | |
const Mesh * | p_mesh |
The mesh associated with this domain. | |
ElementsIndices | p_buffer |
Buffer containing the element indices. More... | |
Eigen::Map< const ElementsIndices, Eigen::Unaligned, Eigen::Stride< Eigen::Dynamic, Eigen::Dynamic > > | p_elements |
Actual pointer to the element indices. More... | |
Friends | |
void | swap (Domain &first, Domain &second) noexcept |
using caribou::topology::Domain< Mesh, Element, NodeIndex >::ElementIndices = Eigen::Matrix<NodeIndex, geometry::traits<Element>::NumberOfNodesAtCompileTime, 1> |
The type of container that stores the node indices of a single element.
using caribou::topology::Domain< Mesh, Element, NodeIndex >::ElementsIndices = Eigen::Matrix<NodeIndex, Eigen::Dynamic, geometry::traits<Element>::NumberOfNodesAtCompileTime, Eigen::RowMajor> |
The type of container that stores the node indices of all the elements of the domain.
The indices should be stored in a dense matrix where each row represent an element, and the columns are the node indices of the element row.
|
delete |
Empty constructor is prohibited
|
inlinenoexcept |
Copy constructor
|
finaldefault |
Destructor
|
inlineprotected |
Construct the domain from an array of indices.
|
inlineprotected |
Construct the domain from an array of indices.
|
inlineprotected |
Construct the domain from a reference to an external array of indices.
|
inlineexplicitprotected |
Construct the domain from a reference to an external array of indices.
|
inlineexplicitprotected |
Construct the domain from a reference to an array of indices.
|
inlinefinalvirtual |
Get the canonical dimension of the element contained in this domain, ie, the number of coordinates of a point relative to the element basis.
For example, a triangle has a canonical dimension of 2, even if it is inside a 3 dimensions mesh : a point inside the triangle has coordinates (x,y,z) relative to the mesh's basis, and coordinates (u, v) relative to the triangle's first node.
Implements caribou::topology::BaseDomain.
|
inline |
Construct an element of the domain using the positions vector of the associated mesh.
element_id | The id of the element in this domain. |
|
inline |
Construct an element of the domain
element_id | The id of the element in this domain. |
positions | An eigen matrix containing all the positions of the mesh. The matrix should have N rows and D columns for a mesh of dimension D containing N nodes. |
|
inline |
Get the indices of an element in the domain.
index | The index of the element. |
|
inline |
Embed a set of nodes (in world coordinates) inside this domain.
This will return a BarycentricContainer that can be used to interpolate field values on these embedded nodes.
Derived | NXD Eigen matrix representing the D dimensional coordinates of the N embedded points. |
points | The positions (in world coordinates) of the nodes embedded in this domain. |
|
inline |
Get the mesh associated to this domain.
|
finalvirtual |
Get the number of elements contained in the domain.
Implements caribou::topology::BaseDomain.
|
finalvirtual |
Get the number of nodes an element of this domain has.
Implements caribou::topology::BaseDomain.
|
inlinenoexcept |
Move constructor */ Domain(Domain && other) noexcept { swap(*this, other); }
/*! copy-and-swap assigment (valid for both copy and move assigment)
|
protected |
Buffer containing the element indices.
This buffer is used when the domain is constructed by copying an array of element indices. If the domain is constructed from a mapped buffer (ie, the indices are stored outside of the domain instance), then this buffer is empty.
|
protected |
Actual pointer to the element indices.
When the domain is constructed by copying an array of element indices, this map points to p_buffer. Else, it points to an external buffer.