30 #define __GeoEntity_H 1
46 template<
typename Entity>
49 boost::equality_comparable<GeoEntity<Entity> >,
50 boost::less_than_comparable<GeoEntity<Entity> >,
51 boost::less_than_comparable<GeoEntity<Entity>, size_type>,
65 typedef typename super::topological_face_type face_type;
66 typedef face_type GeoBShape;
67 typedef typename Entity::edge_permutation_type edge_permutation_type;
68 typedef typename Entity::face_permutation_type face_permutation_type;
70 static const size_type Shape = super::Shape;
71 static const size_type Geometry = super::Geometry;
73 static const uint16_type nDim = super::nDim;
74 static const uint16_type nOrder = super::nOrder;
75 static const uint16_type nRealDim = super::nRealDim;
78 static const uint16_type numVertices = super::numVertices;
79 static const uint16_type numFaces = super::numFaces;
80 static const uint16_type numGeometricFaces = super::numGeometricFaces;
81 static const uint16_type numTopologicalFaces = super::numTopologicalFaces;
82 static const uint16_type numEdges = super::numEdges;
83 static const uint16_type numNormals = super::numNormals;
85 static const uint16_type numPoints = super::numPoints;
86 static const uint16_type nbPtsPerVertex = super::nbPtsPerVertex;
87 static const uint16_type nbPtsPerEdge = super::nbPtsPerEdge;
88 static const uint16_type nbPtsPerFace = super::nbPtsPerFace;
89 static const uint16_type nbPtsPerVolume = super::nbPtsPerVolume;
91 typedef Entity convex_type;
93 static const bool is_simplex = super::is_simplex;
94 static const bool is_hypercube = super::is_hypercube;
99 template<
typename T =
double>
115 M_geometry( Geometry ),
120 M_pidInPartition( 0 ),
122 M_idInOthersPartitions(),
134 M_geometry( geometry ),
139 M_pidInPartition( 0 ),
141 M_idInOthersPartitions(),
145 GeoEntity( GeoEntity
const& __me )
149 M_entity( __me.M_entity ),
150 M_geometry( __me.M_geometry ),
151 M_shape( __me.M_shape ),
152 M_boundaryEntityDimension( __me.M_boundaryEntityDimension ),
153 M_npids( __me.M_npids ),
155 M_pidInPartition( __me.M_pidInPartition ),
156 M_neighor_pids( __me.M_neighor_pids ),
157 M_idInOthersPartitions( __me.M_idInOthersPartitions ),
158 M_elist( __me.M_elist )
161 GeoEntity& operator=( GeoEntity
const& __me )
166 M_entity = __me.M_entity;
167 M_geometry = __me.M_geometry;
168 M_shape = __me.M_shape;
169 M_boundaryEntityDimension = __me.M_boundaryEntityDimension;
170 M_npids = __me.M_npids;
172 M_pidInPartition = __me.M_pidInPartition;
173 M_neighor_pids = __me.M_neighor_pids;
174 M_idInOthersPartitions = __me.M_idInOthersPartitions;
175 M_elist = __me.M_elist;
189 bool operator==( GeoEntity
const& e )
const
191 return M_id == e.id();
193 bool operator<( GeoEntity
const& e )
const
195 return M_id < e.id();
233 return super::numPoints;
243 return super::numVertices;
253 return super::numEdges;
263 return super::numFaces;
273 return super::numTopologicalFaces;
283 return super::numGeometricFaces;
293 return super::numNormals;
305 return M_shape.test( __shape );
345 return M_shape.test( SHAPE_POINT );
353 return M_shape.test( SHAPE_LINE );
361 return M_shape.test( SHAPE_TRIANGLE );
369 return M_shape.test( SHAPE_QUAD );
377 return M_shape.test( SHAPE_TETRA );
385 return M_shape.test( SHAPE_HEXA );
393 return M_shape.test( SHAPE_LINEAR );
401 return M_shape.test( SHAPE_BILINEAR );
409 return M_shape.test( SHAPE_QUADRATIC );
435 return M_boundaryEntityDimension;
445 return ( M_pidInPartition!=M_pid );
470 return M_pidInPartition;
478 M_pidInPartition = pid ;
503 return M_neighor_pids.size();
512 return M_neighor_pids.size() > 0;
520 return M_neighor_pids;
527 return M_neighor_pids;
535 M_idInOthersPartitions.insert( std::make_pair( pid,
id ) );
543 return M_idInOthersPartitions.find( pid )->second;
551 return M_idInOthersPartitions;
559 return M_idInOthersPartitions;
576 virtual double measure()
const = 0;
604 M_boundaryEntityDimension = ent_d;
621 FEELPP_ASSERT( M_npids -1 == M_neighor_pids.size() )( M_npids )( M_neighor_pids ).error(
"invalid partitioning data" );
622 M_neighor_pids.size();
630 M_neighor_pids = npids;
642 static uint16_type
eToP( uint16_type
const __localEdge, uint16_type
const __point )
644 return super::e2p( __localEdge, __point );
650 static uint16_type
fToP( uint16_type
const __localFace, uint16_type
const __point )
652 return super::f2p( __localFace, __point );
658 static uint16_type
fToE( uint16_type
const __localFace, uint16_type
const __edge )
660 return super::f2e( __localFace, __edge );
677 return M_elist.size();
698 M_elistGhost.insert( boost::make_tuple( proc,e ) );
707 return M_elistGhost.size();
730 friend class boost::serialization::access;
731 template<
class Archive>
732 void serialize( Archive & ar,
const unsigned int version )
734 DVLOG(2) <<
"Serializing GeoEntity...\n";
735 DVLOG(2) <<
" - id...\n";
737 DVLOG(2) <<
" - id:" << M_id <<
"\n";
738 DVLOG(2) <<
" - entity...\n";
740 DVLOG(2) <<
" - entity:" << M_entity.
context() <<
"\n";
741 DVLOG(2) <<
" - geometry...\n";
743 DVLOG(2) <<
" - geometry:" << M_geometry.
context() <<
"\n";
744 DVLOG(2) <<
" - shape...\n";
746 DVLOG(2) <<
" - shape:" << M_shape.
context() <<
"\n";
747 DVLOG(2) <<
" - npids...\n";
749 DVLOG(2) <<
" - npids:" << M_npids <<
"\n";
750 DVLOG(2) <<
" - pid...\n";
752 DVLOG(2) <<
" - pid:" << M_pid <<
"\n";
753 ar & M_pidInPartition;
755 ar & M_idInOthersPartitions;
768 uint16_type M_boundaryEntityDimension;
772 uint16_type M_pidInPartition;
773 std::vector<int> M_neighor_pids;
774 std::map<uint16_type, size_type> M_idInOthersPartitions;
777 std::set<size_type> M_elist;
779 std::set<boost::tuple<int,size_type> > M_elistGhost;
783 typedef GeoEntity<Simplex<0, 1> > GeoPoint;
786 typedef GeoEntity<Simplex<1, 1> > LinearLine;
787 typedef GeoEntity<Simplex<2, 1> > LinearTriangle;
788 typedef GeoEntity<Simplex<3, 1> > LinearTetra;
789 typedef GeoEntity<Simplex<1, 2> > QuadraticLine;
790 typedef GeoEntity<Simplex<2, 2> > QuadraticTriangle;
791 typedef GeoEntity<Simplex<3, 2> > QuadraticTetra;
794 typedef GeoEntity<Hypercube<2, 1> > LinearQuad;
795 typedef GeoEntity<Hypercube<3, 1> > LinearHexa;
796 typedef GeoEntity<Hypercube<2, 2> > QuadraticQuad;
797 typedef GeoEntity<Hypercube<3, 2> > QuadraticHexa;
bool isQuadratic() const
Definition: geoentity.hpp:407
uint16_type pidInPartition() const
Definition: geoentity.hpp:468
std::map< uint16_type, size_type > & idInOthersPartitions()
Definition: geoentity.hpp:557
Definition: entities.hpp:49
Definition: entities.hpp:61
void setNumberOfPartitions(uint16_type np)
Definition: geoentity.hpp:611
const uint16_type invalid_uint16_type_value
Definition: feelcore/feel.hpp:338
bool isAPointShape() const
Definition: geoentity.hpp:343
bool isAVolume() const
Definition: geoentity.hpp:311
std::vector< int > const & neighborPartitionIds() const
Definition: geoentity.hpp:518
uint16_type nFaces() const
Definition: geoentity.hpp:261
bool isAQuadrangleShape() const
Definition: geoentity.hpp:367
self_type & addElement(size_type e)
Definition: geoentity.hpp:666
bool isInternal() const
Definition: geoentity.hpp:415
size_type numberOfNeighborPartitions() const
Definition: geoentity.hpp:501
static uint16_type fToP(uint16_type const __localFace, uint16_type const __point)
Definition: geoentity.hpp:650
Definition: entities.hpp:60
uint16_type partitionId() const
Definition: geoentity.hpp:484
bool hasShape(size_type __shape) const
Definition: geoentity.hpp:303
uint16_type numberOfPartitions() const
Definition: geoentity.hpp:493
size_type numberOfElementsGhost() const
Definition: geoentity.hpp:705
bool isLinear() const
Definition: geoentity.hpp:391
bool isAHexahedraShape() const
Definition: geoentity.hpp:383
bool isATriangleShape() const
Definition: geoentity.hpp:359
uint16_type nPoints() const
Definition: geoentity.hpp:231
uint16_type refDim() const
Definition: geoentity.hpp:221
self_type & addElementGhost(int proc, size_type e)
Definition: geoentity.hpp:696
std::set< size_type > const & elements() const
Definition: geoentity.hpp:683
void setOnBoundary(bool b, uint16_type ent_d=invalid_uint16_type_value)
Definition: geoentity.hpp:592
void setNumberOfNeighborPartitions(uint16_type nep)
Definition: geoentity.hpp:619
uint16_type nVertices() const
Definition: geoentity.hpp:241
Definition: geoentity.hpp:100
void setNeighborPartitionIds(std::vector< int > const &npids)
Definition: geoentity.hpp:628
std::map< uint16_type, size_type > const & idInOthersPartitions() const
Definition: geoentity.hpp:549
bool isGhostCell() const
Definition: geoentity.hpp:440
Definition: entities.hpp:62
size_type numberOfElements() const
Definition: geoentity.hpp:675
Reference convex.
Definition: refentity.hpp:58
bool isOnBoundary() const
Definition: geoentity.hpp:425
bool isBilinear() const
Definition: geoentity.hpp:399
bool isALine() const
Definition: geoentity.hpp:327
std::set< boost::tuple< int, size_type > > const & elementsGhost() const
Definition: geoentity.hpp:713
constexpr uint16_type nTopologicalFaces() const
Definition: geoentity.hpp:271
size_type context() const
Definition: feelcore/context.hpp:150
void setProcessIdInPartition(uint16_type pid)
Definition: geoentity.hpp:476
bool isATetrahedraShape() const
Definition: geoentity.hpp:375
Definition: entities.hpp:59
size_t size_type
Indices (starting from 0)
Definition: feelcore/feel.hpp:319
bool active() const
Definition: geoentity.hpp:568
void setProcessId(uint16_type pid)
Definition: geoentity.hpp:460
bool isALineShape() const
Definition: geoentity.hpp:351
static uint16_type fToE(uint16_type const __localFace, uint16_type const __edge)
Definition: geoentity.hpp:658
virtual double measure() const =0
static uint16_type eToP(uint16_type const __localEdge, uint16_type const __point)
Definition: geoentity.hpp:642
bool isLinkedToOtherPartitions() const
Definition: geoentity.hpp:510
base class for all geometric entities
Definition: geoentity.hpp:47
uint16_type processId() const
Definition: geoentity.hpp:451
std::vector< int > & neighborPartitionIds()
Definition: geoentity.hpp:525
uint16_type boundaryEntityDimension() const
Definition: geoentity.hpp:433
uint16_type nGeometricFaces() const
Definition: geoentity.hpp:281
bool isAPoint() const
Definition: geoentity.hpp:335
uint16_type nNormals() const
Definition: geoentity.hpp:291
void setIdInOthersPartitions(uint16_type pid, size_type id)
Definition: geoentity.hpp:533
bool isASurface() const
Definition: geoentity.hpp:319
Definition: entities.hpp:50
uint16_type nEdges() const
Definition: geoentity.hpp:251
size_type idInOthersPartitions(uint16_type pid) const
Definition: geoentity.hpp:541