45 case fieldFormat::SHORT :
51 case fieldFormat::LONG :
57 case fieldFormat::FREE :
91 const label setId = 1;
98 os.setf(std::ios_base::right);
100 writeValue(
os, setId) << separator_;
104 case loadFormat::PLOAD2 :
108 writeValue(
os, value);
112 writeValue(
os,
mag(value));
116 writeValue(
os, elemId);
120 case loadFormat::PLOAD4 :
122 writeValue(
os, elemId);
124 for (
direction d = 0; d < pTraits<Type>::nComponents; ++d)
133 os.unsetf(std::ios_base::right);
144 const word& fieldName,
152 if (!wroteGeom_ && commonGeometry_)
175 !std::is_integral<Type>::value
176 && !fieldMap_.empty()
177 && !fieldMap_.found(fieldName)
181 <<
"No mapping found between field " << fieldName
182 <<
" and corresponding Nastran field. Available types:"
191 <<
" cannot be used for higher rank values"
192 <<
" - reverting to mag()" <<
endl;
203 if (useTimeDir() && !
timeName().empty())
213 geomFileName = outputPath_.
name().ext(
"nas");
216 outputFile /= fieldName +
'_' + outputPath_.name();
222 outputFile /= fieldName / outputPath_.name();
224 outputFile.
ext(
"bdf");
227 tmp<Field<Type>> tfield = adjustField(fieldName, mergeField(localValues));
231 Info<<
" to " << outputFile <<
endl;
240 const auto& values = tfield();
247 const scalar timeValue(0);
257 os <<
"TITLE=OpenFOAM " << outputFile.
name()
260 if (useTimeDir() && !
timeName().empty())
266 os <<
"TIME " << timeValue <<
nl
268 <<
"BEGIN BULK" <<
nl;
272 os <<
"INCLUDE '" << geomFileName.c_str() <<
"'" <<
nl;
292 <<
"$ Field data" <<
nl
301 const bool useOrigFaceIds =
305 && decompFaces.
empty()
311 if (this->isPointData())
317 elemId = elemIds[facei];
320 const label beginElemId = elemId;
325 label decompi = decompOffsets[facei];
326 decompi < decompOffsets[facei+1];
330 const face&
f = decompFaces[decompi];
333 for (
const label verti :
f)
339 writeFaceValue(
os,
format, v, ++elemId);
344 if (beginElemId == elemId)
346 const face&
f = faces[facei];
349 for (
const label verti :
f)
355 writeFaceValue(
os,
format, v, ++elemId);
361 auto valIter = values.cbegin();
367 elemId = elemIds[facei];
370 const Type v(*valIter);
377 (decompOffsets[facei+1] - decompOffsets[facei])
382 writeFaceValue(
os,
format, v, ++elemId);
Istream and Ostream manipulators taking arguments.
Various functions to operate on Lists.
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.
Output to file stream, using an OSstream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
void size(const label n)
Older name for setAddressableSize.
A face is a list of labels corresponding to mesh vertices.
A class for handling file names.
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 /)
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
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.
splitCell * master() const
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
bool found(const ListType &input, const UnaryPredicate &pred, const label start=0)
Same as found_if.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Omanip< int > setw(const int i)
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)
word format(conversionProperties.get< word >("format"))
#define forAll(list, i)
Loop across all elements in list.