4#ifndef lethe_cahn_hilliard_scratch_data_h
5#define lethe_cahn_hilliard_scratch_data_h
12#include <deal.II/fe/fe_system.h>
56 const FESystem<dim> &fe_cahn_hilliard,
57 const Quadrature<dim> &quadrature,
58 const Mapping<dim> &mapping,
59 const FiniteElement<dim> &fe_fd,
60 const Quadrature<dim - 1> &face_quadrature)
65 update_values | update_quadrature_points |
66 update_JxW_values | update_gradients |
68 ,
fe_values_fd(mapping, fe_fd, quadrature, update_values)
72 update_values | update_quadrature_points |
73 update_JxW_values | update_gradients |
74 update_normal_vectors)
93 update_values | update_quadrature_points |
94 update_JxW_values | update_gradients |
104 update_values | update_quadrature_points | update_JxW_values |
105 update_gradients | update_normal_vectors)
134 template <
typename VectorType>
136 reinit(
const typename DoFHandler<dim>::active_cell_iterator &cell,
138 const std::vector<VectorType> &previous_solutions,
139 Function<dim> *source_function)
176 for (
unsigned int p = 0; p < previous_solutions.size(); ++p)
183 for (
unsigned int p = 0; p < previous_solutions.size(); ++p)
193 for (
unsigned int k = 0; k <
n_dofs; ++k)
234 this->
face_normal = std::vector<std::vector<Tensor<1, dim>>>(
237 for (
const auto face : cell->face_indices())
246 .get_function_gradients(current_solution,
252 this->face_normal[face][q] =
254 for (
const unsigned int k :
268 template <
typename VectorType>
286 Tensor<1, dim> velocity_ale;
287 std::shared_ptr<Functions::ParsedFunction<dim>> velocity_ale_function =
289 Vector<double> velocity_ale_vector(dim);
294 velocity_ale_vector);
295 for (
int d = 0; d < dim; ++d)
296 velocity_ale[d] = velocity_ale_vector[d];
313 std::map<field, std::vector<double>>
fields;
std::vector< bool > is_boundary_face
FEValues< dim > fe_values_cahn_hilliard
std::map< field, std::vector< double > > fields
std::vector< double > source_chemical_potential
PhysicalPropertiesManager properties_manager
FEValues< dim > fe_values_fd
Table< 2, double > laplacian_phi_potential
std::vector< double > surface_tension
std::vector< double > phase_order_laplacians
unsigned int n_faces_q_points
Table< 2, double > phi_potential
Table< 2, Tensor< 2, dim > > hess_phi_potential
std::vector< double > mobility_cahn_hilliard_gradient
std::vector< double > chemical_potential_laplacians
std::vector< double > source_phase_order
std::vector< unsigned int > boundary_face_id
std::vector< double > kinematic_viscosity
std::vector< std::vector< Tensor< 1, dim > > > face_normal
std::vector< std::vector< Tensor< 1, dim > > > previous_velocity_values
std::vector< double > density
Table< 2, Tensor< 2, dim > > hess_phi_phase
dealii::types::material_id material_id
std::vector< double > mobility_cahn_hilliard
FEValuesExtractors::Scalar phase_order
std::vector< Tensor< 2, dim > > velocity_gradient_values
std::vector< Tensor< 1, dim > > chemical_potential_gradients
std::vector< Tensor< 1, dim > > velocity_values
Table< 2, Tensor< 1, dim > > grad_phi_phase
std::vector< double > chemical_potential_values
void allocate() override
Allocates the necessary memory for all members of the scratch.
FEFaceValues< dim > fe_face_values_cahn_hilliard
Table< 2, double > laplacian_phi_phase
FEValuesExtractors::Scalar chemical_potential
std::vector< Point< dim > > quadrature_points
std::vector< std::vector< Tensor< 1, dim > > > face_phase_grad_values
std::vector< std::vector< double > > previous_chemical_potential_values
Table< 2, double > phi_phase
CahnHilliardScratchData(const PhysicalPropertiesManager &properties_manager, const FESystem< dim > &fe_cahn_hilliard, const Quadrature< dim > &quadrature, const Mapping< dim > &mapping, const FiniteElement< dim > &fe_fd, const Quadrature< dim - 1 > &face_quadrature)
Constructor. The constructor creates the fe_values that will be used to fill the member variables of ...
Table< 3, Tensor< 1, dim > > grad_phi_face_phase
void calculate_physical_properties()
Calculates the physical properties that may be required by the Cahn-Hilliard problem....
void reinit_velocity(const typename DoFHandler< dim >::active_cell_iterator &cell, const VectorType ¤t_solution, const Parameters::ALE< dim > &ale)
Table< 2, Tensor< 1, dim > > grad_phi_potential
std::vector< Tensor< 1, dim > > phase_order_gradients
std::vector< double > phase_order_values
FEValuesExtractors::Vector velocities
CahnHilliardScratchData(const CahnHilliardScratchData< dim > &sd)
Copy Constructor. Same as the main constructor. This constructor only uses the other scratch to build...
std::vector< std::vector< double > > previous_phase_order_values
void reinit(const typename DoFHandler< dim >::active_cell_iterator &cell, const VectorType ¤t_solution, const std::vector< VectorType > &previous_solutions, Function< dim > *source_function)
Reinitializes the content of the scratch.
Table< 2, double > face_JxW
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