![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <cahn_hilliard_scratch_data.h>
Public Member Functions | |
| 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) | |
| CahnHilliardScratchData (const CahnHilliardScratchData< 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, Function< dim > *source_function) |
| template<typename VectorType> | |
| void | reinit_velocity (const typename DoFHandler< dim >::active_cell_iterator &cell, const VectorType ¤t_solution, const Parameters::ALE< dim > &ale) |
| void | calculate_physical_properties () |
| Public Member Functions inherited from PhysicsScratchDataBase | |
| virtual | ~PhysicsScratchDataBase ()=default |
Public Attributes | |
| PhysicalPropertiesManager | properties_manager |
| std::map< field, std::vector< double > > | fields |
| dealii::types::material_id | material_id |
| std::vector< double > | density |
| std::vector< double > | kinematic_viscosity |
| std::vector< double > | surface_tension |
| std::vector< double > | mobility_cahn_hilliard |
| std::vector< double > | mobility_cahn_hilliard_gradient |
| FEValuesExtractors::Scalar | phase_order |
| FEValuesExtractors::Scalar | chemical_potential |
| FEValues< dim > | fe_values_cahn_hilliard |
| unsigned int | n_dofs |
| unsigned int | n_q_points |
| double | cell_size |
| Table< 1, double > | JxW |
| std::vector< Point< dim > > | quadrature_points |
| std::vector< double > | phase_order_values |
| std::vector< Tensor< 1, dim > > | phase_order_gradients |
| std::vector< double > | phase_order_laplacians |
| std::vector< std::vector< double > > | previous_phase_order_values |
| std::vector< double > | chemical_potential_values |
| std::vector< Tensor< 1, dim > > | chemical_potential_gradients |
| std::vector< double > | chemical_potential_laplacians |
| std::vector< std::vector< double > > | previous_chemical_potential_values |
| std::vector< double > | source_phase_order |
| std::vector< double > | source_chemical_potential |
| Table< 2, double > | phi_phase |
| Table< 2, Tensor< 2, dim > > | hess_phi_phase |
| Table< 2, double > | laplacian_phi_phase |
| Table< 2, Tensor< 1, dim > > | grad_phi_phase |
| Table< 2, double > | phi_potential |
| Table< 2, Tensor< 2, dim > > | hess_phi_potential |
| Table< 2, double > | laplacian_phi_potential |
| Table< 2, Tensor< 1, dim > > | grad_phi_potential |
| FEValuesExtractors::Vector | velocities |
| FEValues< dim > | fe_values_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 |
| FEFaceValues< dim > | fe_face_values_cahn_hilliard |
| Table< 2, double > | face_JxW |
| unsigned int | n_faces |
| unsigned int | n_faces_q_points |
| bool | is_boundary_cell |
| std::vector< bool > | is_boundary_face |
| std::vector< unsigned int > | boundary_face_id |
| Table< 3, Tensor< 1, dim > > | grad_phi_face_phase |
| std::vector< std::vector< Tensor< 1, dim > > > | face_phase_grad_values |
| std::vector< std::vector< Tensor< 1, dim > > > | face_normal |
Class that stores the information required by the assembly procedure for the Cahn-Hilliard equations. Consequently, this class calculates the phase field parameter Phi (values, gradients, laplacians), the chemical potential eta (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. Additionally, the user can request that this class gathers additional fields for physics which are coupled to the Cahn-Hilliard equations, such as the velocity which is required. 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 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 39 of file cahn_hilliard_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 evaluation, since this needs to be done at the cell level.
| properties_manager | The physical properties manager (see physical_properties_manager.h) |
| fe_cahn_hilliard | The FESystem used to solve the Cahn-Hilliard equations |
| quadrature | The quadrature to use for the assembly |
| mapping | The mapping of the domain in which the Cahn-Hilliard equations are solved |
| fe_fd | The FESystem used to solve the Fluid Dynamics equations |
Definition at line 55 of file cahn_hilliard_scratch_data.h.
References allocate(), fe_face_values_cahn_hilliard, fe_values_cahn_hilliard, fe_values_fd, and properties_manager.
|
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.
| sd |
Definition at line 88 of file cahn_hilliard_scratch_data.h.
References allocate(), CahnHilliardScratchData(), fe_face_values_cahn_hilliard, fe_values_cahn_hilliard, fe_values_fd, and properties_manager.
|
overridevirtual |
Allocates the necessary memory for all members of the scratch.
Implements PhysicsScratchDataBase.
Definition at line 9 of file cahn_hilliard_scratch_data.cc.
References chemical_potential, chemical_potential_gradients, chemical_potential_laplacians, chemical_potential_values, fe_values_cahn_hilliard, fields, grad_phi_phase, grad_phi_potential, hess_phi_phase, hess_phi_potential, JxW, laplacian_phi_phase, laplacian_phi_potential, maximum_number_of_previous_solutions(), mobility_cahn_hilliard, mobility_cahn_hilliard_gradient, n_dofs, n_q_points, phase_order, phase_order_cahn_hilliard, phase_order_cahn_hilliard_filtered, phase_order_gradients, phase_order_laplacians, phase_order_values, phi_phase, phi_potential, previous_chemical_potential_values, previous_phase_order_values, previous_velocity_values, source_chemical_potential, source_phase_order, surface_tension, velocity_gradient_values, and velocity_values.
| void CahnHilliardScratchData< dim >::calculate_physical_properties | ( | ) |
Calculates the physical properties that may be required by the Cahn-Hilliard problem. Namely the surface tension and the Cahn-Hilliard mobility.
Definition at line 79 of file cahn_hilliard_scratch_data.cc.
References fields, fluid_fluid, mobility_cahn_hilliard, mobility_cahn_hilliard_gradient, phase_order_cahn_hilliard, phase_order_values, properties_manager, set_field_vector(), and surface_tension.
|
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 for [Phi,eta] |
| [in] | previous_solutions | The solutions at the previous time steps. |
| [in] | source_function | The function describing the source term in Cahn-Hilliard equations. |
Definition at line 136 of file cahn_hilliard_scratch_data.h.
References boundary_face_id, cell_size, chemical_potential, chemical_potential_gradients, chemical_potential_laplacians, chemical_potential_values, compute_cell_diameter(), compute_cell_measure_with_JxW(), face_JxW, face_normal, face_phase_grad_values, fe_face_values_cahn_hilliard, fe_values_cahn_hilliard, grad_phi_face_phase, grad_phi_phase, grad_phi_potential, hess_phi_phase, hess_phi_potential, is_boundary_cell, is_boundary_face, JxW, laplacian_phi_phase, laplacian_phi_potential, n_dofs, n_faces, n_faces_q_points, n_q_points, phase_order, phase_order_gradients, phase_order_laplacians, phase_order_values, phi_phase, phi_potential, previous_chemical_potential_values, previous_phase_order_values, quadrature_points, source_chemical_potential, and source_phase_order.
|
inline |
Definition at line 270 of file cahn_hilliard_scratch_data.h.
References Parameters::ALE< dim >::enabled(), fe_values_fd, n_q_points, quadrature_points, velocities, Parameters::ALE< dim >::velocity, and velocity_values.
| std::vector<unsigned int> CahnHilliardScratchData< dim >::boundary_face_id |
Definition at line 379 of file cahn_hilliard_scratch_data.h.
| double CahnHilliardScratchData< dim >::cell_size |
Definition at line 329 of file cahn_hilliard_scratch_data.h.
| FEValuesExtractors::Scalar CahnHilliardScratchData< dim >::chemical_potential |
Definition at line 323 of file cahn_hilliard_scratch_data.h.
| std::vector<Tensor<1, dim> > CahnHilliardScratchData< dim >::chemical_potential_gradients |
Definition at line 341 of file cahn_hilliard_scratch_data.h.
| std::vector<double> CahnHilliardScratchData< dim >::chemical_potential_laplacians |
Definition at line 342 of file cahn_hilliard_scratch_data.h.
| std::vector<double> CahnHilliardScratchData< dim >::chemical_potential_values |
Definition at line 340 of file cahn_hilliard_scratch_data.h.
| std::vector<double> CahnHilliardScratchData< dim >::density |
Definition at line 315 of file cahn_hilliard_scratch_data.h.
| Table<2, double> CahnHilliardScratchData< dim >::face_JxW |
Definition at line 371 of file cahn_hilliard_scratch_data.h.
| std::vector<std::vector<Tensor<1, dim> > > CahnHilliardScratchData< dim >::face_normal |
Definition at line 386 of file cahn_hilliard_scratch_data.h.
| std::vector<std::vector<Tensor<1, dim> > > CahnHilliardScratchData< dim >::face_phase_grad_values |
Definition at line 384 of file cahn_hilliard_scratch_data.h.
| FEFaceValues<dim> CahnHilliardScratchData< dim >::fe_face_values_cahn_hilliard |
Definition at line 370 of file cahn_hilliard_scratch_data.h.
| FEValues<dim> CahnHilliardScratchData< dim >::fe_values_cahn_hilliard |
Definition at line 326 of file cahn_hilliard_scratch_data.h.
| FEValues<dim> CahnHilliardScratchData< dim >::fe_values_fd |
Definition at line 364 of file cahn_hilliard_scratch_data.h.
| std::map<field, std::vector<double> > CahnHilliardScratchData< dim >::fields |
Definition at line 313 of file cahn_hilliard_scratch_data.h.
| Table<3, Tensor<1, dim> > CahnHilliardScratchData< dim >::grad_phi_face_phase |
Definition at line 382 of file cahn_hilliard_scratch_data.h.
| Table<2, Tensor<1, dim> > CahnHilliardScratchData< dim >::grad_phi_phase |
Definition at line 353 of file cahn_hilliard_scratch_data.h.
| Table<2, Tensor<1, dim> > CahnHilliardScratchData< dim >::grad_phi_potential |
Definition at line 357 of file cahn_hilliard_scratch_data.h.
| Table<2, Tensor<2, dim> > CahnHilliardScratchData< dim >::hess_phi_phase |
Definition at line 351 of file cahn_hilliard_scratch_data.h.
| Table<2, Tensor<2, dim> > CahnHilliardScratchData< dim >::hess_phi_potential |
Definition at line 355 of file cahn_hilliard_scratch_data.h.
| bool CahnHilliardScratchData< dim >::is_boundary_cell |
Definition at line 377 of file cahn_hilliard_scratch_data.h.
| std::vector<bool> CahnHilliardScratchData< dim >::is_boundary_face |
Definition at line 378 of file cahn_hilliard_scratch_data.h.
| Table<1, double> CahnHilliardScratchData< dim >::JxW |
Definition at line 332 of file cahn_hilliard_scratch_data.h.
| std::vector<double> CahnHilliardScratchData< dim >::kinematic_viscosity |
Definition at line 316 of file cahn_hilliard_scratch_data.h.
| Table<2, double> CahnHilliardScratchData< dim >::laplacian_phi_phase |
Definition at line 352 of file cahn_hilliard_scratch_data.h.
| Table<2, double> CahnHilliardScratchData< dim >::laplacian_phi_potential |
Definition at line 356 of file cahn_hilliard_scratch_data.h.
| dealii::types::material_id CahnHilliardScratchData< dim >::material_id |
Definition at line 314 of file cahn_hilliard_scratch_data.h.
| std::vector<double> CahnHilliardScratchData< dim >::mobility_cahn_hilliard |
Definition at line 318 of file cahn_hilliard_scratch_data.h.
| std::vector<double> CahnHilliardScratchData< dim >::mobility_cahn_hilliard_gradient |
Definition at line 319 of file cahn_hilliard_scratch_data.h.
| unsigned int CahnHilliardScratchData< dim >::n_dofs |
Definition at line 327 of file cahn_hilliard_scratch_data.h.
| unsigned int CahnHilliardScratchData< dim >::n_faces |
Definition at line 373 of file cahn_hilliard_scratch_data.h.
| unsigned int CahnHilliardScratchData< dim >::n_faces_q_points |
Definition at line 374 of file cahn_hilliard_scratch_data.h.
| unsigned int CahnHilliardScratchData< dim >::n_q_points |
Definition at line 328 of file cahn_hilliard_scratch_data.h.
| FEValuesExtractors::Scalar CahnHilliardScratchData< dim >::phase_order |
Definition at line 322 of file cahn_hilliard_scratch_data.h.
| std::vector<Tensor<1, dim> > CahnHilliardScratchData< dim >::phase_order_gradients |
Definition at line 337 of file cahn_hilliard_scratch_data.h.
| std::vector<double> CahnHilliardScratchData< dim >::phase_order_laplacians |
Definition at line 338 of file cahn_hilliard_scratch_data.h.
| std::vector<double> CahnHilliardScratchData< dim >::phase_order_values |
Definition at line 336 of file cahn_hilliard_scratch_data.h.
| Table<2, double> CahnHilliardScratchData< dim >::phi_phase |
Definition at line 350 of file cahn_hilliard_scratch_data.h.
| Table<2, double> CahnHilliardScratchData< dim >::phi_potential |
Definition at line 354 of file cahn_hilliard_scratch_data.h.
| std::vector<std::vector<double> > CahnHilliardScratchData< dim >::previous_chemical_potential_values |
Definition at line 343 of file cahn_hilliard_scratch_data.h.
| std::vector<std::vector<double> > CahnHilliardScratchData< dim >::previous_phase_order_values |
Definition at line 339 of file cahn_hilliard_scratch_data.h.
| std::vector<std::vector<Tensor<1, dim> > > CahnHilliardScratchData< dim >::previous_velocity_values |
Definition at line 366 of file cahn_hilliard_scratch_data.h.
| PhysicalPropertiesManager CahnHilliardScratchData< dim >::properties_manager |
Definition at line 312 of file cahn_hilliard_scratch_data.h.
| std::vector<Point<dim> > CahnHilliardScratchData< dim >::quadrature_points |
Definition at line 333 of file cahn_hilliard_scratch_data.h.
| std::vector<double> CahnHilliardScratchData< dim >::source_chemical_potential |
Definition at line 347 of file cahn_hilliard_scratch_data.h.
| std::vector<double> CahnHilliardScratchData< dim >::source_phase_order |
Definition at line 346 of file cahn_hilliard_scratch_data.h.
| std::vector<double> CahnHilliardScratchData< dim >::surface_tension |
Definition at line 317 of file cahn_hilliard_scratch_data.h.
| FEValuesExtractors::Vector CahnHilliardScratchData< dim >::velocities |
Scratch component for the Navier-Stokes component
Definition at line 362 of file cahn_hilliard_scratch_data.h.
| std::vector<Tensor<2, dim> > CahnHilliardScratchData< dim >::velocity_gradient_values |
Definition at line 367 of file cahn_hilliard_scratch_data.h.
| std::vector<Tensor<1, dim> > CahnHilliardScratchData< dim >::velocity_values |
Definition at line 365 of file cahn_hilliard_scratch_data.h.