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

#include <tracer_scratch_data.h>

Inheritance diagram for TracerScratchData< dim >:
[legend]

Public Member Functions

 TracerScratchData (const PhysicalPropertiesManager &properties_manager, const FiniteElement< dim > &fe_tracer, const Quadrature< dim > &quadrature, const Quadrature< dim - 1 > &face_quadrature, const Mapping< dim > &mapping, const FiniteElement< dim > &fe_fd, const bool uses_dg)
 TracerScratchData (const TracerScratchData< 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, const Function< dim > *source_function)
void reinit_signed_distance (const typename DoFHandler< dim >::active_cell_iterator &cell, const std::shared_ptr< Shape< dim > > &immersed_solid_shape)
void reinit_signed_distance_at_face (const typename DoFHandler< dim >::active_cell_iterator &cell, const unsigned int &face_no, const std::shared_ptr< Shape< dim > > &immersed_solid_shape)
template<typename VectorType>
void reinit_velocity (const typename DoFHandler< dim >::active_cell_iterator &cell, const VectorType &velocity_solution, const Parameters::ALE< dim > &ale, const std::shared_ptr< Functions::ParsedFunction< dim > > &drift_velocity)
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 &neigh_cell, const unsigned int &neigh_face_no, const unsigned int &neigh_sub_face_no, const VectorType &current_solution)
template<typename VectorType>
void reinit_boundary_face (const typename DoFHandler< dim >::active_cell_iterator &cell, const unsigned int &face_no, const unsigned int &boundary_index, const VectorType &current_solution)
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, const std::shared_ptr< Functions::ParsedFunction< dim > > &drift_velocity)
void reinit_mortar (const typename DoFHandler< dim >::active_cell_iterator &cell, const Parameters::Mortar< dim > &mortar_parameters, const double &time)
void calculate_face_physical_properties ()
void calculate_physical_properties ()
Public Member Functions inherited from PhysicsScratchDataBase
virtual ~PhysicsScratchDataBase ()=default

Public Attributes

const bool uses_dg
PhysicalPropertiesManager properties_manager
std::map< field, std::vector< double > > fields
std::vector< double > tracer_diffusivity
std::vector< double > tracer_diffusivity_face
std::vector< double > tracer_diffusivity_0
std::vector< double > tracer_diffusivity_1
std::vector< double > tracer_reaction_prefactor
std::vector< double > grad_tracer_reaction_prefactor
FEValues< dim > fe_values_tracer
FEInterfaceValues< dim > fe_interface_values_tracer
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 > tracer_values
std::vector< Tensor< 1, dim > > tracer_gradients
std::vector< double > tracer_laplacians
std::vector< std::vector< double > > previous_tracer_values
std::vector< Tensor< 1, dim > > previous_tracer_gradients
std::vector< double > values_here
std::vector< double > values_there
std::vector< double > tracer_value_jump
std::vector< Tensor< 1, dim > > gradients_here
std::vector< Tensor< 1, dim > > tracer_average_gradient
Table< 2, double > face_phi_here
Table< 2, double > face_phi_there
Table< 2, double > face_jump_phi
Table< 2, double > face_average_grad_phi_dot_n
double penalty_factor
unsigned int boundary_index
std::vector< double > sdf_values
std::vector< double > source
Table< 2, double > phi
Table< 2, Tensor< 2, dim > > hess_phi
Table< 2, double > laplacian_phi
Table< 2, Tensor< 1, dim > > grad_phi
bool gather_mortar
std::vector< Tensor< 1, dim > > rotor_linear_velocity_values
FEValuesExtractors::Vector velocities
FEValues< dim > fe_values_fd
FEFaceValues< dim > fe_face_values_fd
std::vector< Tensor< 1, dim > > velocity_values
std::vector< double > velocity_divergences
std::vector< Tensor< 1, dim > > face_velocity_values

Detailed Description

template<int dim>
class TracerScratchData< dim >

Class that stores the information required by the assembly procedure for a Tracer advection-diffusion equation. Consequently, this class calculates the tracer (values, gradients, laplacians) and the shape function (values, gradients, laplacians) at all the gauss points for all degrees of freedom and stores it into arrays. Additionnaly, the use can request that this class gathers additional fields for physics which are coupled to the Tracer equation, such as the velocity which is required. This class serves as a seperation 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 functions. For more information on this design, the reader can consult deal.II step-9 "https://www.dealii.org/current/doxygen/deal.II/step_9.html". In this latter example, the scratch is a struct instead of a templated class because of the simplicity of step-9.

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

Definition at line 40 of file tracer_scratch_data.h.

Constructor & Destructor Documentation

◆ TracerScratchData() [1/2]

template<int dim>
TracerScratchData< dim >::TracerScratchData ( const PhysicalPropertiesManager & properties_manager,
const FiniteElement< dim > & fe_tracer,
const Quadrature< dim > & quadrature,
const Quadrature< dim - 1 > & face_quadrature,
const Mapping< dim > & mapping,
const FiniteElement< dim > & fe_fd,
const bool uses_dg )
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 evalution, since this needs to be done at the cell level.

Parameters
feThe FESystem used to solve the Navier-Stokes equations
quadratureThe quadrature to use for the assembly
mappingThe mapping of the domain in which the Navier-Stokes equations are solved
uses_dgIf true, the scratch is used for the discontinuous Galerkin formulation. The hessians, laplacians and previous gradients, which are only required by the stabilization of the continuous formulation, are then not computed.

Definition at line 61 of file tracer_scratch_data.h.

References allocate(), fe_face_values_fd, fe_interface_values_tracer, fe_values_fd, fe_values_tracer, properties_manager, and uses_dg.

◆ TracerScratchData() [2/2]

template<int dim>
TracerScratchData< dim >::TracerScratchData ( const TracerScratchData< 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
feThe FESystem used to solve the Navier-Stokes equations
quadratureThe quadrature to use for the assembly
mappingThe mapping of the domain in which the Navier-Stokes equations are solved

Definition at line 101 of file tracer_scratch_data.h.

References allocate(), fe_face_values_fd, fe_interface_values_tracer, fe_values_fd, fe_values_tracer, properties_manager, TracerScratchData(), and uses_dg.

Member Function Documentation

◆ allocate()

◆ calculate_face_physical_properties()

template<int dim>
void TracerScratchData< dim >::calculate_face_physical_properties ( )
inline

Calculates the physical properties at a face.

Definition at line 576 of file tracer_scratch_data.h.

References fields, levelset, properties_manager, sdf_values, set_field_vector(), and tracer_diffusivity_face.

◆ calculate_physical_properties()

template<int dim>
void TracerScratchData< dim >::calculate_physical_properties ( )

Calculates the physical properties. This function calculates the physical properties that may be required by the tracer. Namely the diffusivity.

Definition at line 88 of file tracer_scratch_data.cc.

References fields, grad_tracer_reaction_prefactor, levelset, properties_manager, sdf_values, set_field_vector(), tracer_concentration, tracer_diffusivity, tracer_diffusivity_0, tracer_diffusivity_1, tracer_reaction_prefactor, and tracer_values.

◆ reinit()

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

Reinitializes 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.

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.
[in]previous_solutionsThe solutions at the previous time steps.
[in]source_functionThe function describing the tracer source term.

Definition at line 154 of file tracer_scratch_data.h.

References boundary_index, cell_size, compute_cell_diameter(), compute_cell_measure_with_JxW(), fe_values_tracer, grad_phi, hess_phi, JxW, laplacian_phi, n_dofs, n_q_points, phi, previous_tracer_gradients, previous_tracer_values, quadrature_points, source, tracer_gradients, tracer_laplacians, tracer_values, and uses_dg.

◆ reinit_boundary_face()

template<int dim>
template<typename VectorType>
void TracerScratchData< dim >::reinit_boundary_face ( const typename DoFHandler< dim >::active_cell_iterator & cell,
const unsigned int & face_no,
const unsigned int & boundary_index,
const VectorType & current_solution )
inline

Reinitializes the content of the scratch for the boundary faces. This is only used for the DG assemblers.

Parameters
[in]cellThe cell over which the assembly is being carried.
[in]faceThe face index associated with the cell
[in]current_solutionThe present value of the solution. there are any).

