#include <ArchiveLocationInfo.hpp>
Static Public Member Functions | |
static void | SetMeshPathname (const FileFinder &rDirectory, const std::string &rFilename) |
static void | SetMeshPathname (const std::string &rDirectory, const std::string &rFilename) |
static void | SetMeshFilename (const std::string &rFilename) |
static std::string | GetMeshFilename () |
static std::string | GetArchiveDirectory () |
static std::string | GetProcessUniqueFilePath (const std::string &rFileName, unsigned procId=PetscTools::GetMyRank()) |
static void | SetArchiveDirectory (const FileFinder &rDirectory) |
static std::string | GetArchiveRelativePath () |
static bool | GetIsDirRelativeToChasteTestOutput () |
Static Private Attributes | |
static std::string | mDirAbsPath = "" |
static std::string | mMeshFilename = "mesh" |
This functionality is used by the meshes, LinearSystem and HeartConfig.
For the benefit of the meshes (and the cell_based code), there are also shortcut methods SetMeshPathname and GetMeshFilename, allowing you to specify the base file name for the mesh. This is needed because the cell_based code adds timestamp information to the file name.
Definition at line 50 of file ArchiveLocationInfo.hpp.
void ArchiveLocationInfo::SetMeshPathname | ( | const FileFinder & | rDirectory, | |
const std::string & | rFilename | |||
) | [static] |
Set the location to write mesh files.
rDirectory | the directory to write to. | |
rFilename | the base name (minus extension) for the mesh files. |
Definition at line 40 of file ArchiveLocationInfo.cpp.
References mMeshFilename, and SetArchiveDirectory().
Referenced by CryptSimulationArchiver< DIM, SIM >::Load(), and CellBasedSimulationArchiver< DIM, SIM >::Load().
void ArchiveLocationInfo::SetMeshPathname | ( | const std::string & | rDirectory, | |
const std::string & | rFilename | |||
) | [static] |
Set the location to write mesh files.
rDirectory | the directory to write to (if relative, assumes relative to CHASTE_TEST_OUTPUT). | |
rFilename | the base name (minus extension) for the mesh files. |
Definition at line 46 of file ArchiveLocationInfo.cpp.
References RelativeTo::Absolute, RelativeTo::ChasteTestOutput, FileFinder::IsAbsolutePath(), mMeshFilename, and SetArchiveDirectory().
void ArchiveLocationInfo::SetMeshFilename | ( | const std::string & | rFilename | ) | [static] |
Set the filename for mesh files.
rFilename | the base name (minus extension) for the mesh files, used to put on a timestamp. |
Definition at line 63 of file ArchiveLocationInfo.cpp.
References mMeshFilename.
Referenced by CryptSimulationArchiver< DIM, SIM >::Save(), and CellBasedSimulationArchiver< DIM, SIM >::Save().
std::string ArchiveLocationInfo::GetMeshFilename | ( | ) | [static] |
Get the filename that the mesh should be written to
Definition at line 68 of file ArchiveLocationInfo.cpp.
References EXCEPTION, and mMeshFilename.
Referenced by AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM >::AbstractCardiacTissue(), VertexMesh< DIM, DIM >::load(), AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM >::load(), VertexMesh< DIM, DIM >::save(), AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM >::save(), and AbstractCardiacTissue< SPACE_DIM >::save().
std::string ArchiveLocationInfo::GetArchiveDirectory | ( | ) | [static] |
Get the directory that archives are being written to. Will always end in a '/'.
Definition at line 77 of file ArchiveLocationInfo.cpp.
References EXCEPTION, and mDirAbsPath.
Referenced by AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM >::AbstractCardiacTissue(), ArchiveOpener< Archive, Stream >::ArchiveOpener(), GetProcessUniqueFilePath(), VertexMesh< DIM, DIM >::load(), AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM >::load(), HeartConfig::load(), AbstractCardiacProblem< ELEMENT_DIM, ELEMENT_DIM, 1 >::load(), AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM >::save(), AbstractCardiacProblem< ELEMENT_DIM, ELEMENT_DIM, 1 >::save(), and HeartConfig::Write().
std::string ArchiveLocationInfo::GetProcessUniqueFilePath | ( | const std::string & | rFileName, | |
unsigned | procId = PetscTools::GetMyRank() | |||
) | [static] |
Get the full path to an output file which has a name unique to the current process. Useful for ensuring that each process writes to / reads from a separate file when running in parallel.
The path will have the form "path_to_output_dir/rFileName.process_rank"
rFileName | the base file name | |
procId | the process id number (defaults to current process) |
Definition at line 86 of file ArchiveLocationInfo.cpp.
References GetArchiveDirectory().
Referenced by ArchiveOpener< Archive, Stream >::ArchiveOpener(), and CardiacSimulationArchiver< PROBLEM_CLASS >::Migrate().
void ArchiveLocationInfo::SetArchiveDirectory | ( | const FileFinder & | rDirectory | ) | [static] |
Set the directory that archives are being written to.
rDirectory | the directory in question. |
Definition at line 95 of file ArchiveLocationInfo.cpp.
References FileFinder::GetAbsolutePath(), and mDirAbsPath.
Referenced by ArchiveOpener< Archive, Stream >::ArchiveOpener(), OutputFileHandler::SetArchiveDirectory(), and SetMeshPathname().
std::string ArchiveLocationInfo::GetArchiveRelativePath | ( | ) | [static] |
Get the directory to which the archives are being written. Remove CHASTE_TEST_OUTPUT prefix (assuming it exists); if it doesn't, returns the absolute path. Will always end in a '/'.
Definition at line 104 of file ArchiveLocationInfo.cpp.
References OutputFileHandler::GetChasteTestOutputDirectory(), and mDirAbsPath.
Referenced by ArchiveOpener< Archive, Stream >::ArchiveOpener(), AbstractCardiacProblem< ELEMENT_DIM, ELEMENT_DIM, 1 >::load(), VertexMesh< DIM, DIM >::save(), AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM >::save(), AbstractCardiacTissue< SPACE_DIM >::save(), and AbstractCardiacProblem< ELEMENT_DIM, ELEMENT_DIM, 1 >::save().
bool ArchiveLocationInfo::GetIsDirRelativeToChasteTestOutput | ( | ) | [static] |
Get whether the directory provided is relative to CHASTE_TEST_OUTPUT.
Definition at line 119 of file ArchiveLocationInfo.cpp.
References OutputFileHandler::GetChasteTestOutputDirectory(), and mDirAbsPath.
Referenced by ArchiveOpener< Archive, Stream >::ArchiveOpener().
std::string ArchiveLocationInfo::mDirAbsPath = "" [static, private] |
Absolute path for directory that archives are being written to.
Definition at line 55 of file ArchiveLocationInfo.hpp.
Referenced by GetArchiveDirectory(), GetArchiveRelativePath(), GetIsDirRelativeToChasteTestOutput(), and SetArchiveDirectory().
std::string ArchiveLocationInfo::mMeshFilename = "mesh" [static, private] |
Mesh filename (relative to mDirAbsPath).
Definition at line 58 of file ArchiveLocationInfo.hpp.
Referenced by GetMeshFilename(), SetMeshFilename(), and SetMeshPathname().