![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <tracer_scratch_data.h>
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 ¤t_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 ¤t_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 ¤t_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 |
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.
| dim | An integer that denotes the dimension of the space in which the flow is solved |
Definition at line 40 of file tracer_scratch_data.h.
|
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.
| fe | The FESystem used to solve the Navier-Stokes equations |
| quadrature | The quadrature to use for the assembly |
| mapping | The mapping of the domain in which the Navier-Stokes equations are solved |
| uses_dg | If 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.
|
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.
| fe | The FESystem used to solve the Navier-Stokes equations |
| quadrature | The quadrature to use for the assembly |
| mapping | The 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.
|
overridevirtual |
Allocates the memory for the scratch.
This function allocates the necessary memory for all members of the scratch
Implements PhysicsScratchDataBase.
Definition at line 10 of file tracer_scratch_data.cc.
References face_average_grad_phi_dot_n, face_jump_phi, face_phi_here, face_phi_there, face_velocity_values, fe_interface_values_tracer, fe_values_tracer, fields, grad_phi, grad_tracer_reaction_prefactor, gradients_here, hess_phi, JxW, laplacian_phi, levelset, maximum_number_of_previous_solutions(), n_dofs, n_q_points, phi, previous_tracer_gradients, previous_tracer_values, properties_manager, sdf_values, source, tracer_average_gradient, tracer_concentration, tracer_diffusivity, tracer_diffusivity_0, tracer_diffusivity_1, tracer_diffusivity_face, tracer_gradients, tracer_laplacians, tracer_reaction_prefactor, tracer_value_jump, tracer_values, uses_dg, values_here, values_there, velocities, velocity_divergences, and velocity_values.
|
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.
| 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.
|
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.
| [in] | cell | The 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_solution | The present value of the solution. |
| [in] | previous_solutions | The solutions at the previous time steps. |
| [in] | source_function | The 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.
|
inline |
Reinitializes the content of the scratch for the boundary faces. This is only used for the DG assemblers.
| [in] | cell | The cell over which the assembly is being carried. |
| [in] | face | The face index associated with the cell |
| [in] | current_solution | The 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.
|
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.
| [in] | cell | The cell over which the assembly is being carried. |
| [in] | face | The face index associated with the cell |
| [in] | velocity_solution | The 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.
|
inline |
Reinitializes the content of the scratch for the internal faces. This is only used for the DG assemblers.
| [in] | cell | The cell over which the assembly is being carried. |
| [in] | face_no | The face index associated with the cell |
| [in] | sub_face_no | The subface index associated with the face |
| [in] | neigh_cell | The neighboring cell |
| [in] | neigh_face_no | The face index associated with the neighboring cell |
| [in] | neigh_sub_face_no | The subface index associated with the neighboring cell |
| [in] | current_solution | The 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.
|
inline |
Renitialize the content of the scratch data for mortar.
| [in] | cell | The 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_parameters | Parameters for the mortar method |
| [in] | time | Current 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.
|
inline |
Reinitializes the signed distance vector of the scratch.
| [in] | cell | The cell over which the assembly is being carried. |
| [in] | immersed_solid_shape | Shared 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.
|
inline |
Reinitializes the signed distance vector of the scratch for a given face.
| [in] | cell | The cell over which the assembly is being carried. |
| [in] | face_no | The face index associated with the cell |
| [in] | immersed_solid_shape | Shared 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.
|
inline |
Reinitialize the velocity, calculated by the fluid dynamics while also taking into account ALE.
| VectorType | The Vector type used for the solvers |
| cell | The cell for which the velocity is reinitialized This cell must be compatible with the Fluid Dynamics FE |
| current_solution | The present value of the solution for [u,p] |
| ale | The ALE parameters which include the ALE function |
| drift_velocity | Function 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.
| unsigned int TracerScratchData< dim >::boundary_index |
Definition at line 655 of file tracer_scratch_data.h.
| double TracerScratchData< dim >::cell_size |
Definition at line 621 of file tracer_scratch_data.h.
| Table<2, double> TracerScratchData< dim >::face_average_grad_phi_dot_n |
Definition at line 647 of file tracer_scratch_data.h.
| Table<2, double> TracerScratchData< dim >::face_jump_phi |
Definition at line 646 of file tracer_scratch_data.h.
| Table<2, double> TracerScratchData< dim >::face_phi_here |
Definition at line 644 of file tracer_scratch_data.h.
| Table<2, double> TracerScratchData< dim >::face_phi_there |
Definition at line 645 of file tracer_scratch_data.h.
| std::vector<Point<dim> > TracerScratchData< dim >::face_quadrature_points |
Definition at line 626 of file tracer_scratch_data.h.
| std::vector<Tensor<1, dim> > TracerScratchData< dim >::face_velocity_values |
Definition at line 684 of file tracer_scratch_data.h.
| FEFaceValues<dim> TracerScratchData< dim >::fe_face_values_fd |
Definition at line 681 of file tracer_scratch_data.h.
| FEInterfaceValues<dim> TracerScratchData< dim >::fe_interface_values_tracer |
Definition at line 616 of file tracer_scratch_data.h.
| FEValues<dim> TracerScratchData< dim >::fe_values_fd |
Definition at line 680 of file tracer_scratch_data.h.
| FEValues<dim> TracerScratchData< dim >::fe_values_tracer |
Definition at line 615 of file tracer_scratch_data.h.
| std::map<field, std::vector<double> > TracerScratchData< dim >::fields |
Definition at line 602 of file tracer_scratch_data.h.
| bool TracerScratchData< dim >::gather_mortar |
Scratch components for the mortar method
Definition at line 672 of file tracer_scratch_data.h.
| Table<2, Tensor<1, dim> > TracerScratchData< dim >::grad_phi |
Definition at line 667 of file tracer_scratch_data.h.
| std::vector<double> TracerScratchData< dim >::grad_tracer_reaction_prefactor |
Definition at line 612 of file tracer_scratch_data.h.
| std::vector<Tensor<1, dim> > TracerScratchData< dim >::gradients_here |
Definition at line 639 of file tracer_scratch_data.h.
| Table<2, Tensor<2, dim> > TracerScratchData< dim >::hess_phi |
Definition at line 665 of file tracer_scratch_data.h.
| Table<1, double> TracerScratchData< dim >::JxW |
Definition at line 624 of file tracer_scratch_data.h.
| Table<2, double> TracerScratchData< dim >::laplacian_phi |
Definition at line 666 of file tracer_scratch_data.h.
| unsigned int TracerScratchData< dim >::n_dofs |
Definition at line 618 of file tracer_scratch_data.h.
| unsigned int TracerScratchData< dim >::n_interface_dofs |
Definition at line 619 of file tracer_scratch_data.h.
| unsigned int TracerScratchData< dim >::n_q_points |
Definition at line 620 of file tracer_scratch_data.h.
| double TracerScratchData< dim >::penalty_factor |
Definition at line 652 of file tracer_scratch_data.h.
| Table<2, double> TracerScratchData< dim >::phi |
Definition at line 664 of file tracer_scratch_data.h.
| std::vector<Tensor<1, dim> > TracerScratchData< dim >::previous_tracer_gradients |
Definition at line 633 of file tracer_scratch_data.h.
| std::vector<std::vector<double> > TracerScratchData< dim >::previous_tracer_values |
Definition at line 632 of file tracer_scratch_data.h.
| PhysicalPropertiesManager TracerScratchData< dim >::properties_manager |
Definition at line 601 of file tracer_scratch_data.h.
| std::vector<Point<dim> > TracerScratchData< dim >::quadrature_points |
Definition at line 625 of file tracer_scratch_data.h.
| std::vector<Tensor<1, dim> > TracerScratchData< dim >::rotor_linear_velocity_values |
Definition at line 673 of file tracer_scratch_data.h.
| std::vector<double> TracerScratchData< dim >::sdf_values |
Definition at line 658 of file tracer_scratch_data.h.
| std::vector<double> TracerScratchData< dim >::source |
Definition at line 661 of file tracer_scratch_data.h.
| std::vector<Tensor<1, dim> > TracerScratchData< dim >::tracer_average_gradient |
Definition at line 640 of file tracer_scratch_data.h.
| std::vector<double> TracerScratchData< dim >::tracer_diffusivity |
Definition at line 603 of file tracer_scratch_data.h.
| std::vector<double> TracerScratchData< dim >::tracer_diffusivity_0 |
Definition at line 605 of file tracer_scratch_data.h.
| std::vector<double> TracerScratchData< dim >::tracer_diffusivity_1 |
Definition at line 606 of file tracer_scratch_data.h.
| std::vector<double> TracerScratchData< dim >::tracer_diffusivity_face |
Definition at line 604 of file tracer_scratch_data.h.
| std::vector<Tensor<1, dim> > TracerScratchData< dim >::tracer_gradients |
Definition at line 630 of file tracer_scratch_data.h.
| std::vector<double> TracerScratchData< dim >::tracer_laplacians |
Definition at line 631 of file tracer_scratch_data.h.
| std::vector<double> TracerScratchData< dim >::tracer_reaction_prefactor |
Definition at line 607 of file tracer_scratch_data.h.
| std::vector<double> TracerScratchData< dim >::tracer_value_jump |
Definition at line 638 of file tracer_scratch_data.h.
| std::vector<double> TracerScratchData< dim >::tracer_values |
Definition at line 629 of file tracer_scratch_data.h.
| const bool TracerScratchData< dim >::uses_dg |
Definition at line 598 of file tracer_scratch_data.h.
| std::vector<double> TracerScratchData< dim >::values_here |
Definition at line 636 of file tracer_scratch_data.h.
| std::vector<double> TracerScratchData< dim >::values_there |
Definition at line 637 of file tracer_scratch_data.h.
| FEValuesExtractors::Vector TracerScratchData< dim >::velocities |
Scratch component for the Navier-Stokes component
Definition at line 678 of file tracer_scratch_data.h.
| std::vector<double> TracerScratchData< dim >::velocity_divergences |
Definition at line 683 of file tracer_scratch_data.h.
| std::vector<Tensor<1, dim> > TracerScratchData< dim >::velocity_values |
Definition at line 682 of file tracer_scratch_data.h.