40 namespace coordSetWriters
57 if (width)
os <<
setw(width);
66 Foam::Ostream& Foam::coordSetWriters::nastranWriter::writeKeyword
81 writeFormat_(fieldFormat::FREE),
84 if (writeFormat_ == fieldFormat::FREE)
96 fileFormats::NASCore::fieldFormatNames.getOrDefault
105 if (writeFormat_ == fieldFormat::FREE)
121 open(coords, outputPath);
134 open(tracks, outputPath);
153 return getExpectedPath(
"nas");
157 void Foam::coordSetWriters::nastranWriter::writeGeometry
171 writeFormat_ == fieldFormat::SHORT ? 8
172 : writeFormat_ == fieldFormat::LONG ? 16
177 const char sep = (writeFormat_ == fieldFormat::FREE ?
',' :
'\0');
184 label globalPointi = 0;
185 for (
const coordSet& coords : coords_)
187 for (
const point&
p : coords)
191 os,
p, globalPointi, writeFormat_
201 label globalEdgei = 0;
203 for (label tracki = 0; tracki < nTracks; ++tracki)
205 const label nEdges = (coords_[tracki].size() - 1);
207 for (label edgei = 0; edgei < nEdges; ++edgei)
209 writeKeyword(
os,
"PLOTEL");
232 Foam::fileName Foam::coordSetWriters::nastranWriter::writeTemplate
234 const word& fieldName,
250 Info<<
"Writing nastran geometry to " << outputFile <<
endl;
258 OFstream
os(outputFile);
261 os <<
"TITLE=OpenFOAM " << outputFile.
stem()
263 <<
"BEGIN BULK" <<
nl;
267 os <<
"ENDDATA" <<
nl;
275 Foam::fileName Foam::coordSetWriters::nastranWriter::writeTemplate
277 const word& fieldName,
293 Info<<
"Writing nastran geometry to " << outputFile <<
endl;
301 OFstream
os(outputFile);
304 os <<
"TITLE=OpenFOAM " << outputFile.
stem()
306 <<
"BEGIN BULK" <<
nl;
310 os <<
"ENDDATA" <<
nl;
A class for handling file names.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
constexpr char nl
The newline '\n' character (0x0a)
static const fileName null
An empty fileName.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static std::string path(const std::string &str)
Return directory path name (part before last /)
Write coordSet(s) as Nastran plot lines. Does not do field data.
defineCoordSetWriterWriteFields(Foam::coordSetWriters::nastranWriter)
static std::string stem(const std::string &str)
Return the basename, without extension.
Macros for easy insertion into run-time selection tables.
static void putValue(Ostream &os, const Type &value, const int width)
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
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...
Convenience macros for instantiating coordSetWriter methods.
Holds list of sampling positions.
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.
virtual ~nastranWriter()
Destructor. Calls close()
A class for handling words, derived from Foam::string.
defineTypeName(csvWriter)
Base class for writing coordSet(s) and tracks with fields.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
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)
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
addToRunTimeSelectionTable(coordSetWriter, csvWriter, word)
virtual fileName path() const
Characteristic output file name - information only.
vector point
Point is a vector.
messageStream Info
Information stream (stdout output on master, null elsewhere)
nastranWriter()
Default construct.
Omanip< int > setw(const int i)