ParametersBase Struct Reference

Developer Documentation: MeltPoolDG::ParametersBase Struct Reference
Developer Documentation

Abstract base class for managing parameter files. More...

#include <parameters_base.hpp>

Inheritance diagram for MeltPoolDG::ParametersBase:
[legend]

Public Member Functions

virtual void process_parameters_file (dealii::ParameterHandler &prm, const std::string &parameter_filename)
 Process a parameter file and populate the ParameterHandler.
 
void print_parameters (dealii::ParameterHandler &prm, std::ostream &pcout, const bool print_details)
 Print parameters to an output stream.
 

Protected Member Functions

virtual void add_parameters (dealii::ParameterHandler &prm)=0
 Add parameters to the ParameterHandler.
 
virtual void post (const std::string &parameter_filename)=0
 Post-processing after reading the parameter file.
 

Protected Attributes

bool parameters_read = false
 

Private Member Functions

void check_for_file (const std::string &parameter_filename) const
 Check if a parameter file exists and is accessible.
 

Detailed Description

Abstract base class for managing parameter files.

Provides an interface for processing, validating, and printing parameter files using ParameterHandler. Derived classes must implement methods for adding parameters and handling post-processing logic.

Member Function Documentation

◆ add_parameters()

virtual void MeltPoolDG::ParametersBase::add_parameters ( dealii::ParameterHandler &  prm)
protectedpure virtual

Add parameters to the ParameterHandler.

Derived classes must implement this method to define the parameters managed by the ParameterHandler.

Parameters
prmThe ParameterHandler object where parameters will be added.

Implemented in MeltPoolDG::LevelSet::AdvectionDiffusionCaseParameters< number >, MeltPoolDG::Heat::HeatTransferCaseParameters< number >, MeltPoolDG::LevelSet::LevelSetCaseParameters< number >, MeltPoolDG::MeltPoolCaseParameters< number >, MeltPoolDG::RadiativeTransport::RadiativeTransportCaseParameters< number >, and MeltPoolDG::LevelSet::ReinitializationCaseParameters< number >.

◆ check_for_file()

void MeltPoolDG::ParametersBase::check_for_file ( const std::string &  parameter_filename) const
private

Check if a parameter file exists and is accessible.

Verifies that the specified file exists and can be opened for reading.

Parameters
parameter_filenameThe name of the file to check.
Exceptions
dealii::ExcMessageIf the file cannot be found or opened.

◆ post()

virtual void MeltPoolDG::ParametersBase::post ( const std::string &  parameter_filename)
protectedpure virtual

Post-processing after reading the parameter file.

This method is called after the parameter file has been parsed. Derived classes can override it to perform additional setup or validation based on the file contents.

Parameters
parameter_filenameThe name of the parameter file that was processed.

Implemented in MeltPoolDG::LevelSet::AdvectionDiffusionCaseParameters< number >, MeltPoolDG::Heat::HeatTransferCaseParameters< number >, MeltPoolDG::LevelSet::LevelSetCaseParameters< number >, MeltPoolDG::MeltPoolCaseParameters< number >, MeltPoolDG::RadiativeTransport::RadiativeTransportCaseParameters< number >, and MeltPoolDG::LevelSet::ReinitializationCaseParameters< number >.

◆ print_parameters()

void MeltPoolDG::ParametersBase::print_parameters ( dealii::ParameterHandler &  prm,
std::ostream &  pcout,
const bool  print_details 
)

Print parameters to an output stream.

Prints the parameters in the ParameterHandler to a specified stream, either in detailed or compact format.

Parameters
prmThe ParameterHandler object containing the parameters to print.
pcoutThe output stream where parameters will be printed.
print_detailsIf true, prints parameters in detailed format.

◆ process_parameters_file()

void MeltPoolDG::ParametersBase::process_parameters_file ( dealii::ParameterHandler &  prm,
const std::string &  parameter_filename 
)
virtual

Process a parameter file and populate the ParameterHandler.

Reads a parameter file in .json or .prm format, validates its contents, and updates the associated ParameterHandler object.

Parameters
prmThe ParameterHandler object to populate with parameters.
parameter_filenameThe name of the parameter file to process.
Exceptions
dealii::ExcMessageIf parameters have already been read or the file format is unsupported.

Member Data Documentation

◆ parameters_read

bool MeltPoolDG::ParametersBase::parameters_read = false
protected

Tracks whether parameters have been read.


The documentation for this struct was generated from the following files: