38#include "AbstractTetrahedralMesh.hpp"
45template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
48 unsigned lo=this->GetDistributedVectorFactory()->GetLow();
49 unsigned hi=this->GetDistributedVectorFactory()->GetHigh();
50 for (
unsigned element_index=0; element_index<mElements.size(); element_index++)
54 for (
unsigned local_node_index=0; local_node_index< p_element->
GetNumNodes(); local_node_index++)
57 if (lo<=global_node_index && global_node_index<hi)
66template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
72template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
76 for (
unsigned i=0; i<mElements.size(); i++)
81 for (
unsigned i=0; i<mBoundaryElements.size(); i++)
83 delete mBoundaryElements[i];
87template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
90 return mElements.size();
93template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
96 return GetNumElements();
99template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
102 return mElements.size();
105template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
108 return mBoundaryElements.size();
111template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
114 return GetNumBoundaryElements();
117template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
120 return mBoundaryElements.size();
123template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
129template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
132 return this->GetNumNodes();
135template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
138 return this->GetNumAllNodes();
141template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
144 unsigned local_index = SolveElementMapping(index);
145 return mElements[local_index];
148template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
151 unsigned local_index = SolveBoundaryElementMapping(index);
152 return mBoundaryElements[local_index];
155template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
158 return mBoundaryElements.begin();
161template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
164 return mBoundaryElements.end();
167template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
169 unsigned elementIndex,
170 c_matrix<double, SPACE_DIM, ELEMENT_DIM>& rJacobian,
171 double& rJacobianDeterminant,
172 c_matrix<double, ELEMENT_DIM, SPACE_DIM>& rInverseJacobian)
const
174 mElements[SolveElementMapping(elementIndex)]->CalculateInverseJacobian(rJacobian, rJacobianDeterminant, rInverseJacobian);
177template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
179 unsigned elementIndex,
180 c_vector<double, SPACE_DIM>& rWeightedDirection,
181 double& rJacobianDeterminant)
const
183 mBoundaryElements[SolveBoundaryElementMapping(elementIndex)]->CalculateWeightedDirection(rWeightedDirection, rJacobianDeterminant );
186template<
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 !=
nullptr);
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());
245template <
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]);
277template <
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]);
384template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
389 assert(SPACE_DIM == 3);
390 assert(ELEMENT_DIM == 3);
393 unsigned node_index = 0;
394 for (
unsigned k=0; k<depth+1; k++)
396 for (
unsigned j=0; j<height+1; j++)
398 for (
unsigned i=0; i<width+1; i++)
400 bool is_boundary =
false;
401 if (i==0 || j==0 || k==0 || i==width || j==height || k==depth)
405 assert(node_index == (k*(height+1)+j)*(width+1)+i);
408 this->mNodes.push_back(p_node);
411 this->mBoundaryNodes.push_back(p_node);
419 unsigned elem_index = 0;
420 unsigned belem_index = 0;
421 unsigned element_nodes[6][4] = {{0, 1, 5, 7}, {0, 1, 3, 7},
422 {0, 2, 3, 7}, {0, 2, 6, 7},
423 {0, 4, 6, 7}, {0, 4, 5, 7}};
436 std::vector<Node<SPACE_DIM>*> tetrahedra_nodes;
438 for (
unsigned k=0; k<depth; k++)
443 assert(belem_index == 2*(height*width+k*2*(height+width)) );
445 for (
unsigned j=0; j<height; j++)
447 for (
unsigned i=0; i<width; i++)
450 unsigned global_node_indices[8];
451 unsigned local_node_index = 0;
453 for (
unsigned z = 0; z < 2; z++)
455 for (
unsigned y = 0; y < 2; y++)
457 for (
unsigned x = 0; x < 2; x++)
459 global_node_indices[local_node_index] = i+x+(width+1)*(j+y+(height+1)*(k+z));
466 for (
unsigned m = 0; m < 6; m++)
470 tetrahedra_nodes.clear();
472 for (
unsigned n = 0; n < 4; n++)
474 tetrahedra_nodes.push_back(this->mNodes[global_node_indices[element_nodes[m][n]]]);
477 assert(elem_index == 6 * ((k*height+j)*width+i)+m );
482 std::vector<Node<SPACE_DIM>*> triangle_nodes;
486 triangle_nodes.clear();
487 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
488 triangle_nodes.push_back(this->mNodes[global_node_indices[2]]);
489 triangle_nodes.push_back(this->mNodes[global_node_indices[6]]);
491 triangle_nodes.clear();
492 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
493 triangle_nodes.push_back(this->mNodes[global_node_indices[6]]);
494 triangle_nodes.push_back(this->mNodes[global_node_indices[4]]);
499 triangle_nodes.clear();
500 triangle_nodes.push_back(this->mNodes[global_node_indices[1]]);
501 triangle_nodes.push_back(this->mNodes[global_node_indices[5]]);
502 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
504 triangle_nodes.clear();
505 triangle_nodes.push_back(this->mNodes[global_node_indices[1]]);
506 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
507 triangle_nodes.push_back(this->mNodes[global_node_indices[3]]);
512 triangle_nodes.clear();
513 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
514 triangle_nodes.push_back(this->mNodes[global_node_indices[5]]);
515 triangle_nodes.push_back(this->mNodes[global_node_indices[1]]);
517 triangle_nodes.clear();
518 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
519 triangle_nodes.push_back(this->mNodes[global_node_indices[4]]);
520 triangle_nodes.push_back(this->mNodes[global_node_indices[5]]);
525 triangle_nodes.clear();
526 triangle_nodes.push_back(this->mNodes[global_node_indices[2]]);
527 triangle_nodes.push_back(this->mNodes[global_node_indices[3]]);
528 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
530 triangle_nodes.clear();
531 triangle_nodes.push_back(this->mNodes[global_node_indices[2]]);
532 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
533 triangle_nodes.push_back(this->mNodes[global_node_indices[6]]);
538 triangle_nodes.clear();
539 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
540 triangle_nodes.push_back(this->mNodes[global_node_indices[3]]);
541 triangle_nodes.push_back(this->mNodes[global_node_indices[2]]);
543 triangle_nodes.clear();
544 triangle_nodes.push_back(this->mNodes[global_node_indices[0]]);
545 triangle_nodes.push_back(this->mNodes[global_node_indices[1]]);
546 triangle_nodes.push_back(this->mNodes[global_node_indices[3]]);
551 triangle_nodes.clear();
552 triangle_nodes.push_back(this->mNodes[global_node_indices[4]]);
553 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
554 triangle_nodes.push_back(this->mNodes[global_node_indices[5]]);
556 triangle_nodes.clear();
557 triangle_nodes.push_back(this->mNodes[global_node_indices[4]]);
558 triangle_nodes.push_back(this->mNodes[global_node_indices[6]]);
559 triangle_nodes.push_back(this->mNodes[global_node_indices[7]]);
569template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
572 assert(spaceStep>0.0);
582 unsigned num_elem_x=(
unsigned)((width+0.5*spaceStep)/spaceStep);
583 unsigned num_elem_y=(
unsigned)((height+0.5*spaceStep)/spaceStep);
584 unsigned num_elem_z=(
unsigned)((depth+0.5*spaceStep)/spaceStep);
588 double actual_width_x=num_elem_x*spaceStep;
589 double actual_width_y=num_elem_y*spaceStep;
590 double actual_width_z=num_elem_z*spaceStep;
595 if (fabs (actual_width_x - width) > DBL_EPSILON*width
596 ||( height!= 0.0 && fabs (actual_width_y - height) > DBL_EPSILON*height)
597 ||( depth != 0.0 && fabs (actual_width_z - depth) > DBL_EPSILON*depth ))
599 EXCEPTION(
"Space step does not divide the size of the mesh");
605 this->ConstructLinearMesh(num_elem_x);
608 this->ConstructRectangularMesh(num_elem_x, num_elem_y);
612 this->ConstructCuboid(num_elem_x, num_elem_y, num_elem_z);
614 this->Scale(spaceStep, spaceStep, spaceStep);
617template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
619 unsigned dimension,
double spaceStep,
620 double width,
double height,
double depth)
622 assert(ELEMENT_DIM == SPACE_DIM);
623 if (dimension >= SPACE_DIM)
625 EXCEPTION(
"Cannot split on non-existent dimension");
628 if (SPACE_DIM == 2 && dimension == 0)
630 double temp = height ;
634 else if (SPACE_DIM == 3)
636 unsigned rotate_perm = SPACE_DIM - 1u - dimension;
637 for (
unsigned i=0; i<rotate_perm; i++)
645 this->ConstructRegularSlabMesh(spaceStep, width, height, depth);
646 if (SPACE_DIM == 2 && dimension == 0)
650 c_matrix<double, 2, 2> axis_rotation = zero_matrix<double>(2, 2);
651 axis_rotation(0,1)=1.0;
652 axis_rotation(1,0)=-1.0;
653 this->Rotate(axis_rotation);
654 this->Translate(0.0, width);
656 else if (SPACE_DIM == 3 && dimension == 0)
662 c_matrix<double, 3, 3> axis_permutation = zero_matrix<double>(3, 3);
663 axis_permutation(0, 2)=1.0;
664 axis_permutation(1, 0)=1.0;
665 axis_permutation(2, 1)=1.0;
666 this->Rotate(axis_permutation);
668 else if (SPACE_DIM == 3 && dimension == 1)
674 c_matrix<double, 3, 3> axis_permutation = zero_matrix<double>(3, 3);
675 axis_permutation(0, 1)=1.0;
676 axis_permutation(1, 2)=1.0;
677 axis_permutation(2, 0)=1.0;
678 this->Rotate(axis_permutation);
684template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
688 unsigned tie_break_index = this->GetBoundaryElement(faceIndex)->GetNodeGlobalIndex(0);
691 if (this->GetDistributedVectorFactory()->IsGlobalIndexLocal(tie_break_index))
701template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
705 unsigned tie_break_index = this->GetElement(elementIndex)->GetNodeGlobalIndex(0);
708 if (this->GetDistributedVectorFactory()->IsGlobalIndexLocal(tie_break_index))
718template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
722 if (this->mNodes.size() == 0u)
739 unsigned nodes_per_element = this->mElements[0]->GetNumNodes();
740 if (ELEMENT_DIM <= 2u)
748 unsigned max_num = 1u;
749 unsigned boundary_max_num = 0u;
750 for (
unsigned local_node_index=0; local_node_index<this->mNodes.size(); local_node_index++)
752 unsigned num = this->mNodes[local_node_index]->GetNumContainingElements();
753 if (this->mNodes[local_node_index]->IsBoundaryNode()==
false && num>max_num)
757 if (this->mNodes[local_node_index]->IsBoundaryNode() && num>boundary_max_num)
759 boundary_max_num = num;
762 bool linear = (nodes_per_element == ELEMENT_DIM + 1);
767 if (ELEMENT_DIM == 1)
788 return std::max(max_num+1, boundary_max_num+2);
792 return std::max(3*max_num+1, 3*boundary_max_num+3);
805 std::set<unsigned> forward_star_nodes;
806 unsigned max_connectivity = 0u;
807 for (
unsigned local_node_index=0; local_node_index<this->mNodes.size(); local_node_index++)
809 forward_star_nodes.clear();
812 it != this->mNodes[local_node_index]->ContainingElementsEnd();
816 for (
unsigned i=0; i<nodes_per_element; i++)
821 if (forward_star_nodes.size() > max_connectivity)
823 max_connectivity = forward_star_nodes.size();
826 return max_connectivity;
829template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
833 rHaloIndices.clear();
836template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
839 for (
unsigned i=0; i<rOtherMesh.
GetNumNodes(); i++)
843 const c_vector<double, SPACE_DIM>& location=p_node->
rGetLocation();
847 this->mNodes.push_back( p_node_copy );
850 this->mBoundaryNodes.push_back( p_node_copy );
858 std::vector<Node<SPACE_DIM>*> nodes_for_element;
865 this->mElements.push_back(p_elem_copy);
871 assert(!p_b_elem->IsDeleted());
872 std::vector<Node<SPACE_DIM>*> nodes_for_element;
873 for (
unsigned j=0; j<p_b_elem->GetNumNodes(); j++)
875 nodes_for_element.push_back(this->mNodes[ p_b_elem->GetNodeGlobalIndex(j) ]);
879 this->mBoundaryElements.push_back(p_b_elem_copy);
885template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
887 std::vector<std::vector<unsigned> >& rNodesToSendPerProcess,
888 std::vector<std::vector<unsigned> >& rNodesToReceivePerProcess)
890 assert( rNodesToSendPerProcess.empty() );
891 assert( rNodesToReceivePerProcess.empty() );
894 std::vector<std::set<unsigned> > node_sets_to_send_per_process;
895 std::vector<std::set<unsigned> > node_sets_to_receive_per_process;
899 std::vector<unsigned> global_lows = this->GetDistributedVectorFactory()->rGetGlobalLows();
902 iter != this->GetElementIteratorEnd();
905 std::vector <unsigned> nodes_on_this_process;
906 std::vector <unsigned> nodes_not_on_this_process;
908 for (
unsigned i=0; i<ELEMENT_DIM+1; i++)
910 unsigned node_index=iter->GetNodeGlobalIndex(i);
911 if (this->GetDistributedVectorFactory()->IsGlobalIndexLocal(node_index))
913 nodes_on_this_process.push_back(node_index);
917 nodes_not_on_this_process.push_back(node_index);
924 if (nodes_on_this_process.empty())
930 if (!nodes_not_on_this_process.empty())
932 for (
unsigned i=0; i<nodes_not_on_this_process.size(); i++)
935 unsigned remote_process=global_lows.size()-1;
936 for (; global_lows[remote_process] > nodes_not_on_this_process[i]; remote_process--)
941 node_sets_to_receive_per_process[remote_process].insert(nodes_not_on_this_process[i]);
944 for (
unsigned j=0; j<nodes_on_this_process.size(); j++)
946 node_sets_to_send_per_process[remote_process].insert(nodes_on_this_process[j]);
954 std::vector<unsigned> process_send_vector( node_sets_to_send_per_process[process_number].begin(),
955 node_sets_to_send_per_process[process_number].end() );
956 std::sort(process_send_vector.begin(), process_send_vector.end());
958 rNodesToSendPerProcess.push_back(process_send_vector);
960 std::vector<unsigned> process_receive_vector( node_sets_to_receive_per_process[process_number].begin(),
961 node_sets_to_receive_per_process[process_number].end() );
962 std::sort(process_receive_vector.begin(), process_receive_vector.end());
964 rNodesToReceivePerProcess.push_back(process_receive_vector);
968template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
971 c_vector<double, 2> min_max;
972 min_max[0] = DBL_MAX;
975 ele_iter != GetElementIteratorEnd();
978 c_vector<double, 2> ele_min_max = ele_iter->CalculateMinMaxEdgeLengths();
979 min_max[0] = std::min(min_max[0], ele_min_max[0]);
980 min_max[1] = std::max(min_max[1], ele_min_max[1]);
986template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
989 std::set<unsigned> testElements,
990 bool onlyTryWithTestElements)
992 for (std::set<unsigned>::iterator iter=testElements.begin(); iter!=testElements.end(); iter++)
994 assert(*iter<this->GetNumElements());
995 if (this->mElements[*iter]->IncludesPoint(rTestPoint, strict))
997 assert(!this->mElements[*iter]->IsDeleted());
1002 if (!onlyTryWithTestElements)
1004 for (
unsigned i=0; i<this->mElements.size(); i++)
1006 if (this->mElements[i]->IncludesPoint(rTestPoint, strict))
1008 assert(!this->mElements[i]->IsDeleted());
1015 std::stringstream ss;
1017 for (
unsigned j=0; (int)j<(
int)SPACE_DIM-1; j++)
1019 ss << rTestPoint[j] <<
",";
1021 ss << rTestPoint[SPACE_DIM-1] <<
"] is not in ";
1022 if (!onlyTryWithTestElements)
1024 ss <<
"mesh - all elements tested";
1028 ss <<
"set of elements given";
1033template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
1035 std::set<unsigned> testElements)
1037 assert(testElements.size() > 0);
1040 double max_min_weight = -std::numeric_limits<double>::infinity();
1041 unsigned closest_index = 0;
1042 for (std::set<unsigned>::iterator iter = testElements.begin();
1043 iter != testElements.end();
1046 c_vector<double, ELEMENT_DIM+1> weight = this->mElements[*iter]->CalculateInterpolationWeights(rTestPoint);
1047 double neg_weight_sum = 0.0;
1048 for (
unsigned j=0; j<=ELEMENT_DIM; j++)
1050 if (weight[j] < 0.0)
1052 neg_weight_sum += weight[j];
1055 if (neg_weight_sum > max_min_weight)
1057 max_min_weight = neg_weight_sum;
1058 closest_index = *iter;
1061 assert(!this->mElements[closest_index]->IsDeleted());
1062 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