SimulationCaseBase< dim, number, spacedim > Class Template Reference
|
Developer Documentation
|
Base class for managing a simulation case in a parallel computing environment. More...
#include <simulation_case_base.hpp>
Public Member Functions | |
| virtual | ~SimulationCaseBase ()=default |
| SimulationCaseBase (const std::string ¶meter_file_in, MPI_Comm mpi_communicator_in) | |
| void | create () |
| Main setup function to initialize the simulation. | |
| std::map< dealii::types::boundary_id, std::shared_ptr< dealii::Function< dim > > > | get_boundary_condition (const std::string &type, const std::string &operation_name, const bool is_optional=true) const |
| Retrieve boundary conditions of a specific type for an operation. | |
| std::shared_ptr< BoundaryConditionManager< dim, number > > | get_boundary_condition_manager (const std::string &operation_name, const bool is_optional=true) const |
| Retrieve the boundary condition object for a specific operation. | |
| std::string | get_boundary_condition_type (dealii::types::boundary_id boundary_id, const std::string &operation_name) const |
| Retrieve the type of a boundary condition for a specific boundary ID and operation. | |
| void | set_time_boundary_conditions (const number time) |
| Update the time for all boundary conditions. | |
| std::shared_ptr< dealii::Function< dim > > | get_field_function (const std::string &type, const std::string &operation_name, const bool is_optional=false) |
| std::shared_ptr< dealii::Function< dim > > | get_initial_condition (const std::string &operation_name, const bool is_optional=false) |
| Retrieve the initial condition for a given operation. | |
| const PeriodicBoundaryConditions< dim > & | get_periodic_bc () const |
| Get the periodic boundary condition manager. | |
| virtual void | do_postprocessing (const GenericDataOut< dim, number > &generic_data_out) const |
| Perform specific postprocessing (can be overridden by derived classes). | |
Public Attributes | |
| std::shared_ptr< dealii::Triangulation< dim, spacedim > > | triangulation |
| const std::string | parameter_file |
| const MPI_Comm | mpi_communicator |
Protected Member Functions | |
| virtual void | create_spatial_discretization ()=0 |
| Pure virtual function to create the spatial discretization. | |
| virtual void | set_boundary_conditions ()=0 |
| Pure virtual function to set the boundary conditions. | |
| virtual void | set_field_conditions ()=0 |
| Pure virtual function to set the field conditions. | |
| virtual bool | add_case_specific_parameters (dealii::ParameterHandler &) |
| Add simulation-specific parameters (can be overridden). | |
| void | attach_field_function (std::shared_ptr< dealii::Function< dim > > function, const std::string &type, const std::string &operation_name) |
| void | attach_initial_condition (std::shared_ptr< dealii::Function< dim > > initial_function, const std::string &operation_name) |
| void | attach_boundary_condition (std::pair< const dealii::types::boundary_id, const std::shared_ptr< dealii::Function< dim > > > id_and_function, const std::string &type, const std::string &operation_name) |
| Attach a boundary condition for a specific operation. | |
| void | attach_boundary_condition (const dealii::types::boundary_id id, const std::string &type, const std::string &operation_name) |
| Attach a boundary condition with a dummy function for a specific operation. | |
| void | attach_periodic_boundary_condition (const dealii::types::boundary_id id_in, const dealii::types::boundary_id id_out, const int direction) |
Private Member Functions | |
| void | parse_simulation_specific_parameters () |
| Parses simulation-specific parameters. | |
Private Attributes | |
| PeriodicBoundaryConditions< dim > | periodic_boundary_conditions |
| std::map< std::string, std::map< std::string, std::shared_ptr< dealii::Function< dim > > > > | field_functions |
| std::map< std::string, std::shared_ptr< BoundaryConditionManager< dim, number > > > | boundary_conditions_map |
Detailed Description
class MeltPoolDG::SimulationCaseBase< dim, number, spacedim >
Base class for managing a simulation case in a parallel computing environment.
This class handles the setup and management of boundary conditions, field functions, and spatial discretization in a parallel environment using MPI. It is intended to be extended by more specific simulation classes.
- Template Parameters
-
dim Spatial dimension. P Parameter object type. spacedim Space dimension.
Constructor & Destructor Documentation
◆ ~SimulationCaseBase()
|
virtualdefault |
◆ SimulationCaseBase()
|
inline |
Member Function Documentation
◆ add_case_specific_parameters()
|
inlineprotectedvirtual |
Add simulation-specific parameters (can be overridden).
This function can be overridden in derived classes to add custom simulation parameters to the handler. The return value can be used to print the parameters to the terminal output.
- Parameters
-
prm ParameterHandler object to which parameters can be added.
Reimplemented in MeltPoolDG::Simulation::WallWetting::SimulationWallWetting< dim, number >, MeltPoolDG::Simulation::AdvectionDiffusion::SimulationAdvec< dim, number >, MeltPoolDG::Simulation::AdvectionDiffusionDG::SimulationAdvecDG< dim, number >, MeltPoolDG::Simulation::FixedMeltPool::SimulationFixedMeltPool< dim, number >, MeltPoolDG::Simulation::UnidirectionalHeatTransfer::SimulationUnidirectionalHeatTransfer< dim, number >, MeltPoolDG::Simulation::VortexBubble::SimulationVortexBubble< dim, number >, MeltPoolDG::Simulation::VortexBubbleDG::SimulationVortexBubbleDG< dim, number >, MeltPoolDG::Simulation::EvaporatingDroplet::SimulationEvaporatingDroplet< dim, number >, MeltPoolDG::Simulation::EvaporatingShell::SimulationEvaporatingShell< dim, number >, MeltPoolDG::Simulation::FilmBoiling::SimulationFilmBoiling< dim, number >, MeltPoolDG::Simulation::MovingDroplet::SimulationMovingDroplet< dim, number >, MeltPoolDG::Simulation::OscillatingDroplet::SimulationOscillatingDroplet< dim, number >, MeltPoolDG::Simulation::RecoilPressure::SimulationRecoilPressure< dim, number >, MeltPoolDG::Simulation::SpuriousCurrents::SimulationSpuriousCurrents< dim, number >, MeltPoolDG::Simulation::StefansProblem1WithFlowAndHeat::SimulationStefansProblem1WithFlowAndHeat< dim, number >, MeltPoolDG::Simulation::ThermoCapillaryDroplet::SimulationThermoCapillaryDroplet< dim, number >, MeltPoolDG::Simulation::PowderParticles::SimulationPowderParticles< dim, number >, and MeltPoolDG::Simulation::ReinitCircle::SimulationReinit< dim, number >.
◆ attach_boundary_condition() [1/2]
|
inlineprotected |
Attach a boundary condition with a dummy function for a specific operation.
This overload simplifies attaching a boundary condition by omitting the function. A placeholder function is used internally.
- Parameters
-
id The boundary ID to be associated with the condition. type The type of the boundary condition. operation_name The name of the operation for which the boundary condition is being attached.
◆ attach_boundary_condition() [2/2]
|
inlineprotected |
Attach a boundary condition for a specific operation.
This method associates a boundary condition, specified by its ID and function, with a given operation name. If the operation has no associated boundary conditions yet, a new boundary condition object is created.
- Parameters
-
id_and_function A pair consisting of a boundary ID and a shared pointer to the boundary function. type The type of the boundary condition (e.g., Dirichlet, Neumann, etc.). operation_name The name of the operation for which the boundary condition is being attached.
◆ attach_field_function()
|
inlineprotected |
Attaches a field function with a specified type and operation name.
This function stores a provided field function in an internal dictionary, allowing it to be later retrieved by a combination of its type and operation_name. The type typically represents the category of the field function (e.g., "prescribed_velocity"), while operation_name indicates the specific operation or context to which the function applies (e.g., "heat" or "level_set").
By using this function, various field functions can be organized and managed for different types and operations, enabling efficient lookup and reuse.
- Template Parameters
-
FunctionType The type of the field function being attached, typically a derived class of dealii::Function<dim>.
- Parameters
-
function A std::shared_ptrto the field function object that should be associated with the specifiedtypeandoperation_name.type A string representing the field function category (e.g., "prescribed_velocity"). operation_name A string specifying the operation or context where this field function is applicable (e.g., "level_set").
◆ attach_initial_condition()
|
inlineprotected |
Overload function to attach initial conditions. See documentation of attach_field_function.
◆ attach_periodic_boundary_condition()
|
inlineprotected |
Attach periodic boundary condition.
- Parameters
-
direction refers to the space direction in which periodicity is enforced. When matching periodic faces this vector component is ignored.
◆ create()
|
inline |
Main setup function to initialize the simulation.
This function should be called after the constructor is called and the parameters are parsed. Then, the spatial discretization, boundary conditions, and field functions are created, which may depend on the input parameters.
◆ create_spatial_discretization()
|
protectedpure virtual |
Pure virtual function to create the spatial discretization.
Derived classes must implement this function to define how the spatial discretization is created.
Implemented in MeltPoolDG::Simulation::WallWetting::SimulationWallWetting< dim, number >, MeltPoolDG::Simulation::AdvectionDiffusion::SimulationAdvec< dim, number >, MeltPoolDG::Simulation::AdvectionDiffusionDG::SimulationAdvecDG< dim, number >, MeltPoolDG::Simulation::FixedMeltPool::SimulationFixedMeltPool< dim, number >, MeltPoolDG::Simulation::SolidificationSlab::SimulationSolidificationSlab< dim, number >, MeltPoolDG::Simulation::UnidirectionalHeatTransfer::SimulationUnidirectionalHeatTransfer< dim, number >, MeltPoolDG::Simulation::RotatingBubble::SimulationRotatingBubble< dim, number >, MeltPoolDG::Simulation::StefansProblem::SimulationStefansProblem< dim, number >, MeltPoolDG::Simulation::VortexBubble::SimulationVortexBubble< dim, number >, MeltPoolDG::Simulation::VortexBubbleDG::SimulationVortexBubbleDG< dim, number >, MeltPoolDG::Simulation::ZalesakDisk::SimulationZalesakDisk< dim, number >, MeltPoolDG::Simulation::EvaporatingDroplet::SimulationEvaporatingDroplet< dim, number >, MeltPoolDG::Simulation::EvaporatingDropletWithHeat::SimulationEvaporatingDropletWithHeat< dim, number >, MeltPoolDG::Simulation::EvaporatingShell::SimulationEvaporatingShell< dim, number >, MeltPoolDG::Simulation::FilmBoiling::SimulationFilmBoiling< dim, number >, MeltPoolDG::Simulation::FlowPastCylinder::SimulationFlowPastCylinder< dim, number >, MeltPoolDG::Simulation::MovingDroplet::SimulationMovingDroplet< dim, number >, MeltPoolDG::Simulation::OscillatingDroplet::SimulationOscillatingDroplet< dim, number >, MeltPoolDG::Simulation::RecoilPressure::SimulationRecoilPressure< dim, number >, MeltPoolDG::Simulation::RisingBubble::SimulationRisingBubble< dim, number >, MeltPoolDG::Simulation::SpuriousCurrents::SimulationSpuriousCurrents< dim, number >, MeltPoolDG::Simulation::StefansProblem1WithFlowAndHeat::SimulationStefansProblem1WithFlowAndHeat< dim, number >, MeltPoolDG::Simulation::StefansProblem2WithFlowAndHeat::SimulationStefansProblem2WithFlowAndHeat< dim, number >, MeltPoolDG::Simulation::StefansProblemWithFlow::SimulationStefansProblemWithFlow< dim, number >, MeltPoolDG::Simulation::ThermoCapillaryDroplet::SimulationThermoCapillaryDroplet< dim, number >, MeltPoolDG::Simulation::ThermoCapillaryTwoDroplets::SimulationThermoCapillaryTwoDroplets< dim, number >, MeltPoolDG::Simulation::PowderParticles::SimulationPowderParticles< dim, number >, MeltPoolDG::Simulation::ReinitCircle::SimulationReinit< dim, number >, and MeltPoolDG::Simulation::ReinitCircleDG::SimulationReinitDG< dim, number >.
◆ do_postprocessing()
|
inlinevirtual |
Perform specific postprocessing (can be overridden by derived classes).
- Note
- This function needs to be called within the specific application.
- Parameters
-
generic_data_out The postprocessing data.
Reimplemented in MeltPoolDG::Simulation::AdvectionDiffusion::SimulationAdvec< dim, number >, MeltPoolDG::Simulation::AdvectionDiffusionDG::SimulationAdvecDG< dim, number >, MeltPoolDG::Simulation::VortexBubble::SimulationVortexBubble< dim, number >, MeltPoolDG::Simulation::VortexBubbleDG::SimulationVortexBubbleDG< dim, number >, and MeltPoolDG::Simulation::ReinitCircleDG::SimulationReinitDG< dim, number >.
◆ get_boundary_condition()
|
inline |
Retrieve boundary conditions of a specific type for an operation.
- Parameters
-
type The type of the boundary condition to retrieve. operation_name The name of the operation whose boundary conditions are requested. is_optional A flag indicating whether the bc is optional. Defaults to true, requiring the bc not to be present.
- Returns
- A map of boundary IDs to their corresponding boundary functions.
- Exceptions
-
dealii::ExcMessage If no boundary conditions are found for the specified operation.
◆ get_boundary_condition_manager()
|
inline |
Retrieve the boundary condition object for a specific operation.
- Parameters
-
operation_name The name of the operation whose boundary condition object is requested.
- Returns
- A shared pointer to the BoundaryConditions object for the operation.
- Exceptions
-
dealii::ExcMessage If no boundary conditions are found for the specified operation.
◆ get_boundary_condition_type()
|
inline |
Retrieve the type of a boundary condition for a specific boundary ID and operation.
- Parameters
-
boundary_id The boundary ID for which the type is requested. operation_name The name of the operation associated with the boundary condition.
- Returns
- The type of the boundary condition as a string.
- Exceptions
-
dealii::ExcMessage If no boundary conditions are found for the specified operation.
◆ get_field_function()
|
inline |
Getter functions for field function of type for operation_name. If the field function for the specified type and operation_name cannot be found, behavior depends on the value of is_optional:
- If
is_optionalis set totrue, the function will return anullptrto indicate that the field function is not required and can be omitted. - If
is_optionalisfalse, an exception may be thrown to indicate that the requested field function is missing.
- Parameters
-
type The category of the field function (e.g., "temperature", "velocity"). operation_name The name of the operation or context where the field function is used (e.g., "initial_condition", "boundary_condition"). is_optional A flag indicating whether the field function is optional. Defaults to false, requiring the field function to be present.
◆ get_initial_condition()
|
inline |
Retrieve the initial condition for a given operation.
- Parameters
-
operation_name The operation name for which the initial condition is requested. is_optional Flag indicating if the initial condition is optional.
- Returns
- A shared pointer to the initial condition function.
◆ get_periodic_bc()
|
inline |
Get the periodic boundary condition manager.
- Returns
- The periodic boundary condition manager.
◆ parse_simulation_specific_parameters()
|
inlineprivate |
Parses simulation-specific parameters.
◆ set_boundary_conditions()
|
protectedpure virtual |
Pure virtual function to set the boundary conditions.
Derived classes must implement this function to define how boundary conditions are set.
Implemented in MeltPoolDG::Simulation::AdvectionDiffusion::SimulationAdvec< dim, number >, MeltPoolDG::Simulation::AdvectionDiffusionDG::SimulationAdvecDG< dim, number >, MeltPoolDG::Simulation::SolidificationSlab::SimulationSolidificationSlab< dim, number >, MeltPoolDG::Simulation::UnidirectionalHeatTransfer::SimulationUnidirectionalHeatTransfer< dim, number >, MeltPoolDG::Simulation::StefansProblem::SimulationStefansProblem< dim, number >, MeltPoolDG::Simulation::FilmBoiling::SimulationFilmBoiling< dim, number >, MeltPoolDG::Simulation::MovingDroplet::SimulationMovingDroplet< dim, number >, MeltPoolDG::Simulation::OscillatingDroplet::SimulationOscillatingDroplet< dim, number >, MeltPoolDG::Simulation::StefansProblem1WithFlowAndHeat::SimulationStefansProblem1WithFlowAndHeat< dim, number >, MeltPoolDG::Simulation::StefansProblem2WithFlowAndHeat::SimulationStefansProblem2WithFlowAndHeat< dim, number >, MeltPoolDG::Simulation::StefansProblemWithFlow::SimulationStefansProblemWithFlow< dim, number >, MeltPoolDG::Simulation::ThermoCapillaryDroplet::SimulationThermoCapillaryDroplet< dim, number >, MeltPoolDG::Simulation::ThermoCapillaryTwoDroplets::SimulationThermoCapillaryTwoDroplets< dim, number >, MeltPoolDG::Simulation::WallWetting::SimulationWallWetting< dim, number >, MeltPoolDG::Simulation::FixedMeltPool::SimulationFixedMeltPool< dim, number >, MeltPoolDG::Simulation::RotatingBubble::SimulationRotatingBubble< dim, number >, MeltPoolDG::Simulation::VortexBubble::SimulationVortexBubble< dim, number >, MeltPoolDG::Simulation::VortexBubbleDG::SimulationVortexBubbleDG< dim, number >, MeltPoolDG::Simulation::ZalesakDisk::SimulationZalesakDisk< dim, number >, MeltPoolDG::Simulation::EvaporatingDroplet::SimulationEvaporatingDroplet< dim, number >, MeltPoolDG::Simulation::EvaporatingDropletWithHeat::SimulationEvaporatingDropletWithHeat< dim, number >, MeltPoolDG::Simulation::EvaporatingShell::SimulationEvaporatingShell< dim, number >, MeltPoolDG::Simulation::FlowPastCylinder::SimulationFlowPastCylinder< dim, number >, MeltPoolDG::Simulation::RecoilPressure::SimulationRecoilPressure< dim, number >, MeltPoolDG::Simulation::RisingBubble::SimulationRisingBubble< dim, number >, MeltPoolDG::Simulation::SpuriousCurrents::SimulationSpuriousCurrents< dim, number >, MeltPoolDG::Simulation::PowderParticles::SimulationPowderParticles< dim, number >, MeltPoolDG::Simulation::ReinitCircle::SimulationReinit< dim, number >, and MeltPoolDG::Simulation::ReinitCircleDG::SimulationReinitDG< dim, number >.
◆ set_field_conditions()
|
protectedpure virtual |
Pure virtual function to set the field conditions.
Derived classes must implement this function to define how field conditions are set.
Implemented in MeltPoolDG::Simulation::AdvectionDiffusion::SimulationAdvec< dim, number >, MeltPoolDG::Simulation::AdvectionDiffusionDG::SimulationAdvecDG< dim, number >, MeltPoolDG::Simulation::SolidificationSlab::SimulationSolidificationSlab< dim, number >, MeltPoolDG::Simulation::UnidirectionalHeatTransfer::SimulationUnidirectionalHeatTransfer< dim, number >, MeltPoolDG::Simulation::StefansProblem::SimulationStefansProblem< dim, number >, MeltPoolDG::Simulation::FilmBoiling::SimulationFilmBoiling< dim, number >, MeltPoolDG::Simulation::MovingDroplet::SimulationMovingDroplet< dim, number >, MeltPoolDG::Simulation::OscillatingDroplet::SimulationOscillatingDroplet< dim, number >, MeltPoolDG::Simulation::StefansProblem1WithFlowAndHeat::SimulationStefansProblem1WithFlowAndHeat< dim, number >, MeltPoolDG::Simulation::StefansProblem2WithFlowAndHeat::SimulationStefansProblem2WithFlowAndHeat< dim, number >, MeltPoolDG::Simulation::StefansProblemWithFlow::SimulationStefansProblemWithFlow< dim, number >, MeltPoolDG::Simulation::ThermoCapillaryDroplet::SimulationThermoCapillaryDroplet< dim, number >, MeltPoolDG::Simulation::ThermoCapillaryTwoDroplets::SimulationThermoCapillaryTwoDroplets< dim, number >, MeltPoolDG::Simulation::WallWetting::SimulationWallWetting< dim, number >, MeltPoolDG::Simulation::FixedMeltPool::SimulationFixedMeltPool< dim, number >, MeltPoolDG::Simulation::RotatingBubble::SimulationRotatingBubble< dim, number >, MeltPoolDG::Simulation::VortexBubble::SimulationVortexBubble< dim, number >, MeltPoolDG::Simulation::VortexBubbleDG::SimulationVortexBubbleDG< dim, number >, MeltPoolDG::Simulation::ZalesakDisk::SimulationZalesakDisk< dim, number >, MeltPoolDG::Simulation::EvaporatingDroplet::SimulationEvaporatingDroplet< dim, number >, MeltPoolDG::Simulation::EvaporatingDropletWithHeat::SimulationEvaporatingDropletWithHeat< dim, number >, MeltPoolDG::Simulation::EvaporatingShell::SimulationEvaporatingShell< dim, number >, MeltPoolDG::Simulation::FlowPastCylinder::SimulationFlowPastCylinder< dim, number >, MeltPoolDG::Simulation::RecoilPressure::SimulationRecoilPressure< dim, number >, MeltPoolDG::Simulation::RisingBubble::SimulationRisingBubble< dim, number >, MeltPoolDG::Simulation::SpuriousCurrents::SimulationSpuriousCurrents< dim, number >, MeltPoolDG::Simulation::PowderParticles::SimulationPowderParticles< dim, number >, MeltPoolDG::Simulation::ReinitCircle::SimulationReinit< dim, number >, and MeltPoolDG::Simulation::ReinitCircleDG::SimulationReinitDG< dim, number >.
◆ set_time_boundary_conditions()
|
inline |
Update the time for all boundary conditions.
Sets the current time for all boundary conditions managed by this class.
- Parameters
-
time The current simulation time.
Member Data Documentation
◆ boundary_conditions_map
|
private |
◆ field_functions
|
private |
◆ mpi_communicator
| const MPI_Comm MeltPoolDG::SimulationCaseBase< dim, number, spacedim >::mpi_communicator |
◆ parameter_file
| const std::string MeltPoolDG::SimulationCaseBase< dim, number, spacedim >::parameter_file |
◆ periodic_boundary_conditions
|
private |
◆ triangulation
| std::shared_ptr<dealii::Triangulation<dim, spacedim> > MeltPoolDG::SimulationCaseBase< dim, number, spacedim >::triangulation |
The documentation for this class was generated from the following file:
- include/meltpooldg/core/simulation_case_base.hpp
Generated by