Definition at line 435 of file tracer_scratch_data.h.

References boundary_index, face_quadrature_points, fe_interface_values_tracer, fe_values_tracer, get_penalty_factor(), gradients_here, penalty_factor, and values_here.

◆ reinit_face_velocity()

template<int dim>
template<typename VectorType>
void TracerScratchData< 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,
const std::shared_ptr< Functions::ParsedFunction< dim > > & drift_velocity )
inline

Reinitializes 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]faceThe face index associated with the cell
[in]velocity_solutionThe present value of the solution. there are any).

Definition at line 469 of file tracer_scratch_data.h.

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

◆ reinit_internal_face()

template<int dim>
template<typename VectorType>
void TracerScratchData< 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 & neigh_cell,
const unsigned int & neigh_face_no,
const unsigned int & neigh_sub_face_no,
const VectorType & current_solution )
inline

Reinitializes 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]neigh_cellThe neighboring cell
[in]neigh_face_noThe face index associated with the neighboring cell
[in]neigh_sub_face_noThe subface index associated with the neighboring cell
[in]current_solutionThe present value of the solution.

Definition at line 366 of file tracer_scratch_data.h.

References face_average_grad_phi_dot_n, face_jump_phi, face_phi_here, face_phi_there, face_quadrature_points, fe_interface_values_tracer, fe_values_tracer, get_penalty_factor(), n_interface_dofs, penalty_factor, tracer_average_gradient, tracer_value_jump, values_here, and values_there.

◆ reinit_mortar()

template<int dim>
void TracerScratchData< dim >::reinit_mortar ( const typename DoFHandler< dim >::active_cell_iterator & cell,
const Parameters::Mortar< dim > & mortar_parameters,
const double & time )
inline

Renitialize the content of the scratch data for mortar.

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]mortar_parametersParameters for the mortar method
[in]timeCurrent simulation time

Definition at line 531 of file tracer_scratch_data.h.

References LetheGridTools::angular_to_linear_velocity(), Parameters::Mortar< dim >::center_of_rotation, fe_values_tracer, n_q_points, Parameters::Mortar< dim >::rotation_axis_direction, Parameters::Mortar< dim >::rotor_angular_velocity, rotor_linear_velocity_values, and velocity_values.

◆ reinit_signed_distance()

template<int dim>
void TracerScratchData< dim >::reinit_signed_distance ( const typename DoFHandler< dim >::active_cell_iterator & cell,
const std::shared_ptr< Shape< dim > > & immersed_solid_shape )
inline

Reinitializes the signed distance vector of the scratch.

Parameters
[in]cellThe cell over which the assembly is being carried.
[in]immersed_solid_shapeShared pointer to the shape describing the particles (if there are any).

Definition at line 225 of file tracer_scratch_data.h.

References fe_values_tracer, levelset, n_q_points, properties_manager, quadrature_points, and sdf_values.

◆ reinit_signed_distance_at_face()

template<int dim>
void TracerScratchData< dim >::reinit_signed_distance_at_face ( const typename DoFHandler< dim >::active_cell_iterator & cell,
const unsigned int & face_no,
const std::shared_ptr< Shape< dim > > & immersed_solid_shape )
inline

Reinitializes the signed distance vector of the scratch for a given face.

Parameters
[in]cellThe cell over which the assembly is being carried.
[in]face_noThe face index associated with the cell
[in]immersed_solid_shapeShared pointer to the shape describing the particles (if there are any).

Definition at line 255 of file tracer_scratch_data.h.

References face_quadrature_points, fe_interface_values_tracer, levelset, properties_manager, and sdf_values.

◆ reinit_velocity()

template<int dim>
template<typename VectorType>
void TracerScratchData< dim >::reinit_velocity ( const typename DoFHandler< dim >::active_cell_iterator & cell,
const VectorType & velocity_solution,
const Parameters::ALE< dim > & ale,
const std::shared_ptr< Functions::ParsedFunction< dim > > & drift_velocity )
inline

Reinitialize the velocity, calculated by the fluid dynamics while also taking into account ALE.

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]
aleThe ALE parameters which include the ALE function
drift_velocityFunction to calculate the drift velocity

Definition at line 295 of file tracer_scratch_data.h.

References Parameters::ALE< dim >::enabled(), fe_values_fd, n_q_points, quadrature_points, velocities, Parameters::ALE< dim >::velocity, velocity_divergences, and velocity_values.

Member Data Documentation

◆ boundary_index

template<int dim>
unsigned int TracerScratchData< dim >::boundary_index

Definition at line 655 of file tracer_scratch_data.h.

◆ cell_size

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

Definition at line 621 of file tracer_scratch_data.h.

◆ face_average_grad_phi_dot_n

template<int dim>
Table<2, double> TracerScratchData< dim >::face_average_grad_phi_dot_n

Definition at line 647 of file tracer_scratch_data.h.

◆ face_jump_phi

template<int dim>
Table<2, double> TracerScratchData< dim >::face_jump_phi

Definition at line 646 of file tracer_scratch_data.h.

◆ face_phi_here

template<int dim>
Table<2, double> TracerScratchData< dim >::face_phi_here

Definition at line 644 of file tracer_scratch_data.h.

◆ face_phi_there

template<int dim>
Table<2, double> TracerScratchData< dim >::face_phi_there

Definition at line 645 of file tracer_scratch_data.h.

◆ face_quadrature_points

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

Definition at line 626 of file tracer_scratch_data.h.

◆ face_velocity_values

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

Definition at line 684 of file tracer_scratch_data.h.

◆ fe_face_values_fd

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

Definition at line 681 of file tracer_scratch_data.h.

◆ fe_interface_values_tracer

template<int dim>
FEInterfaceValues<dim> TracerScratchData< dim >::fe_interface_values_tracer

Definition at line 616 of file tracer_scratch_data.h.

◆ fe_values_fd

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

Definition at line 680 of file tracer_scratch_data.h.

◆ fe_values_tracer

template<int dim>
FEValues<dim> TracerScratchData< dim >::fe_values_tracer

Definition at line 615 of file tracer_scratch_data.h.

◆ fields

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

Definition at line 602 of file tracer_scratch_data.h.

◆ gather_mortar

template<int dim>
bool TracerScratchData< dim >::gather_mortar

Scratch components for the mortar method

Definition at line 672 of file tracer_scratch_data.h.

◆ grad_phi

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

Definition at line 667 of file tracer_scratch_data.h.

◆ grad_tracer_reaction_prefactor

template<int dim>
std::vector<double> TracerScratchData< dim >::grad_tracer_reaction_prefactor

Definition at line 612 of file tracer_scratch_data.h.

◆ gradients_here

template<int dim>
std::vector<Tensor<1, dim> > TracerScratchData< dim >::gradients_here

Definition at line 639 of file tracer_scratch_data.h.

◆ hess_phi

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

Definition at line 665 of file tracer_scratch_data.h.

◆ JxW

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

Definition at line 624 of file tracer_scratch_data.h.

◆ laplacian_phi

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

Definition at line 666 of file tracer_scratch_data.h.

◆ n_dofs

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

Definition at line 618 of file tracer_scratch_data.h.

◆ n_interface_dofs

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

Definition at line 619 of file tracer_scratch_data.h.

◆ n_q_points

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

Definition at line 620 of file tracer_scratch_data.h.

◆ penalty_factor

template<int dim>
double TracerScratchData< dim >::penalty_factor

Definition at line 652 of file tracer_scratch_data.h.

◆ phi

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

Definition at line 664 of file tracer_scratch_data.h.

◆ previous_tracer_gradients

template<int dim>
std::vector<Tensor<1, dim> > TracerScratchData< dim >::previous_tracer_gradients

Definition at line 633 of file tracer_scratch_data.h.

◆ previous_tracer_values

template<int dim>
std::vector<std::vector<double> > TracerScratchData< dim >::previous_tracer_values

Definition at line 632 of file tracer_scratch_data.h.

◆ properties_manager

template<int dim>
PhysicalPropertiesManager TracerScratchData< dim >::properties_manager

Definition at line 601 of file tracer_scratch_data.h.

◆ quadrature_points

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

Definition at line 625 of file tracer_scratch_data.h.

◆ rotor_linear_velocity_values

template<int dim>
std::vector<Tensor<1, dim> > TracerScratchData< dim >::rotor_linear_velocity_values

Definition at line 673 of file tracer_scratch_data.h.

◆ sdf_values

template<int dim>
std::vector<double> TracerScratchData< dim >::sdf_values

Definition at line 658 of file tracer_scratch_data.h.

◆ source

template<int dim>
std::vector<double> TracerScratchData< dim >::source

Definition at line 661 of file tracer_scratch_data.h.

◆ tracer_average_gradient

template<int dim>
std::vector<Tensor<1, dim> > TracerScratchData< dim >::tracer_average_gradient

Definition at line 640 of file tracer_scratch_data.h.

◆ tracer_diffusivity

template<int dim>
std::vector<double> TracerScratchData< dim >::tracer_diffusivity

Definition at line 603 of file tracer_scratch_data.h.

◆ tracer_diffusivity_0

template<int dim>
std::vector<double> TracerScratchData< dim >::tracer_diffusivity_0

Definition at line 605 of file tracer_scratch_data.h.

◆ tracer_diffusivity_1

template<int dim>
std::vector<double> TracerScratchData< dim >::tracer_diffusivity_1

Definition at line 606 of file tracer_scratch_data.h.

◆ tracer_diffusivity_face

template<int dim>
std::vector<double> TracerScratchData< dim >::tracer_diffusivity_face

Definition at line 604 of file tracer_scratch_data.h.

◆ tracer_gradients

template<int dim>
std::vector<Tensor<1, dim> > TracerScratchData< dim >::tracer_gradients

Definition at line 630 of file tracer_scratch_data.h.

◆ tracer_laplacians

template<int dim>
std::vector<double> TracerScratchData< dim >::tracer_laplacians

Definition at line 631 of file tracer_scratch_data.h.

◆ tracer_reaction_prefactor

template<int dim>
std::vector<double> TracerScratchData< dim >::tracer_reaction_prefactor

Definition at line 607 of file tracer_scratch_data.h.

◆ tracer_value_jump

template<int dim>
std::vector<double> TracerScratchData< dim >::tracer_value_jump

Definition at line 638 of file tracer_scratch_data.h.

◆ tracer_values

template<int dim>
std::vector<double> TracerScratchData< dim >::tracer_values

Definition at line 629 of file tracer_scratch_data.h.

◆ uses_dg

template<int dim>
const bool TracerScratchData< dim >::uses_dg

Definition at line 598 of file tracer_scratch_data.h.

◆ values_here

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

Definition at line 636 of file tracer_scratch_data.h.

◆ values_there

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

Definition at line 637 of file tracer_scratch_data.h.

◆ velocities

template<int dim>
FEValuesExtractors::Vector TracerScratchData< dim >::velocities

Scratch component for the Navier-Stokes component

Definition at line 678 of file tracer_scratch_data.h.

◆ velocity_divergences

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

Definition at line 683 of file tracer_scratch_data.h.

◆ velocity_values

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

Definition at line 682 of file tracer_scratch_data.h.


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