MonodomainPde.hpp
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 MONODOMAINPDE_HPP_
00031 #define MONODOMAINPDE_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 "AbstractCardiacPde.hpp"
00039
00040
00055 template <unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
00056 class MonodomainPde : public virtual AbstractCardiacPde<ELEMENT_DIM,SPACE_DIM>
00057 {
00058 private:
00059 friend class TestMonodomainPde;
00060
00062 friend class boost::serialization::access;
00069 template<class Archive>
00070 void serialize(Archive & archive, const unsigned int version)
00071 {
00072 archive & boost::serialization::base_object<AbstractCardiacPde<ELEMENT_DIM, SPACE_DIM> >(*this);
00073 }
00074
00075
00076 public:
00082 MonodomainPde(AbstractCardiacCellFactory<ELEMENT_DIM,SPACE_DIM>* pCellFactory);
00083
00084
00091 MonodomainPde(std::vector<AbstractCardiacCell*> & rCellsDistributed,
00092 AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* pMesh);
00093
00094
00095 };
00096
00097
00098 #include "SerializationExportWrapper.hpp"
00099 EXPORT_TEMPLATE_CLASS2(MonodomainPde, 1, 1);
00100 EXPORT_TEMPLATE_CLASS2(MonodomainPde, 1, 2);
00101 EXPORT_TEMPLATE_CLASS2(MonodomainPde, 1, 3);
00102 EXPORT_TEMPLATE_CLASS2(MonodomainPde, 2, 2);
00103 EXPORT_TEMPLATE_CLASS2(MonodomainPde, 3, 3);
00104
00105 namespace boost
00106 {
00107 namespace serialization
00108 {
00109
00110 template<class Archive, unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00111 inline void save_construct_data(
00112 Archive & ar, const MonodomainPde<ELEMENT_DIM, SPACE_DIM> * t, const unsigned int file_version)
00113 {
00114 const AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* p_mesh = t->pGetMesh();
00115 ar & p_mesh;
00116
00117
00118
00119 t->SaveCardiacCells(ar, file_version);
00120
00121
00122
00123 HeartConfig* p_config = HeartConfig::Instance();
00124 ar & *p_config;
00125 ar & p_config;
00126 }
00127
00132 template<class Archive, unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00133 inline void load_construct_data(
00134 Archive & ar, MonodomainPde<ELEMENT_DIM, SPACE_DIM> * t, const unsigned int file_version)
00135 {
00136 std::vector<AbstractCardiacCell*> cells_distributed;
00137 AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* p_mesh;
00138
00139 ar & p_mesh;
00140
00141 AbstractCardiacPde<ELEMENT_DIM,SPACE_DIM>::LoadCardiacCells(
00142 *ProcessSpecificArchive<Archive>::Get(), file_version, cells_distributed, p_mesh);
00143
00144
00145
00146 HeartConfig* p_config = HeartConfig::Instance();
00147 ar & *p_config;
00148 ar & p_config;
00149
00150 ::new(t)MonodomainPde<ELEMENT_DIM, SPACE_DIM>(cells_distributed, p_mesh);
00151 }
00152 }
00153 }
00154
00155
00156 #endif