36 #ifndef PETSCTOOLS_HPP_
37 #define PETSCTOOLS_HPP_
53 #define EXIT_IF_PARALLEL if(PetscTools::IsParallel()){TS_TRACE("This test does not pass in parallel yet.");return;}
55 #define EXIT_IF_SEQUENTIAL if(PetscTools::IsSequential()){TS_TRACE("This test is not meant to be executed in sequential.");return;}
57 #if (PETSC_VERSION_MAJOR == 3 && PETSC_VERSION_MINOR < 2 || PETSC_VERSION_MAJOR<3 ) // Before PETSc 3.2
69 #define PETSC_DESTROY_PARAM(x) x
78 #define PETSC_DESTROY_PARAM(x) &x
90 #define TRY_IF_MASTER(method) { \
91 if (PetscTools::AmMaster()) \
94 } catch (Exception& e) { \
95 PetscTools::ReplicateException(true);\
98 PetscTools::ReplicateException(false); \
200 static void Barrier(
const std::string callerId=
"");
242 static Vec CreateVec(
int size,
int localSize=PETSC_DECIDE,
bool ignoreOffProcEntries =
true);
280 static void SetupMat(
Mat& rMat,
int numRows,
int numColumns,
281 unsigned rowPreallocation,
282 int numLocalRows=PETSC_DECIDE,
283 int numLocalColumns=PETSC_DECIDE,
284 bool ignoreOffProcEntries=
true,
285 bool newAllocationError=
true);
326 static void ReadPetscObject(
Mat& rMat,
const std::string& rOutputFileFullPath,
Vec rParallelLayout=NULL);
335 static void ReadPetscObject(
Vec& rVec,
const std::string& rOutputFileFullPath,
Vec rParallelLayout=NULL);
353 #if (PETSC_VERSION_MAJOR == 3 && PETSC_VERSION_MINOR >= 2) //PETSc 3.2 or later
369 #if (PETSC_VERSION_MAJOR == 3 && PETSC_VERSION_MINOR >= 2) //PETSc 3.2 or later