36 #include "CellBasedPdeHandlerOnCuboid.hpp"
37 #include "ConstBoundaryCondition.hpp"
39 template<
unsigned DIM>
41 bool deleteMemberPointersInDestructor)
46 template<
unsigned DIM>
50 for (
unsigned i=0; i<mConstBoundaryConditions.size(); i++)
52 delete mConstBoundaryConditions[i];
56 template<
unsigned DIM>
69 c_vector<bool,4> are_neumann_boundaries;
70 are_neumann_boundaries[0] =
false;
71 are_neumann_boundaries[1] =
true;
72 are_neumann_boundaries[2] =
false;
73 are_neumann_boundaries[3] =
true;
76 c_vector<double,4> boundary_condition_values;
77 boundary_condition_values[0] = 1.0;
78 boundary_condition_values[1] = 1.0;
79 boundary_condition_values[2] = 1.0;
80 boundary_condition_values[3] = 1.0;
83 for (
unsigned i=0; i<mConstBoundaryConditions.size(); i++)
85 delete mConstBoundaryConditions[i];
87 mConstBoundaryConditions.clear();
100 double fudge_factor = 1e-6;
107 double x_1 = (*elem_iter)->GetNodeLocation(0)[0];
109 double x_2 = (*elem_iter)->GetNodeLocation(1)[0];
112 assert(!are_neumann_boundaries[0]);
120 if (are_neumann_boundaries[1])
122 if ( (x_1 > (right-fudge_factor) ) && (x_2 > (right-fudge_factor) ))
124 p_bcc->AddNeumannBoundaryCondition(*elem_iter, mConstBoundaryConditions[1]);
127 assert(!are_neumann_boundaries[2]);
135 if (are_neumann_boundaries[3])
137 if ( (x_1 > (left+fudge_factor) ) && (x_2 < (left+fudge_factor) ))
139 p_bcc->AddNeumannBoundaryCondition(*elem_iter, mConstBoundaryConditions[3]);
150 double y = (*node_iter)->GetPoint()[1];
152 if (!are_neumann_boundaries[0])
154 if (y > top-fudge_factor)
156 p_bcc->AddDirichletBoundaryCondition(*node_iter, mConstBoundaryConditions[0]);
159 assert(are_neumann_boundaries[1]);
167 if (!are_neumann_boundaries[2])
169 if (y < bottom+fudge_factor)
171 p_bcc->AddDirichletBoundaryCondition(*node_iter, mConstBoundaryConditions[2]);
174 assert(are_neumann_boundaries[3]);
187 template<
unsigned DIM>
199 template class CellBasedPdeHandlerOnCuboid<2>;
200 template class CellBasedPdeHandlerOnCuboid<3>;
BoundaryElementIterator GetBoundaryElementIteratorBegin() const
BoundaryNodeIterator GetBoundaryNodeIteratorBegin() const
const ChastePoint< SPACE_DIM > & rGetUpperCorner() const
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
std::auto_ptr< BoundaryConditionsContainer< DIM, DIM, 1 > > ConstructBoundaryConditionsContainer(PdeAndBoundaryConditions< DIM > *pPdeAndBc, TetrahedralMesh< DIM, DIM > *pMesh)
virtual ~CellBasedPdeHandlerOnCuboid()
CellBasedPdeHandlerOnCuboid(AbstractCellPopulation< DIM > *pCellPopulation, bool deleteMemberPointersInDestructor=false)
virtual void OutputParameters(out_stream &rParamsFile)
virtual void OutputParameters(out_stream &rParamsFile)
BoundaryNodeIterator GetBoundaryNodeIteratorEnd() const
ChasteCuboid< SPACE_DIM > CalculateBoundingBox(const std::vector< Node< SPACE_DIM > * > &rNodes) const
BoundaryElementIterator GetBoundaryElementIteratorEnd() const
const ChastePoint< SPACE_DIM > & rGetLowerCorner() const