Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
SerialSolid< dim, spacedim > Class Template Reference

#include <serial_solid.h>

Public Types

using triangulation_cell_neighbors_map

Public Member Functions

 SerialSolid (std::shared_ptr< Parameters::RigidSolidObject< dim, spacedim > > &param, unsigned int id)
std::vector< std::pair< typename Triangulation< spacedim >::active_cell_iterator, typename Triangulation< dim, spacedim >::active_cell_iterator > > map_solid_in_background_triangulation (const parallel::TriangulationBase< spacedim > &background_tr)
void initial_setup ()
void setup_triangulation (const bool restart)
void setup_dof_handler ()
void setup_containers ()
std::shared_ptr< Triangulation< dim, spacedim > > get_triangulation ()
DoFHandler< dim, spacedim > & get_dof_handler ()
Vector< double > & get_displacement_vector ()
double get_max_displacement_since_mapped () const
Tensor< 1, 3 > get_translational_velocity () const
Tensor< 1, 3 > get_angular_velocity () const
Point< 3 > get_center_of_rotation () const
double get_temperature () const
Parameters::SolidObjectThermalBoundaryType get_thermal_boundary_type () const
unsigned int get_solid_id () const
std::tuple< const triangulation_cell_neighbors_map &, const triangulation_cell_neighbors_map & > get_neighbors_maps () const
void update_solid_temperature (const double initial_time)
void move_solid_triangulation (double time_step, double initial_time)
void write_output_results (const std::shared_ptr< SimulationControl > &simulation_control)
void read_checkpoint (const std::string &prefix_name)
void write_checkpoint (const std::string &prefix_name)

Private Member Functions

void displace_solid_triangulation ()
void reset_displacement_monitoring ()
void move_solid_triangulation_with_displacement ()
void rotate_grid (const double angle, const Tensor< 1, spacedim > &axis)
void translate_grid (const Tensor< 1, spacedim > &translate)

Private Attributes

MPI_Comm mpi_communicator
const unsigned int n_mpi_processes
const unsigned int this_mpi_process
std::shared_ptr< Parameters::RigidSolidObject< dim, spacedim > > & param
unsigned int id
std::shared_ptr< Triangulation< dim, spacedim > > solid_tria
std::shared_ptr< FiniteElement< dim, spacedim > > fe
std::shared_ptr< Mapping< dim, spacedim > > solid_mapping
DoFHandler< dim, spacedim > displacement_dh
std::shared_ptr< FESystem< dim, spacedim > > displacement_fe
Vector< double > displacement
Vector< double > displacement_since_mapped
PVDHandler pvdhandler
const bool output_bool
std::shared_ptr< Function< spacedim > > translational_velocity
std::shared_ptr< Function< spacedim > > angular_velocity
Point< spacedim > center_of_rotation
Tensor< 1, spacedim > current_translational_velocity
Tensor< 1, 3 > current_angular_velocity
std::shared_ptr< Function< spacedim > > solid_temperature
Parameters::SolidObjectThermalBoundaryType thermal_boundary_type
double current_solid_temperature
triangulation_cell_neighbors_map es_neighbors
triangulation_cell_neighbors_map vs_neighbors

Detailed Description

template<int dim, int spacedim = dim>
class SerialSolid< dim, spacedim >

A class that generates an object to manage a serial triangulation that represents a solid object. This class can represent solid objects for which the dimension do not match the spatial dimension. For example, a 2D surface defined in 3D or a line defined in 2D.

Template Parameters
dimAn integer that denotes the dimensionality of the geometry
spacedimAn integer that denotes the dimension of the space occupied by the embedded solid

Definition at line 38 of file serial_solid.h.

Member Typedef Documentation

◆ triangulation_cell_neighbors_map

template<int dim, int spacedim = dim>
using SerialSolid< dim, spacedim >::triangulation_cell_neighbors_map
Initial value:
std::unordered_map<
typename Triangulation<dim, spacedim>::active_cell_iterator,
std::vector<typename Triangulation<dim, spacedim>::active_cell_iterator>,
Hash functor to enable using cut-cell (embedded triangulation) active cell iterators as keys of an un...
Definition utilities.h:1431

