35Foam::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);
Istream and Ostream manipulators taking arguments.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Output to file stream as an OSstream, normally using std::ofstream for the actual output.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool empty() const noexcept
True if List is empty (ie, size() is zero).
void size(const label n)
Older name for setAddressableSize.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
bool wroteGeom_
Track if geometry has been written since the last open.
bool useTimeDir() const noexcept
Should a time directory be spliced into the output path?
void checkOpen() const
Verify that the outputPath_ has been set or FatalError.
bool empty() const
Writer is not associated with content.
bool verbose_
Additional output verbosity.
fileName outputPath_
The full output directory and file (coords) name.
A face is a list of labels corresponding to mesh vertices.
A class for handling file names.
fileName lessExt() const
Return file name without extension (part before last .).
word ext() const
Return file name extension (part after last .).
static std::string path(const std::string &str)
Return directory path name (part before last /).
Implements a meshed surface by referencing another meshed surface or faces/points components.
virtual const pointField & points() const
The points used for the surface.
virtual const labelList & faceIds() const
Per-face identifier (eg, element Id).
virtual const faceList & faces() const
The faces used for the surface.
A traits class, which is primarily used for primitives and vector-space.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< label > labelList
A List of labels.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
messageStream Info
Information stream (stdout output on master, null elsewhere).
List< face > faceList
List of faces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0).
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.