Diana  0.8.3
Classes | Public Member Functions | Static Protected Member Functions | Protected Attributes
PARDASPKSolver Class Reference

Solver for parallel simulation. More...

#include <PARDASPKSolver.hpp>

Inheritance diagram for PARDASPKSolver:
IDianaNumericDAESolver DianaNumericSolver ICapeNumericDAESolver IDianaNumericSolver IDianaNumericSolver ICapeNumericSolver ICapeNumericSolver ICapeNumericSolver ICapeIdentification ICapeUtilities ICapeIdentification ICapeUtilities ICapeIdentification ICapeUtilities

List of all members.

Classes

struct  sExchangeStruct

Public Member Functions

 PARDASPKSolver (Numeric::Solvers::Model::ICapeNumericModel *model) throw (Common::Error::ECapeUnknown)
const Common::Types::CapeStringGetComponentName () const throw (Common::Error::ECapeUnknown)
void SetComponentName (const Common::Types::CapeString &_name) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument)
const Common::Types::CapeStringGetComponentDescription () const throw (Common::Error::ECapeUnknown)
void SetComponentDescription (const Common::Types::CapeString &_description) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument)
Common::Collection::ICapeCollectionGetParameters () throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation, Common::Error::ECapeNoImpl)
void SetSimulationContext (Common::Identification::ICapeIdentification *simContextManager) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeFailedInitialisation, Common::Error::ECapeNoImpl)
void Initialize () throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation, Common::Error::ECapeOutOfResources, Common::Error::ECapeLicenceError, Common::Error::ECapeBadInvOrder)
void Terminate () throw (Common::Error::ECapeUnknown, Common::Error::ECapeOutOfResources, Common::Error::ECapeBadInvOrder)
Numeric::Solvers::Solver::SolveReturn Solve () throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder, Common::Error::ECapeSolvingError, Common::Error::ECapeOutOfResources)
Common::Types::CapeArrayDouble GetSolution () throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder)
void Destroy () throw (Common::Error::ECapeUnknown)
void SetRelTolerance (const Common::Types::CapeArrayDouble &relTolValue) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeOutOfBounds)
Common::Types::CapeArrayDouble GetRelTolerance () throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder)
void SetAbsTolerance (const Common::Types::CapeArrayDouble &absTolValues) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeOutOfBounds)
Common::Types::CapeArrayDouble GetAbsTolerance () throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder)
Numeric::Solvers::Model::CapeArrayNumericEventInfoAdvanceToNextEvent (Numeric::Solvers::Model::CapeArrayNumericEventInfo endConditions, Common::Types::CapeDouble &timeBefore, Common::Types::CapeDouble &timeAfter) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeOutOfBounds, Common::Error::ECapeBadInvOrder, Common::Error::ECapeSolvingError, Common::Error::ECapeOutOfResources, Common::Error::ECapeNoImpl)
void setValuesFromESO ()
void RecalculateIC ()
void SolveWR () throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder, Common::Error::ECapeSolvingError, Common::Error::ECapeOutOfResources)

Static Protected Member Functions

static void calculateResiduals (double *T, double Y[], double YPrime[], double Delta[], int IPar[])
static void calculateJacobian (int *NEQ, double *T, double Y[], double YPRIME[], double *CJ, int IPAR[], int *RECALC)
static void LinearSolver (int *NEQ, double B[], int IPar[])
static void SaveInternalStates (double *X, int *NEQ, int *KOLD, double PHI[], double PSI[], int IPar[])

Protected Attributes

Common::Types::CapeString strName
Common::Types::CapeString strDescription
Numeric::Solvers::Model::ICapeNumericModelpModel
 simulated model
Numeric::Solvers::Eso::ICapeNumericDAESOpESO
 current model ESO
Diana::DianaCollection collParameters
 collections of the exported parameters
Common::Types::CapeBoolean m_bStartSimulation
 flag, indicates whether it is necessary to restart integration
Common::Types::CapeBoolean m_bNeedToInitialize
CapeBoolean m_bNeedToRestoreState
CapeBoolean m_bNeedToSaveState
Common::Types::CapeLong m_lVarsQuantity
 current number of the state variables
Common::Types::CapeLong m_lEquationsQuantity
 current number of the equations
Common::Types::CapeDouble dblT
 is the current value of the independent variable
Common::Types::CapeDouble dblT0
 is the initial value of the independent variable
Common::Types::CapeDouble dblTend
 the final value of the independent variable
Common::Types::CapeLong nVerboseLevel
 reporting level
int nDASKPStatus
int nDASKPStatus_old
 status of DASKP solver
CapeDouble dblRTol
CapeDouble dblAbsTol
double * vecRelTol
 Array with values of relative tolerances.
double * vecAbsTol
 Array with values of absolute tolerances.
int * IPar
 this working array used by DASPK
CapeDouble m_dLastInternalSolverStep
 The value of last internal solver step.
struct
Diana::PARDASPKSolver::sExchangeStruct 
Adresses
int nLRW
int nLIW
 length of RWORK and IWORK - working arrays in ddaspk.f
double * RWORK
 [*]_old data on previous iteration
double * RWORK_old
 real work array for daspk.f
int * IWORK
int * IWORK_old
 integer work array for daspk.f
double * Y
double * Y_old
 variables
double * YP
double * YP_old
 derivatives
double T0_old
int m_nInfo [30]
int m_nInfo_old [30]
 info arrays for DASPK algorithm
CapeDouble m_dMaxStep
 Maximal value of solver step.
CapeDouble m_bNeedToPrint
CapeDouble m_dInitialStepSize

Detailed Description

Solver for parallel simulation.

PARDASPKSolver.


Member Function Documentation

Advances the solution of the DAESO with respect to its independent variable until some Event(s) occurs, or an error occurs in the solution process.

Note:For dynamic problems, we cannot be certain that the Solver will be able to identify precisely the single Event which causes termination. Thus we allow it to provide a list of Event objects, together with independent variable values which "bracket" the termination point.

Parameters:
endConditionsthe list of stopping conditions for this call
timeBeforethe independent variable value at the beginning of the internal step
timeAfterthe independent variable value at the end of the internal step

Implements ICapeNumericDAESolver.

static void calculateJacobian ( int *  NEQ,
double *  T,
double  Y[],
double  YPRIME[],
double *  CJ,
int  IPAR[],
int *  RECALC 
) [static, protected]

Jacobian calculation function - called from daspk solver (daspk.f).

static void calculateResiduals ( double *  T,
double  Y[],
double  YPrime[],
double  Delta[],
int  IPar[] 
) [static, protected]

Residuals calculation function - called from daspk solver (daspk.f).

void Destroy ( ) throw (Common::Error::ECapeUnknown) [virtual]

Deletes the Solver Component and all the objects associated to this particular Solver Component.

Implements ICapeNumericSolver.

Gets information on the absolute tolerance to be used in performing local error tests while solving the DAE system. The precise interpretation of this parameter will depend on individual implementations; the exact nature of the error measure used (e.g. local truncation error, local error etc.), and the way in which this is estimated, are not defined by CAPE-OPEN.

Implements ICapeNumericDAESolver.

gets the description of the component.

Implements ICapeIdentification.

gets the name of the component.

Implements ICapeIdentification.

Returns an ICapeCollection interface. This interface will contain a collection of ICapeParameter interfaces. This method allows any client to access all the Cape Open Parameters exposed by a model component. If the model component does not support exposing its parameters, it should raise the ECapeNoImpl error, instead of returning a NULL reference or an empty Collection. But if the PMC supports parameters but has for this call no parameters, it should return a valid ICapeCollection reference exposing zero parameters.

Implements ICapeUtilities.

Gets information on the relative tolerance to be used in performing local error tests while solving a DAE system, as well as its current value. The precise interpretation of this parameter will depend on individual implementations; the exact nature of the error measure used (e.g. local truncation error, local error etc.), and the way in which this is estimated, are not defined by CAPE-OPEN.

Implements ICapeNumericDAESolver.

Gets all the values of the variables that solve this System.

Implements ICapeNumericSolver.

The environment will order the component to get initialized through this method. Any initialisation that could fail must be placed here. Initialize is guaranteed to be the first method called by the client (except low level methods such as class constructors or initialization persistence methods). Initialize has to be called once when the component is instantiated in a particular flowsheet. When the initialization fails, before signalling an error, the component must free all the resources that were allocated before the failure occurred. When the environment receives this error, it may not use the component anymore. The method terminate of the current interface must not either be called. Hence, the environment may only release the component through the middleware native mechanisms.

Implements ICapeUtilities.

static void LinearSolver ( int *  NEQ,
double  B[],
int  IPar[] 
) [static, protected]

Linear solver - called from daspk solver (daspk.f).

Sets the absolute tolerance to be used in performing local error tests while solving the DAE system. The precise interpretation of this parameter will depend on individual implementations; the exact nature of the error measure used (e.g. local truncation error, local error etc.), and the way in which this is estimated, are not defined by CAPE-OPEN.

Implements ICapeNumericDAESolver.

sets the description of the component.

Parameters:
_descriptionthe description of the component

Implements ICapeIdentification.

sets the name of the component.

Parameters:
_namethe name of the component

Implements ICapeIdentification.

Sets the relative tolerance values to be used in performing local error tests while solving a DAE system. The precise interpretation of this parameter will depend on individual implementations; the exact nature of the error measure used (e.g. local truncation error, local error etc.) and the way in which this is estimated are not defined by CAPE-OPEN.

Parameters:
relTolValuethe relative tolerance values.

Implements ICapeNumericDAESolver.

Allows the environment to convey the component a reference to the former's simulation context. The simulation context will be environment objects which will expose a given set of Cape Open interfaces. Each of these interfaces will allow the component to call back the environment in order to benefit from its exposed services (such as creation of material templates, diagnostics or measurement unit conversion). If the component does not support accessing the simulation context, it is recommended to raise the ECapeNoImpl error.

Parameters:
simContextManagerthe reference to the environment's simulation context class. For the component to use this class, this reference will have to be converted to each of the defined Cape Open Simulation Context interfaces.

Implements ICapeUtilities.

Attempts to solve the system of equations defined within the Model associated with this solver instance. Return will occur in different circumstances:

  • The attempt succeeds.
  • The solver gives up.
  • An unexpected problem ("exception") arises.
    If the underlying Model contains one or more STNs, the Solver may consider a switch to a different set of active states necessary to finding a solution. In this case, it may use the MoveToNextState method of one or more of the Model's STNs during the computation. The numerical values held in the model on return should be consistent with the set of states which are active on return.

Notes:The initial guesses for this solution will be the current variable values of the Model.

Implements ICapeNumericSolver.

The environment will order the component to get destroyed through this method. Any uninitialization that could fail must be placed here. Terminate is guaranteed to be the last method called by the client (except low level methods such as class destructors). Terminate may be called at any time, but may be only called once. When this method returns an error, the environment should report the user. However, after that the environment is not allowed to use the component anymore.

Implements ICapeUtilities.


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