Go to the documentation of this file.
35 Foam::Ostream& Foam::surfaceWriters::abaqusWriter::writeFaceValue
42 if (fileFormats::ABAQUSCore::isEncodedSolidId(elemId))
45 fileFormats::ABAQUSCore::decodeSolidElementId(elemId);
48 fileFormats::ABAQUSCore::decodeSolidSideNum(elemId);
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");
123 const scalar varScale =
125 std::is_integral<Type>::value
127 : fieldScale_.getOrDefault<scalar>(fieldName, 1)
132 Info<<
"Writing field " << fieldName;
133 if (!
equal(varScale, 1))
135 Info<<
" (scaling " << varScale <<
')';
137 Info<<
" to " << outputFile <<
endl;
146 if (Pstream::master() || !parallel_)
148 const auto&
values = tfield();
165 if (noGeometry_ || wroteGeom_)
170 fileFormats::ABAQUSCore::faceDecomposition
192 <<
"** field = " << fieldName <<
nl
195 if (useTimeDir() && !
timeName().empty())
209 const bool useOrigFaceIds =
211 elemIds.size() == faces.size()
212 && decompFaces.empty()
218 if (this->isPointData())
225 elemId = elemIds[facei];
228 const label beginElemId = elemId;
233 label decompi = decompOffsets[facei];
234 decompi < decompOffsets[facei+1];
238 const face&
f = decompFaces[decompi];
241 for (
const label verti :
f)
247 writeFaceValue(
os, v, elemId);
253 if (beginElemId == elemId)
255 const face&
f = faces[facei];
258 for (
const label verti :
f)
264 writeFaceValue(
os, v, elemId);
271 auto valIter =
values.cbegin();
278 elemId = elemIds[facei];
281 const Type v(*valIter);
288 (decompOffsets[facei+1] - decompOffsets[facei])
293 writeFaceValue(
os, v, elemId);
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
A class for handling words, derived from Foam::string.
A class for handling file names.
static std::string path(const std::string &str)
Return directory path name (part before last /)
A class for managing temporary objects.
static constexpr const zero Zero
Global zero (0)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
virtual const faceList & faces() const =0
The faces used for the surface.
Abstract definition of a meshed surface defined by faces and points.
Ostream & endl(Ostream &os)
Add newline and flush stream.
fileName lessExt() const
Return file name without extension (part before last .)
#define forAll(list, i)
Loop across all elements in list.
Generic templated field type.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Istream and Ostream manipulators taking arguments.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
virtual const pointField & points() const =0
The points used for the surface.
OBJstream os(runTime.globalPath()/outputName)
word ext() const
Return file name extension (part after last .)
Output to file stream, using an OSstream.
virtual const labelList & faceIds() const
Per-face identifier (eg, element Id)
A traits class, which is primarily used for primitives.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A face is a list of labels corresponding to mesh vertices.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?