36 #include "PlaneBoundaryCondition.hpp" 37 #include "AbstractCentreBasedCellPopulation.hpp" 38 #include "VertexBasedCellPopulation.hpp" 40 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
42 c_vector<double, SPACE_DIM> point,
43 c_vector<double, SPACE_DIM> normal)
46 mUseJiggledNodesOnPlane(false)
48 assert(norm_2(normal) > 0.0);
52 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
58 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
65 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
71 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
77 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
83 EXCEPTION(
"PlaneBoundaryCondition requires a subclass of AbstractOffLatticeCellPopulation.");
90 double max_jiggle = 1e-4;
100 unsigned node_index = this->
mpCellPopulation->GetLocationIndexUsingCell(*cell_iter);
103 c_vector<double, SPACE_DIM> node_location = p_node->
rGetLocation();
106 if (signed_distance > 0.0)
109 c_vector<double, SPACE_DIM> nearest_point;
124 assert(SPACE_DIM == ELEMENT_DIM);
129 for (
unsigned node_index=0; node_index<num_nodes; node_index++)
132 c_vector<double, SPACE_DIM> node_location = p_node->
rGetLocation();
135 if (signed_distance > 0.0)
138 c_vector<double, SPACE_DIM> nearest_point;
160 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
163 bool condition_satisfied =
true;
167 EXCEPTION(
"PlaneBoundaryCondition is not implemented in 1D");
175 c_vector<double, SPACE_DIM> cell_location = this->
mpCellPopulation->GetLocationOfCellCentre(*cell_iter);
179 condition_satisfied =
false;
185 return condition_satisfied;
188 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
191 *rParamsFile <<
"\t\t\t<PointOnPlane>";
192 for (
unsigned index=0; index != SPACE_DIM-1U; index++)
196 *rParamsFile <<
mPointOnPlane[SPACE_DIM-1] <<
"</PointOnPlane>\n";
198 *rParamsFile <<
"\t\t\t<NormalToPlane>";
199 for (
unsigned index=0; index != SPACE_DIM-1U; index++)
203 *rParamsFile <<
mNormalToPlane[SPACE_DIM-1] <<
"</NormalToPlane>\n";
c_vector< double, SPACE_DIM > mPointOnPlane
bool mUseJiggledNodesOnPlane
AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > * mpCellPopulation
#define EXCEPTION(message)
void ImposeBoundaryCondition(const std::map< Node< SPACE_DIM > *, c_vector< double, SPACE_DIM > > &rOldLocations)
static RandomNumberGenerator * Instance()
#define EXPORT_TEMPLATE_CLASS_ALL_DIMS(CLASS)
void OutputCellPopulationBoundaryConditionParameters(out_stream &rParamsFile)
const c_vector< double, SPACE_DIM > & rGetLocation() const
bool VerifyBoundaryCondition()
c_vector< double, SPACE_DIM > mNormalToPlane
PlaneBoundaryCondition(AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > *pCellPopulation, c_vector< double, SPACE_DIM > point, c_vector< double, SPACE_DIM > normal)
void SetUseJiggledNodesOnPlane(bool useJiggledNodesOnPlane)
const c_vector< double, SPACE_DIM > & rGetNormalToPlane() const
c_vector< double, SPACE_DIM > & rGetModifiableLocation()
virtual void OutputCellPopulationBoundaryConditionParameters(out_stream &rParamsFile)=0
bool GetUseJiggledNodesOnPlane()
const c_vector< double, SPACE_DIM > & rGetPointOnPlane() const