37#include "AbstractTetrahedralMesh.hpp"
44template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
47 unsigned lo=this->GetDistributedVectorFactory()->GetLow();
48 unsigned hi=this->GetDistributedVectorFactory()->GetHigh();
49 for (
unsigned element_index=0; element_index<mElements.size(); element_index++)
53 for (
unsigned local_node_index=0; local_node_index< p_element->
GetNumNodes(); local_node_index++)
56 if (lo<=global_node_index && global_node_index<hi)
65template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
71template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
75 for (
unsigned i=0; i<mElements.size(); i++)
80 for (
unsigned i=0; i<mBoundaryElements.size(); i++)
82 delete mBoundaryElements[i];
86template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
89 return mElements.size();
92template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
95 return GetNumElements();
98template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
101 return mElements.size();
104template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
107 return mBoundaryElements.size();
110template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
113 return GetNumBoundaryElements();
116template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
119 return mBoundaryElements.size();
122template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
128template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
131 return this->GetNumNodes();
134template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
137 return this->GetNumAllNodes();
140template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
143 unsigned local_index = SolveElementMapping(index);
144 return mElements[local_index];
147template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
150 unsigned local_index = SolveBoundaryElementMapping(index);
151 return mBoundaryElements[local_index];
154template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
157 return mBoundaryElements.begin();
160template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
163 return mBoundaryElements.end();
166template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
168 unsigned elementIndex,
169 c_matrix<double, SPACE_DIM, ELEMENT_DIM>& rJacobian,
170 double& rJacobianDeterminant,
171 c_matrix<double, ELEMENT_DIM, SPACE_DIM>& rInverseJacobian)
const
173 mElements[SolveElementMapping(elementIndex)]->CalculateInverseJacobian(rJacobian, rJacobianDeterminant, rInverseJacobian);
176template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
178 unsigned elementIndex,
179 c_vector<double, SPACE_DIM>& rWeightedDirection,
180 double& rJacobianDeterminant)
const
182 mBoundaryElements[SolveBoundaryElementMapping(elementIndex)]->CalculateWeightedDirection(rWeightedDirection, rJacobianDeterminant );
185template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
188 if (ELEMENT_DIM <= 1)
191 EXCEPTION(
"1-D mesh has no boundary normals");
194 face_iter != this->GetBoundaryElementIteratorEnd();
198 std::set<unsigned> boundary_element_node_indices;
199 for (
unsigned i=0; i<ELEMENT_DIM; i++)
201 boundary_element_node_indices.insert( (*face_iter)->GetNodeGlobalIndex(i) );
212 std::set<unsigned> element_node_indices;
213 for (
unsigned i=0; i<=ELEMENT_DIM; i++)
218 std::vector<unsigned> difference(ELEMENT_DIM);
220 std::vector<unsigned>::iterator set_iter = std::set_difference(
221 element_node_indices.begin(),element_node_indices.end(),
222 boundary_element_node_indices.begin(), boundary_element_node_indices.end(),
224 if (set_iter - difference.begin() == 1)
226 p_opposite_node =
this -> GetNodeOrHaloNode(difference[0]);
230 assert(p_opposite_node !=
nullptr);
233 c_vector<double, SPACE_DIM> into_mesh = p_opposite_node->
rGetLocation() - (*face_iter)->CalculateCentroid();
234 c_vector<double, SPACE_DIM> normal = (*face_iter)->CalculateNormal();
236 if (inner_prod(into_mesh, normal) > 0.0)
238 EXCEPTION(
"Inward facing normal in boundary element index "<<(*face_iter)->GetIndex());
244template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
247 assert(ELEMENT_DIM == 1);
249 for (
unsigned node_index=0; node_index<=width; node_index++)
252 this->mNodes.push_back(p_node);
255 this->mBoundaryNodes.push_back(p_node);
258 if (node_index==width)
260 this->mBoundaryNodes.push_back(p_node);
265 std::vector<Node<SPACE_DIM>*> nodes;
266 nodes.push_back(this->mNodes[node_index-1]);
267 nodes.push_back(this->mNodes[node_index]);
276template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
279 assert(SPACE_DIM == 2);
280 assert(ELEMENT_DIM == 2);
283 unsigned node_index=0;
284 for (
unsigned j=0; j<height+1; j++)
286 for (
unsigned i=0; i<width+1; i++)
288 bool is_boundary=
false;
289 if (i==0 || j==0 || i==width || j==height)
294 assert(node_index==(width+1)*(j) + i);
296 this->mNodes.push_back(p_node);
299 this->mBoundaryNodes.push_back(p_node);
305 unsigned belem_index=0;
307 for (
unsigned i=0; i<width; i++)
309 std::vector<Node<SPACE_DIM>*> nodes;
310 nodes.push_back(this->mNodes[height*(width+1)+i+1]);
311 nodes.push_back(this->mNodes[height*(width+1)+i]);
312 assert(belem_index==i);
316 for (
unsigned j=1; j<=height; j++)
318 std::vector<Node<SPACE_DIM>*> nodes;
319 nodes.push_back(this->mNodes[(width+1)*j-1]);
320 nodes.push_back(this->mNodes[(width+1)*(j+1)-1]);
321 assert(belem_index==width+j-1);
325 for (
unsigned i=0; i<width; i++)
327 std::vector<Node<SPACE_DIM>*> nodes;
328 nodes.push_back(this->mNodes[i]);
329 nodes.push_back(this->mNodes[i+1]);
330 assert(belem_index==width+height+i);
334 for (
unsigned j=0; j<height; j++)
336 std::vector<Node<SPACE_DIM>*> nodes;
337 nodes.push_back(this->mNodes[(width+1)*(j+1)]);
338 nodes.push_back(this->mNodes[(width+1)*(j)]);
339 assert(belem_index==2*width+height+j);
344 unsigned elem_index = 0;
345 for (
unsigned j=0; j<height; j++)
347 for (
unsigned i=0; i<width; i++)
349 unsigned parity=(i+(height-j))%2;
350 unsigned nw=(j+1)*(width+1)+i;
351 unsigned sw=(j)*(width+1)+i;
352 std::vector<Node<SPACE_DIM>*> upper_nodes;
353 upper_nodes.push_back(this->mNodes[nw]);
354 upper_nodes.push_back(this->mNodes[nw+1]);
355 if (stagger==
false || parity == 1)
357 upper_nodes.push_back(this->mNodes[sw+1]);
361 upper_nodes.push_back(this->mNodes[sw]);
363 assert(elem_index==2*(j*width+i));
365 std::vector<Node<SPACE_DIM>*> lower_nodes;
366 lower_nodes.push_back(this->mNodes[sw+1]);
367 lower_nodes.push_back(this->mNodes[sw]);
368 if (stagger==
false ||parity == 1)
370 lower_nodes.push_back(this->mNodes[nw]);
374 lower_nodes.push_back(this->mNodes[nw+1]);
383template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
388 assert(SPACE_DIM == 3);
389 assert(ELEMENT_DIM == 3);
392 unsigned node_index = 0;
393 for (
unsigned k=0; k<depth+1; k++)
395 for (
unsigned j=0; j<height+1; j++)
397 for (
unsigned i=0; i<width+1; i++)
399 bool is_boundary =
false;
400 if (i==0 || j==0 || k==0 || i==width || j==height || k==depth)
404 assert(node_index == (k*(height+1)+j)*(width+1)+i);
407 this->mNodes.push_back(p_node);
410 this->mBoundaryNodes.push_back(p_node);
418 unsigned elem_index = 0;
419 unsigned belem_index = 0;
420 unsigned element_nodes[6][4] = {{0, 1, 5, 7}, {0, 1, 3, 7},
421 {0, 2, 3, 7}, {0, 2, 6, 7},
422 {0, 4, 6, 7}, {0, 4, 5, 7}};
435 std::vector<Node<SPACE_DIM>*> tetrahedra_nodes;
437 for (
unsigned k=0; k<depth; k++)
442 assert(belem_index == 2*(height*width+k*2*(height+width)) );
444 for (
unsigned j=0; j<height; j++)
446 for (
unsigned i=0; i<width; i++)
449 unsigned global_node_indices[8];
450 unsigned local_node_index = 0;
452 for (
unsigned z = 0; z < 2; z++)
454 for (
unsigned y = 0; y < 2; y++)
456 for (
unsigned x = 0; x < 2; x++)
458 global_node_indices[local_node_index] = i+x+(width+1)*(j+y+(height+1)*(k+z));
465 for (
unsigned m = 0; m < 6; m++)
469 tetrahedra_nodes.clear();
471 for (
unsigned n = 0; n < 4; n++)
473 tetrahedra_nodes.push_back(this->mNodes[global_node_indices[element_nodes[m][n]]]);
476 assert(elem_index == 6 * ((k*height+j)*width+i)+m );
481 std::vector<Node<SPACE_DIM>*> triangle_nodes;
485 triangle_nodes.clear();
486 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
487 triangle_nodes.push_back(this->mNodes[global_node_indices[2]]);
488 triangle_nodes.push_back(this->mNodes[global_node_indices[6]]);
490 triangle_nodes.clear();
491 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
492 triangle_nodes.push_back(this->mNodes[global_node_indices[6]]);
493 triangle_nodes.push_back(this->mNodes[global_node_indices[4]]);
498 triangle_nodes.clear();
499 triangle_nodes.push_back(this->mNodes[global_node_indices[1]]);
500 triangle_nodes.push_back(this->mNodes[global_node_indices[5]]);
501 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
503 triangle_nodes.clear();
504 triangle_nodes.push_back(this->mNodes[global_node_indices[1]]);
505 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
506 triangle_nodes.push_back(this->mNodes[global_node_indices[3]]);
511 triangle_nodes.clear();
512 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
513 triangle_nodes.push_back(this->mNodes[global_node_indices[5]]);
514 triangle_nodes.push_back(this->mNodes[global_node_indices[1]]);
516 triangle_nodes.clear();
517 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
518 triangle_nodes.push_back(this->mNodes[global_node_indices[4]]);
519 triangle_nodes.push_back(this->mNodes[global_node_indices[5]]);
524 triangle_nodes.clear();
525 triangle_nodes.push_back(this->mNodes[global_node_indices[2]]);
526 triangle_nodes.push_back(this->mNodes[global_node_indices[3]]);
527 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
529 triangle_nodes.clear();
530 triangle_nodes.push_back(this->mNodes[global_node_indices[2]]);
531 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
532 triangle_nodes.push_back(this->mNodes[global_node_indices[6]]);
537 triangle_nodes.clear();
538 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
539 triangle_nodes.push_back(this->mNodes[global_node_indices[3]]);
540 triangle_nodes.push_back(this->mNodes[global_node_indices[2]]);
542 triangle_nodes.clear();
543 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
544 triangle_nodes.push_back(this->mNodes[global_node_indices[1]]);
545 triangle_nodes.push_back(this->mNodes[global_node_indices[3]]);
550 triangle_nodes.clear();
551 triangle_nodes.push_back(this->mNodes[global_node_indices[4]]);
552 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
553 triangle_nodes.push_back(this->mNodes[global_node_indices[5]]);
555 triangle_nodes.clear();
556 triangle_nodes.push_back(this->mNodes[global_node_indices[4]]);
557 triangle_nodes.push_back(this->mNodes[global_node_indices[6]]);
558 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
568template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
571 assert(spaceStep>0.0);
581 unsigned num_elem_x=(
unsigned)((width+0.5*spaceStep)/spaceStep);
582 unsigned num_elem_y=(
unsigned)((height+0.5*spaceStep)/spaceStep);
583 unsigned num_elem_z=(
unsigned)((depth+0.5*spaceStep)/spaceStep);
587 double actual_width_x=num_elem_x*spaceStep;
588 double actual_width_y=num_elem_y*spaceStep;
589 double actual_width_z=num_elem_z*spaceStep;
594 if (fabs (actual_width_x - width) > DBL_EPSILON*width
595 ||( height!= 0.0 && fabs (actual_width_y - height) > DBL_EPSILON*height)
596 ||( depth != 0.0 && fabs (actual_width_z - depth) > DBL_EPSILON*depth ))
598 EXCEPTION(
"Space step does not divide the size of the mesh");
604 this->ConstructLinearMesh(num_elem_x);
607 this->ConstructRectangularMesh(num_elem_x, num_elem_y);
611 this->ConstructCuboid(num_elem_x, num_elem_y, num_elem_z);
613 this->Scale(spaceStep, spaceStep, spaceStep);
616template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
618 unsigned dimension,
double spaceStep,
619 double width,
double height,
double depth)
621 assert(ELEMENT_DIM == SPACE_DIM);
622 if (dimension >= SPACE_DIM)
624 EXCEPTION(
"Cannot split on non-existent dimension");
627 if (SPACE_DIM == 2 && dimension == 0)
629 double temp = height ;
633 else if (SPACE_DIM == 3)
635 unsigned rotate_perm = SPACE_DIM - 1u - dimension;
636 for (
unsigned i=0; i<rotate_perm; i++)
644 this->ConstructRegularSlabMesh(spaceStep, width, height, depth);
645 if (SPACE_DIM == 2 && dimension == 0)
649 c_matrix<double, 2, 2> axis_rotation = zero_matrix<double>(2, 2);
650 axis_rotation(0,1)=1.0;
651 axis_rotation(1,0)=-1.0;
652 this->Rotate(axis_rotation);
653 this->Translate(0.0, width);
655 else if (SPACE_DIM == 3 && dimension == 0)
661 c_matrix<double, 3, 3> axis_permutation = zero_matrix<double>(3, 3);
662 axis_permutation(0, 2)=1.0;
663 axis_permutation(1, 0)=1.0;
664 axis_permutation(2, 1)=1.0;
665 this->Rotate(axis_permutation);
667 else if (SPACE_DIM == 3 && dimension == 1)
673 c_matrix<double, 3, 3> axis_permutation = zero_matrix<double>(3, 3);
674 axis_permutation(0, 1)=1.0;
675 axis_permutation(1, 2)=1.0;
676 axis_permutation(2, 0)=1.0;
677 this->Rotate(axis_permutation);
683template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
687 unsigned tie_break_index = this->GetBoundaryElement(faceIndex)->GetNodeGlobalIndex(0);
690 if (this->GetDistributedVectorFactory()->IsGlobalIndexLocal(tie_break_index))
700template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
704 unsigned tie_break_index = this->GetElement(elementIndex)->GetNodeGlobalIndex(0);
707 if (this->GetDistributedVectorFactory()->IsGlobalIndexLocal(tie_break_index))
717template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
721 if (this->mNodes.size() == 0u)
738 unsigned nodes_per_element = this->mElements[0]->GetNumNodes();
739 if (ELEMENT_DIM <= 2u)
747 unsigned max_num = 1u;
748 unsigned boundary_max_num = 0u;
749 for (
unsigned local_node_index=0; local_node_index<this->mNodes.size(); local_node_index++)
751 unsigned num = this->mNodes[local_node_index]->GetNumContainingElements();
752 if (this->mNodes[local_node_index]->IsBoundaryNode()==
false && num>max_num)
756 if (this->mNodes[local_node_index]->IsBoundaryNode() && num>boundary_max_num)
758 boundary_max_num = num;
761 bool linear = (nodes_per_element == ELEMENT_DIM + 1);
766 if (ELEMENT_DIM == 1)
787 return std::max(max_num+1, boundary_max_num+2);
791 return std::max(3*max_num+1, 3*boundary_max_num+3);
804 std::set<unsigned> forward_star_nodes;
805 unsigned max_connectivity = 0u;
806 for (
unsigned local_node_index=0; local_node_index<this->mNodes.size(); local_node_index++)
808 forward_star_nodes.clear();
811 it != this->mNodes[local_node_index]->ContainingElementsEnd();
815 for (
unsigned i=0; i<nodes_per_element; i++)
820 if (forward_star_nodes.size() > max_connectivity)
822 max_connectivity = forward_star_nodes.size();
825 return max_connectivity;
828template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
832 rHaloIndices.clear();
835template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
838 for (
unsigned i=0; i<rOtherMesh.
GetNumNodes(); i++)
842 const c_vector<double, SPACE_DIM>& location=p_node->
rGetLocation();
846 this->mNodes.push_back( p_node_copy );
849 this->mBoundaryNodes.push_back( p_node_copy );
857 std::vector<Node<SPACE_DIM>*> nodes_for_element;
864 this->mElements.push_back(p_elem_copy);
870 assert(!p_b_elem->IsDeleted());
871 std::vector<Node<SPACE_DIM>*> nodes_for_element;
872 for (
unsigned j=0; j<p_b_elem->GetNumNodes(); j++)
874 nodes_for_element.push_back(this->mNodes[ p_b_elem->GetNodeGlobalIndex(j) ]);
878 this->mBoundaryElements.push_back(p_b_elem_copy);
884template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
886 std::vector<std::vector<unsigned> >& rNodesToSendPerProcess,
887 std::vector<std::vector<unsigned> >& rNodesToReceivePerProcess)
889 assert( rNodesToSendPerProcess.empty() );
890 assert( rNodesToReceivePerProcess.empty() );
893 std::vector<std::set<unsigned> > node_sets_to_send_per_process;
894 std::vector<std::set<unsigned> > node_sets_to_receive_per_process;
898 std::vector<unsigned> global_lows = this->GetDistributedVectorFactory()->rGetGlobalLows();
901 iter != this->GetElementIteratorEnd();
904 std::vector <unsigned> nodes_on_this_process;
905 std::vector <unsigned> nodes_not_on_this_process;
907 for (
unsigned i=0; i<ELEMENT_DIM+1; i++)
909 unsigned node_index=iter->GetNodeGlobalIndex(i);
910 if (this->GetDistributedVectorFactory()->IsGlobalIndexLocal(node_index))
912 nodes_on_this_process.push_back(node_index);
916 nodes_not_on_this_process.push_back(node_index);
923 if (nodes_on_this_process.empty())
929 if (!nodes_not_on_this_process.empty())
931 for (
unsigned i=0; i<nodes_not_on_this_process.size(); i++)
934 unsigned remote_process=global_lows.size()-1;
935 for (; global_lows[remote_process] > nodes_not_on_this_process[i]; remote_process--)
940 node_sets_to_receive_per_process[remote_process].insert(nodes_not_on_this_process[i]);
943 for (
unsigned j=0; j<nodes_on_this_process.size(); j++)
945 node_sets_to_send_per_process[remote_process].insert(nodes_on_this_process[j]);
953 std::vector<unsigned> process_send_vector( node_sets_to_send_per_process[process_number].begin(),
954 node_sets_to_send_per_process[process_number].end() );
955 std::sort(process_send_vector.begin(), process_send_vector.end());
957 rNodesToSendPerProcess.push_back(process_send_vector);
959 std::vector<unsigned> process_receive_vector( node_sets_to_receive_per_process[process_number].begin(),
960 node_sets_to_receive_per_process[process_number].end() );
961 std::sort(process_receive_vector.begin(), process_receive_vector.end());
963 rNodesToReceivePerProcess.push_back(process_receive_vector);
967template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
970 c_vector<double, 2> min_max;
971 min_max[0] = DBL_MAX;
974 ele_iter != GetElementIteratorEnd();
977 c_vector<double, 2> ele_min_max = ele_iter->CalculateMinMaxEdgeLengths();
978 if (ele_min_max[0] < min_max[0])
980 min_max[0] = ele_min_max[0];
982 if (ele_min_max[1] > min_max[1])
984 min_max[1] = ele_min_max[1];
991template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
994 std::set<unsigned> testElements,
995 bool onlyTryWithTestElements)
997 for (std::set<unsigned>::iterator iter=testElements.begin(); iter!=testElements.end(); iter++)
999 assert(*iter<this->GetNumElements());
1000 if (this->mElements[*iter]->IncludesPoint(rTestPoint, strict))
1002 assert(!this->mElements[*iter]->IsDeleted());
1007 if (!onlyTryWithTestElements)
1009 for (
unsigned i=0; i<this->mElements.size(); i++)
1011 if (this->mElements[i]->IncludesPoint(rTestPoint, strict))
1013 assert(!this->mElements[i]->IsDeleted());
1020 std::stringstream ss;
1022 for (
unsigned j=0; (int)j<(
int)SPACE_DIM-1; j++)
1024 ss << rTestPoint[j] <<
",";
1026 ss << rTestPoint[SPACE_DIM-1] <<
"] is not in ";
1027 if (!onlyTryWithTestElements)
1029 ss <<
"mesh - all elements tested";
1033 ss <<
"set of elements given";
1038template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
1040 std::set<unsigned> testElements)
1042 assert(testElements.size() > 0);
1045 double max_min_weight = -std::numeric_limits<double>::infinity();
1046 unsigned closest_index = 0;
1047 for (std::set<unsigned>::iterator iter = testElements.begin();
1048 iter != testElements.end();
1051 c_vector<double, ELEMENT_DIM+1> weight = this->mElements[*iter]->CalculateInterpolationWeights(rTestPoint);
1052 double neg_weight_sum = 0.0;
1053 for (
unsigned j=0; j<=ELEMENT_DIM; j++)
1055 if (weight[j] < 0.0)
1057 neg_weight_sum += weight[j];
1060 if (neg_weight_sum > max_min_weight)
1062 max_min_weight = neg_weight_sum;
1063 closest_index = *iter;
1066 assert(!this->mElements[closest_index]->IsDeleted());
1067 return closest_index;
#define EXCEPTION(message)
#define EXCEPT_IF_NOT(test)
unsigned GetNumNodes() const
unsigned GetNodeGlobalIndex(unsigned localIndex) const
void SetOwnership(bool ownership)
virtual unsigned GetNumNodes() const
Node< SPACE_DIM > * GetNode(unsigned index) const
void ConstructRegularSlabMesh(double spaceStep, double width, double height=0, double depth=0)
virtual unsigned GetNumLocalBoundaryElements() const
virtual bool CalculateDesignatedOwnershipOfElement(unsigned elementIndex)
void CalculateNodeExchange(std::vector< std::vector< unsigned > > &rNodesToSendPerProcess, std::vector< std::vector< unsigned > > &rNodesToReceivePerProcess)
unsigned GetContainingElementIndex(const ChastePoint< SPACE_DIM > &rTestPoint, bool strict=false, std::set< unsigned > testElements=std::set< unsigned >(), bool onlyTryWithTestElements=false)
virtual void GetWeightedDirectionForBoundaryElement(unsigned elementIndex, c_vector< double, SPACE_DIM > &rWeightedDirection, double &rJacobianDeterminant) const
virtual unsigned GetNumBoundaryElements() const
virtual void GetInverseJacobianForElement(unsigned elementIndex, c_matrix< double, SPACE_DIM, ELEMENT_DIM > &rJacobian, double &rJacobianDeterminant, c_matrix< double, ELEMENT_DIM, SPACE_DIM > &rInverseJacobian) const
virtual bool CalculateDesignatedOwnershipOfBoundaryElement(unsigned faceIndex)
void ConstructFromMesh(AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rOtherMesh)
unsigned GetNumAllBoundaryElements() const
virtual unsigned GetMaximumNodeIndex()
virtual unsigned GetNumVertices() const
void ConstructRegularSlabMeshWithDimensionSplit(unsigned dimension, double spaceStep, double width, double height=0, double depth=0)
virtual void GetHaloNodeIndices(std::vector< unsigned > &rHaloIndices) const
std::vector< BoundaryElement< ELEMENT_DIM-1, SPACE_DIM > * >::const_iterator BoundaryElementIterator
virtual unsigned GetNumLocalElements() const
void SetElementOwnerships()
unsigned GetNearestElementIndexFromTestElements(const ChastePoint< SPACE_DIM > &rTestPoint, std::set< unsigned > testElements)
Element< ELEMENT_DIM, SPACE_DIM > * GetElement(unsigned index) const
unsigned CalculateMaximumNodeConnectivityPerProcess() const
AbstractTetrahedralMesh()
virtual ~AbstractTetrahedralMesh()
virtual c_vector< double, 2 > CalculateMinMaxEdgeLengths()
virtual void ConstructRectangularMesh(unsigned width, unsigned height, bool stagger=true)
BoundaryElementIterator GetBoundaryElementIteratorBegin() const
BoundaryElement< ELEMENT_DIM-1, SPACE_DIM > * GetBoundaryElement(unsigned index) const
virtual unsigned GetNumCableElements() const
void CheckOutwardNormals()
virtual void ConstructCuboid(unsigned width, unsigned height, unsigned depth)
virtual unsigned GetNumElements() const
unsigned GetNumAllElements() const
virtual void ConstructLinearMesh(unsigned width)
BoundaryElementIterator GetBoundaryElementIteratorEnd() const
ContainingElementIterator ContainingElementsEnd() const
ContainingElementIterator ContainingElementsBegin() const
const c_vector< double, SPACE_DIM > & rGetLocation() const
bool IsBoundaryNode() const