OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
NodeMapping Class Reference

Public Member Functions

int size ()
void addGlobalId (const int &i)
int getCompactId (const int &i) const
int getGlobalId (const int &i) const

Private Attributes

unordered_map< int, int > toCompact
Vint toGlobal

Detailed Description

Definition at line 52 of file cpp_reorder_elements.cpp.

Member Function Documentation

◆ addGlobalId()

void NodeMapping::addGlobalId ( const int & i)
inline

Definition at line 59 of file cpp_reorder_elements.cpp.

60 {
61 if (toCompact.find(i) == toCompact.end())
62 {
63 const int nb = toCompact.size();
64 toCompact[i] = nb;
65 toGlobal.push_back(i);
66 }
67 };
unordered_map< int, int > toCompact

◆ getCompactId()

int NodeMapping::getCompactId ( const int & i) const
inline

Definition at line 68 of file cpp_reorder_elements.cpp.

69 {
70 auto got = toCompact.find(i);
71 //assert(got != toCompact.end());
72 return got->second;
73 };

◆ getGlobalId()

int NodeMapping::getGlobalId ( const int & i) const
inline

Definition at line 74 of file cpp_reorder_elements.cpp.

75 {
76 //assert(i >= 0);
77 //assert(((size_t)i) < toGlobal.size());
78 return toGlobal[i];
79 }

◆ size()

int NodeMapping::size ( )
inline

Definition at line 58 of file cpp_reorder_elements.cpp.

58{ return toGlobal.size(); };

Field Documentation

◆ toCompact

unordered_map<int, int> NodeMapping::toCompact
private

Definition at line 54 of file cpp_reorder_elements.cpp.

◆ toGlobal

Vint NodeMapping::toGlobal
private

Definition at line 55 of file cpp_reorder_elements.cpp.


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