template<typename Domain>
class caribou::topology::BarycentricContainer< Domain >
The BarycentricContainer class allows to embed nodes into a container domain.
The embedded nodes do not need to match the nodes of the container domain. However, an embedded node must be found in exactly one of the element of the container, or at the boundary between elements (for example, an embedded node lying on a face between two elements of the container is valid). If an embedded node is lying outside of the container domain (ie is not located inside any of the container elements), the BarycentricContainer will ignore it. The list of ignored nodes can be retrieved.
- Template Parameters
-
Domain | The type of the container domain. |
|
| BarycentricContainer ()=delete |
| Default constructor is not permitted.
|
|
template<typename Derived > |
| BarycentricContainer (const Domain *container_domain, const Eigen::MatrixBase< Derived > &embedded_points) |
| Construct the container from the given domain. More...
|
|
| BarycentricContainer (const Domain *container_domain) |
| Construct the container from the given domain. More...
|
|
auto | barycentric_point (const WorldCoordinates &p) const -> BarycentricPoint |
| Get an element that contains the given point (in world coordinates) and its local coordinates within this element. More...
|
|
auto | closest_elements (const WorldCoordinates &p) const -> std::vector< BarycentricPoint > |
| Get the list of closest elements to a point and its barycentric coordinates within these elements.
|
|
template<typename Derived1 , typename Derived2 > |
void | interpolate (const Eigen::MatrixBase< Derived1 > &container_field_values, Eigen::MatrixBase< Derived2 > &embedded_field_values) const |
| Interpolate a field (scalar or vector field) from the container domain to the embedded nodes. More...
|
|
auto | barycentric_points () const -> const std::vector< BarycentricPoint > & |
| Barycentric points of the embedded nodes. More...
|
|
auto | outside_nodes () const -> const std::vector< UNSIGNED_INTEGER_TYPE > & |
| Indices of nodes found outside of the domain (ie, nodes that were not found inside any container elements of the domain).
|
|
template<typename Domain >
template<typename Derived >
Construct the container from the given domain.
This will create an HashGrid class instance to be able to quickly retrieve the container element of a given world position. The size of the HashGrid cells will be set to the mean size of the container elements.
This constructs the BarycentricContainer with a set of embedded points where the barycentric coordinates will be computed.
- Template Parameters
-
Derived | NXD Eigen matrix representing the D dimensional coordinates of the N embedded positions. |
- Parameters
-
container_domain | The mesh domain that will contain the embedded meshes. |
embedded_points | The positions (in world coordinates) embedded in the container mesh for which the barycentric points have to be found. |
template<typename Domain >
template<typename Derived1 , typename Derived2 >
Interpolate a field (scalar or vector field) from the container domain to the embedded nodes.
This methods take an input field values (one value per node of the container mesh) and interpolate it onto the values of the embedded nodes (outputs one value per embedded node). Embedded nodes that are found outside of the containing domain (ie, no elements containing the node can be found) are ignored and their interpolated values won't be computed.
- Template Parameters
-
Derived1 | The matrix (Eigen) type of the input field values. |
Derived2 | The matrix (Eigen) type of the output field valuse. |
- Parameters
-
container_field_values | [INPUT] The field values on every nodes of the container domain. This should be a matrix (Eigen) having one field value (scalar or vector) per rows. The number of rows should match the number of nodes of the container domain. |
embedded_field_values | [OUTPUT] The matrix (Eigen) where the interpolated field values should be written to. This should be a matrix (Eigen) having one field value (scalar or vector) per rows. The number of rows should match the number of embedded nodes. |