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

#include <solid_base.h>

Public Member Functions

 SolidBase (std::shared_ptr< Parameters::NitscheObject< spacedim > > &param, const std::shared_ptr< parallel::DistributedTriangulationBase< spacedim > > &fluid_tria, const std::shared_ptr< Mapping< spacedim > > &fluid_mapping)
void initial_setup ()
void setup_triangulation (const bool restart)
void setup_displacement ()
void setup_particles_handler ()
void setup_particles ()
void load_triangulation (const std::string &filename_tria)
void load_particles (const std::string &filename_part)
std::shared_ptr< Particles::ParticleHandler< spacedim > > & get_solid_particle_handler ()
std::shared_ptr< parallel::DistributedTriangulationBase< dim, spacedim > > get_solid_triangulation ()
DoFHandler< dim, spacedim > & get_solid_dof_handler ()
DoFHandler< dim, spacedim > & get_displacement_dof_handler ()
GlobalVectorType & get_displacement_vector ()
Function< spacedim > * get_solid_velocity ()
Function< spacedim > * get_solid_temperature ()
void integrate_velocity (double time_step, double initial_time)
void move_solid_triangulation (double time_step, double initial_time)
void move_solid_triangulation_with_displacement ()
void print_particle_positions ()
void rotate_grid (const double angle, const Tensor< 1, spacedim > &axis)
void translate_grid (const Tensor< 1, spacedim > &translate)
void update_temperature_time (double time)
void read_checkpoint (const std::string &prefix_name)
void write_checkpoint (const std::string &prefix_name)

Private Attributes

IndexSet locally_owned_dofs
IndexSet locally_relevant_dofs
MPI_Comm mpi_communicator
const unsigned int n_mpi_processes
const unsigned int this_mpi_process
std::shared_ptr< parallel::DistributedTriangulationBase< dim, spacedim > > solid_tria
std::shared_ptr< parallel::DistributedTriangulationBase< spacedim > > fluid_tria
DoFHandler< dim, spacedim > solid_dh
std::shared_ptr< Particles::ParticleHandler< spacedim > > solid_particle_handler
std::shared_ptr< FiniteElement< dim, spacedim > > fe
std::shared_ptr< Mapping< dim, spacedim > > solid_mapping
std::shared_ptr< Mapping< spacedim > > fluid_mapping
std::shared_ptr< Quadrature< dim > > quadrature
DoFHandler< dim, spacedim > displacement_dh
std::shared_ptr< FESystem< dim, spacedim > > displacement_fe
GlobalVectorType displacement
GlobalVectorType displacement_relevant
std::shared_ptr< Parameters::NitscheObject< spacedim > > & param
Function< spacedim > * velocity
Function< spacedim > * temperature
unsigned int initial_number_of_particles

Detailed Description

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

A base class that generates a particle handler for the solid

Template Parameters
dimAn integer that denotes the dimension of the space in which the flow is solved
spacedimAn integer that denotes the dimension of the space occupied by the embedded solid
Author
Carole-Anne Daunais, Valerie Bibeau, 2020

Definition at line 37 of file solid_base.h.

Constructor & Destructor Documentation

◆ SolidBase()

template<int dim, int spacedim>
SolidBase< dim, spacedim >::SolidBase ( std::shared_ptr< Parameters::NitscheObject< spacedim > > & param,
const std::shared_ptr< parallel::DistributedTriangulationBase< spacedim > > & fluid_tria,
const std::shared_ptr< Mapping< spacedim > > & fluid_mapping )

Member Function Documentation

◆ get_displacement_dof_handler()

template<int dim, int spacedim>
DoFHandler< dim, spacedim > & SolidBase< dim, spacedim >::get_displacement_dof_handler ( )
Returns
the reference to the displacement dof handler

Definition at line 399 of file solid_base.cc.

References displacement_dh.

◆ get_displacement_vector()

template<int dim, int spacedim>
GlobalVectorType & SolidBase< dim, spacedim >::get_displacement_vector ( )
Returns
the reference to the displacement vector

Definition at line 407 of file solid_base.cc.

References displacement, and displacement_relevant.

◆ get_solid_dof_handler()

template<int dim, int spacedim>
DoFHandler< dim, spacedim > & SolidBase< dim, spacedim >::get_solid_dof_handler ( )
Returns
the reference to the solid dof handler

Definition at line 392 of file solid_base.cc.

References solid_dh.

◆ get_solid_particle_handler()

template<int dim, int spacedim>
std::shared_ptr< Particles::ParticleHandler< spacedim > > & SolidBase< dim, spacedim >::get_solid_particle_handler ( )
Returns
the reference to the std::shared_ptr of a Particles::ParticleHandler<spacedim> that contains the solid particle handler

Definition at line 415 of file solid_base.cc.

References solid_particle_handler.

◆ get_solid_temperature()

template<int dim, int spacedim>
Function< spacedim > * SolidBase< dim, spacedim >::get_solid_temperature ( )

Definition at line 435 of file solid_base.cc.

References temperature.

◆ get_solid_triangulation()

template<int dim, int spacedim>
std::shared_ptr< parallel::DistributedTriangulationBase< dim, spacedim > > SolidBase< dim, spacedim >::get_solid_triangulation ( )
Returns
shared_ptr of the solid triangulation

Definition at line 422 of file solid_base.cc.

References solid_tria.

◆ get_solid_velocity()

template<int dim, int spacedim>
Function< spacedim > * SolidBase< dim, spacedim >::get_solid_velocity ( )
Returns
Function<spacedim> of the solid velocity

Definition at line 429 of file solid_base.cc.

References velocity.

◆ initial_setup()

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

Manages solid triangulation and particles setup.

Definition at line 97 of file solid_base.cc.

References setup_displacement(), setup_particles(), and setup_triangulation().

◆ integrate_velocity()

template<int dim, int spacedim>
void SolidBase< dim, spacedim >::integrate_velocity ( double time_step,
double initial_time )

Updates particle positions in solid_particle_handler by integrating velocity using an explicit Runge-Kutta 4 method.

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 449 of file solid_base.cc.

References initial_number_of_particles, param, solid_particle_handler, this_mpi_process, and velocity.

◆ load_particles()

template<int dim, int spacedim>
void SolidBase< dim, spacedim >::load_particles ( const std::string & filename_part)

Loads a particle handler in the fluid triangulation domain that holds the particles of the solid according to a specific quadrature, and sets up dofs.

Definition at line 369 of file solid_base.cc.

References check_file_exists(), initial_number_of_particles, setup_particles_handler(), and solid_particle_handler.

◆ load_triangulation()

template<int dim, int spacedim>
void SolidBase< dim, spacedim >::load_triangulation ( const std::string & filename_tria)

Loads a solid triangulation from a restart file.

Definition at line 254 of file solid_base.cc.

References fe, solid_dh, and solid_tria.

◆ move_solid_triangulation()

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

Moves the vertices of the solid triangulation. This function uses an Runge-Kutta 4 explicit 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. See https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods for more details.

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 555 of file solid_base.cc.

References displacement, displacement_dh, displacement_fe, solid_tria, and velocity.

◆ move_solid_triangulation_with_displacement()

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

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

Definition at line 637 of file solid_base.cc.

References displacement_dh, displacement_fe, and displacement_relevant.

◆ print_particle_positions()

template<int dim, int spacedim>
void SolidBase< dim, spacedim >::print_particle_positions ( )

prints the positions of the particles

Definition at line 671 of file solid_base.cc.

References solid_particle_handler.

◆ read_checkpoint()

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

◆ rotate_grid()

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

Rotates the grid by a given angle around an axis.

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

Definition at line 235 of file solid_base.cc.

References solid_tria.

◆ setup_displacement()

template<int dim, int spacedim>
void SolidBase< dim, spacedim >::setup_displacement ( )

Sets-up particles with particle handler, in the fluid triangulation domain that holds the particles of the solid according to a specific quadrature.

Definition at line 803 of file solid_base.cc.

References displacement, displacement_dh, displacement_fe, displacement_relevant, locally_owned_dofs, locally_relevant_dofs, and mpi_communicator.

◆ setup_particles()

template<int dim, int spacedim>
void SolidBase< dim, spacedim >::setup_particles ( )

Sets-up particles with particle handler, in the fluid triangulation domain that holds the particles of the solid according to a specific quadrature.

Definition at line 289 of file solid_base.cc.

References fe, fluid_tria, initial_number_of_particles, mpi_communicator, quadrature, setup_particles_handler(), solid_dh, solid_mapping, solid_particle_handler, and solid_tria.

◆ setup_particles_handler()

template<int dim, int spacedim>
void SolidBase< dim, spacedim >::setup_particles_handler ( )

Creates a particle handler in the fluid triangulation domain.

Definition at line 276 of file solid_base.cc.

References fluid_mapping, fluid_tria, and solid_particle_handler.

◆ setup_triangulation()

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

Generates a solid triangulation from a dealii or gmsh mesh.

Definition at line 110 of file solid_base.cc.

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

◆ translate_grid()

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

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

Parameters
translateThe vector with which the solid is translated.

Definition at line 247 of file solid_base.cc.

References solid_tria.

◆ update_temperature_time()

template<int dim, int spacedim>
void SolidBase< dim, spacedim >::update_temperature_time ( double time)

Updates the time in the function used to describe the solid temperature.

Definition at line 442 of file solid_base.cc.

References temperature.

◆ write_checkpoint()

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

write solid base triangulation checkpoint

Definition at line 695 of file solid_base.cc.

References displacement, displacement_dh, displacement_relevant, solid_particle_handler, and solid_tria.

Member Data Documentation

◆ displacement

template<int dim, int spacedim = dim>
GlobalVectorType SolidBase< dim, spacedim >::displacement
private

Definition at line 234 of file solid_base.h.

◆ displacement_dh

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

Definition at line 232 of file solid_base.h.

◆ displacement_fe

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

Definition at line 233 of file solid_base.h.

◆ displacement_relevant

template<int dim, int spacedim = dim>
GlobalVectorType SolidBase< dim, spacedim >::displacement_relevant
private

Definition at line 235 of file solid_base.h.

◆ fe

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

Definition at line 225 of file solid_base.h.

◆ fluid_mapping

template<int dim, int spacedim = dim>
std::shared_ptr<Mapping<spacedim> > SolidBase< dim, spacedim >::fluid_mapping
private

Definition at line 228 of file solid_base.h.

◆ fluid_tria

template<int dim, int spacedim = dim>
std::shared_ptr<parallel::DistributedTriangulationBase<spacedim> > SolidBase< dim, spacedim >::fluid_tria
private

Definition at line 221 of file solid_base.h.

◆ initial_number_of_particles

template<int dim, int spacedim = dim>
unsigned int SolidBase< dim, spacedim >::initial_number_of_particles
private

Definition at line 243 of file solid_base.h.

◆ locally_owned_dofs

template<int dim, int spacedim = dim>
IndexSet SolidBase< dim, spacedim >::locally_owned_dofs
private

Definition at line 212 of file solid_base.h.

◆ locally_relevant_dofs

template<int dim, int spacedim = dim>
IndexSet SolidBase< dim, spacedim >::locally_relevant_dofs
private

Definition at line 213 of file solid_base.h.

◆ mpi_communicator

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

Definition at line 215 of file solid_base.h.

◆ n_mpi_processes

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

Definition at line 216 of file solid_base.h.

◆ param

template<int dim, int spacedim = dim>
std::shared_ptr<Parameters::NitscheObject<spacedim> >& SolidBase< dim, spacedim >::param
private

Definition at line 238 of file solid_base.h.

◆ quadrature

template<int dim, int spacedim = dim>
std::shared_ptr<Quadrature<dim> > SolidBase< dim, spacedim >::quadrature
private

Definition at line 229 of file solid_base.h.

◆ solid_dh

template<int dim, int spacedim = dim>
DoFHandler<dim, spacedim> SolidBase< dim, spacedim >::solid_dh
private

Definition at line 222 of file solid_base.h.

◆ solid_mapping

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

Definition at line 227 of file solid_base.h.

◆ solid_particle_handler

template<int dim, int spacedim = dim>
std::shared_ptr<Particles::ParticleHandler<spacedim> > SolidBase< dim, spacedim >::solid_particle_handler
private

Definition at line 223 of file solid_base.h.

◆ solid_tria

template<int dim, int spacedim = dim>
std::shared_ptr<parallel::DistributedTriangulationBase<dim, spacedim> > SolidBase< dim, spacedim >::solid_tria
private

Definition at line 220 of file solid_base.h.

◆ temperature

template<int dim, int spacedim = dim>
Function<spacedim>* SolidBase< dim, spacedim >::temperature
private

Definition at line 241 of file solid_base.h.

◆ this_mpi_process

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

Definition at line 217 of file solid_base.h.

◆ velocity

template<int dim, int spacedim = dim>
Function<spacedim>* SolidBase< dim, spacedim >::velocity
private

Definition at line 240 of file solid_base.h.


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