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)
118 if (!table.found(fieldName))
120 fieldEntry entry(fieldName, fullName);
124 ccmReadOptstr(
"Units", fieldNode)
130 fieldEntry& entry = table.find(fieldName)();
137 CCMIODataLocation dataLocation;
161 && CCMIOReadFieldDatad
174 if (dataLocation == kCCMIOCell)
176 entry.maxCellId(maxId);
178 else if (dataLocation == kCCMIOFace)
180 entry.maxFaceId(maxId);
202bool Foam::ccm::reader::detectSolution()
205 if (solutionStatus_ != UNKNOWN)
207 return (solutionStatus_ == OKAY || solutionStatus_ == READ);
218 (globalState_->root),
243 && CCMIOReadProcessor
260 char solutionName[kCCMIOMaxStringLength + 1];
284 && CCMIOReadRestartInfo
297 solutionTable_.append
299 solutionEntry(solutionName, iteration, timeValue)
304 determineFieldInfo(solutionNode, fieldTable_);
307 ccmID lagrangianNode;
308 ccmID lagrangianSolutions;
317 kCCMIOLagrangianData,
323 && CCMIOReadLagrangianData
333 determineFieldInfo(lagrangianSolutions, lagrangianTable_);
338 if (solutionTable_.size() && fieldTable_.size())
340 solutionStatus_ = OKAY;
344 solutionStatus_ = BAD;
347 return (solutionStatus_ == OKAY || solutionStatus_ == READ);
350#define SOLID_STRESS_HACK
358 const word& solutionName,
359 const word& fieldName,
372 (globalState_->root),
373 solutionName.c_str(),
379 || !fieldTable_.found(fieldName)
385 CCMIODataLocation requestedLocation = kCCMIOCell;
389 label maxId =
entry.maxCellId();
393 maxId =
entry.maxFaceId();
394 requestedLocation = kCCMIOFace;
403 char shortName[kCCMIOProstarShortNameLength+1];
415 CCMIODimensionality dims;
433 && CCMIOReadProcessor
483 &(globalState_->error),
492 "reading post data field: "
496 if (fieldName == shortName && dims == kCCMIOScalar)
515 CCMIODataLocation dataLocation;
530 && CCMIOReadFieldDatad
542 && dataLocation == requestedLocation
545#ifdef SOLID_STRESS_HACK
546 bool okayCombination =
true;
551 CCMIOEntityDescription
561 char* dataLabel =
new char[len + 1];
565 CCMIOEntityDescription
578 strstr(fieldName.c_str(),
"SIG")
579 || strstr(fieldName.c_str(),
"EPS")
581 && strstr(dataLabel,
"So") ==
nullptr
584 okayCombination =
false;
592 if (!okayCombination)
609 &(globalState_->error),
619 "reading post data field: "
626 const label
cellId = mapData[i];
627 scalarData[
cellId] = rawData[i];
637 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(const label n)
Alias for resize()
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
T * data() noexcept
Return pointer to the underlying array serving as data storage.
A ccm field entry with short name, name, maxId and type.
bool valid() const
True if all internal ids are non-negative.
tmp< scalarField > readField(const word &solutionName, const word &fieldName, const bool wallData=false)
Read solution and field combination.
A keyword and a list of tokens is an 'entry'.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
#define forAll(list, i)
Loop across all elements in list.