41 #include <lifev/core/mesh/MeshVertex.hpp> 42 #include <lifev/core/mesh/MeshEntity.hpp> 43 #include <lifev/core/array/VectorSmall.hpp> 58 template <
typename GeoShape,
typename PointType =
MeshVertex>
120 std::ostream&
showMe (
bool verbose =
false, std::ostream& c = std::cout )
const;
128 void swapPoints (
const ID& firstIdentity,
const ID& secondIdentity );
233 template <
typename GeoShape,
typename PointType>
236 template <
typename GeoShape,
typename PointType>
239 template <
typename GeoShape,
typename PointType>
246 template <
typename GeoShape,
typename PointType>
253 template <
typename GeoShape,
typename PointType>
260 M_points[ i ] = element.M_points[ i ];
264 template <
typename GeoShape,
typename PointType>
270 template <
typename GeoShape,
typename PointType>
274 if (
this != &element )
279 M_points[ i ] = element.M_points[ i ];
285 template <
typename GeoShape,
typename PointType>
287 showMe (
bool verbose, std::ostream& out )
const 289 out <<
"----- MeshElement object -----" << std::endl;
290 out <<
" Number of Vertices = " << GeoShape::S_numVertices << std::endl;
291 out <<
" Number of Points = " << GeoShape::S_numPoints << std::endl;
292 out <<
" ID = " << id() << std::endl;
293 out <<
" local ID = " << localId() << std::endl;
296 out <<
" POINTS INFORMATION" << std::endl << std::endl;
297 for (
UInt i = 0 ; i < GeoShape::S_numVertices; i++ )
299 out <<
"POINT ID. " << i << std::endl;
300 out <<
point ( i
).showMe ( verbose, out );
303 out <<
"----- END OF MeshElement data ---" << std::endl << std::endl;
307 template <
typename GeoShape,
typename PointType>
313 template <
typename GeoShape,
typename PointType>
316 static bool first (
true);
317 static ID oldToNew[ GeoShape::S_numPoints ];
320 for (
ID i = 0; i < GeoShape::S_numPoints; ++i)
322 oldToNew[i] = reversePoint<GeoShape> (i);
326 this->exchangePoints (oldToNew);
330 template <
typename GeoShape,
typename PointType>
333 point_Type const* tmp[ GeoShape::S_numPoints ];
334 for (
UInt i = 0; i < GeoShape::S_numPoints; ++i )
338 for (
UInt i = 0; i < GeoShape::S_numPoints; ++i )
340 M_points[ i ] = tmp[ oldToNew[ i ] ];
344 template <
typename GeoShape,
typename PointType>
348 ASSERT_BD ( ( identity < MeshElement<GeoShape, PointType>::S_numLocalPoints ) );
349 return * (
static_cast<PointType
const*> (
M_points[ identity ] ) );
352 template <
typename GeoShape,
typename PointType>
356 ASSERT_BD ( ( identity < MeshElement<GeoShape, PointType>::S_numLocalPoints ) );
357 return * (
static_cast<PointType
const*> (
M_points[ reversePoint<GeoShape> ( identity ) ] ) );
360 template <
typename GeoShape,
typename PointType>
364 ASSERT_BD ( ( identity < MeshElement<GeoShape, PointType>::S_numLocalPoints ) ) ;
368 template <
typename GeoShape,
typename PointType>
380 template <
typename GeoShape,
typename PointType>
384 ASSERT_BD ( ( identity < MeshElement<GeoShape, PointType>::S_numLocalPoints ) ) ;
388 template <
typename GeoShape,
typename PointType>
400 template <
typename GeoShape,
typename PointType>
404 return (
const_cast<PointType*> (
M_points[identity]) ) -> setStrongerMarkerID (flag);
407 template <
typename PointType>
418 Vector3D dVec = castToVector3D (edge.point ( 1 ).coordinates() );
419 dVec -= castToVector3D (edge.point ( 0 ).coordinates() );
This is the base class to store basic properties of any mesh entity.
MeshElement & operator=(MeshElement const &element)
The equivalence operator.
static const UInt S_numLocalVertices
Number of Vertices associated to the entity.
markerID_Type setStrongerMarkerIDAtPoint(const ID &identity, markerID_Type const &flag) const
Sets the Marker ID of a point.
MeshElement()
Empty Constructor.
bool setPointWithBoundaryCheck(ID const identity, point_Type const &point)
Inserts a point using point references with forced boundary check.
void swapPoints(const ID &firstIdentity, const ID &secondIdentity)
Swap Points.
MeshVertex - Zero dimensional entity.
MeshVertex - Zero dimensional entity.
ID markerID_Type
markerID_Type is the type used to store the geometric entity marker IDs
MeshElement(const MeshElement< GeoShape, PointType > &element)
Copy constructor.
void updateInverseJacobian(const UInt &iQuadPt)
void setLocalId(const ID &id)
Method to set the local identifier.
static const UInt S_numLocalPoints
Number of points associated to the entity.
point_Type const & point(ID const identity) const
Returns the point of identity indicated in the argument.
void setPoint(ID const identity, point_Type const *point)
Inserts a point using pointers.
MeshElement(ID identity)
Declares item identity.
void exchangePoints(const ID oldToNew[GeoShape::S_numPoints])
Exchange points.
Real edgeLength(const MeshElement< LinearLine, PointType > &edge)
double Real
Generic real data.
point_Type const * points() const
Returns the points vector.
void setPoint(ID const identity, point_Type const &point)
Inserts a point using point references.
point_Type const & reversepoint(ID const identity) const
Returns the point of identity indicated in the argument.
VectorSmall< 3 > Vector3D
std::ostream & showMe(bool verbose=false, std::ostream &c=std::cout) const
Display general information about the content of the class.
point_Type const * M_points[GeoShape::S_numPoints]
Assert & error(const char *strMsg=0)
void reversePoints()
Reverses the points of the element.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
bool setPointWithBoundaryCheck(ID const identity, point_Type const *point)
Inserts a point using pointers with forced boundary check.
~MeshElement()
Destructor.