NEMoSys  0.63.0
A modular, extensible resource with robust automated mesh generation, mesh quality analysis, adaptive mesh refinement, and data transfer between arbitrary meshes.
solutionData Class Reference

Detailed Description

Definition at line 65 of file cgnsAnalyzer.H.

Public Member Functions

 solutionData (std::string sName, solution_type_t inDataType)
 
 ~solutionData ()=default
 
void appendData (const vecSlnType &data, int inNData, int inNDim)
 
void getData (vecSlnType &inBuff, int &outNData, int &outNDim) const
 
void getData (vecSlnType &inBuff, int &outNData, int &outNDim, const std::vector< bool > &mask) const
 
void rmvDataIdx (const std::vector< int > &rmvIdx)
 
std::string getDataName () const
 
int getNDim () const
 
int getNData () const
 
solution_type_t getDataType () const
 
void clearBuff ()
 

Private Types

using vecSlnType = std::vector< double >
 

Private Attributes

vecSlnType slnData
 
std::string dataName
 
int nDim
 
int nData
 
solution_type_t dataType
 

Member Typedef Documentation

◆ vecSlnType

using solutionData::vecSlnType = std::vector<double>
private

Definition at line 67 of file cgnsAnalyzer.H.

Constructor & Destructor Documentation

◆ solutionData()

solutionData::solutionData ( std::string  sName,
solution_type_t  inDataType 
)
inline

Definition at line 70 of file cgnsAnalyzer.H.

References data.

Referenced by cgnsAnalyzer::appendSolutionData(), and cgnsAnalyzer::getSolutionDataObj().

71  : dataName(std::move(sName)), nDim(0), nData(0), dataType(inDataType) {}
std::string dataName
Definition: cgnsAnalyzer.H:99
solution_type_t dataType
Definition: cgnsAnalyzer.H:102

◆ ~solutionData()

solutionData::~solutionData ( )
default

Member Function Documentation

◆ appendData()

void solutionData::appendData ( const vecSlnType data,
int  inNData,
int  inNDim 
)

Definition at line 39 of file cgnsAnalyzer.C.

References nData, nDim, and slnData.

Referenced by cgnsAnalyzer::appendSolutionData(), and cgnsAnalyzer::getSolutionDataObj().

40  {
41  // sanity check
42  if (!slnData.empty()) {
43  if (nDim != inNDim || inNDim == 0) {
44  std::cerr << "Incompatible data size can not be appended."
45  << "Current nDim = " << nDim << " Requested nDim = " << inNDim
46  << std::endl;
47  return;
48  }
49  } else {
50  nDim = inNDim;
51  }
52 
53  // deep copy data
54  slnData.insert(slnData.end(), inBuff.begin(), inBuff.end());
55  nData += inNData;
56 }
vecSlnType slnData
Definition: cgnsAnalyzer.H:95

◆ clearBuff()

void solutionData::clearBuff ( )
inline

Definition at line 89 of file cgnsAnalyzer.H.

References UNKNOWN.

89  {
90  dataName = "";
92  nDim = 0;
93  nData = 0;
94  slnData.clear();
95  };
vecSlnType slnData
Definition: cgnsAnalyzer.H:95
std::string dataName
Definition: cgnsAnalyzer.H:99
solution_type_t dataType
Definition: cgnsAnalyzer.H:102

◆ getData() [1/2]

void solutionData::getData ( vecSlnType inBuff,
int &  outNData,
int &  outNDim 
) const

Definition at line 58 of file cgnsAnalyzer.C.

References nData, nDim, and slnData.

Referenced by cgnsAnalyzer::stitchFields().

59  {
60  // deep copy data
61  outBuff.insert(outBuff.begin(), slnData.begin(), slnData.end());
62  outNData = nData;
63  outNDim = nDim;
64 }
vecSlnType slnData
Definition: cgnsAnalyzer.H:95

◆ getData() [2/2]

void solutionData::getData ( vecSlnType inBuff,
int &  outNData,
int &  outNDim,
const std::vector< bool > &  mask 
) const

Definition at line 67 of file cgnsAnalyzer.C.

References nDim, and slnData.

68  {
69  // deep copy data
70  int cntr1 = 0;
71  int cntr2 = 0;
72  for (const auto &id : mask) {
73  if (id) {
74  outBuff.insert(outBuff.end(), slnData[cntr1]);
75  cntr2++;
76  }
77  cntr1++;
78  }
79  outNData = cntr2;
80  outNDim = nDim;
81 }
vecSlnType slnData
Definition: cgnsAnalyzer.H:95

◆ getDataName()

std::string solutionData::getDataName ( ) const
inline

Definition at line 81 of file cgnsAnalyzer.H.

Referenced by cgnsAnalyzer::stitchFields().

81 { return dataName; };
std::string dataName
Definition: cgnsAnalyzer.H:99

◆ getDataType()

solution_type_t solutionData::getDataType ( ) const
inline

Definition at line 87 of file cgnsAnalyzer.H.

Referenced by cgnsAnalyzer::stitchFields().

87 { return dataType; };
solution_type_t dataType
Definition: cgnsAnalyzer.H:102

◆ getNData()

int solutionData::getNData ( ) const
inline

Definition at line 85 of file cgnsAnalyzer.H.

Referenced by cgnsAnalyzer::loadSolutionDataContainer().

85 { return nData; };

◆ getNDim()

int solutionData::getNDim ( ) const
inline

Definition at line 83 of file cgnsAnalyzer.H.

Referenced by cgnsAnalyzer::loadSolutionDataContainer().

83 { return nDim; };

◆ rmvDataIdx()

void solutionData::rmvDataIdx ( const std::vector< int > &  rmvIdx)

Definition at line 83 of file cgnsAnalyzer.C.

References id, nData, nDim, and slnData.

83  {
84  vecSlnType nsdv;
85  int nnd = 0;
86  for (int id = 0; id < nData; id++) {
87  auto it = std::find(rmvIdx.begin(), rmvIdx.end(), id);
88  if (it != rmvIdx.end())
89  continue;
90  else {
91  nnd++;
92  for (int iDim = 0; iDim < nDim; iDim++)
93  nsdv.push_back(slnData[id * nDim + iDim]);
94  }
95  }
96  slnData = nsdv;
97  nData = nnd;
98 }
std::vector< double > vecSlnType
Definition: cgnsAnalyzer.H:67
vecSlnType slnData
Definition: cgnsAnalyzer.H:95
vtkIdType id
id in .inp file
Definition: inpGeoMesh.C:128

Member Data Documentation

◆ dataName

std::string solutionData::dataName
private

Definition at line 99 of file cgnsAnalyzer.H.

◆ dataType

solution_type_t solutionData::dataType
private

◆ nData

int solutionData::nData
private

Definition at line 101 of file cgnsAnalyzer.H.

Referenced by appendData(), getData(), rmvDataIdx(), and cgnsAnalyzer::stitchFields().

◆ nDim

int solutionData::nDim
private

Definition at line 100 of file cgnsAnalyzer.H.

Referenced by appendData(), getData(), and rmvDataIdx().

◆ slnData

vecSlnType solutionData::slnData
private

Definition at line 95 of file cgnsAnalyzer.H.

Referenced by appendData(), getData(), cgnsAnalyzer::getSolutionDataObj(), and rmvDataIdx().


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