OGS
FileIO::Gocad::GocadNode Class Reference

Detailed Description

Definition at line 24 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.
 Node (std::array< double, 3 > const &coords, std::size_t id=std::numeric_limits< std::size_t >::max())
 Constructor using a coordinate array.
 Node (double x, double y, double z, std::size_t id=std::numeric_limits< std::size_t >::max())
 Constructor using single coordinates.
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:
double & operator[] (std::size_t idx)
 access operator (see book Effektiv C++ programmieren - subsection 1.3.2 ).
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.

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 27 of file GocadNode.h.

29 : Node(coords, id), _layer_transition_idx(layer_transition_idx)
30 {
31 }
std::size_t _layer_transition_idx
Definition GocadNode.h:110
Node(const double coords[3], std::size_t id=std::numeric_limits< std::size_t >::max())
Constructor using a coordinate array.
Definition Node.cpp:10

References MeshLib::Node::Node(), and _layer_transition_idx.

Referenced by GocadNode(), GocadNode(), FileIO::Gocad::GocadSplitNode::GocadSplitNode(), operator=(), operator=(), and FileIO::Gocad::GocadSplitNode::transmitFaceDirections().

◆ GocadNode() [2/4]

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

◆ GocadNode() [3/4]

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

References GocadNode().

◆ GocadNode() [4/4]

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

References GocadNode().

◆ ~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 84 of file GocadNode.h.

85 {
86 auto const it = std::find_if(
88 [&](auto const fi) { return fi.first == face_set_number; });
89 if (it == _face_directions.end())
90 {
92 "GocadNode {:d}: Could not found face indicator for face set "
93 "{:d}",
94 getID(), face_set_number);
95 }
96 return it->second;
97 }
#define OGS_FATAL(...)
Definition Error.h:19
std::vector< std::pair< std::size_t, FaceDirection > > _face_directions
Definition GocadNode.h:106
std::size_t getID() const

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 79 of file GocadNode.h.

80 {
82 }
std::bitset< 128 > _face_set_membership
Definition GocadNode.h:109

References _face_set_membership.

◆ getLayerTransitionIndex()

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

Definition at line 99 of file GocadNode.h.

100 {
102 }

References _layer_transition_idx.

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

◆ isMemberOfAnyFaceSet()

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

Definition at line 75 of file GocadNode.h.

75{ 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 70 of file GocadNode.h.

71 {
72 return _face_set_membership[face_set_number];
73 }

References _face_set_membership.

◆ operator=() [1/2]

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

References GocadNode().

◆ operator=() [2/2]

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

References GocadNode().

◆ resetID()

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

Definition at line 77 of file GocadNode.h.

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

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 40 of file GocadNode.h.

41 {
42 _face_set_membership.set(face_set_number);
43 switch (face_indicator)
44 {
45 case 0:
46 _face_directions.emplace_back(face_set_number,
48 break;
49 case 1:
50 _face_directions.emplace_back(face_set_number,
52 break;
53 case 2:
54 _face_directions.emplace_back(face_set_number,
56 break;
57 default:
59 "GocadNode::setFaceSet(): unknown face indicator {:d}.",
60 face_indicator);
61 }
62 }

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

◆ GocadSplitNode

friend class GocadSplitNode
friend

Definition at line 105 of file GocadNode.h.

References GocadSplitNode.

Referenced by GocadSplitNode.

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 110 of file GocadNode.h.

Referenced by GocadNode(), and getLayerTransitionIndex().


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