Go to the documentation of this file.
44 #include "createTime.H"
45 #include "createMesh.H"
47 Info <<
"runDAUtilityTest1" << endl;
53 IOdictionary ofOptionsIO(
56 mesh.time().constant(),
61 if (ofOptions != ofOptionsIO.subDict(
"ofOptions"))
63 Info <<
"********* pyDict2OFDict test failed! **********" << endl;
64 Info <<
"ofOptions" << ofOptions << endl;
65 Info <<
"ofOptionsIO" << ofOptionsIO.subDict(
"ofOptions") << endl;
70 MatCreate(PETSC_COMM_WORLD, &tmpMat);
77 MatSetFromOptions(tmpMat);
79 MatZeroEntries(tmpMat);
80 PetscScalar val = Pstream::myProcNo() * Pstream::myProcNo();
81 MatSetValue(tmpMat, Pstream::myProcNo(), Pstream::myProcNo(), val, INSERT_VALUES);
82 MatAssemblyBegin(tmpMat, MAT_FINAL_ASSEMBLY);
83 MatAssemblyEnd(tmpMat, MAT_FINAL_ASSEMBLY);
89 MatCreate(PETSC_COMM_WORLD, &tmpMat1);
93 MatEqual(tmpMat, tmpMat1, &equalFlag);
96 Info <<
"********* read/writeMatrixBinary test failed! **********" << endl;
101 VecCreate(PETSC_COMM_WORLD, &tmpVec);
102 VecSetSizes(tmpVec, 17, PETSC_DETERMINE);
103 VecSetFromOptions(tmpVec);
110 VecCreate(PETSC_COMM_WORLD, &tmpVec1);
113 VecEqual(tmpVec, tmpVec1, &equalFlag);
116 Info <<
"********* read/writeVectorBinary test failed! **********" << endl;
119 Info <<
"runDAUtilityTest1 Passed!" << endl;
static void readMatrixBinary(Mat matIn, const word prefix)
read petsc matrix in binary format
static pyJacVecProdInterface pyCalcBetaJacVecProdInterface
static void readVectorBinary(Vec vecIn, const word prefix)
read petsc vector in binary format
static void * pyCalcBeta
define a function pointer template for Python call back
static pyComputeInterface pyCalcBetaInterface
void runDAUtilityTest1(char *argsAll, PyObject *pyOptions)
run the test
void(* pySetCharInterface)(const char *, void *)
static void * pyCalcBetaJacVecProd
static pySetCharInterface pySetModelNameInterface
virtual ~UnitTests()
Destructor.
static scalar angleOfAttackRadForwardAD
angle of attack in radian used in forward mode AD
UnitTests()
Construct from components.
static void pyDict2OFDict(PyObject *pyDict, dictionary &ofDict)
convert a python dictionary object to OpenFoam dictionary
static void * pySetModelName
static void writeVectorBinary(const Vec vecIn, const word prefix)
write petsc vector in binary format
void(* pyJacVecProdInterface)(const double *, double *, int, const double *, const double *, int, void *)
static void writeMatrixBinary(const Mat matIn, const word prefix)
write petsc matrix in binary format
static void writeVectorASCII(const Vec vecIn, const word prefix)
write petsc vector in ascii format
static void writeMatrixASCII(const Mat matIn, const word prefix)
write petsc matrix in ascii format
void(* pyComputeInterface)(const double *, int, double *, int, void *)