Definition at line 189 of file serial_solid.h.

Constructor & Destructor Documentation

◆ SerialSolid()

template<int dim, int spacedim>
SerialSolid< dim, spacedim >::SerialSolid ( std::shared_ptr< Parameters::RigidSolidObject< dim, spacedim > > & param,
unsigned int id )

Member Function Documentation

◆ displace_solid_triangulation()

template<int dim, int spacedim>
void SerialSolid< dim, spacedim >::displace_solid_triangulation ( )
private

Moves the dofs of the solid_triangulation by using the displacement vector. This is only used to move the solid triangulation at the correct location when the simulation is restarted.

Definition at line 382 of file serial_solid.cc.

References displacement, displacement_dh, and displacement_fe.

◆ get_angular_velocity()

template<int dim, int spacedim = dim>
Tensor< 1, 3 > SerialSolid< dim, spacedim >::get_angular_velocity ( ) const
inline

Returns the angular velocity of the center of mass of the solid object.

Returns
The angular velocity of the solid object

Definition at line 134 of file serial_solid.h.

References current_angular_velocity.

◆ get_center_of_rotation()

template<int dim, int spacedim = dim>
Point< 3 > SerialSolid< dim, spacedim >::get_center_of_rotation ( ) const
inline

Returns the center of rotation of the center of mass of the solid object.

Returns
The center of rotation of the solid object

Definition at line 145 of file serial_solid.h.

References center_of_rotation, and point_nd_to_3d().

◆ get_displacement_vector()

template<int dim, int spacedim>
Vector< double > & SerialSolid< dim, spacedim >::get_displacement_vector ( )

Returns the displacement vector of all the vertices of the solid object.

Returns
the reference to the displacement vector

Definition at line 250 of file serial_solid.cc.

References displacement.

◆ get_dof_handler()

template<int dim, int spacedim>
DoFHandler< dim, spacedim > & SerialSolid< dim, spacedim >::get_dof_handler ( )

Returns the dof_handler associated with the displacement of the solid object.

Returns
the reference to the displacement dof handler

Definition at line 242 of file serial_solid.cc.

References displacement_dh.

◆ get_max_displacement_since_mapped()

template<int dim, int spacedim>
double SerialSolid< dim, spacedim >::get_max_displacement_since_mapped ( ) const

Calculates the max displacement of the solid object. The max displacement is defined as the L^\infty norm of the displacement components. This is a measure of the maximal displacement in any direction.

Returns
The reference to the vector of the displacement since the mapping

Definition at line 257 of file serial_solid.cc.

References displacement_since_mapped.

◆ get_neighbors_maps()

template<int dim, int spacedim = dim>
std::tuple< const triangulation_cell_neighbors_map &, const triangulation_cell_neighbors_map & > SerialSolid< dim, spacedim >::get_neighbors_maps ( ) const
inline

Returns the neighboring cells maps of the solid object triangulation. These maps store for each cell of the solid object which neighboring cells are sharing a vertex or an edge (two vertex). 1. edge-sharing and 2. vertex-sharing.

Returns
A tuple of references to the edge-sharing and vertex-sharing neighboring cells maps.

Definition at line 205 of file serial_solid.h.

References es_neighbors, and vs_neighbors.

◆ get_solid_id()

template<int dim, int spacedim = dim>
unsigned int SerialSolid< dim, spacedim >::get_solid_id ( ) const
inline

Returns the solid id of the solid object. This ID is an unsigned integer which is given to the solid object at compile time and is mostly used when writing files.

Returns
id of the solid

Definition at line 184 of file serial_solid.h.

References id.

◆ get_temperature()

template<int dim, int spacedim = dim>
double SerialSolid< dim, spacedim >::get_temperature ( ) const
inline

Returns the temperature of the solid object.

Returns
The temperature of the solid object

Definition at line 160 of file serial_solid.h.

References current_solid_temperature.

◆ get_thermal_boundary_type()

template<int dim, int spacedim = dim>
Parameters::SolidObjectThermalBoundaryType SerialSolid< dim, spacedim >::get_thermal_boundary_type ( ) const
inline

Returns the thermal boundary type of the solid object.

Returns
The thermal boundary type of the solid object

Definition at line 171 of file serial_solid.h.

References thermal_boundary_type.

◆ get_translational_velocity()

template<int dim, int spacedim = dim>
Tensor< 1, 3 > SerialSolid< dim, spacedim >::get_translational_velocity ( ) const
inline

Returns translational velocity of the center of mass of the solid object.

Returns
The translational velocity of the solid object

Definition at line 123 of file serial_solid.h.

References current_translational_velocity, and tensor_nd_to_3d().

◆ get_triangulation()

template<int dim, int spacedim>
std::shared_ptr< Triangulation< dim, spacedim > > SerialSolid< dim, spacedim >::get_triangulation ( )

Returns the shared pointer to the solid object triangulation.

Returns
shared_ptr of the solid triangulation

Definition at line 264 of file serial_solid.cc.

References solid_tria.

◆ initial_setup()

template<int dim, int spacedim>
void SerialSolid< dim, spacedim >::initial_setup ( )

Manages solid triangulation setup.

Definition at line 152 of file serial_solid.cc.

References setup_dof_handler(), and setup_triangulation().

◆ map_solid_in_background_triangulation()

template<int dim, int spacedim>
std::vector< std::pair< typename Triangulation< spacedim >::active_cell_iterator, typename Triangulation< dim, spacedim >::active_cell_iterator > > SerialSolid< dim, spacedim >::map_solid_in_background_triangulation ( const parallel::TriangulationBase< spacedim > & background_tr)

Maps the solid object in the background triangulation.

Definition at line 84 of file serial_solid.cc.

References LetheGridTools::find_point_triangle_distance(), reset_displacement_monitoring(), and solid_tria.

◆ move_solid_triangulation()

template<int dim, int spacedim>
void SerialSolid< dim, spacedim >::move_solid_triangulation ( double time_step,
double initial_time )

Moves the vertices of the solid triangulation. This function uses explicitEuler scheme time integrator to displace the vertices of the solid triangulation and stores the displacement in an array in order to allow correct checkpointing of the triangulation.

Parameters
time_stepThe time_step value for this iteration
initial_timeThe initial time (time t) of the timestep. This is used to set the time of the velocity function.

Definition at line 303 of file serial_solid.cc.

References angular_velocity, center_of_rotation, current_angular_velocity, current_translational_velocity, displacement, displacement_dh, displacement_fe, displacement_since_mapped, solid_tria, and translational_velocity.

◆ move_solid_triangulation_with_displacement()

template<int dim, int spacedim>
void SerialSolid< dim, spacedim >::move_solid_triangulation_with_displacement ( )
private

Moves the vertices of the solid triangulation using the displacement vector. This is mostly used when restarting simulations which contain a serial solid in order to replace it at the position it was when the simulation finished.

Definition at line 416 of file serial_solid.cc.

References displacement, displacement_dh, and displacement_fe.

◆ read_checkpoint()

template<int dim, int spacedim>
void SerialSolid< dim, spacedim >::read_checkpoint ( const std::string & prefix_name)

read solid base triangulation checkpoint and replaces the triangulation at the location where it was when it was checkpointed

Parameters
prefix_nameThe prefix of the checkpoint of the simulation

Definition at line 547 of file serial_solid.cc.

References check_file_exists(), displacement, displacement_dh, move_solid_triangulation_with_displacement(), and pvdhandler.

◆ reset_displacement_monitoring()

template<int dim, int spacedim = dim>
void SerialSolid< dim, spacedim >::reset_displacement_monitoring ( )
inlineprivate

Reset displacements since intersection for contact detection.

Definition at line 273 of file serial_solid.h.

References displacement_since_mapped.

◆ rotate_grid()

template<int dim, int spacedim>
void SerialSolid< dim, spacedim >::rotate_grid ( const double angle,
const Tensor< 1, spacedim > & axis )
private

Rotates the grid by a given angle around an axis.

Parameters
angleThe angle (in rad) with which the solid is rotated
axisThe axis over which the solid is rotated.

Definition at line 271 of file serial_solid.cc.

References solid_tria.

◆ setup_containers()

template<int dim, int spacedim>
void SerialSolid< dim, spacedim >::setup_containers ( )

Builds the neighboring cells information for each cell of the solid object. These containers store for each of these cells which neighboring cells are sharing a vertex or an edge (two vertex). Also stores which of these neighboring cells are coplanar or non-coplanar.

Definition at line 595 of file serial_solid.cc.

References es_neighbors, LetheGridTools::find_cells_around_cell(), solid_tria, LetheGridTools::vertices_cell_mapping(), and vs_neighbors.

◆ setup_dof_handler()

template<int dim, int spacedim>
void SerialSolid< dim, spacedim >::setup_dof_handler ( )

Set-ups the displacement vector to store the motion of the triangulation.

Definition at line 583 of file serial_solid.cc.

References displacement, displacement_dh, displacement_fe, and displacement_since_mapped.

◆ setup_triangulation()

template<int dim, int spacedim>
void SerialSolid< dim, spacedim >::setup_triangulation ( const bool restart)

Generates a solid triangulation from a dealii or gmsh mesh.

Parameters
restartBoolean variable that indicates if the simulation is being restarted

Definition at line 164 of file serial_solid.cc.

References check_file_exists(), Parameters::Mesh< dim, spacedim >::dealii, Parameters::Mesh< dim, spacedim >::gmsh, param, rotate_grid(), solid_tria, and translate_grid().

◆ translate_grid()

template<int dim, int spacedim>
void SerialSolid< dim, spacedim >::translate_grid ( const Tensor< 1, spacedim > & translate)
private

Translate the grid. In spacedim=2, the third component is ignored.

Parameters
translateThe vector with which the solid is translated.

Definition at line 283 of file serial_solid.cc.

References solid_tria.

◆ update_solid_temperature()

template<int dim, int spacedim>
void SerialSolid< dim, spacedim >::update_solid_temperature ( const double initial_time)

Update the temperature of the solid object, which is a function of time.

Parameters
initial_timeThe initial time (time t) of the timestep. This is used to set the time of the temperature function.

Definition at line 291 of file serial_solid.cc.

References Parameters::adiabatic, current_solid_temperature, solid_temperature, and thermal_boundary_type.

◆ write_checkpoint()

template<int dim, int spacedim>
void SerialSolid< dim, spacedim >::write_checkpoint ( const std::string & prefix_name)

write solid base triangulation checkpoint

Parameters
prefix_nameThe prefix of the checkpoint of the simulation

Definition at line 521 of file serial_solid.cc.

References displacement, displacement_dh, and pvdhandler.

◆ write_output_results()

template<int dim, int spacedim>
void SerialSolid< dim, spacedim >::write_output_results ( const std::shared_ptr< SimulationControl > & simulation_control)

Write the output file of the solid object triangulation.

Parameters
simulation_controlThe simulation control object

Definition at line 451 of file serial_solid.cc.

References displacement, displacement_dh, displacement_since_mapped, mpi_communicator, output_bool, pvdhandler, and write_vtu_and_pvd().

Member Data Documentation

◆ angular_velocity

template<int dim, int spacedim = dim>
std::shared_ptr<Function<spacedim> > SerialSolid< dim, spacedim >::angular_velocity
private

Definition at line 334 of file serial_solid.h.

◆ center_of_rotation

template<int dim, int spacedim = dim>
Point<spacedim> SerialSolid< dim, spacedim >::center_of_rotation
private

Definition at line 335 of file serial_solid.h.

◆ current_angular_velocity

template<int dim, int spacedim = dim>
Tensor<1, 3> SerialSolid< dim, spacedim >::current_angular_velocity
private

Definition at line 337 of file serial_solid.h.

◆ current_solid_temperature

template<int dim, int spacedim = dim>
double SerialSolid< dim, spacedim >::current_solid_temperature
private

Definition at line 340 of file serial_solid.h.

◆ current_translational_velocity

template<int dim, int spacedim = dim>
Tensor<1, spacedim> SerialSolid< dim, spacedim >::current_translational_velocity
private

