![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <serial_solid.h>
Public Types | |
| using | triangulation_cell_neighbors_map |
Public Member Functions | |
| SerialSolid (std::shared_ptr< Parameters::RigidSolidObject< dim, spacedim > > ¶m, 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 |
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.
| dim | An integer that denotes the dimensionality of the geometry |
| spacedim | An integer that denotes the dimension of the space occupied by the embedded solid |
Definition at line 38 of file serial_solid.h.
| using SerialSolid< dim, spacedim >::triangulation_cell_neighbors_map |
Definition at line 189 of file serial_solid.h.
| SerialSolid< dim, spacedim >::SerialSolid | ( | std::shared_ptr< Parameters::RigidSolidObject< dim, spacedim > > & | param, |
| unsigned int | id ) |
Definition at line 24 of file serial_solid.cc.
References angular_velocity, center_of_rotation, displacement_dh, id, initial_setup(), mpi_communicator, n_mpi_processes, output_bool, param, setup_containers(), solid_temperature, thermal_boundary_type, this_mpi_process, and translational_velocity.
|
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.
|
inline |
Returns the angular velocity of the center of mass of the solid object.
Definition at line 134 of file serial_solid.h.
References current_angular_velocity.
|
inline |
Returns the center of rotation of the center of mass of the solid object.
Definition at line 145 of file serial_solid.h.
References center_of_rotation, and point_nd_to_3d().
| Vector< double > & SerialSolid< dim, spacedim >::get_displacement_vector | ( | ) |
Returns the displacement vector of all the vertices of the solid object.
Definition at line 250 of file serial_solid.cc.
References displacement.
| DoFHandler< dim, spacedim > & SerialSolid< dim, spacedim >::get_dof_handler | ( | ) |
Returns the dof_handler associated with the displacement of the solid object.
Definition at line 242 of file serial_solid.cc.
References displacement_dh.
| 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.
Definition at line 257 of file serial_solid.cc.
References displacement_since_mapped.
|
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.
Definition at line 205 of file serial_solid.h.
References es_neighbors, and vs_neighbors.
|
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.
Definition at line 184 of file serial_solid.h.
References id.
|
inline |
Returns the temperature of the solid object.
Definition at line 160 of file serial_solid.h.
References current_solid_temperature.
|
inline |
Returns the thermal boundary type of the solid object.
Definition at line 171 of file serial_solid.h.
References thermal_boundary_type.
|
inline |
Returns translational velocity of the center of mass of the solid object.
Definition at line 123 of file serial_solid.h.
References current_translational_velocity, and tensor_nd_to_3d().
| std::shared_ptr< Triangulation< dim, spacedim > > SerialSolid< dim, spacedim >::get_triangulation | ( | ) |
Returns the shared pointer to the solid object triangulation.
Definition at line 264 of file serial_solid.cc.
References solid_tria.
| 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().
| 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.
| 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.
| time_step | The time_step value for this iteration |
| initial_time | The 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.
|
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.
| 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
| prefix_name | The 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.
|
inlineprivate |
Reset displacements since intersection for contact detection.
Definition at line 273 of file serial_solid.h.
References displacement_since_mapped.
|
private |
Rotates the grid by a given angle around an axis.
| angle | The angle (in rad) with which the solid is rotated |
| axis | The axis over which the solid is rotated. |
Definition at line 271 of file serial_solid.cc.
References solid_tria.
| 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.
| 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.
| void SerialSolid< dim, spacedim >::setup_triangulation | ( | const bool | restart | ) |
Generates a solid triangulation from a dealii or gmsh mesh.
| restart | Boolean 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().
|
private |
Translate the grid. In spacedim=2, the third component is ignored.
| translate | The vector with which the solid is translated. |
Definition at line 283 of file serial_solid.cc.
References solid_tria.
| void SerialSolid< dim, spacedim >::update_solid_temperature | ( | const double | initial_time | ) |
Update the temperature of the solid object, which is a function of time.
| initial_time | The 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.
| void SerialSolid< dim, spacedim >::write_checkpoint | ( | const std::string & | prefix_name | ) |
write solid base triangulation checkpoint
| prefix_name | The prefix of the checkpoint of the simulation |
Definition at line 521 of file serial_solid.cc.
References displacement, displacement_dh, and pvdhandler.
| void SerialSolid< dim, spacedim >::write_output_results | ( | const std::shared_ptr< SimulationControl > & | simulation_control | ) |
Write the output file of the solid object triangulation.
| simulation_control | The 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().
|
private |
Definition at line 334 of file serial_solid.h.
|
private |
Definition at line 335 of file serial_solid.h.
|
private |
Definition at line 337 of file serial_solid.h.
|
private |
Definition at line 340 of file serial_solid.h.
|
private |
Definition at line 336 of file serial_solid.h.
|
private |
Definition at line 325 of file serial_solid.h.
|
private |
Definition at line 323 of file serial_solid.h.
|
private |
Definition at line 324 of file serial_solid.h.
|
private |
Definition at line 326 of file serial_solid.h.
|
private |
Definition at line 345 of file serial_solid.h.
|
private |
Definition at line 321 of file serial_solid.h.
|
private |
Definition at line 317 of file serial_solid.h.
|
private |
Definition at line 309 of file serial_solid.h.
|
private |
Definition at line 310 of file serial_solid.h.
|
private |
Definition at line 330 of file serial_solid.h.
|
private |
Definition at line 314 of file serial_solid.h.
|
private |
Definition at line 329 of file serial_solid.h.
|
private |
Definition at line 322 of file serial_solid.h.
|
private |
Definition at line 338 of file serial_solid.h.
|
private |
Definition at line 320 of file serial_solid.h.
|
private |
Definition at line 339 of file serial_solid.h.
|
private |
Definition at line 311 of file serial_solid.h.
|
private |
Definition at line 333 of file serial_solid.h.
|
private |
Definition at line 345 of file serial_solid.h.