1.1.0
CCC
 
ShiftOpCs Class Reference

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

#include <ShiftOpCs.hpp>

Inheritance diagram for ShiftOpCs:
ALinearOp

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)
 

Detailed Description

Shift Operator for performing the basic tasks of SPDE.

Constructor & Destructor Documentation

ShiftOpCs::ShiftOpCs ( const CGParam  params = CGParam())
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::ShiftOpCs ( const MatrixSparse S,
const VectorDouble TildeC,
const VectorDouble Lambda,
Model model,
const CGParam  params = CGParam(),
bool  verbose = false 
)
ShiftOpCs::ShiftOpCs ( const ShiftOpCs shift)
ShiftOpCs::~ShiftOpCs ( )
virtual

Member Function Documentation

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.

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
ShiftOpCs * ShiftOpCs::createFromSparse ( const MatrixSparse S,
const VectorDouble TildeC,
const VectorDouble Lambda,
Model model,
const CGParam  params = CGParam(),
bool  verbose = false 
)
static
double ShiftOpCs::getLambda ( int  iapex) const
inline
double ShiftOpCs::getLambdaGrad ( int  idim,
int  iapex 
) const
inline
const VectorDouble& ShiftOpCs::getLambdaGrads ( int  idim) const
inline
int ShiftOpCs::getLambdaGradSize ( ) const
const VectorDouble& ShiftOpCs::getLambdas ( ) const
inline
double ShiftOpCs::getMaxEigenValue ( ) const
int ShiftOpCs::getNDim ( ) const
inline
int ShiftOpCs::getNModelGradParam ( ) const
inline
MatrixSparse* ShiftOpCs::getS ( ) const
inline
MatrixSparse * ShiftOpCs::getSGrad ( int  iapex,
int  igparam 
) const
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
int ShiftOpCs::getSize ( ) const
inlineoverridevirtual

Implements ALinearOp.

const VectorDouble& ShiftOpCs::getTildeC ( ) const
inline
MatrixSparse * ShiftOpCs::getTildeCGrad ( int  iapex,
int  igparam 
) const
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
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
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
ShiftOpCs & ShiftOpCs::operator= ( const ShiftOpCs shift)
void ShiftOpCs::prodLambda ( const VectorDouble x,
VectorDouble y,
const EPowerPT &  power 
) const
void ShiftOpCs::prodLambdaOnSqrtTildeC ( const VectorDouble inv,
VectorDouble outv,
double  puis = 2 
) const
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: