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 #ifndef PLANEBOUNDARYCONDITION_HPP_
00029 #define PLANEBOUNDARYCONDITION_HPP_
00030
00031 #include "AbstractCellPopulationBoundaryCondition.hpp"
00032
00033 #include "ChasteSerialization.hpp"
00034 #include <boost/serialization/base_object.hpp>
00035 #include <boost/serialization/vector.hpp>
00036
00043 template<unsigned DIM>
00044 class PlaneBoundaryCondition : public AbstractCellPopulationBoundaryCondition<DIM>
00045 {
00046 private:
00047
00051 c_vector<double, DIM> mPointOnPlane;
00052
00056 c_vector<double, DIM> mNormalToPlane;
00057
00059 friend class boost::serialization::access;
00066 template<class Archive>
00067 void serialize(Archive & archive, const unsigned int version)
00068 {
00069 archive & boost::serialization::base_object<AbstractCellPopulationBoundaryCondition<DIM> >(*this);
00070 }
00071
00072 public:
00073
00081 PlaneBoundaryCondition(AbstractCellPopulation<DIM>* pCellPopulation,
00082 c_vector<double, DIM> point,
00083 c_vector<double, DIM> normal);
00084
00088 const c_vector<double, DIM>& rGetPointOnPlane() const;
00089
00093 const c_vector<double, DIM>& rGetNormalToPlane() const;
00094
00100 void ImposeBoundaryCondition();
00101
00109 bool VerifyBoundaryCondition();
00110
00117 void OutputCellPopulationBoundaryConditionParameters(out_stream& rParamsFile);
00118 };
00119
00120 #include "SerializationExportWrapper.hpp"
00121 EXPORT_TEMPLATE_CLASS_SAME_DIMS(PlaneBoundaryCondition)
00122
00123 namespace boost
00124 {
00125 namespace serialization
00126 {
00130 template<class Archive, unsigned DIM>
00131 inline void save_construct_data(
00132 Archive & ar, const PlaneBoundaryCondition<DIM> * t, const BOOST_PFTO unsigned int file_version)
00133 {
00134
00135 const AbstractCellPopulation<DIM>* const p_cell_population = t->GetCellPopulation();
00136 ar << p_cell_population;
00137
00138
00139 c_vector<double, DIM> point = t->rGetPointOnPlane();
00140 for (unsigned i=0; i<DIM; i++)
00141 {
00142 ar << point[i];
00143 }
00144 c_vector<double, DIM> normal = t->rGetNormalToPlane();
00145 for (unsigned i=0; i<DIM; i++)
00146 {
00147 ar << normal[i];
00148 }
00149 }
00150
00154 template<class Archive, unsigned DIM>
00155 inline void load_construct_data(
00156 Archive & ar, PlaneBoundaryCondition<DIM> * t, const unsigned int file_version)
00157 {
00158
00159 AbstractCellPopulation<DIM>* p_cell_population;
00160 ar >> p_cell_population;
00161
00162
00163 c_vector<double, DIM> point;
00164 for (unsigned i=0; i<DIM; i++)
00165 {
00166 ar >> point[i];
00167 }
00168 c_vector<double, DIM> normal;
00169 for (unsigned i=0; i<DIM; i++)
00170 {
00171 ar >> normal[i];
00172 }
00173
00174
00175 ::new(t)PlaneBoundaryCondition<DIM>(p_cell_population, point, normal);
00176 }
00177 }
00178 }
00179
00180 #endif