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

#include <cls_scratch_data.h>

Inheritance diagram for CLSScratchData< dim >:
[legend]

Public Member Functions

 CLSScratchData (const std::shared_ptr< SimulationControl > &simulation_control, const PhysicalPropertiesManager &properties_manager, const FiniteElement< dim > &fe_cls, const Quadrature< dim > &quadrature, const Quadrature< dim - 1 > &face_quadrature, const Mapping< dim > &mapping, const FiniteElement< dim > &fe_fd)
 CLSScratchData (const CLSScratchData< dim > &sd)
void allocate () override
template<typename VectorType>
void reinit (const typename DoFHandler< dim >::active_cell_iterator &cell, const VectorType &current_solution, const std::vector< VectorType > &previous_solutions)
template<typename VectorType>
void reinit_internal_face (const typename DoFHandler< dim >::active_cell_iterator &cell, const unsigned int &face_no, const unsigned int &sub_face_no, const typename DoFHandler< dim >::active_cell_iterator &neighbor_cell, const unsigned int &neighbor_face_no, const unsigned int &neighbor_sub_face_no, const VectorType &current_solution)
template<typename VectorType>
void reinit_velocity (const typename DoFHandler< dim >::active_cell_iterator &cell, const VectorType &current_solution, const std::vector< VectorType > &previous_solutions, const Parameters::ALE< dim > &ale)
template<typename VectorType>
void reinit_face_velocity (const typename DoFHandler< dim >::active_cell_iterator &velocity_cell, const unsigned int &face_no, const VectorType &velocity_solution, const Parameters::ALE< dim > &ale)
Public Member Functions inherited from PhysicsScratchDataBase
virtual ~PhysicsScratchDataBase ()=default

Public Attributes

const std::shared_ptr< SimulationControl > simulation_control
const PhysicalPropertiesManager properties_manager
std::map< field, std::vector< double > > fields
FEValues< dim > fe_values_cls
FEInterfaceValues< dim > fe_interface_values_cls
unsigned int n_dofs
unsigned int n_interface_dofs
unsigned int n_q_points
double cell_size
Table< 1, double > JxW
std::vector< Point< dim > > quadrature_points
std::vector< Point< dim > > face_quadrature_points
std::vector< double > present_phase_values
std::vector< Tensor< 1, dim > > phase_gradients
std::vector< Tensor< 1, dim > > previous_phase_gradients
std::vector< double > phase_laplacians
std::vector< std::vector< double > > previous_phase_values
std::vector< double > values_here
std::vector< double > values_there
std::vector< double > phase_value_jump
Table< 2, double > phi
Table< 2, Tensor< 1, dim > > grad_phi
Table< 2, Tensor< 2, dim > > hess_phi
Table< 2, double > laplacian_phi
FEValues< dim > fe_values_fd
FEFaceValues< dim > fe_face_values_fd
FEValuesExtractors::Vector velocities_fd
std::vector< Tensor< 1, dim > > velocity_values
std::vector< std::vector< Tensor< 1, dim > > > previous_velocity_values
std::vector< Tensor< 2, dim > > velocity_gradient_values
std::vector< double > velocity_divergences
std::vector< Tensor< 1, dim > > face_velocity_values

Detailed Description

template<int dim>
class CLSScratchData< dim >

Store the information required by the assembly procedure for a CLS free surface equation. Consequently, this class calculates the phase values (values, gradients, laplacians) and the shape method (values, gradients, laplacians) at all the gauss points for all degrees of freedom and stores it into arrays. This class serves as a separation between the evaluation at the gauss point of the variables of interest and their use in the assembly, which is carried out by the assembler methods.

Template Parameters
dimAn integer that denotes the dimension of the space in which the flow is solved

Definition at line 34 of file cls_scratch_data.h.

Constructor & Destructor Documentation

◆ CLSScratchData() [1/2]

template<int dim>
CLSScratchData< dim >::CLSScratchData ( const std::shared_ptr< SimulationControl > & simulation_control,
const PhysicalPropertiesManager & properties_manager,
const FiniteElement< dim > & fe_cls,
const Quadrature< dim > & quadrature,
const Quadrature< dim - 1 > & face_quadrature,
const Mapping< dim > & mapping,
const FiniteElement< dim > & fe_fd )
inline

Constructor. The constructor creates the fe_values that will be used to fill the member variables of the scratch. It also allocated the necessary memory for all member variables. However, it does not do any evaluation, since this needs to be done at the cell level.

Parameters
simulation_controlThe SimulationControl object that holds information related to the control of the steady-state or transient simulation. This is used to extrapolate velocity solutions in time for transient simulation.
properties_managerManager to calculate the physical properties.
fe_clsThe FESystem used to solve the CLS equations.
quadratureThe quadrature to use for the assembly within the cells.
face_quadratureThe quadrature to use for the assembly on faces.
mappingThe mapping of the domain in which the Navier-Stokes equations are solved.
fe_fdThe FESystem used to solve the Fluid Dynamics equations.

Definition at line 62 of file cls_scratch_data.h.

References allocate(), fe_face_values_fd, fe_interface_values_cls, fe_values_cls, fe_values_fd, properties_manager, and simulation_control.

◆ CLSScratchData() [2/2]

template<int dim>
CLSScratchData< dim >::CLSScratchData ( const CLSScratchData< dim > & sd)
inline

Copy Constructor. Same as the main constructor. This constructor only uses the other scratch to build the FeValues, it does not copy the content of the other scratch into itself since, by definition of the WorkStream mechanism it is assumed that the content of the scratch will be reset on a cell basis.

Parameters
sdThe scratch data to be copied

Definition at line 97 of file cls_scratch_data.h.

References allocate(), CLSScratchData(), fe_face_values_fd, fe_interface_values_cls, fe_values_cls, fe_values_fd, properties_manager, and simulation_control.

Member Function Documentation

◆ allocate()

template<int dim>
void CLSScratchData< dim >::allocate ( )
overridevirtual

◆ reinit()

template<int dim>
template<typename VectorType>
void CLSScratchData< dim >::reinit ( const typename DoFHandler< dim >::active_cell_iterator & cell,
const VectorType & current_solution,
const std::vector< VectorType > & previous_solutions )
inline

Reinitialize the content of the scratch.

Using the FeValues and the content of the solutions and previous solutions, fills all of the class member of the scratch

Template Parameters
VectorTypeThe Vector type used for the solvers
Parameters
[in]cellThe cell over which the assembly is being carried. This cell must be compatible with the FE which is used to fill the FeValues.
[in]current_solutionThe present value of the solution for the CLS.
[in]previous_solutionsThe solutions at the previous time steps.

Definition at line 150 of file cls_scratch_data.h.

References cell_size, compute_cell_diameter(), compute_cell_measure_with_JxW(), fe_values_cls, grad_phi, hess_phi, JxW, laplacian_phi, n_dofs, n_q_points, phase_gradients, phase_laplacians, phi, present_phase_values, previous_phase_gradients, previous_phase_values, and quadrature_points.

◆ reinit_face_velocity()

template<int dim>
template<typename VectorType>
void CLSScratchData< dim >::reinit_face_velocity ( const typename DoFHandler< dim >::active_cell_iterator & velocity_cell,
const unsigned int & face_no,
const VectorType & velocity_solution,
const Parameters::ALE< dim > & ale )
inline

Reinitialize the content of the scratch regarding the velocity for internal/boundary faces. The velocity is inherently assumed to have been solved using a CG scheme.

Parameters
[in]cellThe cell over which the assembly is being carried.
[in]face_noThe face index associated with the cell
[in]velocity_solutionThe present value of the velocity solution.

Definition at line 345 of file cls_scratch_data.h.

References Parameters::ALE< dim >::enabled(), face_quadrature_points, face_velocity_values, fe_face_values_fd, velocities_fd, and Parameters::ALE< dim >::velocity.

◆ reinit_internal_face()

template<int dim>
template<typename VectorType>
void CLSScratchData< dim >::reinit_internal_face ( const typename DoFHandler< dim >::active_cell_iterator & cell,
const unsigned int & face_no,
const unsigned int & sub_face_no,
const typename DoFHandler< dim >::active_cell_iterator & neighbor_cell,
const unsigned int & neighbor_face_no,
const unsigned int & neighbor_sub_face_no,
const VectorType & current_solution )
inline

Reinitialize the content of the scratch for the internal faces. This is only used for the DG assemblers.

Parameters
[in]cellThe cell over which the assembly is being carried.
[in]face_noThe face index associated with the cell
[in]sub_face_noThe subface index associated with the face
[in]neighbor_cellThe neighboring cell
[in]neighbor_face_noThe face index associated with the neighboring cell
[in]neighbor_sub_face_noThe subface index associated with the neighboring cell
[in]current_solutionThe present value of the solution.

Definition at line 216 of file cls_scratch_data.h.

References face_quadrature_points, fe_interface_values_cls, n_interface_dofs, phase_value_jump, values_here, and values_there.

◆ reinit_velocity()

template<int dim>
template<typename VectorType>
void CLSScratchData< dim >::reinit_velocity ( const typename DoFHandler< dim >::active_cell_iterator & cell,
const VectorType & current_solution,
const std::vector< VectorType > & previous_solutions,
const Parameters::ALE< dim > & ale )
inline

Reinitialize the velocity, calculated by the Fluid Dynamics.

Template Parameters
VectorTypeThe Vector type used for the solvers
Parameters
cellThe cell for which the velocity is reinitialized This cell must be compatible with the Fluid Dynamics FE
current_solutionThe present value of the solution for \([u,p]\)
previous_solutionsVector of \(n\) VectorType containers of previous fluid dynamic solutions ( \([u,p]\)). \(n\) depends on the BDF scheme selected for time-stepping.
aleALE parameters

Definition at line 268 of file cls_scratch_data.h.

References bdf_extrapolate(), Parameters::ALE< dim >::enabled(), fe_values_fd, n_q_points, number_of_previous_solutions(), previous_velocity_values, quadrature_points, simulation_control, time_stepping_is_bdf(), velocities_fd, Parameters::ALE< dim >::velocity, velocity_divergences, velocity_gradient_values, and velocity_values.

Member Data Documentation

◆ cell_size

template<int dim>
double CLSScratchData< dim >::cell_size

Definition at line 393 of file cls_scratch_data.h.

◆ face_quadrature_points

template<int dim>
std::vector<Point<dim> > CLSScratchData< dim >::face_quadrature_points

Definition at line 398 of file cls_scratch_data.h.

◆ face_velocity_values

template<int dim>
std::vector<Tensor<1, dim> > CLSScratchData< dim >::face_velocity_values

Definition at line 434 of file cls_scratch_data.h.

◆ fe_face_values_fd

template<int dim>
FEFaceValues<dim> CLSScratchData< dim >::fe_face_values_fd

Definition at line 424 of file cls_scratch_data.h.

◆ fe_interface_values_cls

template<int dim>
FEInterfaceValues<dim> CLSScratchData< dim >::fe_interface_values_cls

Definition at line 389 of file cls_scratch_data.h.

◆ fe_values_cls

template<int dim>
FEValues<dim> CLSScratchData< dim >::fe_values_cls

Definition at line 388 of file cls_scratch_data.h.

◆ fe_values_fd

template<int dim>
FEValues<dim> CLSScratchData< dim >::fe_values_fd

Scratch component for the Navier-Stokes component

Definition at line 423 of file cls_scratch_data.h.

◆ fields

template<int dim>
std::map<field, std::vector<double> > CLSScratchData< dim >::fields

Definition at line 385 of file cls_scratch_data.h.

◆ grad_phi

template<int dim>
Table<2, Tensor<1, dim> > CLSScratchData< dim >::grad_phi

Definition at line 415 of file cls_scratch_data.h.

◆ hess_phi

template<int dim>
Table<2, Tensor<2, dim> > CLSScratchData< dim >::hess_phi

Definition at line 416 of file cls_scratch_data.h.

◆ JxW

template<int dim>
Table<1, double> CLSScratchData< dim >::JxW

Definition at line 396 of file cls_scratch_data.h.

◆ laplacian_phi

template<int dim>
Table<2, double> CLSScratchData< dim >::laplacian_phi

Definition at line 417 of file cls_scratch_data.h.

◆ n_dofs

template<int dim>
unsigned int CLSScratchData< dim >::n_dofs

Definition at line 390 of file cls_scratch_data.h.

◆ n_interface_dofs

template<int dim>
unsigned int CLSScratchData< dim >::n_interface_dofs

Definition at line 391 of file cls_scratch_data.h.

◆ n_q_points

template<int dim>
unsigned int CLSScratchData< dim >::n_q_points

Definition at line 392 of file cls_scratch_data.h.

◆ phase_gradients

template<int dim>
std::vector<Tensor<1, dim> > CLSScratchData< dim >::phase_gradients

Definition at line 402 of file cls_scratch_data.h.

◆ phase_laplacians

template<int dim>
std::vector<double> CLSScratchData< dim >::phase_laplacians

Definition at line 405 of file cls_scratch_data.h.

◆ phase_value_jump

template<int dim>
std::vector<double> CLSScratchData< dim >::phase_value_jump

Definition at line 411 of file cls_scratch_data.h.

◆ phi

template<int dim>
Table<2, double> CLSScratchData< dim >::phi

Definition at line 414 of file cls_scratch_data.h.

◆ present_phase_values

template<int dim>
std::vector<double> CLSScratchData< dim >::present_phase_values

Definition at line 401 of file cls_scratch_data.h.

◆ previous_phase_gradients

template<int dim>
std::vector<Tensor<1, dim> > CLSScratchData< dim >::previous_phase_gradients

Definition at line 403 of file cls_scratch_data.h.

◆ previous_phase_values

template<int dim>
std::vector<std::vector<double> > CLSScratchData< dim >::previous_phase_values

Definition at line 406 of file cls_scratch_data.h.

◆ previous_velocity_values

template<int dim>
std::vector<std::vector<Tensor<1, dim> > > CLSScratchData< dim >::previous_velocity_values

Definition at line 429 of file cls_scratch_data.h.

◆ properties_manager

template<int dim>
const PhysicalPropertiesManager CLSScratchData< dim >::properties_manager

Definition at line 384 of file cls_scratch_data.h.

◆ quadrature_points

template<int dim>
std::vector<Point<dim> > CLSScratchData< dim >::quadrature_points

Definition at line 397 of file cls_scratch_data.h.

◆ simulation_control

template<int dim>
const std::shared_ptr<SimulationControl> CLSScratchData< dim >::simulation_control

Definition at line 381 of file cls_scratch_data.h.

◆ values_here

template<int dim>
std::vector<double> CLSScratchData< dim >::values_here

Definition at line 409 of file cls_scratch_data.h.

◆ values_there

template<int dim>
std::vector<double> CLSScratchData< dim >::values_there

Definition at line 410 of file cls_scratch_data.h.

◆ velocities_fd

template<int dim>
FEValuesExtractors::Vector CLSScratchData< dim >::velocities_fd

Definition at line 426 of file cls_scratch_data.h.

◆ velocity_divergences

template<int dim>
std::vector<double> CLSScratchData< dim >::velocity_divergences

Definition at line 431 of file cls_scratch_data.h.

◆ velocity_gradient_values

template<int dim>
std::vector<Tensor<2, dim> > CLSScratchData< dim >::velocity_gradient_values

Definition at line 430 of file cls_scratch_data.h.

◆ velocity_values

template<int dim>
std::vector<Tensor<1, dim> > CLSScratchData< dim >::velocity_values

Definition at line 428 of file cls_scratch_data.h.


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