57 if (width)
os <<
setw(width);
66Foam::Ostream& Foam::coordSetWriters::nastranWriter::writeKeyword
81 writeFormat_(fieldFormat::FREE),
84 if (writeFormat_ == fieldFormat::FREE)
105 if (writeFormat_ == fieldFormat::FREE)
121 open(coords, outputPath);
134 open(tracks, outputPath);
153 return getExpectedPath(
"nas");
157void 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");
234 const word& fieldName,
244 fileName outputFile =
path();
250 Info<<
"Writing nastran geometry to " << outputFile <<
endl;
261 os <<
"TITLE=OpenFOAM " << outputFile.stem()
263 <<
"BEGIN BULK" <<
nl;
267 os <<
"ENDDATA" <<
nl;
277 const word& fieldName,
287 fileName outputFile =
path();
293 Info<<
"Writing nastran geometry to " << outputFile <<
endl;
304 os <<
"TITLE=OpenFOAM " << outputFile.stem()
306 <<
"BEGIN BULK" <<
nl;
310 os <<
"ENDDATA" <<
nl;
Istream and Ostream manipulators taking arguments.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
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,...
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Base class for writing coordSet(s) and tracks with fields.
virtual void open(const fileName &outputPath)
Write separate geometry to file.
fileName getExpectedPath(const word &fileExt=word::null) const
Get expected (characteristic) output file name - information only.
bool wroteGeom_
Track if geometry has been written since the last open.
void checkOpen() const
Verify that the outputPath_ has been set or FatalError.
coordSetWriter(const coordSetWriter &)=delete
No copy construct.
bool useTracks_
Prefer tracks to points during single set writing.
bool verbose_
Additional output verbosity.
UPtrList< const coordSet > coords_
Reference to coordinate set(s).
virtual void close(bool force=false)
Finish output, performing any necessary cleanup.
Write coordSet(s) as Nastran plot lines. Does not do field data.
Foam::fileFormats::NASCore::fieldFormat fieldFormat
File field formats.
virtual fileName path() const
Characteristic output file name - information only.
nastranWriter()
Default construct.
virtual ~nastranWriter()
Destructor. Calls close().
Holds list of sampling positions.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
static const fileName null
An empty fileName.
static std::string stem(const std::string &str)
Return the basename, without extension.
static std::string path(const std::string &str)
Return directory path name (part before last /).
A class for handling words, derived from Foam::string.
#define defineTypeName(Type)
Define the typeName.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
Convenience macros for instantiating coordSetWriter methods.
#define defineCoordSetWriterWriteFields(ThisClass)
OBJstream os(runTime.globalPath()/outputName)
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).
Omanip< int > setw(const int i)
Ostream & endl(Ostream &os)
Add newline and flush stream.
vector point
Point is a vector.
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?
constexpr char nl
The newline '\n' character (0x0a).