![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <cls_subequations_interface.h>
Public Member Functions | |
| CLSSubequationsInterface (const SimulationParameters< dim > &p_simulation_parameters, const ConditionalOStream &p_pcout, const std::shared_ptr< parallel::DistributedTriangulationBase< dim > > &p_triangulation, const std::shared_ptr< SimulationControl > &p_simulation_control) | |
| ~CLSSubequationsInterface ()=default | |
| void | initialize_subequations (const SimulationParameters< dim > &p_simulation_parameters, const std::shared_ptr< parallel::DistributedTriangulationBase< dim > > &p_triangulation, const std::shared_ptr< SimulationControl > &p_simulation_control) |
| void | setup_dofs () |
| void | setup_specific_subequation_dofs (const CLSSubequationsID &subequation_id) |
| void | solve () |
| void | solve_specific_subequation (const CLSSubequationsID &subequation_id) |
| std::vector< CLSSubequationsID > | get_active_subequations () |
| const DoFHandler< dim > & | get_dof_handler (const CLSSubequationsID &subequation_id) |
| const DoFHandler< dim > & | get_cls_dof_handler () |
| const GlobalVectorType & | get_solution (const CLSSubequationsID &subequation_id) |
| const GlobalVectorType & | get_cls_solution () |
| bool | get_solution_validity (const CLSSubequationsID &subequation_id) |
| std::string | get_subequation_string (const CLSSubequationsID &subequation_id) |
| void | set_dof_handler (const CLSSubequationsID &subequation_id, std::shared_ptr< DoFHandler< dim > > dof_handler) |
| void | set_solution (const CLSSubequationsID &subequation_id, std::shared_ptr< GlobalVectorType > solution_vector) |
| void | set_cls_solution_and_dof_handler (const GlobalVectorType &cls_solution_vector, const DoFHandler< dim > &dof_handler_cls) |
| void | set_solution_valid (const CLSSubequationsID &subequation_id) |
| bool | validity_map_has_been_reset () |
Private Member Functions | |
| void | reset_subequations_solutions_validity () |
Private Attributes | |
| const ConditionalOStream | pcout |
| std::optional< std::reference_wrapper< const DoFHandler< dim > > > | dof_handler_cls |
| std::optional< std::reference_wrapper< const GlobalVectorType > > | cls_solution_vector |
| std::vector< CLSSubequationsID > | active_subequations |
| std::map< CLSSubequationsID, std::shared_ptr< PhysicsSubequationsSolverBase > > | subequations |
| std::map< CLSSubequationsID, std::shared_ptr< DoFHandler< dim > > > | subequations_dof_handler |
| std::map< CLSSubequationsID, std::shared_ptr< GlobalVectorType > > | subequations_solutions |
| std::map< CLSSubequationsID, bool > | subequations_solutions_validity |
Interface for secondary equations (subequations) solved within the CLS auxiliary physics.
| dim | Number of dimensions of the problem. |
Definition at line 47 of file cls_subequations_interface.h.
|
inline |
Constructor of an interface for subequations that require the use of a solver within the span of the CLS auxiliary physics' resolution.
| [in] | p_simulation_parameters | Simulation parameters. |
| [in] | p_pcout | Parallel cout used to print the information. |
| [in] | p_triangulation | Distributed mesh information. |
| [in] | p_simulation_control | SimulationControl object. |
Definition at line 62 of file cls_subequations_interface.h.
References initialize_subequations(), and pcout.
|
default |
Default destructor.
|
inline |
Get vector of active subequations.
Definition at line 161 of file cls_subequations_interface.h.
References active_subequations.
|
inline |
Get a reference to the DoFHandler of the CLS auxiliary physics.
Definition at line 191 of file cls_subequations_interface.h.
References dof_handler_cls.
|
inline |
Get a reference to the phase indicator solution vector.
Definition at line 220 of file cls_subequations_interface.h.
References cls_solution_vector.
|
inline |
Get a reference to the DoFHandler of a specific subequation.
| [in] | subequation_id | Identifier associated with a specific subequation. |
Definition at line 175 of file cls_subequations_interface.h.
References active_subequations, and subequations_dof_handler.
|
inline |
Get a reference to the solution vector of a specific subequation.
| [in] | subequation_id | Identifier associated with a specific subequation. |
Definition at line 205 of file cls_subequations_interface.h.
References get_solution_validity(), get_subequation_string(), and subequations_solutions.
|
inline |
Check and return a boolean indicating if the solution of the subequation has been solved for the corresponding dof_handler_cls and/or cls_solution_vector previously set with CLSSubequationsInterface<dim>::set_cls_solution_and_dof_handler.
| [in] | subequation_id | Identifier associated with a specific subequation. |
true if the solution of the subequation corresponds to the set dof_handler_cls and/or cls_solution_vector.false. Definition at line 240 of file cls_subequations_interface.h.
References active_subequations, and subequations_solutions_validity.
|
inline |
Get the string associated with a specific subequation.
| [in] | subequation_id | Identifier associated with a specific subequation. |
Definition at line 259 of file cls_subequations_interface.h.
References active_subequations, curvature_projection, pde_based_interface_reinitialization, and phase_gradient_projection.
| void CLSSubequationsInterface< dim >::initialize_subequations | ( | const SimulationParameters< dim > & | p_simulation_parameters, |
| const std::shared_ptr< parallel::DistributedTriangulationBase< dim > > & | p_triangulation, | ||
| const std::shared_ptr< SimulationControl > & | p_simulation_control ) |
Initialize subequations necessary for the simulation and reset subeqaution validation map.
| [in] | p_simulation_parameters | Simulation parameters. |
| [in] | p_triangulation | Distributed mesh information. |
| [in] | p_simulation_control | SimulationControl object. |
Definition at line 12 of file cls_subequations_interface.cc.
References active_subequations, curvature_projection, SimulationParameters< dim >::multiphysics, pcout, pde_based_interface_reinitialization, phase_gradient_projection, reset_subequations_solutions_validity(), and subequations.
|
inlineprivate |
Reset all boolean in the validity associated with active subequations to false.
Definition at line 385 of file cls_subequations_interface.h.
References active_subequations, and subequations_solutions_validity.
|
inline |
Set a new CLS solution vector and DoFHandler for the subequations to be solved and reset their validity.
| [in] | cls_solution_vector | CLS solution vector associated with the subequations to be solved. |
| [in] | dof_handler_cls | Reference to the DoFHandler associated with the specified CLS solution. |
Definition at line 334 of file cls_subequations_interface.h.
References cls_solution_vector, dof_handler_cls, and reset_subequations_solutions_validity().
|
inline |
Set the DoFHandler associated with a specific subequation in the interface.
| [in] | subequation_id | Identifier associated with a specific subequation. |
| [in] | dof_handler | Shared pointer to the DoFHandler of a specific subequation. |
Definition at line 294 of file cls_subequations_interface.h.
References active_subequations, and subequations_dof_handler.
|
inline |
Set the solution associated with a specific subequation in the interface.
| [in] | subequation_id | Identifier associated with a specific subequation. |
| [in] | solution_vector | Shared pointer to the solution vector of a specific subequation. |
Definition at line 314 of file cls_subequations_interface.h.
References active_subequations, and subequations_solutions.
|
inline |
Set the solution as valid after solving it.
| [in] | subequation_id | Identifier associated with a specific subequation. |
Definition at line 352 of file cls_subequations_interface.h.
References active_subequations, and subequations_solutions_validity.
|
inline |
Setup the DofHandler and the degree of freedom associated with the subequations.
Definition at line 102 of file cls_subequations_interface.h.
References subequations.
|
inline |
Setup the DofHandler and the degree of freedom associated with the physics.
| [in] | subequation_id | Identifier associated with the subequation wished to solve. |
Definition at line 118 of file cls_subequations_interface.h.
References active_subequations, and subequations.
|
inline |
Call solving method of active subequations.
Definition at line 131 of file cls_subequations_interface.h.
References subequations.
|
inline |
Call solving method for a specific subequation.
| [in] | subequation_id | Identifier associated with the subequation wished to solve. |
Definition at line 146 of file cls_subequations_interface.h.
References active_subequations, and subequations.
|
inline |
Check if all booleans in subequations_solutions_validity have been reset to false.
true if all booleans in the map are set to false or;false if at least one of the booleans is set to true Definition at line 369 of file cls_subequations_interface.h.
References subequations_solutions_validity.
|
private |
Data structure that stores all enabled subequations.
Definition at line 405 of file cls_subequations_interface.h.
|
private |
CLS solution field associated with solved equations
Definition at line 402 of file cls_subequations_interface.h.
|
private |
CLS DoFHandler associated with solved equations.
Definition at line 397 of file cls_subequations_interface.h.
|
private |
Parallel consol output object.
Definition at line 394 of file cls_subequations_interface.h.
|
private |
Subequations are stored within a map of shared pointer to ensure proper memory management
Definition at line 410 of file cls_subequations_interface.h.
|
private |
Map of DoFHandler of subequations.
Definition at line 414 of file cls_subequations_interface.h.
|
private |
Present solutions map.
Definition at line 418 of file cls_subequations_interface.h.
|
private |
Booleans indicating if the subequation has been solved with the set CLS solution vector. The CLS solution vector is set with CLSSubequationsInterface<dim>::set_cls_solution_and_dof_handler.
During initialization (CLSSubequationsInterface<dim>::initialize_subequations), all boolean are set to false.
We start by setting a CLS solution and DOFHandler (CLSSubequationsInterface<dim>::set_cls_solution_and_dof_handler), and then start solving equations making sure that dependencies are met (CLSPhaseGradientProjection<dim>::check_dependencies_validity, CLSCurvatureProjection<dim>::check_dependencies_validity, and CLSPDEBasedInterfaceReinitialization<dim>::check_dependencies_validity). For instance, to solve the curvature projection subequation, the phase gradient projection subequation has to be solved before as the projected phase gradient is used in the curvature projection subequation.
A subequation in the validity map is to true only when it is solved, and it remains valid until a new CLS solution and/or DOFHandler are set through CLSSubequationsInterface<dim>::set_cls_solution_and_dof_handler.
This validation mechanism allows, to check if:
false. Definition at line 454 of file cls_subequations_interface.h.