TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
ProblemTrio Class Reference

class ProblemTrio More...

#include <ProblemTrio.h>

Inheritance diagram for ProblemTrio:
[legend]
Collaboration diagram for ProblemTrio:
[legend]

Public Member Functions

bool initialize_pb (Probleme_U &pb)
void deactivate_multiple_runs ()
 ProblemTrio ()
void setDataFile (const std::string &datafile) override
void setMPIComm (void *) override
 ~ProblemTrio () override
bool initialize () override
 This method is called once at the beginning, before any other one of the interface Problem.
void terminate () override
 This method is called once at the end, after any other one.
double presentTime () const override
 Returns the present time.
double computeTimeStep (bool &stop) const override
 Compute the value the Problem would like for the next time step.
bool initTimeStep (double dt) override
 This method allocates and initializes the unknown and given fields for the future time step.
bool solveTimeStep () override
 Calculates the unknown fields for the next time step.
void validateTimeStep () override
 Validates the calculated unknown by moving the present time at the end of the time step.
void setStationaryMode (bool stationary) override
bool getStationaryMode () const override
bool isStationary () const override
 Tells if the Problem unknowns have changed during the last time step.
void abortTimeStep () override
 Aborts the resolution of the current time step.
void resetTime (double time) override
 Reset the current time of the Problem to a given value.
bool iterateTimeStep (bool &converged) override
 In the case solveTimeStep uses an iterative process, this method executes a single iteration.
std::vector< std::string > getInputFieldsNames () const override
 This method is used to find the names of input fields understood by the Problem.
std::vector< std::string > getOutputFieldsNames () const override
ValueType getFieldType (const std::string &name) const override
void getInputFieldTemplate (const std::string &name, TrioField &afield) const override
 This method is used to get a template of a field expected for the given name.
void setInputField (const std::string &name, const TrioField &afield) override
 This method is used to provide the Problem with an input field.
void getOutputField (const std::string &name, TrioField &afield) const override
void updateOutputField (const std::string &name, TrioField &afield) const override
void getInputMEDDoubleFieldTemplate (const std::string &name, MEDDoubleField &afield) const override
void setInputMEDDoubleField (const std::string &name, const MEDDoubleField &afield) override
void getOutputMEDDoubleField (const std::string &name, MEDDoubleField &afield) const override
void updateOutputMEDDoubleField (const std::string &name, MEDDoubleField &afield) const override
int getMEDCouplingMajorVersion () const override
bool isMEDCoupling64Bits () const override
void setInputIntValue (const std::string &name, const int &val) override
int getOutputIntValue (const std::string &name) const override
double getOutputDoubleValue (const std::string &name) const override
void setInputDoubleValue (const std::string &name, const double &val) override
void getOutputPointValues (const std::string &name, const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &z, std::vector< double > &vals, int compo=0)
double getOutputPointValues (const std::string &name, const double x, const double y, const double z, int compo=0)
void setInputStringValue (const std::string &name, const std::string &val) override
std::string getOutputStringValue (const std::string &name) const override
MEDDoubleField getDirectAccessToUnknown (const std::string &unk_name, bool isFuture)

Protected Attributes

Init_Params * my_params
Probleme_Upb
mon_mainp
bool supports_multiple_runs_ = true

Detailed Description

class ProblemTrio

This class defines the API a problem has to implement in order to be coupled.
For precise specifications and possible use of this API, See NT
SSTH/LMDL_2006_001
Implements IterativeUnsteadyProblem and FieldIO

Definition at line 45 of file ProblemTrio.h.

Constructor & Destructor Documentation

◆ ProblemTrio()

Definition at line 101 of file ProblemTrio.cpp.

◆ ~ProblemTrio()

Definition at line 58 of file ProblemTrio.cpp.

Member Function Documentation

◆ abortTimeStep()

void ProblemTrio::abortTimeStep ( )
override

Aborts the resolution of the current time step.

Exceptions
WrongContext

Definition at line 365 of file ProblemTrio.cpp.

◆ computeTimeStep()

double ProblemTrio::computeTimeStep ( bool & stop) const
override

Compute the value the Problem would like for the next time step.

This value will not necessarily be used at the call of initTimeStep, but it is a hint. This method may use all the internal state of the Problem.

Parameters
(stop)Does the Problem want to stop ?
Returns
(double) The desired time step
Exceptions
WrongContext

Definition at line 273 of file ProblemTrio.cpp.

◆ deactivate_multiple_runs()

Definition at line 95 of file ProblemTrio.cpp.

◆ getDirectAccessToUnknown()

