29 #ifndef T8_GEOMETRY_LAGRANGE_HXX
30 #define T8_GEOMETRY_LAGRANGE_HXX
42 #define T8_GEOMETRY_MAX_POLYNOMIAL_DEGREE 2
131 double *out_coords)
const;
144 double *jacobian)
const;
161 inline std::vector<double>
162 t8_geom_compute_basis (
const double *ref_point)
const;
173 inline std::vector<double>
174 t8_geom_s2_basis (
const double *ref_point)
const;
185 inline std::vector<double>
186 t8_geom_s3_basis (
const double *ref_point)
const;
204 inline std::vector<double>
205 t8_geom_t3_basis (
const double *ref_point)
const;
223 inline std::vector<double>
224 t8_geom_t6_basis (
const double *ref_point)
const;
242 inline std::vector<double>
243 t8_geom_q4_basis (
const double *ref_point)
const;
261 inline std::vector<double>
262 t8_geom_q9_basis (
const double *ref_point)
const;
284 inline std::vector<double>
285 t8_geom_h8_basis (
const double *ref_point)
const;
307 inline std::vector<double>
308 t8_geom_h27_basis (
const double *ref_point)
const;
321 template <
typename T>
323 flatten (
const std::vector<std::vector<T>> &vec)
325 std::vector<T> flattened;
326 for (
auto const &v : vec) {
327 flattened.insert (flattened.end (), v.begin (), v.end ());
378 std::vector<t8_eclass_t>
396 std::vector<std::vector<double>>
404 std::vector<std::vector<uint32_t>>
416 std::vector<t8_lagrange_element>
427 std::array<double, T8_ECLASS_MAX_DIM>
428 evaluate (
const std::array<double, T8_ECLASS_MAX_DIM> &ref_point)
const;
436 std::vector<std::array<double, T8_ECLASS_MAX_DIM>>
475 std::array<double, T8_ECLASS_MAX_DIM>
476 map_on_face (
t8_eclass eclass,
const int face_id,
const std::array<double, T8_ECLASS_MAX_DIM> &coord)
const;
492 const uint32_t degree;
494 const std::vector<double> nodes;
498 static constexpr uint32_t lagrange_nodes[
T8_ECLASS_COUNT][2] = { { 1, 1 }, { 2, 3 }, { 4, 9 }, { 3, 6 }, { 8, 27 } };
501 create_uniform_forest (
t8_cmesh_t cmesh, uint32_t level)
const;
A single coarse mesh cell with Lagrange geometry.
Definition: t8_geometry_lagrange.hxx:341
std::vector< std::vector< uint32_t > > get_face_nodes() const
Node labels on the faces of the element.
Definition: t8_geometry_lagrange.cxx:291
std::vector< t8_eclass_t > face_classes() const
Element classes of the faces of this element.
Definition: t8_geometry_lagrange.cxx:341
void write() const
Save the geometry into a VTK file.
Definition: t8_geometry_lagrange.cxx:488
~t8_lagrange_element()
Destroy the t8_lagrange_element object.
Definition: t8_geometry_lagrange.hxx:359
std::vector< std::array< double, T8_ECLASS_MAX_DIM > > sample(uint32_t n_point) const
Sample random points in the reference domain.
std::vector< t8_lagrange_element > decompose() const
Decompose the element into its faces.
Definition: t8_geometry_lagrange.cxx:393
t8_eclass_t get_type() const
Get the type of the element.
Definition: t8_geometry_lagrange.cxx:285
std::vector< double > get_node_coords(uint32_t node) const
Coordinates of the specified node.
Definition: t8_geometry_lagrange.cxx:373
t8_lagrange_element(t8_eclass_t eclass, uint32_t degree, std::vector< double > &nodes)
Construct a new t8_lagrange_element object.
Definition: t8_geometry_lagrange.cxx:266
std::array< double, T8_ECLASS_MAX_DIM > map_on_face(t8_eclass eclass, const int face_id, const std::array< double, T8_ECLASS_MAX_DIM > &coord) const
Map this element on the face of a higher-dimensional element.
Definition: t8_geometry_lagrange.cxx:418
std::array< double, T8_ECLASS_MAX_DIM > evaluate(const std::array< double, T8_ECLASS_MAX_DIM > &ref_point) const
Physical coordinates of a point given in the reference domain.
Definition: t8_geometry_lagrange.cxx:410
This structure holds the connectivity data of the coarse mesh.
Definition: t8_cmesh_types.h:88
This structure is private to the implementation.
Definition: t8_forest_types.h:69
Mapping with Lagrange basis functions.
Definition: t8_geometry_lagrange.hxx:77
virtual void t8_geom_evaluate_jacobian(t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_points, double *jacobian) const
Compute the Jacobian of the t8_geom_evaluate map at a point in the reference space.
Definition: t8_geometry_lagrange.cxx:64
virtual void t8_geom_load_tree_data(t8_cmesh_t cmesh, t8_gloidx_t gtreeid)
Update a possible internal data buffer for per tree data.
Definition: t8_geometry_lagrange.cxx:71
void t8_geom_evaluate(t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_points, double *out_coords) const
Maps points from the reference space to the physical space .
Definition: t8_geometry_lagrange.cxx:45
t8_geometry_type_t t8_geom_get_type() const
Get the type of this geometry.
Definition: t8_geometry_lagrange.hxx:103
Definition: t8_geometry_with_vertices.hxx:40
This is the administrative header file for t8code.
int64_t t8_gloidx_t
A type for global indexing that holds really big numbers.
Definition: t8.h:100
void t8_cmesh_destroy(t8_cmesh_t *pcmesh)
Verify that a coarse mesh has only one reference left and destroy it.
Definition: t8_cmesh.cxx:1241
We define here the datatypes needed for internal cmesh routines.
enum t8_eclass t8_eclass_t
This enumeration contains all possible element classes.
t8_eclass
This enumeration contains all possible element classes.
Definition: t8_eclass.h:39
@ T8_ECLASS_COUNT
This is no element class but can be used as the number of element classes.
Definition: t8_eclass.h:58
We define the forest of trees in this file.
@ T8_GEOMETRY_TYPE_LAGRANGE
The Lagrange geometry uses a mapping with Lagrange polynomials to approximate curved elements .
Definition: t8_geometry.h:43
enum t8_geometry_type t8_geometry_type_t
This enumeration contains all possible geometries.
std::vector< T > flatten(const std::vector< std::vector< T >> &vec)
Flatten a vector of vector into a single vector.
Definition: t8_geometry_lagrange.hxx:323
This header file provides a C interface for functions for the t8_geometry_with_vertices class.
Implements the inherited struct t8_geometry_with_vertices, which can be used for geometries that use ...