35#ifndef ABSTRACTCARDIACTISSUE_HPP_
36#define ABSTRACTCARDIACTISSUE_HPP_
40#include <boost/shared_ptr.hpp>
47#include <boost/serialization/base_object.hpp>
48#include <boost/serialization/shared_ptr.hpp>
49#include <boost/serialization/vector.hpp>
50#include <boost/serialization/string.hpp>
51#include <boost/serialization/split_member.hpp>
53#include "AbstractCardiacCellInterface.hpp"
54#include "FakeBathCell.hpp"
55#include "AbstractCardiacCellFactory.hpp"
56#include "AbstractConductivityTensors.hpp"
57#include "AbstractPurkinjeCellFactory.hpp"
58#include "ReplicatableVector.hpp"
59#include "HeartConfig.hpp"
60#include "ArchiveLocationInfo.hpp"
61#include "AbstractDynamicallyLoadableEntity.hpp"
62#include "DynamicModelLoaderRegistry.hpp"
63#include "AbstractConductivityModifier.hpp"
80#ifdef DOXYGEN_CHASTE_ISSUE_199
81template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
83template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM = ELEMENT_DIM>
91 friend class TestMonodomainTissue;
99 template<
class Archive>
100 void save(Archive & archive,
const unsigned int version)
const
120 case cp::media_type::Orthotropic:
123 assert(source_file.
Exists());
130 case cp::media_type::Axisymmetric:
133 assert(source_file.
Exists());
141 case cp::media_type::NoFibreOrientation:
168 template<
class Archive>
169 void load(Archive & archive,
const unsigned int version)
191 for (
unsigned local_index = 0; local_index < num_halo_nodes; local_index++)
193 unsigned global_index =
mHaloNodes[local_index];
210 bool do_one_cache_replication =
true;
211 archive & do_one_cache_replication;
226 BOOST_SERIALIZATION_SPLIT_MEMBER()
454 virtual
void SolveCellSystems(
Vec existingSolution,
double time,
double nextTime,
bool updateVoltage=false);
476 void UpdateCaches(
unsigned globalIndex,
unsigned localIndex,
double nextTime);
527 template<class Archive>
530 const std::vector<AbstractCardiacCellInterface*> & r_cells_distributed =
rGetCellsDistributed();
533 const unsigned num_cells = r_cells_distributed.size();
535 for (
unsigned i=0; i<num_cells; i++)
538 bool is_dynamic = (p_entity != NULL);
539 archive & is_dynamic;
542#ifdef CHASTE_CAN_CHECKPOINT_DLLS
543 archive & p_entity->
GetLoader()->GetLoadableModulePath();
549 archive & r_cells_distributed[i];
569 template<
class Archive>
614 std::set<FakeBathCell*> fake_cells_non_local, fake_cells_local;
629 for (
unsigned local_index=0; local_index<num_cells; local_index++)
632 unsigned global_index = index_low + local_index;
636 std::map<unsigned, unsigned>::const_iterator halo_position;
641 archive & is_dynamic;
644#ifdef CHASTE_CAN_CHECKPOINT_DLLS
648 std::string shared_object_path;
649 archive & shared_object_path;
661 archive & p_purkinje_cell;
669 fake_cells_local.insert(p_fake);
673 fake_cells_non_local.insert(p_fake);
681 fake_cells_local.insert(p_fake_purkinje);
685 fake_cells_non_local.insert(p_fake_purkinje);
693 unsigned new_local_index = global_index - p_mesh_factory->
GetLow();
714 if (!p_fake_purkinje)
717 delete p_purkinje_cell;
723 for (std::set<FakeBathCell*>::iterator it = fake_cells_non_local.begin();
724 it != fake_cells_non_local.end();
727 if (fake_cells_local.find(*it) == fake_cells_local.end())
738namespace serialization {
745template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
gcov doesn't like this file...
#define TEMPLATED_CLASS_IS_ABSTRACT_2_UNSIGNED(T)
const std::vector< AbstractCardiacCellInterface * > & rGetPurkinjeCellsDistributed() const
ReplicatableVector mPurkinjeIntracellularStimulusCacheReplicated
ReplicatableVector & rGetIionicCacheReplicated()
ReplicatableVector mIntracellularStimulusCacheReplicated
const AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * pGetMesh() const
std::string mFibreFilePathNoExtension
AbstractCardiacCellInterface * GetCardiacCellOrHaloCell(unsigned globalIndex)
void UpdateCaches(unsigned globalIndex, unsigned localIndex, double nextTime)
void UpdatePurkinjeCaches(unsigned globalIndex, unsigned localIndex, double nextTime)
const std::vector< AbstractCardiacCellInterface * > & rGetCellsDistributed() const
std::vector< std::vector< unsigned > > mNodesToReceivePerProcess
ReplicatableVector & rGetPurkinjeIntracellularStimulusCacheReplicated()
virtual void SolveCellSystems(Vec existingSolution, double time, double nextTime, bool updateVoltage=false)
ReplicatableVector & rGetIntracellularStimulusCacheReplicated()
void CalculateHaloNodesFromNodeExchange()
DistributedVectorFactory * mpDistributedVectorFactory
void save(Archive &archive, const unsigned int version) const
std::vector< AbstractCardiacCellInterface * > mHaloCellsDistributed
void SaveCardiacCells(Archive &archive, const unsigned int version) const
AbstractConductivityTensors< ELEMENT_DIM, SPACE_DIM > * mpIntracellularConductivityTensors
void SetCacheReplication(bool doCacheReplication)
bool GetDoCacheReplication()
ReplicatableVector & rGetPurkinjeIionicCacheReplicated()
std::vector< AbstractCardiacCellInterface * > mPurkinjeCellsDistributed
AbstractCardiacCellInterface * GetPurkinjeCell(unsigned globalIndex)
void CreateIntracellularConductivityTensor()
std::vector< std::vector< unsigned > > mNodesToSendPerProcess
void SetConductivityModifier(AbstractConductivityModifier< ELEMENT_DIM, SPACE_DIM > *pModifier)
std::vector< AbstractCardiacCellInterface * > mCellsDistributed
friend class boost::serialization::access
void LoadCardiacCells(Archive &archive, const unsigned int version)
ReplicatableVector mPurkinjeIionicCacheReplicated
void SetUpHaloCells(AbstractCardiacCellFactory< ELEMENT_DIM, SPACE_DIM > *pCellFactory)
void load(Archive &archive, const unsigned int version)
AbstractConductivityModifier< ELEMENT_DIM, SPACE_DIM > * mpConductivityModifier
AbstractCardiacCellInterface * GetCardiacCell(unsigned globalIndex)
virtual const c_matrix< double, SPACE_DIM, SPACE_DIM > & rGetExtracellularConductivityTensor(unsigned elementIndex)
const c_matrix< double, SPACE_DIM, SPACE_DIM > & rGetIntracellularConductivityTensor(unsigned elementIndex)
std::map< unsigned, unsigned > mHaloGlobalToLocalIndexMap
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * mpMesh
std::vector< unsigned > mHaloNodes
ReplicatableVector mIionicCacheReplicated
Forward declaration which is going to be used for friendship.
const DynamicCellModelLoaderPtr GetLoader() const
static std::string GetMeshFilename()
static std::string GetArchiveRelativePath()
unsigned GetProblemSize() const
DistributedVectorFactory * GetOriginalFactory()
bool IsGlobalIndexLocal(unsigned globalIndex)
unsigned GetLocalOwnership() const
DynamicCellModelLoaderPtr GetLoader(const std::string &rPath)
static DynamicModelLoaderRegistry * Instance()
FileFinder CopyTo(const FileFinder &rDest) const
static HeartConfig * Instance()
static Archive * Get(void)
void Resize(unsigned size)
CHASTE_VERSION_CONTENT(3)
Macro to set the version number of templated archive in known versions of Boost.