1.3.2
CCC
 
ShiftOpCs Class Reference

Shift Operator for performing the basic tasks of SPDE. More...

#include <ShiftOpCs.hpp>

Inheritance diagram for ShiftOpCs:
ALinearOp

Detailed Description

Shift Operator for performing the basic tasks of SPDE.

Public Member Functions

 ShiftOpCs (const CGParam params=CGParam())
 
 ShiftOpCs (const AMesh *amesh, Model *model, const Db *dbout=nullptr, int igrf=0, int icov=0, const CGParam params=CGParam(), bool verbose=false)
 
 ShiftOpCs (const MatrixSparse *S, const VectorDouble &TildeC, const VectorDouble &Lambda, Model *model, const CGParam params=CGParam(), bool verbose=false)
 
 ShiftOpCs (const ShiftOpCs &shift)
 
ShiftOpCsoperator= (const ShiftOpCs &shift)
 
virtual ~ShiftOpCs ()
 
void _evalDirect (const VectorDouble &inv, VectorDouble &outv) const override
 
int initFromMesh (const AMesh *amesh, Model *model, const Db *dbout=nullptr, int igrf=0, int icov=0, bool flagAdvection=false, bool verbose=false)
 
int initGradFromMesh (const AMesh *amesh, Model *model, int igrf=0, int icov=0, bool verbose=false, double tol=EPSILON10)
 
int initFromCS (const MatrixSparse *S, const VectorDouble &TildeC, const VectorDouble &Lambda, Model *model, bool verbose=false)
 
int getSize () const override
 
int getNDim () const
 
int getNModelGradParam () const
 
void prodTildeC (const VectorDouble &x, VectorDouble &y, const EPowerPT &power) const
 
void prodLambda (const VectorDouble &x, VectorDouble &y, const EPowerPT &power) const
 
void prodLambdaOnSqrtTildeC (const VectorDouble &inv, VectorDouble &outv, double puis=2) const
 
double getMaxEigenValue () const
 
MatrixSparsegetS () const
 
MatrixSparsegetTildeCGrad (int iapex, int igparam) const
 
MatrixSparsegetSGrad (int iapex, int igparam) const
 
const VectorDoublegetTildeC () const
 
const VectorDoublegetLambdas () const
 
double getLambda (int iapex) const
 
const VectorDoublegetLambdaGrads (int idim) const
 
double getLambdaGrad (int idim, int iapex) const
 
int getSGradAddress (int iapex, int igparam) const
 
int getLambdaGradSize () const
 
- Public Member Functions inherited from ALinearOp
 ALinearOp (const CGParam params=CGParam())
 
 ALinearOp (const ALinearOp &m)
 
ALinearOpoperator= (const ALinearOp &m)
 
virtual ~ALinearOp ()
 
virtual void evalInverse (const VectorDouble &inv, VectorDouble &outv) const
 
void evalDirect (const VectorDouble &inv, VectorDouble &outv) const
 
void setX0 (const VectorDouble &x0)
 
void mustShowStats (bool status)
 
const LogStatsgetLogStats () const
 

Static Public Member Functions

static ShiftOpCscreate (const AMesh *amesh, Model *model, const Db *dbout=nullptr, int igrf=0, int icov=0, const CGParam params=CGParam(), bool verbose=false)
 
static ShiftOpCscreateFromSparse (const MatrixSparse *S, const VectorDouble &TildeC, const VectorDouble &Lambda, Model *model, const CGParam params=CGParam(), bool verbose=false)
 

Constructor & Destructor Documentation

◆ ShiftOpCs() [1/4]

ShiftOpCs::ShiftOpCs ( const CGParam  params = CGParam())

◆ ShiftOpCs() [2/4]

ShiftOpCs::ShiftOpCs ( const AMesh amesh,
Model model,
const Db dbout = nullptr,
int  igrf = 0,
int  icov = 0,
const CGParam  params = CGParam(),
bool  verbose = false 
)

◆ ShiftOpCs() [3/4]

ShiftOpCs::ShiftOpCs ( const MatrixSparse S,
const VectorDouble TildeC,
const VectorDouble Lambda,
Model model,
const CGParam  params = CGParam(),
bool  verbose = false 
)

◆ ShiftOpCs() [4/4]

ShiftOpCs::ShiftOpCs ( const ShiftOpCs shift)

◆ ~ShiftOpCs()

ShiftOpCs::~ShiftOpCs ( )
virtual

Member Function Documentation

◆ _evalDirect()

void ShiftOpCs::_evalDirect ( const VectorDouble x,
VectorDouble y 
) const
overridevirtual

Perform the operation: y = S * x

Parameters
[in]xInput vector
[in]yOutput vector
Remarks
'S' is a member that stands as a sparse matrix

Implements ALinearOp.

◆ create()

ShiftOpCs * ShiftOpCs::create ( const AMesh amesh,
Model model,
const Db dbout = nullptr,
int  igrf = 0,
int  icov = 0,
const CGParam  params = CGParam(),
bool  verbose = false 
)
static

◆ createFromSparse()

ShiftOpCs * ShiftOpCs::createFromSparse ( const MatrixSparse S,
const VectorDouble TildeC,
const VectorDouble Lambda,
Model model,
const CGParam  params = CGParam(),
bool  verbose = false 
)
static

◆ getLambda()

double ShiftOpCs::getLambda ( int  iapex) const
inline

◆ getLambdaGrad()

double ShiftOpCs::getLambdaGrad ( int  idim,
int  iapex 
) const
inline

◆ getLambdaGrads()

const VectorDouble& ShiftOpCs::getLambdaGrads ( int  idim) const
inline

◆ getLambdaGradSize()

int ShiftOpCs::getLambdaGradSize ( ) const

◆ getLambdas()

const VectorDouble& ShiftOpCs::getLambdas ( ) const
inline

◆ getMaxEigenValue()

double ShiftOpCs::getMaxEigenValue ( ) const

◆ getNDim()

int ShiftOpCs::getNDim ( ) const
inline

◆ getNModelGradParam()

int ShiftOpCs::getNModelGradParam ( ) const
inline

◆ getS()

MatrixSparse* ShiftOpCs::getS ( ) const
inline

◆ getSGrad()

MatrixSparse * ShiftOpCs::getSGrad ( int  iapex,
int  igparam 
) const

◆ getSGradAddress()

int ShiftOpCs::getSGradAddress ( int  iapex,
int  igparam 
) const

Returns the internal address for a given vertex and a given parameter It returns -1 if the address is ivalid

Parameters
iapexRank of the target apex
igparamRank of the target parameter
Returns

◆ getSize()

int ShiftOpCs::getSize ( ) const
inlineoverridevirtual

Implements ALinearOp.

◆ getTildeC()

const VectorDouble& ShiftOpCs::getTildeC ( ) const
inline

◆ getTildeCGrad()

MatrixSparse * ShiftOpCs::getTildeCGrad ( int  iapex,
int  igparam 
) const

◆ initFromCS()

int ShiftOpCs::initFromCS ( const MatrixSparse S,
const VectorDouble TildeC,
const VectorDouble Lambda,
Model model,
bool  verbose = false 
)
Parameters
SSparse matrix describing the S information
TildeCDiagonal array containing TildeC
LambdaNormalization vector
modelPointer to the Model structure
verboseVerbose flag
Returns

◆ initFromMesh()

int ShiftOpCs::initFromMesh ( const AMesh amesh,
Model model,
const Db dbout = nullptr,
int  igrf = 0,
int  icov = 0,
bool  flagAdvection = false,
bool  verbose = false 
)
Parameters
ameshMeshing description (New format)
modelPointer to the Model structure
dboutPointer to the Db structure
igrfRank of the GRF
icovRank of the Covariance within the Model
flagAdvectionWhen TRUE, S is replaced by G
verboseVerbose flag
Returns
Error return code

◆ initGradFromMesh()

int ShiftOpCs::initGradFromMesh ( const AMesh amesh,
Model model,
int  igrf = 0,
int  icov = 0,
bool  verbose = false,
double  tol = EPSILON10 
)

Initialize the environment for calculation of derivatives of S

Parameters
ameshMeshing description (New format)
modelPointer to the Model structure
igrfRank of the GRF
icovRank of the Covariance within the Model
verboseVerbose flag
tolSmallest value below which the value is not stored in sparse matrix
Returns
Error return code

◆ operator=()

ShiftOpCs & ShiftOpCs::operator= ( const ShiftOpCs shift)

◆ prodLambda()

void ShiftOpCs::prodLambda ( const VectorDouble x,
VectorDouble y,
const EPowerPT &  power 
) const

◆ prodLambdaOnSqrtTildeC()

void ShiftOpCs::prodLambdaOnSqrtTildeC ( const VectorDouble inv,
VectorDouble outv,
double  puis = 2 
) const

◆ prodTildeC()

void ShiftOpCs::prodTildeC ( const VectorDouble x,
VectorDouble y,
const EPowerPT &  power 
) const

Perform the operation: y = x * C^power

Parameters
[in]xInput vector
[in]yOutput vector
[in]powerValue of the exponent
Remarks
'C' is a member (_TildeC) that stands as a vector
Specific coding has been realized for the cases
where 'power' is equal to 1, -1, 0.5 and -0.5

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