OGS
FileIO::Gocad::GocadNode Class Reference

Detailed Description

Definition at line 30 of file GocadNode.h.

#include <GocadNode.h>

Inheritance diagram for FileIO::Gocad::GocadNode:
[legend]
Collaboration diagram for FileIO::Gocad::GocadNode:
[legend]

Public Member Functions

 GocadNode (double const *const coords, std::size_t id, std::size_t layer_transition_idx)
 
 GocadNode ()=delete
 
 GocadNode (GocadNode const &src)=default
 
 GocadNode (GocadNode &&src)=default
 
GocadNodeoperator= (GocadNode &&rhs)=default
 
GocadNodeoperator= (GocadNode const &rhs)=default
 
 ~GocadNode () override=default
 
void setFaceSet (std::size_t face_set_number, std::size_t face_indicator)
 
bool isMemberOfFaceSet (std::size_t face_set_number) const
 
bool isMemberOfAnyFaceSet () const
 
void resetID (std::size_t id)
 
std::bitset< 128 > const & getFaceSetMembership () const
 
FaceDirection getFaceDirection (std::size_t const face_set_number) const
 
std::size_t getLayerTransitionIndex () const
 
- Public Member Functions inherited from MeshLib::Node
 Node (const double coords[3], std::size_t id=std::numeric_limits< std::size_t >::max())
 Constructor using a coordinate array. More...
 
 Node (std::array< double, 3 > const &coords, std::size_t id=std::numeric_limits< std::size_t >::max())
 Constructor using a coordinate array. More...
 
 Node (double x, double y, double z, std::size_t id=std::numeric_limits< std::size_t >::max())
 Constructor using single coordinates. More...
 
 Node (const Node &node)
 Copy constructor. More...
 
- Public Member Functions inherited from MathLib::Point3dWithID
 Point3dWithID (double x0, double x1, double x2, std::size_t id=std::numeric_limits< std::size_t >::max())
 
 Point3dWithID (std::array< double, 3 > const &coords, std::size_t id=std::numeric_limits< std::size_t >::max())
 
 Point3dWithID (MathLib::Point3d const &pnt, std::size_t id=std::numeric_limits< std::size_t >::max())
 
 Point3dWithID ()
 
std::size_t getID () const
 
- Public Member Functions inherited from MathLib::Point3d
 Point3d ()
 
 Point3d (std::array< double, 3 > x)
 
virtual ~Point3d ()=default
 
 Point3d (Point3d const &)=default
 
Point3doperator= (Point3d const &)=default
 
const double & operator[] (std::size_t idx) const
 const access operator The access to the point coordinates is like the access to a field. Code example: More...
 
double & operator[] (std::size_t idx)
 access operator (see book Effektiv C++ programmieren - subsection 1.3.2 ). More...
 
const double * data () const
 
double * data ()
 
Eigen::Vector3d const & asEigenVector3d () const
 
Eigen::Vector3d & asEigenVector3d ()
 

Protected Attributes

std::vector< std::pair< std::size_t, FaceDirection > > _face_directions
 

Private Attributes

std::bitset< 128 > _face_set_membership
 
std::size_t _layer_transition_idx
 

Friends

class GocadSplitNode
 

Additional Inherited Members

- Protected Member Functions inherited from MathLib::Point3dWithID
void setID (std::size_t id)
 Sets the ID of a node to the given value. More...
 

Constructor & Destructor Documentation

◆ GocadNode() [1/4]

FileIO::Gocad::GocadNode::GocadNode ( double const *const  coords,
std::size_t  id,
std::size_t  layer_transition_idx 
)
inline

Definition at line 33 of file GocadNode.h.

35 : Node(coords, id), _layer_transition_idx(layer_transition_idx)
36 {
37 }
std::size_t _layer_transition_idx
Definition: GocadNode.h:116
Node(const double coords[3], std::size_t id=std::numeric_limits< std::size_t >::max())
Constructor using a coordinate array.
Definition: Node.cpp:21

◆ GocadNode() [2/4]

FileIO::Gocad::GocadNode::GocadNode ( )
delete

◆ GocadNode() [3/4]

FileIO::Gocad::GocadNode::GocadNode ( GocadNode const &  src)
default

◆ GocadNode() [4/4]

FileIO::Gocad::GocadNode::GocadNode ( GocadNode &&  src)
default

◆ ~GocadNode()

FileIO::Gocad::GocadNode::~GocadNode ( )
overridedefault

Member Function Documentation

◆ getFaceDirection()

FaceDirection FileIO::Gocad::GocadNode::getFaceDirection ( std::size_t const  face_set_number) const
inline

Definition at line 90 of file GocadNode.h.

91 {
92 auto const it = std::find_if(
94 [&](auto const fi) { return fi.first == face_set_number; });
95 if (it == _face_directions.end())
96 {
98 "GocadNode {:d}: Could not found face indicator for face set "
99 "{:d}",
100 getID(), face_set_number);
101 }
102 return it->second;
103 }
#define OGS_FATAL(...)
Definition: Error.h:26
std::vector< std::pair< std::size_t, FaceDirection > > _face_directions
Definition: GocadNode.h:112
std::size_t getID() const
Definition: Point3dWithID.h:62

References _face_directions, MathLib::Point3dWithID::getID(), and OGS_FATAL.

Referenced by FileIO::Gocad::GocadSGridReader::addFaceSetQuad().

◆ getFaceSetMembership()

std::bitset< 128 > const & FileIO::Gocad::GocadNode::getFaceSetMembership ( ) const
inline

Definition at line 85 of file GocadNode.h.

86 {
88 }
std::bitset< 128 > _face_set_membership
Definition: GocadNode.h:115

References _face_set_membership.

◆ getLayerTransitionIndex()

std::size_t FileIO::Gocad::GocadNode::getLayerTransitionIndex ( ) const
inline

Definition at line 105 of file GocadNode.h.

106 {
108 }

References _layer_transition_idx.

Referenced by FileIO::Gocad::operator<=().

◆ isMemberOfAnyFaceSet()

bool FileIO::Gocad::GocadNode::isMemberOfAnyFaceSet ( ) const
inline

Definition at line 81 of file GocadNode.h.

81{ return _face_set_membership.any(); }

References _face_set_membership.

◆ isMemberOfFaceSet()

bool FileIO::Gocad::GocadNode::isMemberOfFaceSet ( std::size_t  face_set_number) const
inline

Checks if this GocadNode is in the face set with the number face_set_number.

Parameters
face_set_numberthe number of the face set
Returns
true/false

Definition at line 76 of file GocadNode.h.

77 {
78 return _face_set_membership[face_set_number];
79 }

References _face_set_membership.

◆ operator=() [1/2]

GocadNode & FileIO::Gocad::GocadNode::operator= ( GocadNode &&  rhs)
default

◆ operator=() [2/2]

GocadNode & FileIO::Gocad::GocadNode::operator= ( GocadNode const &  rhs)
default

◆ resetID()

void FileIO::Gocad::GocadNode::resetID ( std::size_t  id)
inline

Definition at line 83 of file GocadNode.h.

83{ this->setID(id); }
void setID(std::size_t id)
Sets the ID of a node to the given value.
Definition: Point3dWithID.h:66

References MathLib::Point3dWithID::setID().

◆ setFaceSet()

void FileIO::Gocad::GocadNode::setFaceSet ( std::size_t  face_set_number,
std::size_t  face_indicator 
)
inline

Definition at line 46 of file GocadNode.h.

47 {
48 _face_set_membership.set(face_set_number);
49 switch (face_indicator)
50 {
51 case 0:
52 _face_directions.emplace_back(face_set_number,
54 break;
55 case 1:
56 _face_directions.emplace_back(face_set_number,
58 break;
59 case 2:
60 _face_directions.emplace_back(face_set_number,
62 break;
63 default:
65 "GocadNode::setFaceSet(): unknown face indicator {:d}.",
66 face_indicator);
67 }
68 }

References _face_directions, _face_set_membership, OGS_FATAL, FileIO::Gocad::U, FileIO::Gocad::V, and FileIO::Gocad::W.

Friends And Related Function Documentation

◆ GocadSplitNode

friend class GocadSplitNode
friend

Definition at line 111 of file GocadNode.h.

Member Data Documentation

◆ _face_directions

std::vector<std::pair<std::size_t, FaceDirection> > FileIO::Gocad::GocadNode::_face_directions
protected

◆ _face_set_membership

std::bitset<128> FileIO::Gocad::GocadNode::_face_set_membership
private

◆ _layer_transition_idx

std::size_t FileIO::Gocad::GocadNode::_layer_transition_idx
private

Definition at line 116 of file GocadNode.h.

Referenced by getLayerTransitionIndex().


The documentation for this class was generated from the following file: