Chaste  Release::2017.1
PetscTools.hpp File Reference
#include <string>
#include <vector>
#include <cstdlib>
#include <petsc.h>
#include <petscvec.h>
#include <petscmat.h>
#include <petscsys.h>
+ Include dependency graph for PetscTools.hpp:

Go to the source code of this file.

Classes

class  PetscTools
 

Macros

#define EXIT_IF_PARALLEL   if(PetscTools::IsParallel()){TS_TRACE("This test does not pass in parallel yet.");return;}
 
#define EXIT_IF_SEQUENTIAL   if(PetscTools::IsSequential()){TS_TRACE("This test is not meant to be executed in sequential.");return;}
 
#define PETSC_DESTROY_PARAM(x)   x
 
#define TRY_IF_MASTER(method)
 

Typedefs

typedef PetscTruth PetscBool
 

Detailed Description

Contains the PetscTools class.

Definition in file PetscTools.hpp.

Macro Definition Documentation

#define EXIT_IF_PARALLEL   if(PetscTools::IsParallel()){TS_TRACE("This test does not pass in parallel yet.");return;}

For use in tests that do not work when run in parallel.

Definition at line 54 of file PetscTools.hpp.

#define EXIT_IF_SEQUENTIAL   if(PetscTools::IsSequential()){TS_TRACE("This test is not meant to be executed in sequential.");return;}

For use in tests that should ONLY be run in parallel.

Definition at line 56 of file PetscTools.hpp.

#define TRY_IF_MASTER (   method)
Value:
{ \
{ try { \
method; \
} catch (Exception& e) { \
throw(e); \
} } \
}
static bool AmMaster()
Definition: PetscTools.cpp:120
static void ReplicateException(bool flag)
Definition: PetscTools.cpp:198

A macro to allow code to be attempted by just the master process, but to replicate any exceptions that occur to other processes. Useful for file access.

Note
MUST be called collectively, as it contains a barrier.
Parameters
methoda command or block of code to run if master process

Definition at line 91 of file PetscTools.hpp.

Referenced by CardiacSimulation::CreateAndRun(), CardiacSimulation::CreateResumeXmlFile(), and AbstractCardiacTissue< SPACE_DIM >::save().

Typedef Documentation

typedef PetscTruth PetscBool

Older versions of PETSc used PetscTruth in place of PetscBool, so we define an alias for those installations.

Definition at line 62 of file PetscTools.hpp.