4#ifndef lethe_serial_solid_h
5#define lethe_serial_solid_h
13#include <deal.II/base/function.h>
15#include <deal.II/dofs/dof_handler.h>
17#include <deal.II/fe/mapping_fe.h>
19#include <deal.II/particles/particle_handler.h>
21#include <unordered_map>
37template <
int dim,
int spacedim = dim>
49 std::pair<typename Triangulation<spacedim>::active_cell_iterator,
50 typename Triangulation<dim, spacedim>::active_cell_iterator>>
52 const parallel::TriangulationBase<spacedim> &background_tr);
88 std::shared_ptr<Triangulation<dim, spacedim>>
96 DoFHandler<dim, spacedim> &
147 if constexpr (spacedim == 3)
190 typename Triangulation<dim, spacedim>::active_cell_iterator,
191 std::vector<typename Triangulation<dim, spacedim>::active_cell_iterator>,
239 const std::shared_ptr<SimulationControl> &simulation_control);
296 [[maybe_unused]]
const Tensor<1, spacedim> &axis);
314 std::shared_ptr<Parameters::RigidSolidObject<dim, spacedim>> &
param;
321 std::shared_ptr<FiniteElement<dim, spacedim>>
fe;
The PVDHandler class manages the storage of the information required to write pvd file....
Parameters for a single rigid solid object used in DEM simulations.
std::shared_ptr< Function< spacedim > > angular_velocity
void setup_containers()
Builds the neighboring cells information for each cell of the solid object. These containers store fo...
const unsigned int n_mpi_processes
Tensor< 1, 3 > current_angular_velocity
std::shared_ptr< Triangulation< dim, spacedim > > solid_tria
void setup_dof_handler()
Set-ups the displacement vector to store the motion of the triangulation.
MPI_Comm mpi_communicator
void write_output_results(const std::shared_ptr< SimulationControl > &simulation_control)
Write the output file of the solid object triangulation.
std::shared_ptr< FiniteElement< dim, spacedim > > fe
std::shared_ptr< Parameters::RigidSolidObject< dim, spacedim > > & param
double current_solid_temperature
Tensor< 1, 3 > get_translational_velocity() const
Returns translational velocity of the center of mass of the solid object.
std::shared_ptr< FESystem< dim, spacedim > > displacement_fe
triangulation_cell_neighbors_map vs_neighbors
Vector< double > displacement_since_mapped
std::shared_ptr< Triangulation< dim, spacedim > > get_triangulation()
Returns the shared pointer to the solid object triangulation.
Tensor< 1, spacedim > current_translational_velocity
triangulation_cell_neighbors_map es_neighbors
void move_solid_triangulation(double time_step, double initial_time)
Moves the vertices of the solid triangulation. This function uses explicitEuler scheme time integrato...
void initial_setup()
Manages solid triangulation setup.
void reset_displacement_monitoring()
Reset displacements since intersection for contact detection.
void read_checkpoint(const std::string &prefix_name)
read solid base triangulation checkpoint and replaces the triangulation at the location where it was ...
DoFHandler< dim, spacedim > displacement_dh
void rotate_grid(const double angle, const Tensor< 1, spacedim > &axis)
Rotates the grid by a given angle around an axis.
void write_checkpoint(const std::string &prefix_name)
write solid base triangulation checkpoint
Tensor< 1, 3 > get_angular_velocity() const
Returns the angular velocity of the center of mass of the solid object.
std::shared_ptr< Function< spacedim > > translational_velocity
double get_temperature() const
Returns the temperature of the solid object.
Parameters::SolidObjectThermalBoundaryType get_thermal_boundary_type() const
Returns the thermal boundary type of the solid object.
Vector< double > displacement
DoFHandler< dim, spacedim > & get_dof_handler()
Returns the dof_handler associated with the displacement of the solid object.
Point< 3 > get_center_of_rotation() const
Returns the center of rotation of the center of mass of the solid object.
void update_solid_temperature(const double initial_time)
Update the temperature of the solid object, which is a function of time.
double get_max_displacement_since_mapped() const
Calculates the max displacement of the solid object. The max displacement is defined as the L^\infty ...
Parameters::SolidObjectThermalBoundaryType thermal_boundary_type
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)
Maps the solid object in the background triangulation.
void translate_grid(const Tensor< 1, spacedim > &translate)
Translate the grid. In spacedim=2, the third component is ignored.
std::shared_ptr< Function< spacedim > > solid_temperature
std::tuple< const triangulation_cell_neighbors_map &, const triangulation_cell_neighbors_map & > get_neighbors_maps() const
Returns the neighboring cells maps of the solid object triangulation. These maps store for each cell ...
unsigned int get_solid_id() const
Returns the solid id of the solid object. This ID is an unsigned integer which is given to the solid ...
std::unordered_map< typename Triangulation< dim, spacedim >::active_cell_iterator, std::vector< typename Triangulation< dim, spacedim >::active_cell_iterator >, cut_cell_hash< spacedim > > triangulation_cell_neighbors_map
const unsigned int this_mpi_process
void move_solid_triangulation_with_displacement()
Moves the vertices of the solid triangulation using the displacement vector. This is mostly used when...
Point< spacedim > center_of_rotation
void displace_solid_triangulation()
Moves the dofs of the solid_triangulation by using the displacement vector. This is only used to move...
std::shared_ptr< Mapping< dim, spacedim > > solid_mapping
void setup_triangulation(const bool restart)
Generates a solid triangulation from a dealii or gmsh mesh.
SerialSolid(std::shared_ptr< Parameters::RigidSolidObject< dim, spacedim > > ¶m, unsigned int id)
Vector< double > & get_displacement_vector()
Returns the displacement vector of all the vertices of the solid object.
SolidObjectThermalBoundaryType
Thermal boundary condition type applied on a solid object surface.
Simulation control classes for managing time-stepping and iteration control in Lethe.
Parameter classes for solid objects used in Nitsche immersed boundary and DEM simulations.
Hash functor to enable using cut-cell (embedded triangulation) active cell iterators as keys of an un...
Tensor< 1, 3 > tensor_nd_to_3d(const Tensor< 1, dim > &tensor)
Point< 3 > point_nd_to_3d(const Point< dim > &point)