37 #include "AbstractTetrahedralMesh.hpp"
44 template <
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)
65 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
71 template<
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];
86 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
89 return mElements.size();
92 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
95 return GetNumElements();
98 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
101 return mElements.size();
104 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
107 return mBoundaryElements.size();
110 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
113 return GetNumBoundaryElements();
116 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
119 return mBoundaryElements.size();
122 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
128 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
131 return this->GetNumNodes();
134 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
137 return this->GetNumAllNodes();
140 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
143 unsigned local_index = SolveElementMapping(index);
144 return mElements[local_index];
147 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
150 unsigned local_index = SolveBoundaryElementMapping(index);
151 return mBoundaryElements[local_index];
154 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
157 return mBoundaryElements.begin();
160 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
163 return mBoundaryElements.end();
166 template <
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);
176 template <
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 );
186 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
189 if (ELEMENT_DIM <= 1)
192 EXCEPTION(
"1-D mesh has no boundary normals");
195 face_iter != this->GetBoundaryElementIteratorEnd();
199 std::set<unsigned> boundary_element_node_indices;
200 for (
unsigned i=0; i<ELEMENT_DIM; i++)
202 boundary_element_node_indices.insert( (*face_iter)->GetNodeGlobalIndex(i) );
213 std::set<unsigned> element_node_indices;
214 for (
unsigned i=0; i<=ELEMENT_DIM; i++)
219 std::vector<unsigned> difference(ELEMENT_DIM);
221 std::vector<unsigned>::iterator set_iter = std::set_difference(
222 element_node_indices.begin(),element_node_indices.end(),
223 boundary_element_node_indices.begin(), boundary_element_node_indices.end(),
225 if (set_iter - difference.begin() == 1)
227 p_opposite_node =
this -> GetNodeOrHaloNode(difference[0]);
231 assert(p_opposite_node != NULL);
234 c_vector<double, SPACE_DIM> into_mesh = p_opposite_node->
rGetLocation() - (*face_iter)->CalculateCentroid();
235 c_vector<double, SPACE_DIM> normal = (*face_iter)->CalculateNormal();
237 if (inner_prod(into_mesh, normal) > 0.0)
239 EXCEPTION(
"Inward facing normal in boundary element index "<<(*face_iter)->GetIndex());
245 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
248 assert(ELEMENT_DIM == 1);
250 for (
unsigned node_index=0; node_index<=width; node_index++)
253 this->mNodes.push_back(p_node);
256 this->mBoundaryNodes.push_back(p_node);
259 if (node_index==width)
261 this->mBoundaryNodes.push_back(p_node);
266 std::vector<Node<SPACE_DIM>*> nodes;
267 nodes.push_back(this->mNodes[node_index-1]);
268 nodes.push_back(this->mNodes[node_index]);
277 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
280 assert(SPACE_DIM == 2);
281 assert(ELEMENT_DIM == 2);
284 unsigned node_index=0;
285 for (
unsigned j=0; j<height+1; j++)
287 for (
unsigned i=0; i<width+1; i++)
289 bool is_boundary=
false;
290 if (i==0 || j==0 || i==width || j==height)
295 assert(node_index==(width+1)*(j) + i);
297 this->mNodes.push_back(p_node);
300 this->mBoundaryNodes.push_back(p_node);
306 unsigned belem_index=0;
308 for (
unsigned i=0; i<width; i++)
310 std::vector<Node<SPACE_DIM>*> nodes;
311 nodes.push_back(this->mNodes[height*(width+1)+i+1]);
312 nodes.push_back(this->mNodes[height*(width+1)+i]);
313 assert(belem_index==i);
317 for (
unsigned j=1; j<=height; j++)
319 std::vector<Node<SPACE_DIM>*> nodes;
320 nodes.push_back(this->mNodes[(width+1)*j-1]);
321 nodes.push_back(this->mNodes[(width+1)*(j+1)-1]);
322 assert(belem_index==width+j-1);
326 for (
unsigned i=0; i<width; i++)
328 std::vector<Node<SPACE_DIM>*> nodes;
329 nodes.push_back(this->mNodes[i]);
330 nodes.push_back(this->mNodes[i+1]);
331 assert(belem_index==width+height+i);
335 for (
unsigned j=0; j<height; j++)
337 std::vector<Node<SPACE_DIM>*> nodes;
338 nodes.push_back(this->mNodes[(width+1)*(j+1)]);
339 nodes.push_back(this->mNodes[(width+1)*(j)]);
340 assert(belem_index==2*width+height+j);
345 unsigned elem_index = 0;
346 for (
unsigned j=0; j<height; j++)
348 for (
unsigned i=0; i<width; i++)
350 unsigned parity=(i+(height-j))%2;
351 unsigned nw=(j+1)*(width+1)+i;
352 unsigned sw=(j)*(width+1)+i;
353 std::vector<Node<SPACE_DIM>*> upper_nodes;
354 upper_nodes.push_back(this->mNodes[nw]);
355 upper_nodes.push_back(this->mNodes[nw+1]);
356 if (stagger==
false || parity == 1)
358 upper_nodes.push_back(this->mNodes[sw+1]);
362 upper_nodes.push_back(this->mNodes[sw]);
364 assert(elem_index==2*(j*width+i));
366 std::vector<Node<SPACE_DIM>*> lower_nodes;
367 lower_nodes.push_back(this->mNodes[sw+1]);
368 lower_nodes.push_back(this->mNodes[sw]);
369 if (stagger==
false ||parity == 1)
371 lower_nodes.push_back(this->mNodes[nw]);
375 lower_nodes.push_back(this->mNodes[nw+1]);
387 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
392 assert(SPACE_DIM == 3);
393 assert(ELEMENT_DIM == 3);
396 unsigned node_index = 0;
397 for (
unsigned k=0; k<depth+1; k++)
399 for (
unsigned j=0; j<height+1; j++)
401 for (
unsigned i=0; i<width+1; i++)
403 bool is_boundary =
false;
404 if (i==0 || j==0 || k==0 || i==width || j==height || k==depth)
408 assert(node_index == (k*(height+1)+j)*(width+1)+i);
411 this->mNodes.push_back(p_node);
414 this->mBoundaryNodes.push_back(p_node);
422 unsigned elem_index = 0;
423 unsigned belem_index = 0;
424 unsigned element_nodes[6][4] = {{0, 1, 5, 7}, {0, 1, 3, 7},
425 {0, 2, 3, 7}, {0, 2, 6, 7},
426 {0, 4, 6, 7}, {0, 4, 5, 7}};
439 std::vector<Node<SPACE_DIM>*> tetrahedra_nodes;
441 for (
unsigned k=0; k<depth; k++)
446 assert(belem_index == 2*(height*width+k*2*(height+width)) );
448 for (
unsigned j=0; j<height; j++)
450 for (
unsigned i=0; i<width; i++)
453 unsigned global_node_indices[8];
454 unsigned local_node_index = 0;
456 for (
unsigned z = 0; z < 2; z++)
458 for (
unsigned y = 0; y < 2; y++)
460 for (
unsigned x = 0; x < 2; x++)
462 global_node_indices[local_node_index] = i+x+(width+1)*(j+y+(height+1)*(k+z));
469 for (
unsigned m = 0; m < 6; m++)
473 tetrahedra_nodes.clear();
475 for (
unsigned n = 0; n < 4; n++)
477 tetrahedra_nodes.push_back(this->mNodes[global_node_indices[element_nodes[m][n]]]);
480 assert(elem_index == 6 * ((k*height+j)*width+i)+m );
485 std::vector<Node<SPACE_DIM>*> triangle_nodes;
489 triangle_nodes.clear();
490 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
491 triangle_nodes.push_back(this->mNodes[global_node_indices[2]]);
492 triangle_nodes.push_back(this->mNodes[global_node_indices[6]]);
494 triangle_nodes.clear();
495 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
496 triangle_nodes.push_back(this->mNodes[global_node_indices[6]]);
497 triangle_nodes.push_back(this->mNodes[global_node_indices[4]]);
502 triangle_nodes.clear();
503 triangle_nodes.push_back(this->mNodes[global_node_indices[1]]);
504 triangle_nodes.push_back(this->mNodes[global_node_indices[5]]);
505 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
507 triangle_nodes.clear();
508 triangle_nodes.push_back(this->mNodes[global_node_indices[1]]);
509 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
510 triangle_nodes.push_back(this->mNodes[global_node_indices[3]]);
515 triangle_nodes.clear();
516 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
517 triangle_nodes.push_back(this->mNodes[global_node_indices[5]]);
518 triangle_nodes.push_back(this->mNodes[global_node_indices[1]]);
520 triangle_nodes.clear();
521 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
522 triangle_nodes.push_back(this->mNodes[global_node_indices[4]]);
523 triangle_nodes.push_back(this->mNodes[global_node_indices[5]]);
528 triangle_nodes.clear();
529 triangle_nodes.push_back(this->mNodes[global_node_indices[2]]);
530 triangle_nodes.push_back(this->mNodes[global_node_indices[3]]);
531 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
533 triangle_nodes.clear();
534 triangle_nodes.push_back(this->mNodes[global_node_indices[2]]);
535 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
536 triangle_nodes.push_back(this->mNodes[global_node_indices[6]]);
541 triangle_nodes.clear();
542 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
543 triangle_nodes.push_back(this->mNodes[global_node_indices[3]]);
544 triangle_nodes.push_back(this->mNodes[global_node_indices[2]]);
546 triangle_nodes.clear();
547 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
548 triangle_nodes.push_back(this->mNodes[global_node_indices[1]]);
549 triangle_nodes.push_back(this->mNodes[global_node_indices[3]]);
554 triangle_nodes.clear();
555 triangle_nodes.push_back(this->mNodes[global_node_indices[4]]);
556 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
557 triangle_nodes.push_back(this->mNodes[global_node_indices[5]]);
559 triangle_nodes.clear();
560 triangle_nodes.push_back(this->mNodes[global_node_indices[4]]);
561 triangle_nodes.push_back(this->mNodes[global_node_indices[6]]);
562 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
572 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
575 assert(spaceStep>0.0);
585 unsigned num_elem_x=(
unsigned)((width+0.5*spaceStep)/spaceStep);
586 unsigned num_elem_y=(
unsigned)((height+0.5*spaceStep)/spaceStep);
587 unsigned num_elem_z=(
unsigned)((depth+0.5*spaceStep)/spaceStep);
591 double actual_width_x=num_elem_x*spaceStep;
592 double actual_width_y=num_elem_y*spaceStep;
593 double actual_width_z=num_elem_z*spaceStep;
598 if ( fabs (actual_width_x - width) > DBL_EPSILON*width
599 ||( height!= 0.0 && fabs (actual_width_y - height) > DBL_EPSILON*height)
600 ||( depth != 0.0 && fabs (actual_width_z - depth) > DBL_EPSILON*depth ) )
602 EXCEPTION(
"Space step does not divide the size of the mesh");
608 this->ConstructLinearMesh(num_elem_x);
611 this->ConstructRectangularMesh(num_elem_x, num_elem_y);
615 this->ConstructCuboid(num_elem_x, num_elem_y, num_elem_z);
617 this->Scale(spaceStep, spaceStep, spaceStep);
620 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
622 unsigned dimension,
double spaceStep,
623 double width,
double height,
double depth)
625 assert(ELEMENT_DIM == SPACE_DIM);
626 if (dimension >= SPACE_DIM)
628 EXCEPTION(
"Cannot split on non-existent dimension");
631 if (SPACE_DIM == 2 && dimension == 0)
633 double temp = height ;
637 else if (SPACE_DIM == 3)
639 unsigned rotate_perm = SPACE_DIM - 1u - dimension;
640 for (
unsigned i=0; i<rotate_perm; i++)
648 this->ConstructRegularSlabMesh(spaceStep, width, height, depth);
649 if (SPACE_DIM == 2 && dimension == 0)
653 c_matrix<double, 2, 2> axis_rotation = zero_matrix<double>(2, 2);
654 axis_rotation(0,1)=1.0;
655 axis_rotation(1,0)=-1.0;
656 this->Rotate(axis_rotation);
657 this->Translate(0.0, width);
659 else if (SPACE_DIM == 3 && dimension == 0)
665 c_matrix<double, 3, 3> axis_permutation = zero_matrix<double>(3, 3);
666 axis_permutation(0, 2)=1.0;
667 axis_permutation(1, 0)=1.0;
668 axis_permutation(2, 1)=1.0;
669 this->Rotate(axis_permutation);
671 else if (SPACE_DIM == 3 && dimension == 1)
677 c_matrix<double, 3, 3> axis_permutation = zero_matrix<double>(3, 3);
678 axis_permutation(0, 1)=1.0;
679 axis_permutation(1, 2)=1.0;
680 axis_permutation(2, 0)=1.0;
681 this->Rotate(axis_permutation);
687 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
691 unsigned tie_break_index = this->GetBoundaryElement(faceIndex)->GetNodeGlobalIndex(0);
694 if (this->GetDistributedVectorFactory()->IsGlobalIndexLocal(tie_break_index))
704 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
708 unsigned tie_break_index = this->GetElement(elementIndex)->GetNodeGlobalIndex(0);
711 if (this->GetDistributedVectorFactory()->IsGlobalIndexLocal(tie_break_index))
721 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
725 if (this->mNodes.size() == 0u)
727 #define COVERAGE_IGNORE
739 #undef COVERAGE_IGNORE
742 unsigned nodes_per_element = this->mElements[0]->GetNumNodes();
743 if (ELEMENT_DIM <= 2u)
751 unsigned max_num = 1u;
752 unsigned boundary_max_num = 0u;
753 for (
unsigned local_node_index=0; local_node_index<this->mNodes.size(); local_node_index++)
755 unsigned num = this->mNodes[local_node_index]->GetNumContainingElements();
756 if (this->mNodes[local_node_index]->IsBoundaryNode()==
false && num>max_num)
760 if (this->mNodes[local_node_index]->IsBoundaryNode() && num>boundary_max_num)
762 boundary_max_num = num;
765 bool linear = (nodes_per_element == ELEMENT_DIM + 1);
770 if (ELEMENT_DIM == 1)
791 return std::max(max_num+1, boundary_max_num+2);
795 return std::max(3*max_num+1, 3*boundary_max_num+3);
808 std::set<unsigned> forward_star_nodes;
809 unsigned max_connectivity = 0u;
810 for (
unsigned local_node_index=0; local_node_index<this->mNodes.size(); local_node_index++)
812 forward_star_nodes.clear();
815 it != this->mNodes[local_node_index]->ContainingElementsEnd();
819 for (
unsigned i=0; i<nodes_per_element; i++)
824 if (forward_star_nodes.size() > max_connectivity)
826 max_connectivity = forward_star_nodes.size();
829 return max_connectivity;
832 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
836 rHaloIndices.clear();
839 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
842 for (
unsigned i=0; i<rOtherMesh.
GetNumNodes(); i++)
846 c_vector<double, SPACE_DIM> location=p_node->
rGetLocation();
850 this->mNodes.push_back( p_node_copy );
853 this->mBoundaryNodes.push_back( p_node_copy );
861 std::vector<Node<SPACE_DIM>*> nodes_for_element;
868 this->mElements.push_back(p_elem_copy);
874 assert(!p_b_elem->IsDeleted());
875 std::vector<Node<SPACE_DIM>*> nodes_for_element;
876 for (
unsigned j=0; j<p_b_elem->GetNumNodes(); j++)
878 nodes_for_element.push_back(this->mNodes[ p_b_elem->GetNodeGlobalIndex(j) ]);
882 this->mBoundaryElements.push_back(p_b_elem_copy);
888 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
890 std::vector<std::vector<unsigned> >& rNodesToSendPerProcess,
891 std::vector<std::vector<unsigned> >& rNodesToReceivePerProcess)
893 assert( rNodesToSendPerProcess.empty() );
894 assert( rNodesToReceivePerProcess.empty() );
897 std::vector<std::set<unsigned> > node_sets_to_send_per_process;
898 std::vector<std::set<unsigned> > node_sets_to_receive_per_process;
902 std::vector<unsigned> global_lows = this->GetDistributedVectorFactory()->rGetGlobalLows();
905 iter != this->GetElementIteratorEnd();
908 std::vector <unsigned> nodes_on_this_process;
909 std::vector <unsigned> nodes_not_on_this_process;
911 for (
unsigned i=0; i<ELEMENT_DIM+1; i++)
913 unsigned node_index=iter->GetNodeGlobalIndex(i);
914 if (this->GetDistributedVectorFactory()->IsGlobalIndexLocal(node_index))
916 nodes_on_this_process.push_back(node_index);
920 nodes_not_on_this_process.push_back(node_index);
927 if (nodes_on_this_process.empty())
933 if (!nodes_not_on_this_process.empty())
935 for (
unsigned i=0; i<nodes_not_on_this_process.size(); i++)
938 unsigned remote_process=global_lows.size()-1;
939 for (; global_lows[remote_process] > nodes_not_on_this_process[i]; remote_process--)
944 node_sets_to_receive_per_process[remote_process].insert(nodes_not_on_this_process[i]);
947 for (
unsigned j=0; j<nodes_on_this_process.size(); j++)
949 node_sets_to_send_per_process[remote_process].insert(nodes_on_this_process[j]);
957 std::vector<unsigned> process_send_vector( node_sets_to_send_per_process[process_number].begin(),
958 node_sets_to_send_per_process[process_number].end() );
959 std::sort(process_send_vector.begin(), process_send_vector.end());
961 rNodesToSendPerProcess.push_back(process_send_vector);
963 std::vector<unsigned> process_receive_vector( node_sets_to_receive_per_process[process_number].begin(),
964 node_sets_to_receive_per_process[process_number].end() );
965 std::sort(process_receive_vector.begin(), process_receive_vector.end());
967 rNodesToReceivePerProcess.push_back(process_receive_vector);
971 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
974 c_vector<double, 2> min_max;
975 min_max[0] = DBL_MAX;
978 ele_iter != GetElementIteratorEnd();
981 c_vector<double, 2> ele_min_max = ele_iter->CalculateMinMaxEdgeLengths();
982 if (ele_min_max[0] < min_max[0])
984 min_max[0] = ele_min_max[0];
986 if (ele_min_max[1] > min_max[1])
988 min_max[1] = ele_min_max[1];
995 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
998 std::set<unsigned> testElements,
999 bool onlyTryWithTestElements)
1001 for (std::set<unsigned>::iterator iter=testElements.begin(); iter!=testElements.end(); iter++)
1003 assert(*iter<this->GetNumElements());
1004 if (this->mElements[*iter]->IncludesPoint(rTestPoint, strict))
1006 assert(!this->mElements[*iter]->IsDeleted());
1011 if (!onlyTryWithTestElements)
1013 for (
unsigned i=0; i<this->mElements.size(); i++)
1015 if (this->mElements[i]->IncludesPoint(rTestPoint, strict))
1017 assert(!this->mElements[i]->IsDeleted());
1024 std::stringstream ss;
1026 for (
unsigned j=0; (int)j<(
int)SPACE_DIM-1; j++)
1028 ss << rTestPoint[j] <<
",";
1030 ss << rTestPoint[SPACE_DIM-1] <<
"] is not in ";
1031 if (!onlyTryWithTestElements)
1033 ss <<
"mesh - all elements tested";
1037 ss <<
"set of elements given";
1044 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
1046 std::set<unsigned> testElements)
1048 assert(testElements.size() > 0);
1050 double max_min_weight = -std::numeric_limits<double>::infinity();
1051 unsigned closest_index = 0;
1052 for (std::set<unsigned>::iterator iter = testElements.begin();
1053 iter != testElements.end();
1056 c_vector<double, ELEMENT_DIM+1> weight = this->mElements[*iter]->CalculateInterpolationWeights(rTestPoint);
1057 double neg_weight_sum = 0.0;
1058 for (
unsigned j=0; j<=ELEMENT_DIM; j++)
1060 if (weight[j] < 0.0)
1062 neg_weight_sum += weight[j];
1065 if (neg_weight_sum > max_min_weight)
1067 max_min_weight = neg_weight_sum;
1068 closest_index = *iter;
1071 assert(!this->mElements[closest_index]->IsDeleted());
1072 return closest_index;
virtual unsigned GetNumBoundaryElements() const
virtual unsigned GetNumLocalBoundaryElements() const
BoundaryElementIterator GetBoundaryElementIteratorBegin() const
unsigned GetNodeGlobalIndex(unsigned localIndex) const
virtual unsigned GetMaximumNodeIndex()
virtual bool CalculateDesignatedOwnershipOfBoundaryElement(unsigned faceIndex)
void ConstructRegularSlabMesh(double spaceStep, double width, double height=0, double depth=0)
bool IsBoundaryNode() const
Node< SPACE_DIM > * GetNode(unsigned index) const
virtual unsigned GetNumElements() const
#define EXCEPTION(message)
virtual unsigned GetNumCableElements() const
unsigned CalculateMaximumNodeConnectivityPerProcess() const
Element< ELEMENT_DIM, SPACE_DIM > * GetElement(unsigned index) const
AbstractTetrahedralMesh()
void SetOwnership(bool ownership)
virtual unsigned GetNumNodes() const
void CheckOutwardNormals()
virtual void GetHaloNodeIndices(std::vector< unsigned > &rHaloIndices) 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 unsigned GetNumLocalElements() const
ContainingElementIterator ContainingElementsBegin() const
virtual void GetWeightedDirectionForBoundaryElement(unsigned elementIndex, c_vector< double, SPACE_DIM > &rWeightedDirection, double &rJacobianDeterminant) const
unsigned GetNumNodes() const
virtual unsigned GetNumVertices() const
unsigned GetContainingElementIndex(const ChastePoint< SPACE_DIM > &rTestPoint, bool strict=false, std::set< unsigned > testElements=std::set< unsigned >(), bool onlyTryWithTestElements=false)
virtual void ConstructRectangularMesh(unsigned width, unsigned height, bool stagger=true)
BoundaryElement< ELEMENT_DIM-1, SPACE_DIM > * GetBoundaryElement(unsigned index) const
virtual void ConstructCuboid(unsigned width, unsigned height, unsigned depth)
void SetElementOwnerships()
const c_vector< double, SPACE_DIM > & rGetLocation() const
unsigned GetNumAllElements() const
void CalculateNodeExchange(std::vector< std::vector< unsigned > > &rNodesToSendPerProcess, std::vector< std::vector< unsigned > > &rNodesToReceivePerProcess)
unsigned GetNumAllBoundaryElements() const
unsigned GetNearestElementIndexFromTestElements(const ChastePoint< SPACE_DIM > &rTestPoint, std::set< unsigned > testElements)
virtual bool CalculateDesignatedOwnershipOfElement(unsigned elementIndex)
virtual void ConstructLinearMesh(unsigned width)
std::vector< BoundaryElement< ELEMENT_DIM-1, SPACE_DIM > * >::const_iterator BoundaryElementIterator
virtual c_vector< double, 2 > CalculateMinMaxEdgeLengths()
void ConstructFromMesh(AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rOtherMesh)
ContainingElementIterator ContainingElementsEnd() const
virtual ~AbstractTetrahedralMesh()
void ConstructRegularSlabMeshWithDimensionSplit(unsigned dimension, double spaceStep, double width, double height=0, double depth=0)
BoundaryElementIterator GetBoundaryElementIteratorEnd() const