Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
DAUtility Class Reference

Public Member Functions

 DAUtility ()
 Constructors. More...
 
virtual ~DAUtility ()
 Destructor. More...
 

Static Public Member Functions

static void pyDict2OFDict (PyObject *pyDict, dictionary &ofDict)
 convert a python dictionary object to OpenFoam dictionary More...
 
template<class classType >
static label listDeleteVal (List< classType > &listIn, const classType valDel)
 delete a value in the list More...
 
static void writeMatrixBinary (const Mat matIn, const word prefix)
 write petsc matrix in binary format More...
 
static void writeMatrixASCII (const Mat matIn, const word prefix)
 write petsc matrix in ascii format More...
 
static void readMatrixBinary (Mat matIn, const word prefix)
 read petsc matrix in binary format More...
 
static void writeVectorASCII (const Vec vecIn, const word prefix)
 write petsc vector in ascii format More...
 
static void readVectorBinary (Vec vecIn, const word prefix)
 read petsc vector in binary format More...
 
static void writeVectorBinary (const Vec vecIn, const word prefix)
 write petsc vector in binary format More...
 
static void boundVar (const dictionary &allOptions, volScalarField &var, const label printToScreen)
 bound a volScalar variable based on parametes defined in DAOption::allOptions_ More...
 
static void boundVar (const dictionary &allOptions, volVectorField &var, const label printToScreen)
 bound a volVector variable based on parametes defined in DAOption::allOptions_ More...
 
static label isValueCloseToRef (const scalar val, const scalar refVal, const scalar tol=1.0e-6)
 check whether a value is close to a reference value by a tolerance More...
 
static globalIndex genGlobalIndex (const label localIndexSize)
 generate global index numbering for local-global index transferring More...
 
static void primalResidualControl (const SolverPerformance< scalar > &solverP, const label printToScreen, const word varName, scalar &primalMaxRes)
 control when to print the residual and also compute the maxInitRes More...
 
static void primalResidualControl (const SolverPerformance< vector > &solverP, const label printToScreen, const word varName, scalar &primalMaxRes)
 control when to print the residual and also compute the maxInitRes More...
 
static label myFindCell (const primitiveMesh &mesh, const point &point)
 
static label isFieldReadable (const fvMesh &mesh, const word fieldName, const word fieldType)
 
template<class classType >
static void swapLists (List< classType > &a, List< classType > &b)
 swap two lists More...
 

Static Public Attributes

static scalar angleOfAttackRadForwardAD = -9999.0
 angle of attack in radian used in forward mode AD More...
 
static void * pyCalcBeta = NULL
 define a function pointer template for Python call back More...
 
static pyComputeInterface pyCalcBetaInterface = NULL
 
static void * pyCalcBetaJacVecProd = NULL
 
static pyJacVecProdInterface pyCalcBetaJacVecProdInterface = NULL
 
static void * pySetModelName = NULL
 
static pySetCharInterface pySetModelNameInterface = NULL
 

Detailed Description

Definition at line 34 of file DAUtility.H.

Constructor & Destructor Documentation

◆ DAUtility()

DAUtility ( )

Constructors.

Definition at line 16 of file DAUtility.C.

◆ ~DAUtility()

~DAUtility ( )
virtual

Destructor.

Definition at line 20 of file DAUtility.C.

Member Function Documentation

◆ pyDict2OFDict()

void pyDict2OFDict ( PyObject *  pyDict,
dictionary &  ofDict 
)
static

convert a python dictionary object to OpenFoam dictionary

Definition at line 24 of file DAUtility.C.

References k.

Referenced by DAOption::DAOption(), DASolver::New(), UnitTests::runDAUtilityTest1(), and DAOption::updateDAOption().

Here is the caller graph for this function:

◆ listDeleteVal()

label listDeleteVal ( List< classType > &  listIn,
const classType  valDel 
)
static

delete a value in the list

Definition at line 155 of file DAUtility.H.

References forAll().

Here is the call graph for this function:

◆ writeMatrixBinary()

void writeMatrixBinary ( const Mat  matIn,
const word  prefix 
)
static

write petsc matrix in binary format

Definition at line 411 of file DAUtility.C.

Referenced by DASolver::calcdRdWT(), DAJacCon::initializeStateBoundaryCon(), UnitTests::runDAUtilityTest1(), DAJacCon::setupdRdWCon(), and DASolver::writeMatrixBinary().

Here is the caller graph for this function:

◆ writeMatrixASCII()

void writeMatrixASCII ( const Mat  matIn,
const word  prefix 
)
static

write petsc matrix in ascii format

Definition at line 443 of file DAUtility.C.

Referenced by UnitTests::runDAUtilityTest1(), and DASolver::writeMatrixASCII().

Here is the caller graph for this function:

◆ readMatrixBinary()

void readMatrixBinary ( Mat  matIn,
const word  prefix 
)
static

read petsc matrix in binary format

Definition at line 378 of file DAUtility.C.

Referenced by DASolver::readMatrixBinary(), and UnitTests::runDAUtilityTest1().

Here is the caller graph for this function:

◆ writeVectorASCII()

void writeVectorASCII ( const Vec  vecIn,
const word  prefix 
)
static

write petsc vector in ascii format

Definition at line 347 of file DAUtility.C.

Referenced by DAJacCon::checkSpecialBCs(), UnitTests::runDAUtilityTest1(), DAJacCon::setupdRdWCon(), and DASolver::writeVectorASCII().

Here is the caller graph for this function:

◆ readVectorBinary()

void readVectorBinary ( Vec  vecIn,
const word  prefix 
)
static

read petsc vector in binary format

Definition at line 282 of file DAUtility.C.

Referenced by DAJacCon::readJacConColoring(), DASolver::readVectorBinary(), and UnitTests::runDAUtilityTest1().

Here is the caller graph for this function:

◆ writeVectorBinary()

void writeVectorBinary ( const Vec  vecIn,
const word  prefix 
)
static

write petsc vector in binary format

Definition at line 315 of file DAUtility.C.

Referenced by DAJacCon::calcJacConColoring(), UnitTests::runDAUtilityTest1(), and DASolver::writeVectorBinary().

Here is the caller graph for this function:

◆ boundVar() [1/2]

void boundVar ( const dictionary &  allOptions,
volScalarField &  var,
const label  printToScreen 
)
static

bound a volScalar variable based on parametes defined in DAOption::allOptions_

Definition at line 475 of file DAUtility.C.

References allOptions, and forAll().

Referenced by DASpalartAllmaras::calcResiduals(), DAkOmega::calcResiduals(), DAkEpsilon::calcResiduals(), DASpalartAllmarasFv3::calcResiduals(), DAkOmegaSST::calcResiduals(), and DAkOmegaSSTLM::calcResiduals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ boundVar() [2/2]

void boundVar ( const dictionary &  allOptions,
volVectorField &  var,
const label  printToScreen 
)
static

bound a volVector variable based on parametes defined in DAOption::allOptions_

Definition at line 562 of file DAUtility.C.

References allOptions, and forAll().

Here is the call graph for this function:

◆ isValueCloseToRef()

label isValueCloseToRef ( const scalar  val,
const scalar  refVal,
const scalar  tol = 1.0e-6 
)
static

check whether a value is close to a reference value by a tolerance

Definition at line 707 of file DAUtility.C.

Referenced by DAJacCon::addPhi4PIV(), DAJacCon::allocateJacobianConnections(), DAJacCon::calcColoredColumns(), DAColoring::parallelD2Coloring(), DAJacCon::setupStateBoundaryConID(), and DAColoring::validateColoring().

Here is the caller graph for this function:

◆ genGlobalIndex()

globalIndex genGlobalIndex ( const label  localIndexSize)
static

generate global index numbering for local-global index transferring

Definition at line 655 of file DAUtility.C.

◆ primalResidualControl() [1/2]

void primalResidualControl ( const SolverPerformance< scalar > &  solverP,
const label  printToScreen,
const word  varName,
scalar &  primalMaxRes 
)
static

◆ primalResidualControl() [2/2]

void primalResidualControl ( const SolverPerformance< vector > &  solverP,
const label  printToScreen,
const word  varName,
scalar &  primalMaxRes 
)
static

control when to print the residual and also compute the maxInitRes

Definition at line 762 of file DAUtility.C.

◆ myFindCell()

label myFindCell ( const primitiveMesh &  mesh,
const point &  point 
)
static

Definition at line 803 of file DAUtility.C.

References mesh.

Referenced by DAFunctionLocation::DAFunctionLocation(), DAFunctionVariance::DAFunctionVariance(), and DAFvSourceHeatSource::DAFvSourceHeatSource().

Here is the caller graph for this function:

◆ isFieldReadable()

label isFieldReadable ( const fvMesh &  mesh,
const word  fieldName,
const word  fieldType 
)
static

◆ swapLists()

void swapLists ( List< classType > &  a,
List< classType > &  b 
)
static

swap two lists

Definition at line 204 of file DAUtility.H.

Referenced by DAPimpleFoam::solveAdjointFP().

Here is the caller graph for this function:

Member Data Documentation

◆ angleOfAttackRadForwardAD

scalar angleOfAttackRadForwardAD = -9999.0
static

angle of attack in radian used in forward mode AD

Definition at line 114 of file DAUtility.H.

◆ pyCalcBeta

void * pyCalcBeta = NULL
static

define a function pointer template for Python call back

Definition at line 117 of file DAUtility.H.

Referenced by DARegression::compute(), and DASolver::initTensorFlowFuncs().

◆ pyCalcBetaInterface

pyComputeInterface pyCalcBetaInterface = NULL
static

Definition at line 118 of file DAUtility.H.

Referenced by DARegression::compute(), and DASolver::initTensorFlowFuncs().

◆ pyCalcBetaJacVecProd

void * pyCalcBetaJacVecProd = NULL
static

Definition at line 120 of file DAUtility.H.

Referenced by DASolver::initTensorFlowFuncs().

◆ pyCalcBetaJacVecProdInterface

pyJacVecProdInterface pyCalcBetaJacVecProdInterface = NULL
static

Definition at line 121 of file DAUtility.H.

Referenced by DASolver::initTensorFlowFuncs().

◆ pySetModelName

void * pySetModelName = NULL
static

Definition at line 123 of file DAUtility.H.

Referenced by DARegression::compute(), and DASolver::initTensorFlowFuncs().

◆ pySetModelNameInterface

pySetCharInterface pySetModelNameInterface = NULL
static

Definition at line 124 of file DAUtility.H.

Referenced by DARegression::compute(), and DASolver::initTensorFlowFuncs().


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