ICoCo::MEDDoubleField ProblemTrio::getDirectAccessToUnknown ( const std::string & unk_name,
bool isFuture )

Definition at line 642 of file ProblemTrio.cpp.

◆ getFieldType()

ICoCo::ValueType ProblemTrio::getFieldType ( const std::string & name) const
override

Definition at line 525 of file ProblemTrio.cpp.

◆ getInputFieldsNames()

vector< string > ProblemTrio::getInputFieldsNames ( ) const
override

This method is used to find the names of input fields understood by the Problem.

Returns
(vector<string>) list of names usable with getInputFieldTemplate and setInputField

Definition at line 416 of file ProblemTrio.cpp.

◆ getInputFieldTemplate()

void ProblemTrio::getInputFieldTemplate ( const std::string & name,
TrioField & afield ) const
override

This method is used to get a template of a field expected for the given name.

Definition at line 429 of file ProblemTrio.cpp.

◆ getInputMEDDoubleFieldTemplate()

void ProblemTrio::getInputMEDDoubleFieldTemplate ( const std::string & name,
MEDDoubleField & afield ) const
override

Definition at line 562 of file ProblemTrio.cpp.

◆ getMEDCouplingMajorVersion()

Definition at line 620 of file ProblemTrio.cpp.

◆ getOutputDoubleValue()

double ProblemTrio::getOutputDoubleValue ( const std::string & name) const
override

Definition at line 460 of file ProblemTrio.cpp.

◆ getOutputField()

void ProblemTrio::getOutputField ( const std::string & name,
TrioField & afield ) const
override

Definition at line 538 of file ProblemTrio.cpp.

◆ getOutputFieldsNames()

vector< string > ProblemTrio::getOutputFieldsNames ( ) const
override

Definition at line 512 of file ProblemTrio.cpp.

◆ getOutputIntValue()

int ProblemTrio::getOutputIntValue ( const std::string & name) const
override

Definition at line 489 of file ProblemTrio.cpp.

◆ getOutputMEDDoubleField()

void ProblemTrio::getOutputMEDDoubleField ( const std::string & name,
MEDDoubleField & afield ) const
override

Definition at line 550 of file ProblemTrio.cpp.

◆ getOutputPointValues() [1/2]

double ProblemTrio::getOutputPointValues ( const std::string & name,
const double x,
const double y,
const double z,
int compo = 0 )

Definition at line 507 of file ProblemTrio.cpp.

◆ getOutputPointValues() [2/2]

void ProblemTrio::getOutputPointValues ( const std::string & name,
const std::vector< double > & x,
const std::vector< double > & y,
const std::vector< double > & z,
std::vector< double > & vals,
int compo = 0 )

Definition at line 498 of file ProblemTrio.cpp.

◆ getOutputStringValue()

std::string ProblemTrio::getOutputStringValue ( const std::string & name) const
override

Definition at line 455 of file ProblemTrio.cpp.

◆ getStationaryMode()

bool ProblemTrio::getStationaryMode ( ) const
override

Definition at line 352 of file ProblemTrio.cpp.

◆ initialize()

bool ProblemTrio::initialize ( )
override

This method is called once at the beginning, before any other one of the interface Problem.

Exceptions
WrongContext

Definition at line 133 of file ProblemTrio.cpp.

◆ initialize_pb()

Definition at line 211 of file ProblemTrio.cpp.

◆ initTimeStep()

bool ProblemTrio::initTimeStep ( double dt)
override

This method allocates and initializes the unknown and given fields for the future time step.

The value of the interval is imposed through the parameter dt. In case of error, returns false.

Parameters
(doubledt) the time interval to allocate
Returns
(bool) true=OK, false=error, not able to tackle this dt
Exceptions
WrongContext,WrongArgument

Definition at line 288 of file ProblemTrio.cpp.

◆ isMEDCoupling64Bits()

bool ProblemTrio::isMEDCoupling64Bits ( ) const
override

Definition at line 629 of file ProblemTrio.cpp.

◆ isStationary()

bool ProblemTrio::isStationary ( ) const
override

Tells if the Problem unknowns have changed during the last time step.

Returns
(bool) true=stationary, false=not stationary
Exceptions
WrongContext

Definition at line 340 of file ProblemTrio.cpp.

◆ iterateTimeStep()

bool ProblemTrio::iterateTimeStep ( bool & converged)
override

In the case solveTimeStep uses an iterative process, this method executes a single iteration.

It is thus possible to modify the given fields between iterations. converged is set to true if the process has converged, ie if the unknown fields are solution to the problem on the next time step. Otherwise converged is set to false. The return value indicates if the convergence process behaves normally. If false, the ProblemTrio wishes to abort the time step resolution.

Parameters
(bool&converged) It is a return value : true if the process has converged, false otherwise.
Returns
(bool) true=OK, false=unable to converge
Exceptions
WrongContext

Definition at line 407 of file ProblemTrio.cpp.

◆ presentTime()

double ProblemTrio::presentTime ( ) const
override

Returns the present time.

This value may change only at the call of validateTimeStep. A surcharger

Returns
(double) present time
Exceptions
WrongContext

Definition at line 258 of file ProblemTrio.cpp.

◆ resetTime()

void ProblemTrio::resetTime ( double time)
override

Reset the current time of the Problem to a given value.

New in version 2 of ICoCo. Particularly useful for the initialization of complex transients: the starting point of the transient of interest is computed first, the time is reset to 0, and then the actual transient of interest starts with proper initial conditions, and global time 0.

Can be called outside the TIME_STEP_DEFINED context (see Problem documentation).

Parameters
[in]timethe new current time.
Exceptions
ICoCo::WrongContextexception if called before initialize() or after terminate().
ICoCo::WrongContextexception if called inside the TIME_STEP_DEFINED context (see Problem documentation)

Definition at line 383 of file ProblemTrio.cpp.

◆ setDataFile()

void ProblemTrio::setDataFile ( const std::string & datafile)
override

Definition at line 113 of file ProblemTrio.cpp.

◆ setInputDoubleValue()

void ProblemTrio::setInputDoubleValue ( const std::string & name,
const double & val )
override

Definition at line 444 of file ProblemTrio.cpp.

◆ setInputField()

void ProblemTrio::setInputField ( const std::string & name,
const TrioField & afield )
override

This method is used to provide the Problem with an input field.

Definition at line 438 of file ProblemTrio.cpp.

◆ setInputIntValue()

void ProblemTrio::setInputIntValue ( const std::string & name,
const int & val )
override

Definition at line 482 of file ProblemTrio.cpp.

◆ setInputMEDDoubleField()

void ProblemTrio::setInputMEDDoubleField ( const std::string & name,
const MEDDoubleField & afield )
override

Definition at line 573 of file ProblemTrio.cpp.

◆ setInputStringValue()

void ProblemTrio::setInputStringValue ( const std::string & name,
const std::string & val )
override

Definition at line 450 of file ProblemTrio.cpp.

◆ setMPIComm()

void ProblemTrio::setMPIComm ( void * mpicomm)
override

Definition at line 117 of file ProblemTrio.cpp.

◆ setStationaryMode()

void ProblemTrio::setStationaryMode ( bool stationary)
override

Definition at line 345 of file ProblemTrio.cpp.

◆ solveTimeStep()

bool ProblemTrio::solveTimeStep ( )
override

Calculates the unknown fields for the next time step.

The default implementation uses iterations.

Returns
(bool) true=OK, false=unable to find the solution.
Exceptions
WrongContext

Definition at line 301 of file ProblemTrio.cpp.

◆ terminate()

void ProblemTrio::terminate ( )
override

This method is called once at the end, after any other one.

It frees the memory and saves anything that needs to be saved.

Exceptions
WrongContext

Definition at line 226 of file ProblemTrio.cpp.

◆ updateOutputField()

void ProblemTrio::updateOutputField ( const std::string & name,
TrioField & afield ) const
override

Definition at line 545 of file ProblemTrio.cpp.

◆ updateOutputMEDDoubleField()

void ProblemTrio::updateOutputMEDDoubleField ( const std::string & name,
MEDDoubleField & afield ) const
override

Definition at line 607 of file ProblemTrio.cpp.

◆ validateTimeStep()

void ProblemTrio::validateTimeStep ( )
override

Validates the calculated unknown by moving the present time at the end of the time step.

This method is allowed to free past values of the unknown and given fields.

Exceptions
WrongContext

Definition at line 318 of file ProblemTrio.cpp.

Member Data Documentation

◆ my_params

Init_Params* ICoCo::ProblemTrio::my_params
protected

Definition at line 137 of file ProblemTrio.h.

◆ p

Definition at line 139 of file ProblemTrio.h.

◆ pb

Definition at line 138 of file ProblemTrio.h.

◆ supports_multiple_runs_

Definition at line 140 of file ProblemTrio.h.


The documentation for this class was generated from the following files:
  • /home/docs/checkouts/readthedocs.org/user_builds/cea-trust-platform/checkouts/master/src/Kernel/ICoCo/ProblemTrio.h
  • /home/docs/checkouts/readthedocs.org/user_builds/cea-trust-platform/checkouts/master/src/Kernel/ICoCo/ProblemTrio.cpp