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

Managing module that calculates and manages surface albedo. More...

#include <Albedo.h>

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

Public Member Functions

 Albedo (SimulationClassBase< T > *sim)
 Construct the Albedo module.
 
bool setup (std::vector< std::shared_ptr< GenericSubmodule< T > > > all_submodules) override
 Setup method called after construction.
 
bool exec (std::string_view param) override
 Main execution method of the module.
 
bool init () override
 Initialization step.
 
bool preTimeStep () override
 Pre-time-step processing.
 
bool postTimeStep () override
 Post-time-step processing.
 
bool output () override
 Output stage.
 
void writeToSim ()
 Write the current albedo field to the simulation.
 
std::vector< std::string > getChainInsertion () const override
 Get chain insertion points.
 
std::string_view getNameLocal () const override
 Get the localized name of the module.
 
- 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 bool postNonLinIter ()
 
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)
 Factory method for creating an Albedo module.
 
static std::string getName ()
 Get the name of the module.
 

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 Albedo< T >

Managing module that calculates and manages surface albedo.

The Albedo module is a managing module that:

Template Parameters
TNumeric type used in the simulation (e.g., float, double).

Constructor & Destructor Documentation

◆ Albedo()

template<typename T >
Albedo< T >::Albedo ( SimulationClassBase< T > *  sim)

Construct the Albedo module.

Loads user configuration from the .ini file and initializes the submodule list.

Parameters
simPointer to the simulation base class.

Member Function Documentation

◆ createMethode()

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

Factory method for creating an Albedo module.

Used by the ModuleFactory to dynamically create instances.

Parameters
simPointer to the simulation base class.
Returns
Shared pointer to the newly created Albedo instance.

◆ exec()

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

Main execution method of the module.

Dispatches calls to the corresponding chain stage based on the given parameter:

  • "InitChain"
  • "PreTimeStepChain"
  • "PostTimeStepChain"
  • "OutputChain"
Parameters
paramString indicating which chain stage to run.
Returns
True if the stage executed successfully, false otherwise.

Implements GenericManagingModule< T >.

◆ getChainInsertion()

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

Get chain insertion points.

Reads the list of chain stages where this module should be inserted from the .ini file parameter chain_insertion.

Returns
A vector of chain stage names.

Reimplemented from GenericManagingModule< T >.

◆ getName()

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

Get the name of the module.

Returns
The string "Albedo".

◆ getNameLocal()

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

Get the localized name of the module.

Returns
The string "Albedo".

Implements GenericManagingModule< T >.

◆ init()

template<typename T >
bool Albedo< T >::init ( )
overridevirtual

Initialization step.

Runs the submodule chain’s initialization stage and writes results to the simulation.

Returns
True on success.

Reimplemented from GenericManagingModule< T >.

◆ output()

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

Output stage.

Currently does nothing except return success.

Returns
Always true.

Reimplemented from GenericManagingModule< T >.

◆ postTimeStep()

template<typename T >
bool Albedo< T >::postTimeStep ( )
inlineoverridevirtual

Post-time-step processing.

Currently does nothing except return success.

Returns
Always true.

Reimplemented from GenericManagingModule< T >.

◆ preTimeStep()

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

Pre-time-step processing.

Runs the submodule chain’s pre-time-step stage and writes results to the simulation.

Returns
True on success.

Reimplemented from GenericManagingModule< T >.

◆ setup()

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

Setup method called after construction.

Initializes the albedo field in the simulation’s field map and sets submodules.

Parameters
all_submodulesList of all available submodules.
Returns
Always returns true on success.

Reimplemented from GenericManagingModule< T >.

◆ writeToSim()

template<typename T >
void Albedo< T >::writeToSim ( )

Write the current albedo field to the simulation.

Updates the simulation’s field map with the values from module_field.


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