Chaste
Release::3.4
|
#include <CellMLLoader.hpp>
Public Member Functions | |
CellMLLoader (const FileFinder &rCellMLFile, const OutputFileHandler &rOutputFileHandler, const std::vector< std::string > &rOptions) | |
boost::shared_ptr < AbstractCardiacCell > | LoadCardiacCell (void) |
boost::shared_ptr < AbstractCvodeCell > | LoadCvodeCell (void) |
Private Member Functions | |
AbstractCardiacCellInterface * | LoadCellMLFile (bool makeCvodeCell) |
Private Attributes | |
FileFinder | mCellMLFile |
OutputFileHandler | mOutputFileHandler |
std::vector< std::string > | mOptions |
boost::shared_ptr < CellMLToSharedLibraryConverter > | mpConverter |
boost::logic::tribool | mUseCvode |
A helper class which will dynamically load a CellML file and provide a method to get a pointer to a new AbstractCardiacCell (or AbstractCvodeCell if CVODE is enabled).
Note that you cannot call both LoadCardiacCell and LoadCvodeCell on the same object, since there would be filename conflicts trying to create different classes in the same output folder. Create a second loader with a different rOutputFileHandler parameter if you need both kinds of cell.
Definition at line 58 of file CellMLLoader.hpp.
CellMLLoader::CellMLLoader | ( | const FileFinder & | rCellMLFile, |
const OutputFileHandler & | rOutputFileHandler, | ||
const std::vector< std::string > & | rOptions | ||
) |
Create a new loader for a CellML model.
rCellMLFile | the location of a CellML file to load on the fly |
rOutputFileHandler | where to put the generated files |
rOptions | any options to be passed to PyCML e.g. "--expose-annotated-variables" |
Definition at line 41 of file CellMLLoader.cpp.
boost::shared_ptr< AbstractCardiacCell > CellMLLoader::LoadCardiacCell | ( | void | ) |
Make an AbstractCardiacCell, which will be solved with a (Forward)Euler solver, and uses the default stimulus from the CellML file (if present).
Definition at line 108 of file CellMLLoader.cpp.
References LoadCellMLFile().
|
private |
A method to make a new cell model which is then cast in the public methods to the relevant type. It copies the CellML file to the mOutputFileHandler location, writes an options file, converts to .hpp and .cpp, makes a shared library, and loads the cell.
Note that on any subsequent calls, the shared library will already exist, and so the conversion will not be performed, making the method much faster.
makeCvodeCell | whether this cell should be an AbstractCvodeCell (false = AbstractCardiacCell) |
Definition at line 50 of file CellMLLoader.cpp.
References OutputFileHandler::CopyFileTo(), EXCEPTION, FileFinder::Exists(), OutputFileHandler::FindFile(), FileFinder::GetLeafName(), FileFinder::GetLeafNameNoExtension(), AbstractCardiacCellInterface::HasCellMLDefaultStimulus(), mCellMLFile, mOptions, mOutputFileHandler, mpConverter, mUseCvode, and AbstractCardiacCellInterface::UseCellMLDefaultStimulus().
Referenced by LoadCardiacCell(), and LoadCvodeCell().
boost::shared_ptr< AbstractCvodeCell > CellMLLoader::LoadCvodeCell | ( | void | ) |
Make an AbstractCvodeCell, using the default stimulus from the CellML file (if present).
Definition at line 116 of file CellMLLoader.cpp.
References LoadCellMLFile().
|
private |
The location of the CellML file to convert
Definition at line 89 of file CellMLLoader.hpp.
Referenced by LoadCellMLFile().
|
private |
A vector of options to be passed to the CellML converter (PyCML) e.g. "--expose-annotated-variables"
Definition at line 95 of file CellMLLoader.hpp.
Referenced by LoadCellMLFile().
|
private |
The location of an output folder to put the converted file and shared library in
Definition at line 92 of file CellMLLoader.hpp.
Referenced by LoadCellMLFile().
|
private |
The converter we will use
Definition at line 98 of file CellMLLoader.hpp.
Referenced by LoadCellMLFile().
|
private |
Whether we are building 'normal' (false) or 'CVODE' (true) cells.
Definition at line 101 of file CellMLLoader.hpp.
Referenced by LoadCellMLFile().