40 #ifndef _REGIONMESH_HH_ 41 #define _REGIONMESH_HH_ 46 #include <Epetra_ConfigDefs.h> 49 #include <Epetra_MpiComm.h> 51 #include <Epetra_SerialComm.h> 55 #include <lifev/core/LifeV.hpp> 56 #include <lifev/core/util/LifeDebug.hpp> 57 #include <lifev/core/mesh/MeshElementMarked.hpp> 58 #include <lifev/core/util/Switch.hpp> 59 #include <lifev/core/mesh/MeshElementBare.hpp> 61 #include <lifev/core/mesh/MeshEntityContainer.hpp> 62 #include <lifev/core/array/ArraySimple.hpp> 63 #include <lifev/core/mesh/ElementShapes.hpp> 64 #include <lifev/core/mesh/MeshUtility.hpp> 245 std::ostream&
showMe (
bool verbose =
false, std::ostream& out = std::cout )
const;
261 Int check (
Int level = 0,
bool const fix =
false,
bool verbose =
true, std::ostream& out = std::cerr );
305 return switches.size();
332 std::ostream&
showLinkSwitch (
bool verbose =
false, std::ostream& out = std::cout )
431 return volumeList.size();
526 M_numVolumes = volumeList.size();
537 return volumeList.back();
584 return ! M_ElemToFacet.empty();
595 return hasLocalFaces ( twoD_Type() );
633 void updateElementFaces (
bool createFaces =
false,
const bool verbose =
false,
UInt estimateFaceNumber = 0 );
673 return ! M_ElemToRidge.empty();
705 UInt estimateRidgeNumber = 0,
bool renumber =
true)
707 updateElementRidges (
M_geoDim, createRidges, verbose, estimateRidgeNumber, renumber);
728 UInt estimateEdgeNumber = 0,
bool renumber =
true)
730 updateElementEdges (
edge_Type(), createEdges, verbose, estimateEdgeNumber, renumber);
749 return localRidgeId (
M_geoDim, elemId, locR );
760 return localRidgeId (
M_geoDim, elem.localId(), locR );
771 return localEdgeId (
M_geoDim, elemId, locE );
781 return localRidgeId ( elem, elem.localId(), locE );
898 setMaxNumGlobalFacets (
M_geoDim, n );
1229 return e.boundary();
1395 return pointList.front();
1406 return pointList.back();
1620 return numBoundaryFacets (
M_geoDim);
1650 return boundaryFacet (
M_geoDim, i);
1660 return boundaryFacet (
M_geoDim, i);
1669 return numGlobalElements (
M_geoDim );
1700 setMaxNumElements (
M_geoDim, n, setcounter);
1711 setMaxNumGlobalElements (
M_geoDim, n) ;
1769 return numGlobalFacets (
M_geoDim );
1781 setMaxNumFacets (
M_geoDim, n, setcounter);
1792 return addFacet (
M_geoDim, boundary);
1805 return addFace (facet);
1817 return addEdge (facet);
1829 return addPoint (facet);
1868 setNumBoundaryFacets (
M_geoDim, n ) ;
1878 return isBoundaryFacet (
M_geoDim, id );
1902 return numGlobalRidges (
M_geoDim );
1914 setMaxNumRidges (
M_geoDim, n, setcounter);
1925 setMaxNumGlobalRidges (
M_geoDim, n);
1946 return addRidge (
M_geoDim, boundary);
1960 return addEdge ( r );
1974 return addPoint ( r );
2009 setNumBoundaryRidges (
M_geoDim, n );
2021 return isBoundaryEdge (r);
2033 return isBoundaryPoint (r);
2045 return isBoundaryRidge (
M_geoDim, id );
2228 return numBVertices();
2262 return boundaryFace (i);
2266 return boundaryEdge (i);
2273 return boundaryFace (i);
2277 return boundaryEdge (i);
2281 return boundaryPoint (i);
2357 return addVolume (elem);
2361 return addFace (elem);
2365 return addEdge (elem);
2380 UInt estimateEdgeNumber = 0,
bool renumber =
true)
2382 updateElementRidges (
M_geoDim, createEdges, verbose, estimateEdgeNumber, renumber);
2387 UInt estimateEdgeNumber = 0,
bool =
true)
2394 UInt estimateRidgeNumber = 0,
bool renumber =
true);
2397 ERROR_MSG (
"RegionMesh::updateElementRidges, It is not possible to use this method with 2D geometries.");
2401 ERROR_MSG (
"RegionMesh::updateElementRidges, It is not possible to use this method with 1D geometries.");
2418 return element (elemId).point (locR).localId();
2429 return localRidgeId ( threeD_Type(), elemId, locE );
2441 ERROR_MSG (
"localEdgeId not implemented for oneD_Type." );
2442 return static_cast<
ID> (0);
2504 return addFace (boundary);
2508 return addEdge (boundary);
2512 return addPoint (boundary);
2578 return isBoundaryEdge ( id );
2582 return isBoundaryPoint ( id );
2624 ERROR_MSG (
"RegionMesh::setMaxNumRidges, No ridges in 1D");
2638 ERROR_MSG (
"RegionMesh::setMaxNumGlobalRidges, No ridges in 1D");
2644 return addEdge ( boundary);
2648 return addPoint ( boundary,
false );
2652 ERROR_MSG (
"RegionMesh::addRidge, No ridges in 1D"); ;
2667 ERROR_MSG (
"RegionMesh::ridge, No ridges in 1D");
2682 ERROR_MSG (
"RegionMesh::ridge, No ridges in 1D");
2703 ERROR_MSG (
"RegionMesh::setNumBoundaryRidges, No ridges in 1D");
2709 return isBoundaryEdge ( id );
2713 return isBoundaryPoint ( id );
2717 ERROR_MSG (
"RegionMesh::isBoundaryRidge, No ridges in 1D");
2728 ERROR_MSG (
"RegionMesh::peak, No peak in 2D");
2733 ERROR_MSG (
"RegionMesh::peak, No peak in 1D");
2744 ERROR_MSG (
"RegionMesh::peak, No peak in 2D");
2749 ERROR_MSG (
"RegionMesh::peak, No peak in 2D");
2806 ERROR_MSG (
"RegionMesh::ridgeList, no RidgeList in 1D");
2807 return ridges_Type();
2821 template <
typename GeoShapeType,
typename MCType>
2838 set_switches_for_regionmesh (
switches );
2841 template <
typename GeoShapeType,
typename MCType>
2859 set_switches_for_regionmesh (
switches );
2863 template <
typename GeoShapeType,
typename MCType>
2881 set_switches_for_regionmesh (
switches );
2884 template <
typename GeoShapeType,
typename MCType>
2889 template <
typename GeoShapeType,
typename MCType>
2896 template <
typename GeoShapeType,
typename MCType>
2903 template <
typename GeoShapeType,
typename MCType>
2910 template <
typename GeoShapeType,
typename MCType>
2919 template <
typename GeoShapeType,
typename MCType>
2923 volumeList.setMaxNumItems (n);
2930 template <
typename GeoShapeType,
typename MCType>
2936 return addVolume ( aVolume );
2939 template <
typename GeoShapeType,
typename MCType>
2943 volumeList.push_back ( v );
2946 thisVolume.setLocalId ( volumeList.size() - 1 );
2950 template <
typename GeoShapeType,
typename MCType>
2955 ASSERT_PRE ( pos < volumeList.capacity() ,
"position requested exceed capacity" <<
2956 pos <<
" " << volumeList.capacity() ) ;
2962 template <
typename GeoShapeType,
typename MCType>
2971 template <
typename GeoShapeType,
typename MCType>
2981 template <
typename GeoShapeType,
typename MCType>
2988 template <
typename GeoShapeType,
typename MCType>
2995 template <
typename GeoShapeType,
typename MCType>
2999 return faceList.size();
3002 template <
typename GeoShapeType,
typename MCType>
3006 return faceList.maxNumItems();
3009 template <
typename GeoShapeType,
typename MCType>
3013 faceList.setMaxNumItems (n);
3020 template <
typename GeoShapeType,
typename MCType>
3027 template <
typename GeoShapeType,
typename MCType>
3033 aFace.setBoundary ( boundary );
3034 return this->addFace ( aFace );
3038 template <
typename GeoShapeType,
typename MCType>
3043 faceList.push_back ( f );
3046 thisFace.setLocalId ( faceList.size() - 1 );
3050 template <
typename GeoShapeType,
typename MCType>
3055 ASSERT_PRE ( position < faceList.capacity(),
"Face list size exceeded" <<
3056 position <<
" " << faceList.capacity() ) ;
3058 faceList ( position
).setLocalId ( position );
3062 template <
typename GeoShapeType,
typename MCType>
3067 return faceList.back();
3071 template <
typename GeoShapeType,
typename MCType>
3080 template <
typename GeoShapeType,
typename MCType>
3090 template <
typename GeoShapeType,
typename MCType>
3095 ASSERT_PRE ( faceList.size() != 0,
"Boundary Faces not stored" ) ;
3101 template <
typename GeoShapeType,
typename MCType>
3106 ASSERT_PRE ( faceList.size() != 0,
"Boundary Faces not stored" ) ;
3112 template <
typename GeoShapeType,
typename MCType>
3119 template <
typename GeoShapeType,
typename MCType>
3126 template <
typename GeoShapeType,
typename MCType>
3135 template <
typename GeoShapeType,
typename MCType>
3142 template <
typename GeoShapeType,
typename MCType>
3149 template <
typename GeoShapeType,
typename MCType>
3153 return edgeList.size();
3156 template <
typename GeoShapeType,
typename MCType>
3160 return edgeList.maxNumItems();
3163 template <
typename GeoShapeType,
typename MCType>
3167 edgeList.setMaxNumItems (n);
3174 template <
typename GeoShapeType,
typename MCType>
3181 template <
typename GeoShapeType,
typename MCType>
3188 template <
typename GeoShapeType,
typename MCType>
3193 anEdge.setBoundary ( boundary );
3194 return addEdge ( anEdge );
3197 template <
typename GeoShapeType,
typename MCType>
3201 edgeList.push_back ( f );
3204 thisEdge.setLocalId ( edgeList.size() - 1 );
3208 template <
typename GeoShapeType,
typename MCType>
3213 ASSERT_PRE ( position < edgeList.capacity(),
"Edge list size exceeded" <<
3214 position <<
" " << edgeList.capacity() ) ;
3217 thisEdge.setLocalId ( position );
3222 template <
typename GeoShapeType,
typename MCType>
3227 return edgeList.back();
3232 template <
typename GeoShapeType,
typename MCType>
3241 template <
typename GeoShapeType,
typename MCType>
3251 template <
typename GeoShapeType,
typename MCType>
3256 ASSERT_PRE ( edgeList.size() != 0,
"Boundary Edges not stored" ) ;
3261 template <
typename GeoShapeType,
typename MCType>
3266 ASSERT_PRE ( edgeList.size() != 0,
"Boundary Edges not stored" ) ;
3271 template <
typename GeoShapeType,
typename MCType>
3278 template <
typename GeoShapeType,
typename MCType>
3287 template <
typename GeoShapeType,
typename MCType>
3294 template <
typename GeoShapeType,
typename MCType>
3301 template <
typename GeoShapeType,
typename MCType>
3305 return pointList.size();
3308 template <
typename GeoShapeType,
typename MCType>
3312 return _bPoints.size();
3315 template <
typename GeoShapeType,
typename MCType>
3319 return pointList.maxNumItems();
3322 template <
typename GeoShapeType,
typename MCType>
3326 pointList.setMaxNumItems (n);
3333 template <
typename GeoShapeType,
typename MCType>
3340 template <
typename GeoShapeType,
typename MCType>
3347 template <
typename GeoShapeType,
typename MCType>
3354 template <
typename GeoShapeType,
typename MCType>
3361 template <
typename GeoShapeType,
typename MCType>
3367 aPoint.setBoundary ( boundary );
3372 return addPoint ( aPoint );
3375 template <
typename GeoShapeType,
typename MCType>
3380 ASSERT_PRE ( pointList.size() < pointList.capacity(),
"Point list size exceeded" <<
3381 pointList.size() + 1 <<
" " << pointList.capacity() ) ;
3383 pointList.push_back ( p );
3386 thisPoint.setLocalId ( pointList.size() - 1 );
3388 if ( thisPoint.boundary() )
3390 ASSERT_PRE ( _bPoints.size() < _bPoints.capacity(),
"Boundary Point list size exceeded" <<
3391 _bPoints.size() + 1 <<
" " << _bPoints.capacity() ) ;
3392 _bPoints.push_back ( & pointList.back() );
3397 template <
typename GeoShapeType,
typename MCType>
3407 template <
typename GeoShapeType,
typename MCType>
3417 template <
typename GeoShapeType,
typename MCType>
3422 ASSERT_PRE ( _bPoints.size() != 0,
" Boundary Points not Stored" ) ;
3424 return * ( _bPoints[ i ] );
3427 template <
typename GeoShapeType,
typename MCType>
3432 ASSERT_PRE ( _bPoints.size() != 0,
" Boundary Points not Stored" ) ;
3434 return * ( _bPoints[ i ] );
3437 template <
typename GeoShapeType,
typename MCType>
3444 template <
typename GeoShapeType,
typename MCType>
3449 _bPoints.reserve ( n );
3452 template <
typename GeoShapeType,
typename MCType>
3459 template <
typename GeoShapeType,
typename MCType>
3467 template <
typename GeoShapeType,
typename MCType>
3474 template <
typename GeoShapeType,
typename MCType>
3483 template <
typename GeoShapeType,
typename MCType>
3484 inline std::ostream&
3487 out <<
"**************************************************" << std::endl;
3488 out <<
"**************************************************" << std::endl;
3489 out <<
" RegionMesh " << std::endl;
3490 out <<
"**************************************************" << std::endl;
3491 out <<
"**************************************************" << std::endl;
3492 out <<
" Global ID: " <<
this->id() <<
" Marker Flag: " <<
this->markerID() << std::endl;
3501 out <<
"**************** COUNTERS ********************" << std::endl;
3502 out <<
"NumPoints=" << numPoints() <<
" " <<
"numBPoints=" << numBPoints() << std::endl;
3503 out <<
"NumVertices=" << numVertices() <<
" " <<
"numBVerices=" << numBVertices() << std::endl;
3504 out <<
"NumVolumes=" << numVolumes() <<
" " <<
"numFaces=" << numFaces() << std::endl;
3505 out <<
"NumBFaces=" << numBFaces() <<
" " <<
"numEdges=" << numEdges() << std::endl;
3506 out <<
"NumBEdges=" << numBEdges() << std::endl;
3507 out <<
"**************************************************" << std::endl;
3508 out <<
"************ACTUALLY STORED ********************" << std::endl;
3509 out <<
"Points=" << pointList.size() <<
" " <<
"Edges= " << edgeList.size() << std::endl;
3510 out <<
"Faces= " << faceList.size() <<
" " <<
"Volumes=" << volumeList.size() << std::endl;
3511 out <<
"**************************************************" << std::endl;
3512 out <<
"******* STATUS OF SWITCHES ************" << std::endl;
3514 out <<
"**************************************************" << std::endl;
3515 out <<
"**************************************************" << std::endl;
3518 out <<
"list of points " <<
this->numPoints() << std::endl;
3519 for (
UInt i = 0; i <
this->numPoints(); i++ )
3521 out <<
"p " << i <<
" (" <<
this->point ( i ).id() <<
"): " 3522 <<
this->point ( i ).coordinate ( 0 ) <<
" " 3523 <<
this->point ( i ).coordinate ( 1 ) <<
" " 3524 <<
this->point ( i ).coordinate ( 2 ) << std::endl;
3527 out <<
"list of elements " <<
this->numElements() << std::endl;
3528 for (
UInt i = 0; i <
this->numElements(); i++ )
3530 out <<
"e " << i <<
" (" <<
this->element ( i ).id() <<
"): ";
3533 out <<
this->element ( i ).point ( j ).localId() <<
" ";
3538 out <<
"list of facets " <<
this->numFacets() << std::endl;
3539 for (
UInt i = 0; i <
this->numFacets(); i++ )
3541 out <<
"f " << i <<
" (" <<
this->facet ( i ).id() <<
"): ";
3544 out <<
this->facet ( i ).point ( j ).localId() <<
" ";
3569 template <
typename GeoShapeType,
typename MCType>
3573 verb = verb && ( M_comm->MyPID() == 0 );
3578 out <<
"**************************************************" << std::endl;
3579 out <<
" Checkin RegionMesh " << std::endl;
3580 out <<
" ID: " <<
this->id() << std::endl;
3581 out <<
"**************************************************" << std::endl;
3585 checkMesh3D ( *
this, testsw, fix, verb, out, out, out );
3588 out <<
"**********************************************" << std::endl <<
3589 "DETAILS OF EXTENDED CHECK:" << std::endl;
3591 out <<
"**********************************************" << std::endl << std::endl;
3592 if ( testsw
.test ( "ABORT_CONDITION" ) )
3601 if ( pointList.size() != M_numPoints )
3603 if ( verb ) out <<
" Point list size " << pointList.size() <<
" not equal to internal counter value " 3604 << M_numPoints << std::endl;
3607 M_numPoints = pointList.size();
3616 if ( edgeList.size() == 0 )
3620 out <<
"WARNING: No Edges Stored" << std::endl;
3621 out <<
"MAY NOT WORK IF WE HAVE DOF ON EDGES AND ESSENTIAL BC!!!!" << std::endl;
3627 else if ( edgeList.size() == numBEdges() )
3634 out <<
"INFORMATION: Only Boundary Edges Stored" << std::endl;
3637 else if ( edgeList.size() == numEdges() )
3646 out <<
"ERROR: Inconsistent numbering of edges" << std::endl;
3647 out <<
"Counters: Boundary=" << numBEdges() <<
" Total=" << numEdges() << std::endl;
3648 out <<
"Stored =" << edgeList.size() << std::endl;
3654 if ( faceList.size() == 0 )
3658 out <<
"ERROR: No Faces Stored: at least boundary faces are needed" << std::endl;
3659 out <<
"" << std::endl;
3665 else if ( faceList.size() == numBFaces() )
3671 out <<
"INFORMATION: Only Boundary Faces Stored" << std::endl;
3674 else if ( faceList.size() == numFaces() )
3683 out <<
"ERROR: Inconsistent numbering of faces" << std::endl;
3684 out <<
"Counters: Boundary=" << numBFaces() <<
" Total=" << numFaces() << std::endl;
3685 out <<
"Stored =" << faceList.size() << std::endl;
3692 for (
typename points_Type::iterator i = pointList.begin(); i != pointList.end(); ++i )
3693 if ( i->boundary() )
3703 if ( verb ) out <<
"Num Boundary points " << count <<
" not equal to internal counter value " 3704 << M_numBPoints << std::endl;
3705 if ( ( count != 0 ) & fix )
3710 out <<
"Fixed Counter";
3722 out <<
" SEVERITY ERROR: internal Vertices Counter unset";
3731 out <<
" SEVERITY ERROR: internal Points Counter unset";
3739 out <<
" SEVERITY ERROR: internal Points Counter unset";
3747 out <<
" SEVERITY ERROR: boundary Points Counter unset";
3755 out <<
" SEVERITY ERROR: boundary Vertices Counter unset";
3760 out <<
" Check Finished " << std::endl <<
3761 "***********************************************" << std::endl;
3769 template <
typename GeoShapeType,
typename MCType>
3774 ASSERT_PRE ( i < faceList.size(),
"Not enough faces stored" ) ;
3775 ASSERT_PRE ( Pos <= 1 ,
"Wrong position (0 or 1)" ) ;
3778 return (
faceList[ i ] ).firstAdjacentElementIdentity();
3782 return (
faceList[ i ] ).secondAdjacentElementIdentity();
3786 template <
typename GeoShapeType,
typename MCType>
3792 ASSERT_PRE ( Pos <= 1 ,
"Wrong position (0 or 1)" );
3795 return f.firstAdjacentElementIdentity();
3799 return f.secondAdjacentElementIdentity();
3804 template <
typename GeoShapeType,
typename MCType>
3810 ASSERT0 ( check, std::stringstream (
"Switch named " + _s +
" is not allowed" ).str().c_str() );
3814 template <
typename GeoShapeType,
typename MCType>
3819 bool check =
switches.unset ( _s );
3820 ASSERT0 ( check, std::stringstream (
"Switch named " + _s +
" is not allowed" ).str().c_str() );
3824 template <
typename GeoShapeType,
typename MCType>
3832 template <
typename GeoShapeType,
typename MCType>
3837 return faceList.size() > M_numBFaces;
3840 template <
typename GeoShapeType,
typename MCType>
3845 return edgeList.size() > M_numBEdges;
3848 template <
typename GeoShapeType,
typename MCType>
3853 return ! edgeList.empty();
3856 template <
typename GeoShapeType,
typename MCType>
3861 return ! faceList.empty();
3864 template <
typename GeoShapeType,
typename MCType>
3872 template <
typename GeoShapeType,
typename MCType>
3881 template <
typename GeoShapeType,
typename MCType>
3886 return point ( id ).boundary();
3889 template <
typename GeoShapeType,
typename MCType>
3894 return p.boundary();
3897 template <
typename GeoShapeType,
typename MCType>
3902 return this->faceList[id].boundary();
3905 template <
typename GeoShapeType,
typename MCType>
3909 ASSERT_PRE ( !M_ElemToFacet.empty(),
"Element to Facet array not set" );
3911 ASSERT_BD ( locF < element_Type::S_numLocalFacets );
3913 return M_ElemToFacet.operator() ( locF, elemId );
3916 template <
typename GeoShapeType,
typename MCType>
3920 ASSERT_PRE (S_geoDimensions == 3,
"RegionMesh::localFaceId, It is not possible to use this method with 2D and 1D geometries.");
3924 template <
typename GeoShapeType,
typename MCType>
3930 ASSERT_PRE ( !M_ElemToRidge.empty(),
"Volume to Edges array not set" );
3932 ASSERT_BD ( locR < element_Type::S_numLocalRidges );
3933 return M_ElemToRidge ( locR, elemId );
3936 template <
typename GeoShapeType,
typename MCType>
3941 return edgeList.size() > id;
3944 template <
typename GeoShapeType,
typename MCType>
3948 return faceList.size() > id;
3951 template <
typename GeoShapeType,
typename MCType>
3956 return point (i * (numPoints() - 1) );
3964 template <
typename GeoShapeType,
typename MCType>
3968 bool verbose = verb && ( M_comm->MyPID() == 0 );
3972 ERROR_MSG (
"RegionMesh::updateElementRidges, It is not possible to use this method with 2D and 1D geometries.");
3980 std::cout <<
" Updating element ridges ... " << std::flush;
3983 renumber = renumber && ce && !
this->ridgeList().empty();
3984 if ( ce && ee == 0 )
3993 ridgeList().setMaxNumItems (ee);
3996 std::pair<
UInt,
bool> e;
3997 M_ElemToRidge.reshape ( numLocalEdges(), numVolumes() );
3999 UInt elemLocalID, i1, i2;
4004 if ( ! ridgeList().empty() )
4009 std::pair<
UInt,
bool> _check;
4010 for (
UInt j = 0; j < ridgeList().size(); ++j )
4012 i1 = ( ridge ( j ).point ( 0 ) ).localId();
4013 i2 = ( ridge ( j ).point ( 1 ) ).localId();
4015 _edge = makeBareEdge ( i1, i2 );
4016 _check = bareEdge.addIfNotThere ( _edge.first );
4022 for (
typename faces_Type::iterator ifa = faceList.begin();
4023 ifa != faceList.begin() + M_numBFaces; ++ifa )
4025 for ( UInt j = 0; j < numLocalEdgesOfFace(); j++ )
4027 i1 = bele.edgeToPoint ( j, 0 );
4028 i2 = bele.edgeToPoint ( j, 1 );
4030 i1 = ( ifa->point ( i1 ) ).localId();
4031 i2 = ( ifa->point ( i2 ) ).localId();
4033 _edge = makeBareEdge ( i1, i2 );
4035 e = bareEdge.addIfNotThere ( _edge.first );
4037 if ( ce && e.second )
4040 for ( UInt k = 0; k < 2 + facetShape_Type::S_numPointsPerEdge; k++ )
4042 UInt inode = bele.edgeToPoint (j, k);
4043 edg.setPoint ( k, ifa->point ( inode ) );
4045 MeshUtility::inheritPointsWeakerMarker ( edg );
4046 edg.setBoundary (
true );
4047 edg.setId ( ridgeList().size() );
4060 for (
typename elements_Type::iterator elemIt = elementList().begin();
4061 elemIt != elementList().end(); ++elemIt )
4063 elemLocalID = elemIt->localId();
4065 for ( UInt j = 0; j < numLocalEdges(); j++ )
4067 i1 = ele.edgeToPoint ( j, 0 );
4068 i2 = ele.edgeToPoint ( j, 1 );
4070 i1 = ( elemIt->point ( i1 ) ).localId();
4071 i2 = ( elemIt->point ( i2 ) ).localId();
4072 _edge = makeBareEdge ( i1, i2 );
4074 e = bareEdge.addIfNotThere ( _edge.first );
4075 M_ElemToRidge.operator() ( j, elemLocalID ) = e.first;
4076 if ( ce && e.second )
4078 for ( UInt k = 0; k < 2 + geoShape_Type::S_numPointsPerEdge; k++ )
4080 UInt inode = ele.edgeToPoint (j, k);
4081 edg.setPoint ( k, elemIt->point ( inode ) );
4083 MeshUtility::inheritPointsWeakerMarker ( edg );
4084 edg.setBoundary (
false );
4085 edg.setId ( ridgeList().size() );
4097 if (
this->M_numGlobalEdges == 0)
4103 if (renumber && !ridgeList().empty() )
4106 std::vector<ID> newToOld = ridgeList().reorderAccordingToFlag (EntityFlags::PHYSICAL_BOUNDARY, &Flag::testOneSet).second;
4108 std::vector<ID> oldToNew ( newToOld.size() );
4109 for (UInt j = 0; j < newToOld.size(); ++j)
4111 oldToNew[ newToOld[j] ] = j;
4114 std::vector<ID>().swap (newToOld);
4117 std::vector<UInt> tmp ( M_ElemToRidge.size() );
4118 std::vector<UInt>::iterator tmp_it = tmp.begin();
4119 for (std::vector<UInt>::iterator it = M_ElemToRidge.begin(); it < M_ElemToRidge.end(); ++it, ++tmp_it)
4121 *tmp_it = oldToNew[*it];
4123 std::copy (tmp.begin(), tmp.end(), M_ElemToRidge.begin() );
4126 UInt n = bareEdge.maxId();
4138 std::cout << n <<
" edges found";
4140 ASSERT_POS ( n == M_numEdges ,
"#Edges found is not equal to that in RegionMesh" << n <<
" " << M_numEdges ) ;
4141 setLinkSwitch ( std::string (
"HAS_ELEMENT_TO_RIDGES" ) );
4145 std::cout <<
" done." << std::endl;
4154 template <
typename GeoShapeType,
typename MCType>
4158 verbose = verbose && ( M_comm->MyPID() == 0 );
4161 typedef typename bareEntitySelector_Type::bareEntity_Type bareFacet_type;
4165 std::cout <<
" Updating element facets ... " << std::flush;
4168 ASSERT0 ( ! cf || numBoundaryFacets() > 0, std::stringstream ( std::string (
"Boundary Facets Must have been set") +
4169 std::string (
"in order to call updateElementFacets with createFacets=true") +
4170 std::string (
"\nUse buildBoundaryFacets(..) from mesh_util.h") ).str().c_str() );
4173 if ( cf && ef == 0 )
4175 ef = numFacets() > numBoundaryFacets() ? numFacets() : (
geoShape_Type::S_numFacets * numElements() + numBoundaryFacets() ) / 2;
4178 ASSERT ( cf || numFacets() > 0 ,
"Mesh is not properly set!" );
4182 facetList().setMaxNumItems ( ef );
4192 std::pair<
UInt,
bool> e;
4193 M_ElemToFacet.reshape ( element_Type::S_numLocalFacets, numElements() );
4196 std::pair<bareFacet_type,
bool>_facet;
4203 for (
typename facets_Type::iterator itf = facetList().begin(); itf != facetList().end(); ++itf )
4205 if ( itf->firstAdjacentElementPosition() != NotAnId && itf->firstAdjacentElementIdentity() != NotAnId)
4207 M_ElemToFacet ( itf->firstAdjacentElementPosition() , itf->firstAdjacentElementIdentity() ) = itf->localId();
4209 if ( itf->secondAdjacentElementPosition() != NotAnId && itf->secondAdjacentElementIdentity() != NotAnId)
4211 M_ElemToFacet ( itf->secondAdjacentElementPosition(), itf->secondAdjacentElementIdentity() ) = itf->localId();
4218 std::cout <<
" done." << std::endl;
4227 UInt _numOriginalStoredFacets = facetList().size();
4229 if ( ! facetList().empty() )
4236 std::pair<
UInt,
bool> _check;
4237 for (
UInt j = 0; j < facetList().size(); ++j )
4241 points[k] = ( facet ( j ).point ( k ) ).localId();
4243 _facet = bareEntitySelector_Type::makeBareEntity ( points );
4244 _check = bareFacet.addIfNotThere ( _facet.first );
4245 if ( ! (
this->facet ( j ).boundary() ) )
4247 extraBareFacet.addIfNotThere ( _facet.first, j);
4251 UInt numFoundBoundaryFacets = bareFacet.size();
4252 UInt facetCount = numFoundBoundaryFacets;
4253 for (
typename elements_Type::iterator elemIt = elementList().begin();
4254 elemIt != elementList().end(); ++elemIt )
4256 elemLocalID = elemIt->localId();
4257 for ( UInt j = 0; j < element_Type::S_numLocalFacets; j++ )
4259 for (UInt k = 0; k < facetShape_Type::S_numVertices; k++)
4261 UInt id = ele.facetToPoint ( j, k );
4262 points[k] = elemIt->point ( id ).localId();
4264 _facet = bareEntitySelector_Type::makeBareEntity ( points );
4266 e = bareFacet.addIfNotThere ( _facet.first );
4267 M_ElemToFacet ( j, elemLocalID ) = e.first;
4268 bool _isBound = e.first < numFoundBoundaryFacets;
4270 bool _isExtra = (e.first >= numFoundBoundaryFacets && e.first < _numOriginalStoredFacets);
4273 facet_Type& _thisFacet (facet (e.first) );
4274 _thisFacet.firstAdjacentElementIdentity() = elemLocalID;
4275 _thisFacet.firstAdjacentElementPosition() = j;
4276 _thisFacet.secondAdjacentElementIdentity() = NotAnId;
4277 _thisFacet.secondAdjacentElementPosition() = NotAnId;
4282 facet_Type& _thisFacet (facet (e.first) );
4285 if (extraBareFacet.deleteIfThere (_facet.first) )
4288 for ( UInt k = 0; k < facet_Type::S_numPoints; ++k )
4290 _thisFacet.setPoint ( k, elemIt->point ( ele.facetToPoint ( j, k ) ) );
4292 _thisFacet.firstAdjacentElementIdentity() = elemLocalID;
4293 _thisFacet.firstAdjacentElementPosition() = j;
4298 _thisFacet.secondAdjacentElementIdentity() = elemLocalID;
4299 _thisFacet.secondAdjacentElementPosition() = j;
4308 for ( UInt k = 0; k < facet_Type::S_numPoints; ++k )
4310 aFacet.setPoint ( k, elemIt->point ( ele.facetToPoint ( j, k ) ) );
4313 aFacet.firstAdjacentElementIdentity() = elemLocalID;
4314 aFacet.firstAdjacentElementPosition() = j;
4317 aFacet.setMarkerID ( NotAnId );
4318 aFacet.setBoundary (
false);
4319 aFacet.setId ( facetCount++ );
4324 facet ( e.first ).secondAdjacentElementIdentity() = elemLocalID;
4325 facet ( e.first ).secondAdjacentElementPosition() = j;
4331 UInt n = bareFacet.maxId();
4335 if (numGlobalFacets() == 0)
4337 setMaxNumGlobalFacets (n);
4342 std::cout << n <<
" facets ";
4354 std::cout <<
" done." << std::endl;
4358 template <
typename GeoShapeType,
typename MCType>
4361 ASSERT_PRE (S_geoDimensions == 3,
"RegionMesh::updateElementFaces, It is not possible to use this method with 2D and 1D geometries.");
4365 template <
typename GeoShapeType,
typename MCType>
4369 M_ElemToFacet.clearArray();
4374 template <
typename GeoShapeType,
typename MCType>
4378 ASSERT_PRE (S_geoDimensions == 3,
"RegionMesh::cleanElementFaces(), It is not possible to use this method with 2D and 1D geometries.");
4382 template <
typename GeoShapeType,
typename MCType>
4386 M_ElemToRidge.clearArray();
4391 template <
typename GeoShapeType,
typename MCType>
4401 list_pts.push_back ( i );
4407 template <
typename GeoShapeType,
typename MCType>
4411 return this->M_meshTransformer;
4414 template <
typename GeoShapeType,
typename MCType>
4418 return this->M_comm;
4421 template <
typename GeoShapeType,
typename MCType>
This is the base class to store basic properties of any mesh entity.
ID localEdgeId(const oneD_Type, UInt const, UInt const) const
Local Edge (specialization for 1D geometries). It calls an error.
MeshEntityContainer< edge_Type > edges_Type
facet_Type & boundaryFacet(oneD_Type, const UInt &i)
UInt faceElement(UInt const faceId, UInt const Pos) const
Id of the Volume Element adjacent to a Face.
void setMarkerID(markerID_Type const &markerId)
set only the mesh marker id.
std::ostream & showLinkSwitch(bool verbose=false, std::ostream &out=std::cout)
Output switches contents.
MeshUtility::MeshTransformer< RegionMesh< geoShape_Type, markerCommon_Type >, markerCommon_Type > & meshTransformer()
Return the handle to perform transormations on the mesh.
element_Type const & volume(UInt const i) const
i-th mesh 3D Element.
ID localEdgeId(const twoD_Type, UInt const elemId, UInt const locE) const
Local Edge (specialization for 2D geometries).
void setMaxNumVolumes(UInt const n, bool const setcounter=false)
Changes Current capacity of Volumes.
UInt numVertices() const
Number of Vertices in Region.
void setMaxNumRidges(threeD_Type, UInt const n, bool const setcounter)
Changes Current capacity of Ridges.
MeshElementMarked< S_ridgeDimension, S_geoDimensions, geoShape_Type, markerCommon_Type > ridge_Type
void setMaxNumPoints(UInt const n, bool const setcounter=false)
Set the number of storable points in the mesh.
ID localRidgeId(twoD_Type, UInt const elemId, UInt const locR) const
edge_Type & setEdge(edge_Type const &e, UInt position)
Add an Edge to specified position.
markerCommon_Type::faceMarker_Type faceMarker_Type
Face Marker.
bool hasFaces() const
Do I store mesh faces?
void setMaxNumGlobalRidges(twoD_Type, UInt const n)
bool getLinkSwitch(std::string const &_s) const
Interrogate Switch.
volume_Type::geoShape_Type volumeShape_Type
Element Shape.
face_Type const & face(UInt const i) const
i-th mesh Face.
facet_Type & boundaryFacet(const UInt &i)
Get boundary facet at the i-th index.
UInt numGlobalPeaks(threeD_Type) const
Returns the global number of peaks in the mesh.
UInt numFacets(twoD_Type) const
GeoDim< S_geoDimensions > geoDim_Type
void setMaxNumGlobalFacets(twoD_Type, UInt const n)
void setNumElements(threeD_Type, UInt const n)
Set counter of elements.
UInt numLocalEdgesOfFace() const
Number of edges on each face.
ridge_Type const & ridge(oneD_Type, UInt const) const
ID localRidgeId(UInt const elemId, UInt const locR) const
Local Ridge ID of a ridge in an element stored in the mesh.
UInt numBoundaryFacets(oneD_Type) const
void setMaxNumGlobalRidges(UInt const n)
Changes Current capacity of Global Ridges.
edge_Type & edge(UInt const i)
i-th mesh edge reference.
void setNumVolumes(UInt const n)
Set number of volumes.
facets_Type & facetList(oneD_Type)
std::vector< point_Type *> _bPoints
Boundary points list.
elements_Type & elementList(threeD_Type)
returns a reference to the elements' container
edge_Type & lastEdge()
Reference to last edge stored in list.
elements_Type & elementList(oneD_Type)
bool isFullFace(UInt const &id) const
Does this id corresponds to a full face?
bool hasInternalEdges() const
Do I store internal Edges?
void setNumBoundaryRidges(twoD_Type, UInt const n)
UInt numGlobalElements(twoD_Type) const
void setMaxNumGlobalVolumes(UInt const n)
Set the number of global volumes.
UInt numRidges(twoD_Type) const
I use standard constructor/destructors.
ID localEdgeId(const threeD_Type, UInt const elemId, UInt const locE) const
Local Edge (specialization for 3D geometries).
elements_Type & elementList()
returns a reference to the elements' container
ridge_Type & ridge(twoD_Type, UInt const i)
bool isBoundaryEdge(UInt const &id) const
Edge on boundary check by id.
bool hasLocalEdges(facet_Type) const
Is the array for local Edges set up? Specialization for 2D geometries.
void setNumBoundaryRidges(oneD_Type, UInt const)
void setNumVertices(UInt const n)
Changes number of Vertices.
void setMaxNumElements(oneD_Type, UInt const n, bool const setcounter=false)
markerCommon_Type::edgeMarker_Type edgeMarker_Type
Edge Marker.
static const Int S_peakDimension
ridge_Type & addRidge(oneD_Type, bool const)
MeshEntityContainer< face_Type > faces_Type
static const UInt S_geoDimensions
static const S_geoDimensions: the dimensions (1,2,3) of the geometry
static const Int S_ridgeDimension
ArraySimple< UInt > M_ElemToFacet
void setMaxNumGlobalRidges(oneD_Type, UInt const)
element_Type & addElement(face_Type const &elem)
UInt numGlobalPeaks(twoD_Type) const
void cleanElementFacets()
Destroys element-to-facet container. Useful to save memory!
UInt numGlobalRidges(oneD_Type) const
std::shared_ptr< Epetra_Comm > commPtr_Type
bool hasLocalFacets() const
Is the array for local facets set up?
bool isBoundaryFacet(UInt const &id) const
Is facet whose id is given on boundary?
peak_Type & peak(threeD_Type, UInt const i)
Returns a reference to the i-th mesh peak.
void setComm(commPtr_Type const &comm)
Setter for the communicator.
point_Type const & lastPoint() const
Returns the last mesh Point.
UInt numGlobalFacets(threeD_Type) const
specializations numGlobalFacets
element_Type & setElement(edge_Type const &elem, UInt const pos)
Adds element in a certain position (specialization for 1D geometry).
UInt maxNumFaces() const
Current capacity of Faces Container.
ridge_Type & ridge(UInt const i)
i-th mesh ridge reference.
UInt storedVolumes() const
Volumes actually stored in list.
UInt numGlobalFacets(twoD_Type) const
ID localRidgeId(oneD_Type, UInt const, UInt const) const
UInt numElements(oneD_Type) const
UInt numEdges() const
Number of Edges.
markerCommon_Type::regionMarker_Type & markerClass() const
get mesh marker.
void setMaxNumGlobalPoints(UInt const n)
Set the number of storable global points in the mesh.
UInt numBEdges() const
Number of Boundary Edges.
edges_Type edgeList
Container of mesh Edges.
RegionMesh()
Default constructor.
UInt localFaceId(UInt const volId, UInt const locF) const
Local Face Id.
edge_Type const & boundaryEdge(UInt const i) const
i-th mesh 1D Boundary Edge.
ridge_Type & addRidge(threeD_Type, bool const boundary)
Adds a Ridge.
const element_Type & element(oneD_Type, const UInt &i) const
void setIsPartitioned(bool const isPartitioned)
UInt numGlobalFacets(oneD_Type) const
void setNumBoundaryFacets(threeD_Type, UInt const n)
Set counter of boundary facets.
void setMarkerClass(typename MCType::regionMarker_Type const &marker)
set mesh marker.
void updateElementRidges(oneD_Type, bool, const bool, UInt, bool)
facets_Type & facetList()
returns a reference to the facets' container
void setMaxNumElements(threeD_Type, UInt const n, bool const setcounter=false)
Changes Current capacity of the container of elements.
UInt numGlobalElements() const
Number of global elements.
void cleanElementRidges()
Destroys Ridge-To-Facet lookup table.
facet_Type & addFacet(oneD_Type, bool const boundary)
void setMaxNumGlobalElements(twoD_Type, UInt const n)
MeshVertex - Zero dimensional entity.
int32_type Int
Generic integer data.
UInt numGlobalElements(threeD_Type) const
Number of global elements.
MeshElementMarked< 0, S_geoDimensions, geoShape_Type, markerCommon_Type > point_Type
peak_Type & peak(twoD_Type, UInt const)
UInt numGlobalPeaks() const
Returns a reference to the i-th mesh peak.
face_Type & addFace()
Adds a face.
bool isBoundaryRidge(oneD_Type, UInt const &) const
ridge_Type const & ridge(threeD_Type, UInt const i) const
i-th mesh ridge.
UInt numFacets(threeD_Type) const
specializations for numFacets
UInt numGlobalRidges() const
Global number of Ridges.
std::ostream & showMe(bool verbose=false, std::ostream &out=std::cout) const
bool isBoundaryFace(UInt const &id) const
Is face whose id is given on boundary?
UInt numGlobalEdges() const
Global number of Edges.
MeshEntityContainer< facet_Type > facets_Type
ID markerID_Type
markerID_Type is the type used to store the geometric entity marker IDs
void setVolumeCounter()
set numVolumes counter.
UInt numGlobalRidges(threeD_Type) const
Global number of Ridges.
void setMaxNumGlobalElements(oneD_Type, UInt const n)
MeshElementMarked< S_facetDimension, S_geoDimensions, geoShape_Type, markerCommon_Type > facet_Type
void setNumFacets(oneD_Type, UInt const n)
bool isPartitioned() const
get M_isPartitioned bool
void printLtGMap(std::ostream &os)
Display local to global mapping.
UInt numElements(threeD_Type) const
point_Type const & firstPoint() const
Returns the first mesh Point.
markerCommon_Type::pointMarker_Type pointMarker_Type
Point Marker.
UInt numFacets(oneD_Type) const
UInt numBoundaryFacets() const
Number of Boundary facets.
void updateInverseJacobian(const UInt &iQuadPt)
void setNumFaces(UInt const n)
Set counter of faces.
UInt numLocalVertices() const
Number of local vertices for each (3D) element.
element_Type & addElement(volume_Type const &elem)
Adds element.
element_Type & addElement()
Adds element.
void setMaxNumGlobalFacets(oneD_Type, UInt const n)
ID localRidgeId(threeD_Type, UInt const elemId, UInt const locR) const
Local Ridge.
ridges_Type & ridgeList()
returns a reference to the ridges' container
facet_Type & boundaryFacet(twoD_Type, const UInt &i)
bool isBoundaryFacet(twoD_Type, UInt const &id) const
point_Type & addPoint(point_Type const &p)
Adds a Point in the mesh.
UInt & numBVertices()
Reference to the number of Boundary Vertices in Region.
point_Type const & point(UInt const i) const
Returns the i-th mesh Point.
bool testOneSet(flag_Type const &inputFlag, flag_Type const &refFlag)
returns true if at least one flag set in refFlag is set in inputFlag
void setMaxNumGlobalElements(threeD_Type, UInt const n)
Set the number of global elements.
UInt localFacetId(UInt const elemId, UInt const locF) const
Local Facet Id.
void setMaxNumGlobalElements(UInt const n)
Set the number of global elements.
UInt numGlobalFaces() const
Returns Global Number of Faces.
ridge_Type & addRidge(edge_Type const &r)
Adds a Ridge. Specialization for 3D geometries.
face_Type & setFace(face_Type const &f, UInt pos)
Adds a face in a certain position.
ridges_Type & ridgeList(oneD_Type)
void updateElementFacets(bool createFaces=false, bool verbose=false, UInt estimateFacetNumber=0)
Build localFacetId table and optionally fills the list of Facets.
void setMaxNumFacets(oneD_Type, UInt const n, bool const setcounter=false)
Real & z()
Returns the reference to the z-coordinate and checks if working in two dimensions.
UInt numLocalEdges() const
Number of local edges for each (3D) element.
facet_Type & addFacet(face_Type const &facet)
Adds a facet. 3D specialization.
void setNumBVertices(UInt const n)
Changes number of Boundary Vertices.
void setNumRidges(UInt const n)
Set counter of facets.
UInt numGlobalVolumes() const
Returns Global Number of Volumes.
markerID_Type markerID() const
get only mesh marker id.
element_Type & setElement(volume_Type const &elem, UInt const pos)
Adds element in a certain position (specialization for 3D geometry).
const flag_Type VERTEX(0x20)
element_Type & element(const UInt &i)
Get element at the i-th index.
void setMaxNumFacets(twoD_Type, UInt const n, bool const setcounter=false)
element_Type & lastVolume()
Reference to last volume stored in list.
dummy class for selecting correct function specializations based on geometry dimensions (1...
void unsetLinkSwitch(std::string const &_s)
Unset a switch.
UInt numPoints() const
Returns number of points in the mesh.
face_Type & boundaryFace(UInt const i)
i-th mesh boundary face.
edge_Type::geoShape_Type edgeShape_Type
UInt storedEdges() const
Number of stored Edges.
UInt localFaceId(const volume_Type &vol, UInt const locF) const
Local Face Id.
void updateElementRidges(bool createRidges=false, const bool verbose=false, UInt estimateRidgeNumber=0, bool renumber=true)
Build localRidgeId table and optionally fills the list of Ridges.
void setMaxNumElements(twoD_Type, UInt const n, bool const setcounter=false)
element_Type & addElement(edge_Type const &elem)
bool isBoundaryRidge(threeD_Type, UInt const &id) const
Ridge on boundary check by id.
ridge_Type const & ridge(twoD_Type, UInt const i) const
RegionMesh(UInt id, commPtr_Type const &comm)
Constructor.
facet_Type const & facet(oneD_Type, UInt const i) const
MeshUtility::MeshTransformer< RegionMesh< geoShape_Type, markerCommon_Type >, markerCommon_Type > M_meshTransformer
facet_Type & facet(oneD_Type, UInt const i)
element_Type & element(threeD_Type, const UInt &i)
Get element at the i-th index.
Real & x()
Returns the reference to the x-coordinate.
element_Type & element(oneD_Type, const UInt &i)
void setMaxNumRidges(oneD_Type, UInt const, bool const)
face_Type & addFace(bool const boundary)
Adds a face.
MeshElementMarked< 3, S_geoDimensions, geoShape_Type, markerCommon_Type > volume_Type
void setMaxNumEdges(UInt const n, bool const setcounter=false)
Changes Current capacity of Edges.
vectorSize_Type const numberOfColumns() const
Return the number of columns.
UInt maxNumElements(threeD_Type) const
Current capacity of the container of Elements.
const facet_Type & boundaryFacet(twoD_Type, const UInt &i) const
MeshEntityContainer< peak_Type > peaks_Type
MeshEntityContainer< point_Type > points_Type
Class for 3D, 2D and 1D Mesh.
bool isBoundaryEdge(ridge_Type const &e) const
Edge on boundary check.
facet_Type & addFacet(edge_Type const &facet)
Adds a facet. 2D specialization.
void setMaxNumFaces(UInt const n, bool const setcounter=false)
Changes Current capacity of Faces.
const facet_Type & boundaryFacet(threeD_Type, const UInt &i) const
Get boundary facet at the i-th index.
UInt maxNumPoints() const
Returns the number of storable points in the mesh.
geoShape_Type elementShape_Type
GeoShapeType geoShape_Type
bool isVertex(point_Type const &p) const
Vertex check.
UInt numBPoints() const
Returns the number of Boundary Points.
UInt numRidges() const
Number of Ridges.
element_Type & volume(UInt const i)
i-th mesh 3D Element.
const flag_Type PHYSICAL_BOUNDARY(0x01)
facet_Type const & facet(UInt const i) const
i-th mesh Facet.
MeshEntityContainer< volume_Type > volumes_Type
void setLinkSwitch(std::string const &_s)
Set a switch using a given name.
void setMaxNumFacets(UInt const n, bool const setcounter=false)
Changes Current capacity of Facets.
const flag_Type DEFAULT(0x00)
bool isBoundaryFacet(threeD_Type, UInt const &id) const
Is facet whose id is given on boundary?
ridge_Type const & ridge(UInt const i) const
i-th mesh ridge.
std::ostream & showMe(bool verbose=false, std::ostream &out=std::cout) const
Display general information about the content of the class.
MarkerCommon< MarkerIDStandardPolicy > defaultMarkerCommon_Type
The simplest MarkerCommon: uses all defaults.
UInt maxNumEdges() const
Capacity of Edge Container.
ID localEdgeId(const face_Type &elem, UInt const locE) const
Local Edge (specialization for 2D geometries).
volumes_Type volumeList
Container of mesh 3D Elements.
ridge_Type & ridge(oneD_Type, UInt const)
void setNumEdges(UInt const n)
Set internal counter of number of Edges.
facetShape_Type::GeoBShape ridgeShape_Type
ridge_Type & addRidge(point_Type const &r)
Adds a Ridge. Specialization for 2D geometries.
ID localEdgeId(UInt const elemId, UInt const locE) const
Local Edge.
ridges_Type & ridgeList(threeD_Type)
returns a reference to the ridges' container
void cleanElementEdges(facet_Type)
UInt numBoundaryFacets(threeD_Type) const
Number of Boundary facets.
const facet_Type & boundaryFacet(const UInt &i) const
Get boundary facet at the i-th index.
void setMaxNumFacets(threeD_Type, UInt const n, bool const setcounter=false)
Changes Current capacity of Facets.
UInt numGlobalElements(oneD_Type) const
peak_Type const & peak(twoD_Type, UInt const) const
peak_Type const & peak(UInt const i) const
Returns the i-th mesh Peak.
void setNumRidges(threeD_Type, UInt const n)
Set counter of ridges.
bool isBoundaryRidge(edge_Type const &r) const
Ridge on boundary check. Specialization for 3D geometries.
void getListOfPoints(bool(*fct)(Real, Real, Real), std::vector< UInt > &list_pts)
List of points.
bool isBoundaryPoint(UInt const &id) const
Is this point on boundary?
facets_Type & facetList(threeD_Type)
returns a reference to the facets' container
ridges_Type & ridgeList(twoD_Type)
UInt numGlobalVertices() const
Returns the global number of vertices in the mesh.
UInt maxNumVolumes() const
Current capacity of Volumes Container.
void setNumFacets(twoD_Type, UInt const n)
point_Type & point(UInt const i)
Returns a reference to the i-th mesh point.
commPtr_Type comm() const
Return the communicator.
UInt numFaces() const
Returns Number of Faces.
void setMaxNumElements(UInt const n, bool const setcounter=false)
Changes Current capacity of the container of elements.
void updateElementEdges(facet_Type, bool createEdges=false, const bool verbose=false, UInt estimateEdgeNumber=0, bool=true)
Build localEdgeId table and optionally fills the list of Edges.
void setNumElements(UInt const n)
Set counter of elements.
face_Type & lastFace()
Reference to last face stored in list.
const element_Type & element(threeD_Type, const UInt &i) const
Get element at the i-th index.
UInt maxNumElements(oneD_Type) const
facet_Type & addFacet(bool const boundary)
Adds a facet.
geoShape_Type::GeoBShape facetShape_Type
ridge_Type & addRidge(twoD_Type, bool const boundary)
double Real
Generic real data.
void updateElementFaces(bool createFaces=false, const bool verbose=false, UInt estimateFaceNumber=0)
Build localFaceId table and optionally fills the list of Faces.
faces_Type faceList
Container of mesh Faces.
facet_Type & facet(threeD_Type, UInt const i)
i-th mesh facet.
bool isBoundaryFacet(oneD_Type, UInt const &id) const
element_Type & element(twoD_Type, const UInt &i)
edge_Type & addEdge(edge_Type const &r)
Adds an Edge.
void setMaxNumGlobalFacets(UInt const n)
Changes Current capacity of Global Facets.
ID localRidgeId(const element_Type &elem, UInt const locR) const
Local Ridge.
UInt numElements(twoD_Type) const
flag related free functions and functors
void setMaxNumGlobalFaces(UInt const n)
Changes Current capacity of Global Faces.
UInt numBoundaryFacets(twoD_Type) const
ridge_Type & addRidge(bool const boundary)
Adds a Ridge.
bool hasLocalFaces() const
Is the array for local faces set up?
markerCommon_Type::volumeMarker_Type volumeMarker_Type
Volume Marker.
virtual ~RegionMesh()
Destructor.
container_Type::const_iterator containerConstIterator_Type
facet_Type & addFacet(threeD_Type, bool const boundary)
Adds a facet.
point_Type & boundaryPoint(UInt const i)
Returns a reference to the i-th mesh Boundary Point.
peak_Type const & peak(threeD_Type, UInt const i) const
Returns the i-th mesh Peak.
available bit-flags for different geometric properties
void updateElementEdges(bool createEdges=false, const bool verbose=false, UInt estimateEdgeNumber=0, bool renumber=true)
Builds localEdgeId table and optionally fills the list of Edges.
UInt numRidges(threeD_Type) const
Number of Ridges.
void setNumBoundaryFacets(oneD_Type, UInt const n)
element_Type & setElement(face_Type const &elem, UInt const pos)
Adds element in a certain position (specialization for 2D geometry).
UInt storedPoints() const
Returns number of points in the mesh actually stored.
UInt numLocalFaces() const
Number of local faces for each 3Delement.
MeshElementMarked< 2, S_geoDimensions, geoShape_Type, markerCommon_Type > face_Type
void updateElementRidges(twoD_Type, bool, const bool, UInt, bool)
face_Type & face(UInt const i)
i-th mesh face.
void cleanElementEdges()
Destroys edge To facet lookup table.
Class for describing a geometric Entity immersed in 1D, 2D or 3D Geometry.
bool hasLocalFaces(ridge_Type) const
edge_Type & boundaryEdge(UInt const i)
i-th mesh 1D Boundary Edge Reference.
UInt & numPoints()
Returns a reference to number of points in the mesh.
void setNumElements(oneD_Type, UInt const n)
void setNumElements(twoD_Type, UInt const n)
void setNumBPoints(UInt const n)
Sets the number of Boundary Points.
bool hasInternalFaces() const
Do I store also internal faces?
face_Type const & boundaryFace(UInt const i) const
i-th mesh boundary face.
void setNumFacets(UInt const n)
Set counter of facets.
facet_Type & facet(UInt const i)
i-th mesh facet.
void setMaxNumGlobalEdges(UInt const n)
Changes Current capacity of Global Edges.
UInt faceElement(facet_Type const &f, UInt const Pos) const
3DElement adjacent to a FACE. Face reference given.
bool isBoundaryRidge(UInt const &id) const
Ridge on boundary check by id.
UInt numBVertices() const
Number of Boundary Vertices in Region.
UInt numGlobalPeaks(oneD_Type) const
void setNumBoundaryFacets(UInt const n)
Set counter of boundary facets.
void setMaxNumGlobalFacets(threeD_Type, UInt const n)
Changes Current capacity of Global Facets.
static const Int S_facetDimension
MeshEntityContainer< element_Type > elements_Type
UInt numRidges(oneD_Type) const
facets_Type & facetList(twoD_Type)
UInt storedFaces() const
Number of Faces actually stored.
markerCommon_Type::regionMarker_Type M_marker
markerCommon_Type::regionMarker_Type regionMarker_Type
Region Marker.
element_Type & setVolume(element_Type const &v, UInt const pos)
Adds volume in a certain position.
ridge_Type & ridge(threeD_Type, UInt const i)
i-th mesh ridge reference.
elements_Type & elementList(twoD_Type)
const element_Type & element(const UInt &i) const
Get element at the i-th index.
void setNumBEdges(UInt const n)
Set boundary Edge counter.
bool hasEdges() const
Do I store mesh edges?
facet_Type & addFacet(point_Type const &facet)
Adds a facet. 1D specialization.
UInt numGlobalPoints() const
Returns the global number of points in the mesh.
point_Type & addPoint(bool const boundary, bool const vertices)
Adds a Point in the mesh.
const facet_Type & boundaryFacet(oneD_Type, const UInt &i) const
void setNumFacets(threeD_Type, UInt const n)
Set counter of facets.
UInt storedBPoints() const
Returns number of boundary points in the mesh actually stored.
void setMaxNumRidges(UInt const n, bool const setcounter=false)
Changes Current capacity of Ridges.
MeshElementMarked< S_peakDimension, S_geoDimensions, geoShape_Type, markerCommon_Type > peak_Type
Real & y()
Returns the reference to the y-coordinate.
UInt maxNumElements(twoD_Type) const
peak_Type const & peak(oneD_Type, UInt const) const
face_Type::geoShape_Type faceShape_Type
void setNumBoundaryRidges(UInt const n)
Set boundary ridge counter.
bool isBoundaryRidge(point_Type const &r) const
Ridge on boundary check. Specialization for 2D geometries.
facet_Type const & facet(twoD_Type, UInt const i) const
facet_Type & addFacet(twoD_Type, bool const boundary)
const UInt & numSwitches() const
Get the number of switch which have been set.
void updateElementRidges(threeD_Type, bool createRidges=false, const bool verbose=false, UInt estimateRidgeNumber=0, bool renumber=true)
Build localRidgeId table and optionally fills the list of Ridges.
bool isFullEdge(UInt const &id) const
Full Edge check by id.
const element_Type & element(twoD_Type, const UInt &i) const
facet_Type const & facet(threeD_Type, UInt const i) const
i-th mesh Facet.
Int check(Int level=0, bool const fix=false, bool verbose=true, std::ostream &out=std::cerr)
Basic tests for mesh consistency.
void setNumBoundaryFacets(twoD_Type, UInt const n)
MCType markerCommon_Type
Common Markers.
facet_Type & facet(twoD_Type, UInt const i)
ArraySimple< UInt > M_ElemToRidge
UInt numFacets() const
Returns Number of Facets.
UInt numBFaces() const
Number of Boundary Faces.
UInt numVolumes() const
Returns Number of Volumes.
element_Type & addVolume()
Adds volume.
element_Type & addVolume(element_Type const &vol)
Adds volume.
void setNumBoundaryRidges(threeD_Type, UInt const n)
Set boundary ridge counter.
bool hasLocalEdges() const
Is the array for local Edges set up?
bool hasLocalRidges() const
Is the array for ridges set up?
MeshElementMarked< S_geoDimensions, S_geoDimensions, geoShape_Type, markerCommon_Type > element_Type
edge_Type const & edge(UInt const i) const
i-th mesh edge.
points_Type pointList
Container of mesh Points/Vertices.
void setNumGlobalVertices(UInt const n)
Set the number of vertices in the mesh.
MeshElementMarked< 1, S_geoDimensions, geoShape_Type, markerCommon_Type > edge_Type
bool test(const char *a) const
bool isVertex(UInt const &id) const
Vertex check.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
UInt numGlobalRidges(twoD_Type) const
void setMaxNumGlobalRidges(threeD_Type, UInt const n)
Changes Current capacity of Global Ridges.
facet_Type & boundaryFacet(threeD_Type, const UInt &i)
Get boundary facet at the i-th index.
point_Type const & boundaryPoint(UInt const i) const
Returns a reference to the i-th mesh Boundary Point.
BareEntitySelector class - Select the proper bare entity type (bareEdge or bareFace) based on the num...
void setNumBFaces(UInt const n)
Set counter of boundary faces.
void setMaxNumRidges(twoD_Type, UInt const n, bool const setcounter)
ID localEdgeId(const volume_Type &elem, UInt const locE) const
Local Edge (specialization for 3D geometries).
peak_Type & peak(oneD_Type, UInt const)
bool isBoundaryPoint(point_Type const &p) const
Is this point on boundary?
edge_Type & addEdge(bool const boundary)
Adds an Edge.
bool isBoundaryRidge(twoD_Type, UInt const &id) const
UInt numGlobalFacets() const
Returns Global Number of Facets.
void cleanElementFaces()
Destroys element-to-face container. Useful to save memory!
MeshEntityContainer< ridge_Type > ridges_Type
RegionMesh(commPtr_Type const &comm)
Constructor.
face_Type & addFace(face_Type const &f)
Adds a face.
UInt maxNumElements() const
Current capacity of the container of Elements.
UInt numElements() const
Number of elements in mesh.
void set_switches_for_regionmesh(Switch &sw)