![]() |
Chaste Commit::333233612e3dcc941d260418acd7b5ccdc30390e
|
#include <AbstractLookupTableCollection.hpp>
Classes | |
class | EventHandler |
Public Member Functions | |
AbstractLookupTableCollection () | |
std::vector< std::string > | GetKeyingVariableNames () const |
unsigned | GetNumberOfTables (const std::string &rKeyingVariableName) const |
void | GetTableProperties (const std::string &rKeyingVariableName, double &rMin, double &rStep, double &rMax) const |
void | SetTableProperties (const std::string &rKeyingVariableName, double min, double step, double max) |
void | SetTimestep (double dt) |
virtual void | RegenerateTables ()=0 |
virtual void | FreeMemory ()=0 |
virtual | ~AbstractLookupTableCollection () |
Protected Member Functions | |
unsigned | GetTableIndex (const std::string &rKeyingVariableName) const |
Protected Attributes | |
std::vector< std::string > | mKeyingVariableNames |
std::vector< unsigned > | mNumberOfTables |
std::vector< double > | mTableSteps |
std::vector< double > | mTableStepInverses |
std::vector< double > | mTableMins |
std::vector< double > | mTableMaxs |
std::vector< bool > | mNeedsRegeneration |
double | mDt |
Base class for lookup tables used in optimised cells generated by chaste_codegen. Contains methods to query and adjust table parameters (i.e. size and spacing), and an event handler to time table generation.
Definition at line 49 of file AbstractLookupTableCollection.hpp.
AbstractLookupTableCollection::AbstractLookupTableCollection | ( | ) |
Default constructor.
Definition at line 40 of file AbstractLookupTableCollection.cpp.
|
virtual |
Virtual destructor since we have a virtual method.
Definition at line 110 of file AbstractLookupTableCollection.cpp.
|
pure virtual |
You can call this method to free the memory used by lookup tables when they're no longer needed.
In most usage scenarios you won't need to do this, but if you're running several simulations in turn that use different cell models, you may find it useful to prevent running out of memory.
std::vector< std::string > AbstractLookupTableCollection::GetKeyingVariableNames | ( | ) | const |
Definition at line 45 of file AbstractLookupTableCollection.cpp.
References mKeyingVariableNames.
unsigned AbstractLookupTableCollection::GetNumberOfTables | ( | const std::string & | rKeyingVariableName | ) | const |
rKeyingVariableName | the table key name |
Definition at line 50 of file AbstractLookupTableCollection.cpp.
References GetTableIndex(), and mNumberOfTables.
|
protected |
rKeyingVariableName | the table key name |
Definition at line 93 of file AbstractLookupTableCollection.cpp.
References EXCEPTION, and mKeyingVariableNames.
Referenced by GetNumberOfTables(), GetTableProperties(), and SetTableProperties().
void AbstractLookupTableCollection::GetTableProperties | ( | const std::string & | rKeyingVariableName, |
double & | rMin, | ||
double & | rStep, | ||
double & | rMax | ||
) | const |
Returns the properties of lookup tables keyed by the given variable (via arguments).
rKeyingVariableName | the table key name |
rMin | will be filled with the lower table bound (returned) |
rStep | will be filled with the table spacing (returned) |
rMax | will be filled with the upper table bound (returned) |
Definition at line 55 of file AbstractLookupTableCollection.cpp.
References GetTableIndex(), mTableMaxs, mTableMins, and mTableSteps.
|
pure virtual |
Subclasses implement this method to generate the lookup tables based on the current settings.
void AbstractLookupTableCollection::SetTableProperties | ( | const std::string & | rKeyingVariableName, |
double | min, | ||
double | step, | ||
double | max | ||
) |
Set the properties of lookup tables keyed by the given variable.
rKeyingVariableName | the table key name |
min | the lower table bound |
step | the table spacing; must divide the interval between min and max exactly |
max | the upper table bound |
Definition at line 63 of file AbstractLookupTableCollection.cpp.
References EXCEPTION, GetTableIndex(), mNeedsRegeneration, mTableMaxs, mTableMins, mTableStepInverses, and mTableSteps.
void AbstractLookupTableCollection::SetTimestep | ( | double | dt | ) |
With some chaste_codegen settings, the cell model timestep may be included within lookup tables. If the cell's dt is changed, this method must be called to reflect this, and RegenerateTables called to update the tables to match.
dt | the new timestep |
Definition at line 84 of file AbstractLookupTableCollection.cpp.
References mDt, and mNeedsRegeneration.
|
protected |
Timestep to use in lookup tables
Definition at line 163 of file AbstractLookupTableCollection.hpp.
Referenced by SetTimestep().
|
protected |
Names of variables used to index lookup tables
Definition at line 142 of file AbstractLookupTableCollection.hpp.
Referenced by GetKeyingVariableNames(), and GetTableIndex().
|
protected |
Whether the parameters for each set of tables have changed
Definition at line 160 of file AbstractLookupTableCollection.hpp.
Referenced by SetTableProperties(), and SetTimestep().
|
protected |
Number of tables indexed by each variable
Definition at line 145 of file AbstractLookupTableCollection.hpp.
Referenced by GetNumberOfTables().
|
protected |
Upper bound of tables indexed by each variable
Definition at line 157 of file AbstractLookupTableCollection.hpp.
Referenced by GetTableProperties(), and SetTableProperties().
|
protected |
Lower bound of tables indexed by each variable
Definition at line 154 of file AbstractLookupTableCollection.hpp.
Referenced by GetTableProperties(), and SetTableProperties().
|
protected |
Contains the reciprocals of mTableSteps
Definition at line 151 of file AbstractLookupTableCollection.hpp.
Referenced by SetTableProperties().
|
protected |
Spacing of tables indexed by each variable
Definition at line 148 of file AbstractLookupTableCollection.hpp.
Referenced by GetTableProperties(), and SetTableProperties().