Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
grids.h File Reference
#include <core/manifolds.h>
#include <core/parameters.h>
#include <core/periodic_boundary.h>
#include <deal.II/distributed/tria_base.h>
Include dependency graph for grids.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<int dim, int spacedim = dim>
void attach_grid_to_triangulation (Triangulation< dim, spacedim > &triangulation, const Parameters::Mesh< dim, spacedim > &mesh_parameters)
template<int dim, int spacedim = dim>
void setup_periodic_boundary_conditions (parallel::DistributedTriangulationBase< dim, spacedim > &triangulation, const Parameters::PeriodicBoundaries &periodic_boundaries)
template<int dim, int spacedim = dim>
void read_mesh_and_manifolds (parallel::DistributedTriangulationBase< dim, spacedim > &triangulation, const Parameters::Mesh< dim, spacedim > &mesh_parameters, const Parameters::Manifolds &manifolds_parameters, bool restart, const Parameters::PeriodicBoundaries &periodic_boundaries)
template<int dim, int spacedim = dim>
void read_mesh_and_manifolds_for_stator_and_rotor (parallel::DistributedTriangulationBase< dim, spacedim > &triangulation, const Parameters::Mesh< dim, spacedim > &mesh_parameters, const Parameters::Manifolds &manifolds_parameters, bool restart, const Parameters::PeriodicBoundaries &periodic_boundaries, const Parameters::Mortar< dim > &mortar_parameters)
template<int dim, int spacedim = dim>
void refine_triangulation_at_boundaries (const std::vector< int > &boundary_ids, const unsigned int n_refinement, parallel::DistributedTriangulationBase< dim, spacedim > &triangulation)
template<int dim, int spacedim = dim>
void build_refinement_box_triangulation (const Parameters::Mesh< dim, spacedim > &box_mesh_parameters, Triangulation< dim, spacedim > &box_triangulation)
template<int dim, int spacedim = dim>
void apply_mesh_transformation (const Parameters::Mesh< dim, spacedim > &mesh_parameters, Triangulation< dim, spacedim > &triangulation)

Function Documentation

◆ apply_mesh_transformation()

template<int dim, int spacedim = dim>
void apply_mesh_transformation ( const Parameters::Mesh< dim, spacedim > & mesh_parameters,
Triangulation< dim, spacedim > & triangulation )

Apply scaling, rotation and translation to the mesh in the listed order.

Template Parameters
dimAn integer that denotes the dimensionality of the geometry.
spacedimAn integer that denotes the dimension of the space occupied by the embedded geometry.
Parameters
[in]mesh_parametersParameters of the mesh.
[in,out]triangulationTriangulation object on which the mesh transformations are applied.

Definition at line 728 of file grids.cc.

References Parameters::Mesh< dim, spacedim >::rotation_angle, Parameters::Mesh< dim, spacedim >::rotation_axis, Parameters::Mesh< dim, spacedim >::scale, and Parameters::Mesh< dim, spacedim >::translation.

◆ attach_grid_to_triangulation()

◆ build_refinement_box_triangulation()

template<int dim, int spacedim = dim>
void build_refinement_box_triangulation ( const Parameters::Mesh< dim, spacedim > & box_mesh_parameters,
Triangulation< dim, spacedim > & box_triangulation )

Build the triangulation which delimits a mesh refinement box.

The box is described by a full set of mesh parameters, so any mesh type supported by attach_grid_to_triangulation() can be used to delimit a refinement region. The initial refinement of the box mesh is applied here, so the resulting triangulation is ready to be used to flag cells.

Parameters
[in]box_mesh_parametersThe mesh parameters describing the box
[in,out]box_triangulationThe triangulation which will hold the box mesh

Definition at line 712 of file grids.cc.

References attach_grid_to_triangulation(), Parameters::Mesh< dim, spacedim >::initial_refinement, and Parameters::Mesh< dim, spacedim >::simplex.

◆ read_mesh_and_manifolds()

template<int dim, int spacedim = dim>
void read_mesh_and_manifolds ( parallel::DistributedTriangulationBase< dim, spacedim > & triangulation,
const Parameters::Mesh< dim, spacedim > & mesh_parameters,
const Parameters::Manifolds & manifolds_parameters,
bool restart,
const Parameters::PeriodicBoundaries & periodic_boundaries )

Completely sets up a mesh and its manifolds.

This function reads and constructs a mesh according to the given mesh parameters, sets up manifolds on boundaries, and applies boundary conditions. It is intended for distributed triangulations.

Template Parameters
dimThe topological dimension of the mesh.
spacedimThe embedding space dimension (default = dim).
Parameters
[in,out]triangulationThe triangulation to which the grid will be attached.
[in]mesh_parametersParameters defining the mesh or primitive to use.
[in]manifolds_parametersInformation about the manifolds attached to boundaries.
[in]restartFlag indicating whether this is a restart.
[in]periodic_boundariesThe periodic boundary pairs and their direction of periodicity, used to set up the periodicity of the domain.

Definition at line 447 of file grids.cc.

References apply_initial_refinement(), attach_grid_to_triangulation(), attach_manifolds_to_triangulation(), Parameters::Mesh< dim, spacedim >::gmsh, Parameters::Manifolds::ids, setup_periodic_boundary_conditions(), and Parameters::Mesh< dim, spacedim >::type.

◆ read_mesh_and_manifolds_for_stator_and_rotor()

template<int dim, int spacedim = dim>
void read_mesh_and_manifolds_for_stator_and_rotor ( parallel::DistributedTriangulationBase< dim, spacedim > & triangulation,
const Parameters::Mesh< dim, spacedim > & mesh_parameters,
const Parameters::Manifolds & manifolds_parameters,
bool restart,
const Parameters::PeriodicBoundaries & periodic_boundaries,
const Parameters::Mortar< dim > & mortar_parameters )

Completely sets up a mesh and its manifolds for rotor-stator domains.

The triangulation initially contains the stator triangulation, which is later replaced by the merged rotor-stator triangulation.

Template Parameters
dimThe topological dimension of the mesh.
spacedimThe embedding space dimension (default = dim).
Parameters
[in,out]triangulationThe triangulation to which the grid will be attached.
[in]mesh_parametersParameters defining the mesh or primitive to use.
[in]manifolds_parametersInformation about the manifolds attached to boundaries.
[in]restartFlag indicating whether this is a restart.
[in]periodic_boundariesThe periodic boundary pairs and their direction of periodicity, used to set up the periodicity of the domain.
[in]mortar_parametersParameters controlling the mortar method, including rotor mesh info.

Definition at line 501 of file grids.cc.

References apply_initial_refinement(), attach_grid_to_triangulation(), attach_manifolds_to_triangulation(), Parameters::Mesh< dim, spacedim >::dealii, Parameters::Mesh< dim, spacedim >::gmsh, Parameters::Manifolds::ids, Parameters::Mortar< dim >::interface_type, Parameters::Mortar< dim >::linear, Parameters::Mortar< dim >::rotor_boundary_id, Parameters::Mortar< dim >::rotor_mesh, setup_periodic_boundary_conditions(), Parameters::Mortar< dim >::stator_boundary_id, and Parameters::Mesh< dim, spacedim >::type.

◆ refine_triangulation_at_boundaries()

template<int dim, int spacedim = dim>
void refine_triangulation_at_boundaries ( const std::vector< int > & boundary_ids,
const unsigned int n_refinement,
parallel::DistributedTriangulationBase< dim, spacedim > & triangulation )

Refine a mesh around specific boundary ids.

Parameters
[in]n_refinementThe number of times the boundary should be refined
[in]boundary_idsThe boundary ids for which the cells should be refined
[in,out]triangulationThe triangulation on which refinement must be carried out

Definition at line 122 of file grids.h.

◆ setup_periodic_boundary_conditions()

template<int dim, int spacedim = dim>
void setup_periodic_boundary_conditions ( parallel::DistributedTriangulationBase< dim, spacedim > & triangulation,
const Parameters::PeriodicBoundaries & periodic_boundaries )

Modifies the triangulation to set up its periodic boundary conditions.

The periodic boundary information is the part of the boundary conditions that is shared by the CFD and the DEM solvers, so this function is used by both.

Parameters
[in,out]triangulationThe triangulation to which a grid is attached
[in]periodic_boundariesThe periodic boundary pairs and their direction of periodicity. This is used to set up the periodicity of the domain

Definition at line 367 of file grids.cc.