MoCSI API Reference
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
FluxSmoothingTool< T > Class Template Reference

Managing module that adaptively reduces the timestep to limit excessive temperature changes. More...

#include <FluxSmoothingTool.h>

Inheritance diagram for FluxSmoothingTool< T >:
Inheritance graph
Collaboration diagram for FluxSmoothingTool< T >:
Collaboration graph

Public Member Functions

 FluxSmoothingTool (SimulationClassBase< T > *sim)
 
bool setup (std::vector< std::shared_ptr< GenericSubmodule< T > > > all_submodules) override
 
bool exec (std::string_view param) override
 
bool init () override
 
bool preTimeStep () override
 
bool postNonLinIter () override
 
bool postTimeStep () override
 
bool output () override
 
std::vector< std::string > getChainInsertion () const override
 
std::string_view getNameLocal () const override
 
- Public Member Functions inherited from GenericManagingModule< T >
 GenericManagingModule ()
 Constructor without arguments. Will be employed when using the static modules registry.
 
virtual ~GenericManagingModule ()=default
 
 GenericManagingModule (SimulationClassBase< T > *l_sim)
 Constructor to be preferably used when a module is created during runtime.
 
virtual std::vector< std::string > getDependencies () const
 
virtual void setSubmoduleList (std::vector< std::string > submodules)
 
std::vector< std::string > getSubmoduleList () const
 
void setSimPointer (SimulationClassBase< T > *sim)
 Setter function for the sim pointer. As the module is usually registered during static initialization when the sim class is not yet existing, this function is needed to set the pointer.
 
void setSubmodules (std::vector< std::shared_ptr< GenericSubmodule< T > > > all_submodules)
 Sets all the submodules of this module into their corresponding chains. Also sets their field-pointers to this->module_field as a way to communicate between submodules.
 
void writeToGlobalIniContent (std::ofstream &global_stream)
 Function that writes the local ini file contents to the global ini file stream. "Tags" the keys with the name of the module in the format "module_name$key".
 
void overwriteLocalIniContent (const std::unordered_map< std::string, std::any > &global_ini_content)
 Writes the (already trimmed to the local content) data from the global ini file to the local ini file. This only overwrites the internal data and not the file contents itself.
 

Static Public Member Functions

static std::shared_ptr< GenericManagingModule< T > > createMethode (SimulationClassBase< T > *sim)
 
static std::string getName ()
 

Additional Inherited Members

- Protected Attributes inherited from GenericManagingModule< T >
SimulationClassBase< T > * sim {}
 
std::shared_ptr< std::valarray< T > > module_field
 
ChainManager< GenericSubmodule< T > > sub_module_chain
 
std::vector< std::string > m_generic_submodules
 
InputManager ini_file_data
 
bool in_snapshot {false}
 
bool in_output {false}
 
char field_id
 

Detailed Description

template<typename T>
class FluxSmoothingTool< T >

Managing module that adaptively reduces the timestep to limit excessive temperature changes.

This module implements an artificial flux smoothing mechanism based on the description in Schörghofer & Khatiwala (2024). During the simulation, if the change in surface temperature exceeds defined thresholds, the timestep is temporarily reduced to stabilize the solution. Once the temperatures have stabilized over a few substeps, the original timestep is restored.

Template Parameters
TType of numerical values used (e.g., double or float)
Note
This module is inefficient for resource-intensive simulations because it rewinds and subdivides timesteps. It is primarily intended for testing or comparison purposes.

Constructor & Destructor Documentation

◆ FluxSmoothingTool()

Member Function Documentation

◆ createMethode()

template<typename T >
static std::shared_ptr< GenericManagingModule< T > > FluxSmoothingTool< T >::createMethode ( SimulationClassBase< T > *  sim)
inlinestatic

◆ exec()

template<typename T >
bool FluxSmoothingTool< T >::exec ( std::string_view  param)
overridevirtual

◆ getChainInsertion()

template<typename T >
std::vector< std::string > FluxSmoothingTool< T >::getChainInsertion ( ) const
inlineoverridevirtual

Reimplemented from GenericManagingModule< T >.

◆ getName()

template<typename T >
static std::string FluxSmoothingTool< T >::getName ( )
inlinestatic

◆ getNameLocal()

template<typename T >
std::string_view FluxSmoothingTool< T >::getNameLocal ( ) const
inlineoverridevirtual

◆ init()

template<typename T >
bool FluxSmoothingTool< T >::init ( )
inlineoverridevirtual

Reimplemented from GenericManagingModule< T >.

◆ output()

template<typename T >
bool FluxSmoothingTool< T >::output ( )
inlineoverridevirtual

Reimplemented from GenericManagingModule< T >.

◆ postNonLinIter()

template<typename T >
bool FluxSmoothingTool< T >::postNonLinIter ( )
inlineoverridevirtual

Reimplemented from GenericManagingModule< T >.

◆ postTimeStep()

template<typename T >
bool FluxSmoothingTool< T >::postTimeStep ( )
overridevirtual

Reimplemented from GenericManagingModule< T >.

◆ preTimeStep()

template<typename T >
bool FluxSmoothingTool< T >::preTimeStep ( )
overridevirtual

Reimplemented from GenericManagingModule< T >.

◆ setup()

template<typename T >
bool FluxSmoothingTool< T >::setup ( std::vector< std::shared_ptr< GenericSubmodule< T > > >  all_submodules)
overridevirtual

Reimplemented from GenericManagingModule< T >.


The documentation for this class was generated from the following file: