#include <PetscTools.hpp>
Static Public Member Functions | |
static void | ResetCache () |
static bool | IsSequential () |
static bool | IsParallel () |
static unsigned | GetNumProcs () |
static unsigned | GetMyRank () |
static bool | AmMaster () |
static bool | AmTopMost () |
static void | Barrier (const std::string callerId="") |
static Vec | CreateVec (int size, int localSize=PETSC_DECIDE, bool ignoreOffProcEntries=true) |
static Vec | CreateVec (std::vector< double > data) |
static Vec | CreateAndSetVec (int size, double value) |
static void | SetupMat (Mat &rMat, int numRows, int numColumns, unsigned rowPreallocation, int numLocalRows=PETSC_DECIDE, int numLocalColumns=PETSC_DECIDE, bool ignoreOffProcEntries=true) |
static bool | ReplicateBool (bool flag) |
static void | ReplicateException (bool flag) |
static void | DumpPetscObject (const Mat &rMat, const std::string &rOutputFileFullPath) |
static void | DumpPetscObject (const Vec &rVec, const std::string &rOutputFileFullPath) |
static void | ReadPetscObject (Mat &rMat, const std::string &rOutputFileFullPath, Vec rParallelLayout=NULL) |
static void | ReadPetscObject (Vec &rVec, const std::string &rOutputFileFullPath, Vec rParallelLayout=NULL) |
static void | Terminate (const std::string &rMessage, const std::string &rFilename, unsigned lineNumber) |
Static Public Attributes | |
static const unsigned | MASTER_RANK = 0 |
Static Private Member Functions | |
static void | CheckCache () |
Static Private Attributes | |
static bool | mPetscIsInitialised = false |
static unsigned | mNumProcessors = 0 |
static unsigned | mRank = 0 |
Definition at line 65 of file PetscTools.hpp.
static void PetscTools::CheckCache | ( | ) | [inline, static, private] |
Private method makes sure that (if this is the first use within a test) then PETSc has been probed
Definition at line 83 of file PetscTools.hpp.
References mNumProcessors, and ResetCache().
Referenced by AmMaster(), AmTopMost(), Barrier(), GetMyRank(), GetNumProcs(), IsParallel(), and IsSequential().
void PetscTools::ResetCache | ( | ) | [static] |
Reset our cached values: whether PETSc is initialised, how many processors there are, and which one we are.
Definition at line 47 of file PetscTools.cpp.
References mNumProcessors, mPetscIsInitialised, and mRank.
Referenced by CheckCache().
bool PetscTools::IsSequential | ( | ) | [static] |
Just returns whether there is one process or not.
Definition at line 82 of file PetscTools.cpp.
References CheckCache(), and mNumProcessors.
Referenced by AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM >::AbstractCardiacTissue(), AbstractNonlinearElasticitySolver< COMPRESSIBILITY_TYPE, DIM >::AllocateMatrixMemory(), CylindricalHoneycombMeshGenerator::CylindricalHoneycombMeshGenerator(), DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::DistanceMapCalculator(), FormDebugHead(), HoneycombMeshGenerator::HoneycombMeshGenerator(), AbstractBidomainSolver< ELEMENT_DIM, SPACE_DIM >::InitialiseForSolve(), PCTwoLevelsBlockDiagonal::PCTwoLevelsBlockDiagonalCreate(), VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::SetParallelFiles(), SetupMat(), VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh(), and AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh().
bool PetscTools::IsParallel | ( | ) | [static] |
Just returns whether there is more than one process.
Definition at line 88 of file PetscTools.cpp.
References CheckCache(), and mNumProcessors.
Referenced by DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ComputeMeshPartitioning(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetDistributedVectorFactory(), GenericEventHandler< 13, HeartEventHandler >::Headings(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::MetisLibraryNodePartitioning(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ParMetisLibraryNodePartitioning(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::PetscMatrixPartitioning(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ReorderNodes(), GenericEventHandler< 13, HeartEventHandler >::Report(), and ExecutableSupport::ShowParallelLaunching().
unsigned PetscTools::GetNumProcs | ( | ) | [static] |
Returns total number of processors
Definition at line 94 of file PetscTools.cpp.
References CheckCache(), and mNumProcessors.
Referenced by VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddPointData(), AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM >::CalculateHaloNodesFromNodeExchange(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::CalculateNodeExchange(), DistributedVectorFactory::CalculateOwnership(), DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::ComputeDistanceMap(), DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::DistanceMapCalculator(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::MetisLibraryNodePartitioning(), CardiacSimulationArchiver< PROBLEM_CLASS >::Migrate(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ParMetisLibraryNodePartitioning(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::PetscMatrixPartitioning(), TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ReadNodesPerProcessorFile(), GenericEventHandler< 13, HeartEventHandler >::Report(), DistributedVectorFactory::rGetGlobalLows(), CardiacSimulationArchiver< PROBLEM_CLASS >::Save(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::SetDistributedVectorFactory(), ExecutableSupport::ShowParallelLaunching(), AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM >::SolveCellSystems(), DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::UpdateQueueFromRemote(), DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::WorkOnLocalQueue(), VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingParallelMesh(), PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteGenericFile(), and ExecutableSupport::WriteMachineInfoFile().
unsigned PetscTools::GetMyRank | ( | ) | [static] |
Return our rank.
If PETSc has not been initialized, returns 0.
Definition at line 100 of file PetscTools.cpp.
References CheckCache(), and mRank.
Referenced by VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddPointData(), ArchiveOpener< Archive, Stream >::ArchiveOpener(), NonlinearElasticitySolver< DIM >::AssembleSystem(), CompressibleNonlinearElasticitySolver< DIM >::AssembleSystem(), Barrier(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructCuboid(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader(), FormDebugHead(), AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM >::GetCardiacCellOrHaloCell(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetNodeOrHaloNode(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::MetisLibraryNodePartitioning(), CardiacSimulationArchiver< PROBLEM_CLASS >::Migrate(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ParMetisLibraryNodePartitioning(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::PetscMatrixPartitioning(), ExecutableSupport::PrintError(), TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ReadNodesPerProcessorFile(), GenericEventHandler< 13, HeartEventHandler >::Report(), ExecutableSupport::ShowParallelLaunching(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::SolveBoundaryElementMapping(), AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM >::SolveCellSystems(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::SolveElementMapping(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::SolveNodeMapping(), AbstractNonlinearElasticitySolver< COMPRESSIBILITY_TYPE, DIM >::TakeNewtonStep(), DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::UpdateQueueFromRemote(), VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingParallelMesh(), PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteGenericFile(), ExecutableSupport::WriteMachineInfoFile(), and ExecutableSupport::WriteProvenanceInfoFile().
bool PetscTools::AmMaster | ( | ) | [static] |
Just returns whether it is the master process or not.
If not running in parallel, always returns true.
Definition at line 106 of file PetscTools.cpp.
References CheckCache(), MASTER_RANK, and mRank.
Referenced by AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::AbstractHdf5Converter(), ParallelColumnDataWriter::AdvanceAlongUnlimitedDimension(), CellBasedSimulationWithPdes< DIM >::AfterSolve(), ArchiveOpener< Archive, Stream >::ArchiveOpener(), ParallelColumnDataWriter::Close(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ComputeMeshPartitioning(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructCuboid(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructLinearMesh(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructRectangularMesh(), AbstractConvergenceTester< CELL, CARDIAC_PROBLEM, DIM, PROBLEM_DIM >::Converge(), CellMLToSharedLibraryConverter::ConvertCellmlToSo(), OutputFileHandler::CopyFileTo(), HeartConfig::CopySchema(), CardiacSimulation::CreateAndRun(), OutputDirectoryFifoQueue::CreateNextDir(), CellMLToSharedLibraryConverter::CreateOptionsFile(), CardiacSimulation::CreateResumeXmlFile(), CylindricalHoneycombMeshGenerator::CylindricalHoneycombMeshGenerator(), ParallelColumnDataWriter::EndDefineMode(), StreeterFibreGenerator< SPACE_DIM >::GenerateOrthotropicFibreOrientation(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextElement(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextNode(), GenericEventHandler< 13, HeartEventHandler >::Headings(), HoneycombMeshGenerator::HoneycombMeshGenerator(), AbstractBidomainSolver< ELEMENT_DIM, SPACE_DIM >::InitialiseForSolve(), OutputFileHandler::MakeFoldersAndReturnFullPath(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::MetisLibraryNodePartitioning(), OutputFileHandler::OutputFileHandler(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::PetscMatrixPartitioning(), ExecutableSupport::Print(), ExecutableSupport::PrintError(), ProgressReporter::PrintFinalising(), ProgressReporter::PrintInitialising(), ProgressReporter::ProgressReporter(), Hdf5DataWriter::PutUnlimitedVariable(), ParallelColumnDataWriter::PutVariable(), ParallelColumnDataWriter::PutVector(), GenericEventHandler< 13, HeartEventHandler >::Report(), AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM >::save(), AbstractCardiacTissue< SPACE_DIM >::save(), HeartConfig::save(), CardiacSimulationArchiver< PROBLEM_CLASS >::Save(), CellBasedSimulationWithPdes< DIM >::SetupWritePdeSolution(), ExecutableSupport::ShowCopyright(), LinearSystem::Solve(), ProgressReporter::Update(), HeartConfig::Write(), Hdf5ToMeshalyzerConverter< ELEMENT_DIM, SPACE_DIM >::Write(), Hdf5ToCmguiConverter< ELEMENT_DIM, SPACE_DIM >::Write(), Hdf5ToCmguiConverter< ELEMENT_DIM, SPACE_DIM >::WriteCmguiScript(), VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMeshReader(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingParallelMesh(), PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteGenericFile(), MonodomainProblem< ELEMENT_DIM, SPACE_DIM >::WriteInfo(), BidomainProblem< DIM >::WriteInfo(), HeartGeometryInformation< SPACE_DIM >::WriteLayerForEachNode(), CellBasedSimulationWithPdes< DIM >::WritePdeSolution(), PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WritePseudoEcg(), OdeSolution::WriteToFile(), PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteVariablesOverTimeAtNodes(), LinearSystem::~LinearSystem(), and ProgressReporter::~ProgressReporter().
bool PetscTools::AmTopMost | ( | ) | [static] |
Just returns whether it is the right-most process or not.
If not running in parallel, always returns true.
Definition at line 112 of file PetscTools.cpp.
References CheckCache(), mNumProcessors, and mRank.
Referenced by DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::PetscMatrixPartitioning(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh(), and AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingParallelMesh().
void PetscTools::Barrier | ( | const std::string | callerId = "" |
) | [static] |
If MPI is set up, perform a barrier synchronisation. If not, it's a noop.
callerId | only used in debug mode; printed before & after the barrier call |
Definition at line 122 of file PetscTools.cpp.
References CheckCache(), GetMyRank(), and mPetscIsInitialised.
Referenced by ParallelColumnDataWriter::AdvanceAlongUnlimitedDimension(), GenericEventHandler< 13, HeartEventHandler >::BeginEvent(), ParallelColumnDataWriter::Close(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ComputeMeshPartitioning(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader(), OutputFileHandler::CopyFileTo(), OutputDirectoryFifoQueue::CreateNextDir(), CellMLToSharedLibraryConverter::CreateOptionsFile(), CylindricalHoneycombMeshGenerator::CylindricalHoneycombMeshGenerator(), GenericEventHandler< 13, HeartEventHandler >::EndEvent(), StreeterFibreGenerator< SPACE_DIM >::GenerateOrthotropicFibreOrientation(), Hdf5ToCmguiConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToCmguiConverter(), Hdf5ToMeshalyzerConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToMeshalyzerConverter(), GenericEventHandler< 13, HeartEventHandler >::Headings(), HoneycombMeshGenerator::HoneycombMeshGenerator(), OutputFileHandler::MakeFoldersAndReturnFullPath(), OutputFileHandler::OutputFileHandler(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::PetscMatrixPartitioning(), GenericEventHandler< 13, HeartEventHandler >::Report(), AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM >::save(), AbstractCardiacTissue< SPACE_DIM >::save(), HeartConfig::save(), CardiacSimulationArchiver< PROBLEM_CLASS >::Save(), ExecutableSupport::ShowParallelLaunching(), CardiacElectroMechanicsProblem< DIM >::Solve(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingParallelMesh(), PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteGenericFile(), and HeartGeometryInformation< SPACE_DIM >::WriteLayerForEachNode().
Vec PetscTools::CreateVec | ( | int | size, | |
int | localSize = PETSC_DECIDE , |
|||
bool | ignoreOffProcEntries = true | |||
) | [static] |
Create a vector of the specified size. SetFromOptions is called.
size | the size of the vector | |
localSize | the local number of items owned by this process | |
ignoreOffProcEntries | whether to ignore entries destined to be stored on a separate processor when assembling (eliminates global reductions). |
Definition at line 165 of file PetscTools.cpp.
Referenced by AbstractNonlinearAssemblerSolverHybrid< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputeJacobianNumerically(), PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputePseudoEcgAtOneTimeStep(), CreateAndSetVec(), CreateVec(), DistributedVectorFactory::CreateVec(), DistributedVectorFactory::DistributedVectorFactory(), LinearSystem::GetMatrixRowDistributed(), LinearSystem::LinearSystem(), PCBlockDiagonal::PCBlockDiagonalCreate(), PCLDUFactorisation::PCLDUFactorisationCreate(), PCTwoLevelsBlockDiagonal::PCTwoLevelsBlockDiagonalCreate(), Hdf5DataWriter::PutStripedVector(), Hdf5DataWriter::PutVector(), PetscVecTools::SetupInterleavedVectorScatterGather(), and VoltageInterpolaterOntoMechanicsMesh< DIM >::VoltageInterpolaterOntoMechanicsMesh().
Vec PetscTools::CreateVec | ( | std::vector< double > | data | ) | [static] |
Create a Vec from the given data.
data | some data |
Definition at line 185 of file PetscTools.cpp.
References CreateVec().
Vec PetscTools::CreateAndSetVec | ( | int | size, | |
double | value | |||
) | [static] |
Create a vector of the specified size with all values set to be the given constant. SetFromOptions is called.
size | the size of the vector | |
value | the value to set each entry |
Definition at line 205 of file PetscTools.cpp.
References CreateVec().
Referenced by AbstractNonlinearAssemblerSolverHybrid< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::VerifyJacobian().
void PetscTools::SetupMat | ( | Mat & | rMat, | |
int | numRows, | |||
int | numColumns, | |||
unsigned | rowPreallocation, | |||
int | numLocalRows = PETSC_DECIDE , |
|||
int | numLocalColumns = PETSC_DECIDE , |
|||
bool | ignoreOffProcEntries = true | |||
) | [static] |
Set up a matrix - set the size using the given parameters. The number of local rows and columns is by default PETSC_DECIDE. SetFromOptions is called.
rMat | the matrix | |
numRows | the number of rows in the matrix | |
numColumns | the number of columns in the matrix | |
rowPreallocation | the max number of nonzero entries expected on a row A value of 0 is allowed: no preallocation is then done and the user must preallocate the memory for the matrix themselves. | |
numLocalRows | the number of local rows (defaults to PETSC_DECIDE) | |
numLocalColumns | the number of local columns (defaults to PETSC_DECIDE) | |
ignoreOffProcEntries | tells PETSc to drop off-processor entries |
Definition at line 219 of file PetscTools.cpp.
References IsSequential().
Referenced by Hdf5DataWriter::ApplyPermutation(), Hdf5DataWriter::DefineFixedDimensionUsingMatrix(), OperatorSplittingMonodomainSolver< ELEMENT_DIM, SPACE_DIM >::InitialiseForSolve(), MatrixBasedMonodomainSolver< ELEMENT_DIM, SPACE_DIM >::InitialiseForSolve(), MatrixBasedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::InitialiseForSolve(), LinearSystem::LinearSystem(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::PetscMatrixPartitioning(), ReadPetscObject(), LinearSystem::SetPrecondMatrixIsDifferentFromLhs(), SimplePetscNonlinearSolver::Solve(), and AbstractNonlinearAssemblerSolverHybrid< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::VerifyJacobian().
bool PetscTools::ReplicateBool | ( | bool | flag | ) | [static] |
Boolean AND of a flags between processes
flag | is set to true on this process. |
Definition at line 139 of file PetscTools.cpp.
Referenced by BidomainProblem< DIM >::AnalyseMeshForBath(), DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::ComputeDistanceMap(), AbstractBoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::HasDirichletBoundaryConditions(), ReplicateException(), CardiacSimulationArchiver< PROBLEM_CLASS >::Save(), and DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::UpdateQueueFromRemote().
void PetscTools::ReplicateException | ( | bool | flag | ) | [static] |
Ensure exceptions are handled cleanly in parallel code, by causing all processes to throw if any one does.
flag | is set to true if this process has thrown. |
Definition at line 147 of file PetscTools.cpp.
References EXCEPTION, and ReplicateBool().
Referenced by AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM >::AbstractCardiacTissue(), AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Calculate(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::CalculateBoundingBox(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader(), CellMLToSharedLibraryConverter::ConvertCellmlToSo(), BidomainTissue< SPACE_DIM >::CreateExtracellularConductivityTensors(), AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM >::CreateIntracellularConductivityTensor(), ReplicatableVector::Resize(), AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM >::SetUpHaloCells(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve(), and AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM >::SolveCellSystems().
void PetscTools::DumpPetscObject | ( | const Mat & | rMat, | |
const std::string & | rOutputFileFullPath | |||
) | [static] |
Dumps a given Petsc object to disk.
rMat | a matrix | |
rOutputFileFullPath | where to dump the matrix to disk |
Definition at line 282 of file PetscTools.cpp.
void PetscTools::DumpPetscObject | ( | const Vec & | rVec, | |
const std::string & | rOutputFileFullPath | |||
) | [static] |
Dumps a given Petsc object to disk.
rVec | a vector | |
rOutputFileFullPath | where to dump the vector to disk |
Definition at line 297 of file PetscTools.cpp.
void PetscTools::ReadPetscObject | ( | Mat & | rMat, | |
const std::string & | rOutputFileFullPath, | |||
Vec | rParallelLayout = NULL | |||
) | [static] |
Read a previously dumped Petsc object from disk.
rMat | a matrix | |
rOutputFileFullPath | where to read the matrix from | |
rParallelLayout | If provided, rMat will have the same parallel layout. Its content is irrelevant. |
Definition at line 312 of file PetscTools.cpp.
References SetupMat().
void PetscTools::ReadPetscObject | ( | Vec & | rVec, | |
const std::string & | rOutputFileFullPath, | |||
Vec | rParallelLayout = NULL | |||
) | [static] |
Read a previously dumped Petsc object from disk.
rVec | a vector | |
rOutputFileFullPath | where to read the matrix from | |
rParallelLayout | If provided, rMat will have the same parallel layout. Its content is irrelevant. |
Definition at line 356 of file PetscTools.cpp.
void PetscTools::Terminate | ( | const std::string & | rMessage, | |
const std::string & | rFilename, | |||
unsigned | lineNumber | |||
) | [static] |
Level 4 error (Termination). Execution cannot continue from this point and hence should be terminated (even when running with NDEBUG).
rMessage | An error message to appear on the screen | |
rFilename | which source file produced the termination error | |
lineNumber | which line number of the source file produced the termination error |
Definition at line 381 of file PetscTools.cpp.
bool PetscTools::mPetscIsInitialised = false [static, private] |
Whether PETSc has been initialised.
Definition at line 69 of file PetscTools.hpp.
Referenced by Barrier(), and ResetCache().
unsigned PetscTools::mNumProcessors = 0 [static, private] |
The total number of processors.
Definition at line 72 of file PetscTools.hpp.
Referenced by AmTopMost(), CheckCache(), GetNumProcs(), IsParallel(), IsSequential(), and ResetCache().
unsigned PetscTools::mRank = 0 [static, private] |
Which processors we are.
Definition at line 80 of file PetscTools.hpp.
Referenced by AmMaster(), AmTopMost(), GetMyRank(), and ResetCache().
const unsigned PetscTools::MASTER_RANK = 0 [static] |
As a convention, we consider processor 0 the master process
Definition at line 96 of file PetscTools.hpp.
Referenced by AmMaster().