![]() |
Reference documentation for deal.II version GIT 2c37b3e359 2022-05-26 00:10:02+00:00
|
This module describes the experimental simplex support in deal.II. More...
Classes | |
class | QGaussSimplex< dim > |
class | QWitherdenVincentSimplex< dim > |
class | FE_PyramidPoly< dim, spacedim > |
class | FE_PyramidP< dim, spacedim > |
class | FE_PyramidDGP< dim, spacedim > |
class | FE_SimplexPoly< dim, spacedim > |
class | FE_SimplexP< dim, spacedim > |
class | FE_SimplexDGP< dim, spacedim > |
class | FE_WedgePoly< dim, spacedim > |
class | FE_WedgeP< dim, spacedim > |
class | FE_WedgeDGP< dim, spacedim > |
class | MappingFE< dim, spacedim > |
Functions | |
void | GridIn< dim, spacedim >::read_vtk (std::istream &in) |
void | GridIn< dim, spacedim >::read_msh (std::istream &in) |
void | GridIn< dim, spacedim >::read_msh (const std::string &filename) |
void | GridIn< dim, spacedim >::read_comsol_mphtxt (std::istream &in) |
Creating meshes from other meshes | |
template<int dim, int spacedim> | |
void | GridGenerator::convert_hypercube_to_simplex_mesh (const Triangulation< dim, spacedim > &in_tria, Triangulation< dim, spacedim > &out_tria) |
template<int dim, int spacedim> | |
void | GridGenerator::subdivided_hyper_rectangle_with_simplices (Triangulation< dim, spacedim > &tria, const std::vector< unsigned int > &repetitions, const Point< dim > &p1, const Point< dim > &p2, const bool colorize=false) |
template<int dim, int spacedim> | |
void | GridGenerator::subdivided_hyper_cube_with_simplices (Triangulation< dim, spacedim > &tria, const unsigned int repetitions, const double p1=0.0, const double p2=1.0, const bool colorize=false) |
This module describes the experimental simplex support in deal.II.
Simplex and mixed meshes in deal.II are still experimental, i.e., work in progress. Large parts of the library have been ported to be able to operate on such kind of meshes. However, there are still many functions that need to be generalized. You can get a good overview of the ported functionalities by taking a look at the tests in the folder "tests/simplex". In the following, we provide two very basic examples to get started and provide some implementation details.
The following code shows how to work with simplex meshes:
The following code shows how to work with mixed meshes:
In 2D, we provide triangles and quadrilaterals with the following possible orientations in 3D:
In 3D, tetrahedra, pyramids, wedges, and hexahedra are available:
Each surface of a 3D reference cell consists of 2D reference cells. The documentation of the enumeration of the numbering of their vertices and lines are given in the right columns.
void GridGenerator::convert_hypercube_to_simplex_mesh | ( | const Triangulation< dim, spacedim > & | in_tria, |
Triangulation< dim, spacedim > & | out_tria | ||
) |
Convert a triangulation consisting only of hypercube cells (quadrilaterals, hexahedra) to a triangulation only consisting of simplices (triangles, tetrahedra).
As an example, the following image shows how a set of four hexahedra meshing one eighth of a sphere are subdivided into tetrahedra, and how the curved surface is taken into account. Colors indicate how boundary indicators are inherited:
In general, each quadrilateral in 2d is subdivided into eight triangles, and each hexahedron in 3d into 24 tetrahedra, as shown here (top left for the 2d case, the rest shows vertex numbers and subdivisions for a single 3d hexahedron):
Material ID and boundary IDs are inherited upon conversion.
in_tria | The triangulation containing hex elements. |
out_tria | The converted triangulation containing tet elements. |
in_tria
to out_tria
, e.g., with the following code: void GridGenerator::subdivided_hyper_rectangle_with_simplices | ( | Triangulation< dim, spacedim > & | tria, |
const std::vector< unsigned int > & | repetitions, | ||
const Point< dim > & | p1, | ||
const Point< dim > & | p2, | ||
const bool | colorize = false |
||
) |
Create a coordinate-parallel brick from the two diagonally opposite corner points p1
and p2
. The number of vertices in coordinate direction i
is given by repetitions[i]+1
.
dim==spacedim
. void GridGenerator::subdivided_hyper_cube_with_simplices | ( | Triangulation< dim, spacedim > & | tria, |
const unsigned int | repetitions, | ||
const double | p1 = 0.0 , |
||
const double | p2 = 1.0 , |
||
const bool | colorize = false |
||
) |
Initialize the given triangulation with a hypercube (square in 2D and cube in 3D) consisting of repetitions
cells in each direction. The hypercube volume is the tensor product interval \([left,right]^{\text{dim}}\) in the present number of dimensions, where the limits are given as arguments. They default to zero and unity, then producing the unit hypercube.
void GridIn< dim, spacedim >::read_vtk | ( | std::istream & | in | ) |
Read grid data from a unstructured vtk file. The vtk file may contain the following VTK cell types: VTK_HEXAHEDRON (12), VTK_TETRA (10), VTK_QUAD (9), VTK_TRIANGLE (5), and VTK_LINE (3).
Depending on the template dimension, only some of the above are accepted.
In particular, in three dimensions, this function expects the file to contain
In two dimensions:
In one dimension
The input file may specify boundary ids, material ids, and manifold ids using the CELL_DATA section of the VTK file format.
This function interprets two types of CELL_DATA contained in the input file: SCALARS MaterialID
, used to specify the material_id of the cells, or the boundary_id of the faces and edges, and SCALARS ManifoldID
, that can be used to specify the manifold id of any Triangulation object (cell, face, or edge).
The companion GridOut::write_vtk function can be used to write VTK files compatible with this method.
Definition at line 129 of file grid_in.cc.
void GridIn< dim, spacedim >::read_msh | ( | std::istream & | in | ) |
Read grid data from an msh file. The Gmsh formats are documented at http://www.gmsh.info/.
Definition at line 1997 of file grid_in.cc.
void GridIn< dim, spacedim >::read_msh | ( | const std::string & | filename | ) |
Read grid data using Gmsh API. Any file supported by Gmsh can be passed as argument. The format is deduced from the filename extension.
This function interprets non-named physical ids (gmsh format < 4.0) as material or boundary ids (similarly to what happens with the other read_msh() function). If you want to specify non default manifold or boundary ids, you must group all entities that require a non default boundary or manifold id into named physical groups, where the name is interpreted using the function Patterns::Tools::to_value() applied to a std::map<std::string, int>
. The keys can be either MaterialID
(if the physical group refers to object of dimension dim
), BoundaryID
(if the group refers to objects of dimension < dim
), or ManifoldID
.
From the Gmsh documentation, the formats of the physical tags follows the following conventions:
For example, the following snippet of mesh file
refers to a two dimensional grid where:
If the physical groups are not named, then the behavior is the same as the other read_msh() function, i.e., the physical tag itself is interpreted as a boundary or material id. Physical surface numbers created in Gmsh, which can be seen in the .geo file, become material IDs.
Definition at line 2712 of file grid_in.cc.
void GridIn< dim, spacedim >::read_comsol_mphtxt | ( | std::istream & | in | ) |
Read grid data from a .mphtxt
file. .mphtxt
is one of the file formats typically generated by COMSOL. The file format is described at http://victorsndvg.github.io/FEconv/formats/mphtxt.xhtml .
The reader interprets the "geometric entity indicators" that COMSOL writes into these files as either boundary indicators (for edges and faces of cells) or as material ids (for cells). See the glossary for a description of boundary indicators. and material indicators
COMSOL has a habit of assigning "geometric entity indicators" not only to edges and faces on the actual boundary, but also to interior faces and edges. For example, for the following volume mesh generated by COMSOL,
the marked edges and faces are as follows:
Here, some of the marked lines and faces with explicitly given geometric entity indicators are in the interior of the domain – an artifact of the geometry description that was used to describe the mesh. However, we can of course not assign boundary indicators to interior edges and faces. As a consequence, this reader function simply ignores the geometric entity indicator for edges and faces that are not in fact on the boundary of the domain. The result is then a mesh in which only the following edges and faces are explicitly assigned boundary indicators:
Definition at line 1451 of file grid_in.cc.