35 Foam::Ostream& Foam::surfaceWriters::abaqusWriter::writeFaceValue
52 os << (solidId + 1) <<
", P" << sideNum;
57 os << (elemId + 1) <<
", P";
78 const word& fieldName,
90 switch (outputLayout_)
92 case outputLayoutType::BY_TIME:
94 outputFile = outputPath_;
95 if (useTimeDir() && !
timeName().empty())
103 outputFile /= fieldName +
'_' + outputPath_.name();
106 case outputLayoutType::BY_FIELD:
108 outputFile = outputPath_ / fieldName / outputPath_.name();
117 outputFile.
ext(
"inp");
121 tmp<Field<Type>> tfield = adjustField(fieldName, mergeField(localValues));
125 Info<<
" to " << outputFile <<
endl;
130 const meshedSurfRef& surf = adjustSurface();
134 const auto&
values = tfield();
146 DynamicList<face> decompFaces;
149 OFstream
os(outputFile);
151 if (noGeometry_ || wroteGeom_)
168 OFstream osGeom(outputFile.
lessExt().
ext(
"abq"));
178 <<
"** field = " << fieldName <<
nl 179 <<
"** type = " << pTraits<Type>::typeName <<
nl;
181 if (useTimeDir() && !
timeName().empty())
191 const faceList& faces = surf.faces();
192 const labelList& elemIds = surf.faceIds();
195 const bool useOrigFaceIds =
197 elemIds.size() == faces.size()
198 && decompFaces.empty()
204 if (this->isPointData())
211 elemId = elemIds[facei];
214 const label beginElemId = elemId;
219 label decompi = decompOffsets[facei];
220 decompi < decompOffsets[facei+1];
224 const face&
f = decompFaces[decompi];
227 for (
const label verti :
f)
233 writeFaceValue(
os, v, elemId);
239 if (beginElemId == elemId)
241 const face&
f = faces[facei];
244 for (
const label verti :
f)
250 writeFaceValue(
os, v, elemId);
257 auto valIter =
values.cbegin();
264 elemId = elemIds[facei];
267 const Type v(*valIter);
274 (decompOffsets[facei+1] - decompOffsets[facei])
279 writeFaceValue(
os, v, elemId);
A class for handling file names.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A traits class, which is primarily used for primitives and vector-space.
static std::string path(const std::string &str)
Return directory path name (part before last /)
word ext() const
Return file name extension (part after last .)
#define forAll(list, i)
Loop across all elements in list.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
List< face > faceList
List of faces.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
Generic templated field type.
A class for handling words, derived from Foam::string.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Istream and Ostream manipulators taking arguments.
OBJstream os(runTime.globalPath()/outputName)
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
fileName lessExt() const
Return file name without extension (part before last .)
messageStream Info
Information stream (stdout output on master, null elsewhere)
List< label > labelList
A List of labels.
A class for managing temporary objects.
static constexpr const zero Zero
Global zero (0)