Definition at line 336 of file serial_solid.h.

◆ displacement

template<int dim, int spacedim = dim>
Vector<double> SerialSolid< dim, spacedim >::displacement
private

Definition at line 325 of file serial_solid.h.

◆ displacement_dh

template<int dim, int spacedim = dim>
DoFHandler<dim, spacedim> SerialSolid< dim, spacedim >::displacement_dh
private

Definition at line 323 of file serial_solid.h.

◆ displacement_fe

template<int dim, int spacedim = dim>
std::shared_ptr<FESystem<dim, spacedim> > SerialSolid< dim, spacedim >::displacement_fe
private

Definition at line 324 of file serial_solid.h.

◆ displacement_since_mapped

template<int dim, int spacedim = dim>
Vector<double> SerialSolid< dim, spacedim >::displacement_since_mapped
private

Definition at line 326 of file serial_solid.h.

◆ es_neighbors

template<int dim, int spacedim = dim>
triangulation_cell_neighbors_map SerialSolid< dim, spacedim >::es_neighbors
private

Definition at line 345 of file serial_solid.h.

◆ fe

template<int dim, int spacedim = dim>
std::shared_ptr<FiniteElement<dim, spacedim> > SerialSolid< dim, spacedim >::fe
private

Definition at line 321 of file serial_solid.h.

◆ id

template<int dim, int spacedim = dim>
unsigned int SerialSolid< dim, spacedim >::id
private

Definition at line 317 of file serial_solid.h.

◆ mpi_communicator

template<int dim, int spacedim = dim>
MPI_Comm SerialSolid< dim, spacedim >::mpi_communicator
private

Definition at line 309 of file serial_solid.h.

◆ n_mpi_processes

template<int dim, int spacedim = dim>
const unsigned int SerialSolid< dim, spacedim >::n_mpi_processes
private

Definition at line 310 of file serial_solid.h.

◆ output_bool

template<int dim, int spacedim = dim>
const bool SerialSolid< dim, spacedim >::output_bool
private

Definition at line 330 of file serial_solid.h.

◆ param

template<int dim, int spacedim = dim>
std::shared_ptr<Parameters::RigidSolidObject<dim, spacedim> >& SerialSolid< dim, spacedim >::param
private

Definition at line 314 of file serial_solid.h.

◆ pvdhandler

template<int dim, int spacedim = dim>
PVDHandler SerialSolid< dim, spacedim >::pvdhandler
private

Definition at line 329 of file serial_solid.h.

◆ solid_mapping

template<int dim, int spacedim = dim>
std::shared_ptr<Mapping<dim, spacedim> > SerialSolid< dim, spacedim >::solid_mapping
private

Definition at line 322 of file serial_solid.h.

◆ solid_temperature

template<int dim, int spacedim = dim>
std::shared_ptr<Function<spacedim> > SerialSolid< dim, spacedim >::solid_temperature
private

Definition at line 338 of file serial_solid.h.

◆ solid_tria

template<int dim, int spacedim = dim>
std::shared_ptr<Triangulation<dim, spacedim> > SerialSolid< dim, spacedim >::solid_tria
private

Definition at line 320 of file serial_solid.h.

◆ thermal_boundary_type

template<int dim, int spacedim = dim>
Parameters::SolidObjectThermalBoundaryType SerialSolid< dim, spacedim >::thermal_boundary_type
private

Definition at line 339 of file serial_solid.h.

◆ this_mpi_process

template<int dim, int spacedim = dim>
const unsigned int SerialSolid< dim, spacedim >::this_mpi_process
private

Definition at line 311 of file serial_solid.h.

◆ translational_velocity

template<int dim, int spacedim = dim>
std::shared_ptr<Function<spacedim> > SerialSolid< dim, spacedim >::translational_velocity
private

Definition at line 333 of file serial_solid.h.

◆ vs_neighbors

template<int dim, int spacedim = dim>
triangulation_cell_neighbors_map SerialSolid< dim, spacedim >::vs_neighbors
private

Definition at line 345 of file serial_solid.h.


The documentation for this class was generated from the following files: