4#ifndef lethe_cls_scratch_data_h
5#define lethe_cls_scratch_data_h
12#include <deal.II/fe/fe_interface_values.h>
13#include <deal.II/fe/fe_system.h>
64 const FiniteElement<dim> &fe_cls,
65 const Quadrature<dim> &quadrature,
66 const Quadrature<dim - 1> &face_quadrature,
67 const Mapping<dim> &mapping,
68 const FiniteElement<dim> &fe_fd)
74 update_values | update_gradients |
75 update_quadrature_points | update_hessians |
80 update_values | update_quadrature_points |
81 update_JxW_values | update_normal_vectors)
82 ,
fe_values_fd(mapping, fe_fd, quadrature, update_values | update_gradients)
103 update_values | update_gradients |
104 update_quadrature_points | update_hessians |
109 update_values | update_quadrature_points |
110 update_JxW_values | update_normal_vectors)
114 update_values | update_gradients)
148 template <
typename VectorType>
150 reinit(
const typename DoFHandler<dim>::active_cell_iterator &cell,
152 const std::vector<VectorType> &previous_solutions)
159 double cell_measure =
174 for (
unsigned int p = 0; p < previous_solutions.size(); ++p)
180 for (
unsigned int q = 0; q < this->
n_q_points; ++q)
184 for (
unsigned int k = 0; k < this->
n_dofs; ++k)
214 template <
typename VectorType>
217 const typename DoFHandler<dim>::active_cell_iterator &cell,
218 const unsigned int &face_no,
219 const unsigned int &sub_face_no,
220 const typename DoFHandler<dim>::active_cell_iterator &neighbor_cell,
221 const unsigned int &neighbor_face_no,
222 const unsigned int &neighbor_sub_face_no,
230 neighbor_sub_face_no);
266 template <
typename VectorType>
270 const std::vector<VectorType> &previous_solutions,
280 for (
unsigned int q = 0; q < this->
n_q_points; ++q)
287 for (
unsigned int p = 0; p < previous_solutions.size(); ++p)
297 Tensor<1, dim> velocity_ale;
298 std::shared_ptr<Functions::ParsedFunction<dim>> velocity_ale_function =
300 Vector<double> velocity_ale_vector(dim);
305 velocity_ale_vector);
306 for (
int d = 0; d < dim; ++d)
307 velocity_ale[d] = velocity_ale_vector[d];
311 for (
unsigned int p = 0; p < previous_solutions.size(); ++p)
324 std::vector<double> time_vector =
343 template <
typename VectorType>
346 const typename DoFHandler<dim>::active_cell_iterator &velocity_cell,
347 const unsigned int &face_no,
364 Tensor<1, dim> velocity_ale;
365 std::shared_ptr<Functions::ParsedFunction<dim>> velocity_ale_function =
367 Vector<double> velocity_ale_vector(dim);
372 velocity_ale_vector);
373 for (
int d = 0; d < dim; ++d)
374 velocity_ale[d] = velocity_ale_vector[d];
385 std::map<field, std::vector<double>>
fields;
void bdf_extrapolate(const std::vector< double > &time_vector, const std::vector< std::vector< DataType > > &solution_vector, const unsigned int number_of_previous_solutions, std::vector< DataType > &extrapolated_solution)
Extrapolate vector of solution to time_vector[0] using previous solution times and previous solutions...
unsigned int number_of_previous_solutions(const Parameters::SimulationControl::TimeSteppingMethod method)
Get the number of previous time steps for a specific BDF scheme.
FEFaceValues< dim > fe_face_values_fd
std::vector< Point< dim > > face_quadrature_points
void reinit(const typename DoFHandler< dim >::active_cell_iterator &cell, const VectorType ¤t_solution, const std::vector< VectorType > &previous_solutions)
Reinitialize the content of the scratch.
const PhysicalPropertiesManager properties_manager
std::vector< Tensor< 1, dim > > face_velocity_values
std::vector< double > values_there
Table< 2, Tensor< 2, dim > > hess_phi
std::vector< double > velocity_divergences
Table< 2, Tensor< 1, dim > > grad_phi
std::vector< Tensor< 2, dim > > velocity_gradient_values
std::vector< Point< dim > > quadrature_points
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)
Constructor. The constructor creates the fe_values that will be used to fill the member variables of ...
CLSScratchData(const CLSScratchData< dim > &sd)
Copy Constructor. Same as the main constructor. This constructor only uses the other scratch to build...
FEValues< dim > fe_values_cls
FEValuesExtractors::Vector velocities_fd
Table< 2, double > laplacian_phi
const std::shared_ptr< SimulationControl > simulation_control
FEInterfaceValues< dim > fe_interface_values_cls
void reinit_velocity(const typename DoFHandler< dim >::active_cell_iterator &cell, const VectorType ¤t_solution, const std::vector< VectorType > &previous_solutions, const Parameters::ALE< dim > &ale)
Reinitialize the velocity, calculated by the Fluid Dynamics.
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 ¤t_solution)
Reinitialize the content of the scratch for the internal faces. This is only used for the DG assemble...
std::vector< double > values_here
std::vector< double > phase_laplacians
std::vector< std::vector< double > > previous_phase_values
std::vector< double > phase_value_jump
std::vector< double > present_phase_values
std::map< field, std::vector< double > > fields
std::vector< Tensor< 1, dim > > previous_phase_gradients
std::vector< Tensor< 1, dim > > velocity_values
FEValues< dim > fe_values_fd
std::vector< std::vector< Tensor< 1, dim > > > previous_velocity_values
void allocate() override
Allocates the memory for the scratch.
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)
Reinitialize the content of the scratch regarding the velocity for internal/boundary faces....
unsigned int n_interface_dofs
std::vector< Tensor< 1, dim > > phase_gradients
An interface for all the common parameters required to consider a moving frame of reference in a simp...
bool enabled() const
Return if the ALE module is enabled.
std::shared_ptr< Functions::ParsedFunction< dim > > velocity
ALE velocity function.
Class that manages the physical properties model which are required to calculate the various physical...
Base class for scratch data objects of physics and subequations.
double compute_cell_measure_with_JxW(const std::vector< double > &JxW_values)
Computes the area (2D) or volume (3D) of the cell by integrating 1 over the cell, by summing JxW valu...
double compute_cell_diameter(const double cell_measure, const unsigned int fe_degree)
Computes equivalent cell diameter by comparing the area to a disk (2D) or the volume to a sphere (3D)...
GlobalVectorType VectorType
bool time_stepping_is_bdf(const Parameters::SimulationControl::TimeSteppingMethod method)
Determines if the time integration method is within the bdf family.