00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef MONODOMAINTISSUE_HPP_
00031 #define MONODOMAINTISSUE_HPP_
00032
00033 #include "ChasteSerialization.hpp"
00034 #include <boost/serialization/vector.hpp>
00035 #include <boost/serialization/base_object.hpp>
00036
00037 #include <vector>
00038 #include "AbstractCardiacTissue.hpp"
00039
00040
00047 template <unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
00048 class MonodomainTissue : public virtual AbstractCardiacTissue<ELEMENT_DIM,SPACE_DIM>
00049 {
00050 private:
00051 friend class TestMonodomainTissue;
00052
00054 friend class boost::serialization::access;
00061 template<class Archive>
00062 void serialize(Archive & archive, const unsigned int version)
00063 {
00064 archive & boost::serialization::base_object<AbstractCardiacTissue<ELEMENT_DIM, SPACE_DIM> >(*this);
00065 }
00066
00067
00068 public:
00074 MonodomainTissue(AbstractCardiacCellFactory<ELEMENT_DIM,SPACE_DIM>* pCellFactory);
00075
00076
00083 MonodomainTissue(std::vector<AbstractCardiacCell*> & rCellsDistributed,
00084 AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* pMesh);
00085
00086
00087 };
00088
00089
00090 #include "SerializationExportWrapper.hpp"
00091 EXPORT_TEMPLATE_CLASS2(MonodomainTissue, 1, 1)
00092 EXPORT_TEMPLATE_CLASS2(MonodomainTissue, 1, 2)
00093 EXPORT_TEMPLATE_CLASS2(MonodomainTissue, 1, 3)
00094 EXPORT_TEMPLATE_CLASS2(MonodomainTissue, 2, 2)
00095 EXPORT_TEMPLATE_CLASS2(MonodomainTissue, 3, 3)
00096
00097 namespace boost
00098 {
00099 namespace serialization
00100 {
00101
00102 template<class Archive, unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00103 inline void save_construct_data(
00104 Archive & ar, const MonodomainTissue<ELEMENT_DIM, SPACE_DIM> * t, const unsigned int file_version)
00105 {
00106 const AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* p_mesh = t->pGetMesh();
00107 ar & p_mesh;
00108
00109
00110
00111 t->SaveCardiacCells(ar, file_version);
00112
00113
00114
00115 HeartConfig* p_config = HeartConfig::Instance();
00116 ar & *p_config;
00117 ar & p_config;
00118 }
00119
00124 template<class Archive, unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00125 inline void load_construct_data(
00126 Archive & ar, MonodomainTissue<ELEMENT_DIM, SPACE_DIM> * t, const unsigned int file_version)
00127 {
00128 std::vector<AbstractCardiacCell*> cells_distributed;
00129 AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* p_mesh;
00130
00131 ar & p_mesh;
00132
00133 AbstractCardiacTissue<ELEMENT_DIM,SPACE_DIM>::LoadCardiacCells(
00134 *ProcessSpecificArchive<Archive>::Get(), file_version, cells_distributed, p_mesh);
00135
00136
00137
00138 HeartConfig* p_config = HeartConfig::Instance();
00139 ar & *p_config;
00140 ar & p_config;
00141
00142 ::new(t)MonodomainTissue<ELEMENT_DIM, SPACE_DIM>(cells_distributed, p_mesh);
00143 }
00144 }
00145 }
00146
00147
00148 #endif