40void Foam::ccm::reader::determineFieldInfo
42 const ccmID& fieldSetNode,
46 char fullName[kCCMIOMaxStringLength + 1];
47 char shortName[kCCMIOProstarShortNameLength+1];
66 CCMIODimensionality dims;
102 char *ptr = shortName;
113 word fieldName(shortName);
115 if (dims == kCCMIOScalar)
117 auto tableIter = table.find(fieldName);
119 if (!tableIter.good())
122 fieldEntry entry(fieldName, fullName);
126 ccmReadOptstr(
"Units", fieldNode)
129 table.push_back(entry);
131 tableIter = table.find(fieldName);
133 fieldEntry& entry = *tableIter;
140 CCMIODataLocation dataLocation;
164 && CCMIOReadFieldDatad
177 if (dataLocation == kCCMIOCell)
179 entry.maxCellId(maxId);
181 else if (dataLocation == kCCMIOFace)
183 entry.maxFaceId(maxId);
205bool Foam::ccm::reader::detectSolution()
208 if (solutionStatus_ != UNKNOWN)
210 return (solutionStatus_ == OKAY || solutionStatus_ == READ);
221 (globalState_->root),
246 && CCMIOReadProcessor
263 char solutionName[kCCMIOMaxStringLength + 1];
287 && CCMIOReadRestartInfo
300 solutionTable_.append
307 determineFieldInfo(solutionNode, fieldTable_);
310 ccmID lagrangianNode;
311 ccmID lagrangianSolutions;
320 kCCMIOLagrangianData,
326 && CCMIOReadLagrangianData
336 determineFieldInfo(lagrangianSolutions, lagrangianTable_);
341 if (solutionTable_.size() && fieldTable_.size())
343 solutionStatus_ = OKAY;
347 solutionStatus_ = BAD;
350 return (solutionStatus_ == OKAY || solutionStatus_ == READ);
353#define SOLID_STRESS_HACK
361 const word& solutionName,
362 const word& fieldName,
376 solutionName.c_str(),
387 CCMIODataLocation requestedLocation = kCCMIOCell;
389 const auto tableIter = fieldTable_.find(fieldName);
391 if (tableIter.good())
395 maxId =
entry.maxCellId();
399 maxId =
entry.maxFaceId();
400 requestedLocation = kCCMIOFace;
410 char shortName[kCCMIOProstarShortNameLength+1];
416 auto& scalarData = tscalarData.ref();
419 CCMIODimensionality dims;
437 && CCMIOReadProcessor
496 "reading post data field: "
500 if (fieldName == shortName && dims == kCCMIOScalar)
519 CCMIODataLocation dataLocation;
534 && CCMIOReadFieldDatad
546 && dataLocation == requestedLocation
549#ifdef SOLID_STRESS_HACK
550 bool okayCombination =
true;
555 CCMIOEntityDescription
565 char* dataLabel =
new char[len + 1];
569 CCMIOEntityDescription
582 strstr(fieldName.c_str(),
"SIG")
583 || strstr(fieldName.c_str(),
"EPS")
585 && strstr(dataLabel,
"So") ==
nullptr
588 okayCombination =
false;
596 if (!okayCombination)
623 "reading post data field: "
630 const label
cellId = mapData[i];
631 scalarData[
cellId] = rawData[i];
641 scalarData[0] =
option().undefScalar();
Internal bits for wrapping libccmio - do not use directly.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setSize(label n)
Alias for resize().
T * data() noexcept
Return pointer to the underlying array serving as data storage.
std::unique_ptr< ccmGlobalState > globalState_
Maintain overall global states (error, root-node).
static bool assertNoError(int err, const char *msg)
Die with msg if there is an error.
A ccm field entry with short name, name, maxId and type.
FOAM_DLL_EXPORT const reader::options & option() const
Reference to the reader options.
FOAM_DLL_EXPORT tmp< scalarField > readField(const word &solutionName, const word &fieldName, const bool wallData=false)
Read solution and field combination.
A ccm solution entry with name, iteration and time.
A keyword and a list of tokens is an 'entry'.
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
A class for handling words, derived from Foam::string.
static bool valid(char c)
Is this character valid for a word?
#define forAll(list, i)
Loop across all elements in list.