Core routines used when reading/writing NASTRAN files. More...
#include <NASCore.H>


Public Types | |
| enum | fieldFormat { SHORT , LONG , FREE } |
| File field formats. More... | |
| enum | loadFormat { PLOAD2 , PLOAD4 } |
| Output load format. More... | |
Public Member Functions | |
| NASCore () noexcept=default | |
| Default construct. | |
Static Public Member Functions | |
| static scalar | readNasScalar (const std::string &str) |
| Extract numbers from things like "-2.358-8" (same as "-2.358e-8"). | |
| static std::string | nextNasField (const std::string &str, std::string::size_type &pos, const std::string::size_type width, const bool free_format=false) |
| A std::string::substr() variant to handle fixed-format and free-format NASTRAN. | |
| static void | setPrecision (Ostream &os, const fieldFormat format) |
| Set output stream precision and format flags. | |
| static Ostream & | writeKeyword (Ostream &os, const word &keyword, const fieldFormat format) |
| Write initial keyword (eg, 'GRID' or 'GRID*') followed by the requisite number of spaces for the field-width. | |
| static void | writeCoord (Ostream &os, const point &p, const label pointId, const fieldFormat format) |
| Write a GRID point. | |
| static label | faceDecomposition (const UList< point > &points, const UList< face > &faces, labelList &decompOffsets, DynamicList< face > &decompFaces) |
| Calculate face decomposition for non tri/quad faces. | |
Static Public Attributes | |
| static int | debug |
| Named/registered debug switch: 'nastran.debug'. | |
| static const Enum< fieldFormat > | fieldFormatNames |
| Selection names for the NASTRAN file field formats. | |
| static const Enum< loadFormat > | loadFormatNames |
| Selection names for the NASTRAN load formats. | |
Core routines used when reading/writing NASTRAN files.
| enum fieldFormat |
| enum loadFormat |
|
defaultnoexcept |
Default construct.
References faceDecomposition(), format(), nextNasField(), Foam::noexcept, os(), p, points, Foam::pos(), readNasScalar(), setPrecision(), writeCoord(), and writeKeyword().

|
static |
Extract numbers from things like "-2.358-8" (same as "-2.358e-8").
Definition at line 82 of file NASCore.C.
References Foam::parsing::errorNames, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, Foam::parsing::GENERAL, Foam::isspace(), Foam::pow(), and Foam::readInt().
Referenced by NASCore(), NASedgeFormat::read(), and NASsurfaceFormat< Face >::read().


|
static |
A std::string::substr() variant to handle fixed-format and free-format NASTRAN.
Returns the substr until the next comma (if found) or the given fixed width
| str | The string to extract from | |
| [in,out] | pos | The parse position within str |
| width | The fixed-format width to use (if comma is not found) | |
| free_format | The input is known to be free-format |
Definition at line 128 of file NASCore.C.
References Foam::pos().
Referenced by NASCore(), NASedgeFormat::read(), and NASsurfaceFormat< Face >::read().


|
static |
Set output stream precision and format flags.
Definition at line 161 of file NASCore.C.
References format(), FREE, LONG, os(), and SHORT.
Referenced by NASCore(), NASsurfaceFormat< Face >::write(), nastranWriter::write(), nastranWriter::writeTemplate(), nastranWriter::writeTemplate(), and nastranWriter::writeTemplate().


|
static |
Write initial keyword (eg, 'GRID' or 'GRID*') followed by the requisite number of spaces for the field-width.
Definition at line 195 of file NASCore.C.
References format(), FREE, LONG, os(), Foam::setw(), and SHORT.
Referenced by NASCore(), and writeCoord().


|
static |
Write a GRID point.
| pointId | 0-based Point Id |
Definition at line 229 of file NASCore.C.
References format(), FREE, LONG, Foam::nl, os(), p, Foam::putValue(), SHORT, and writeKeyword().
Referenced by NASCore().


|
static |
Calculate face decomposition for non tri/quad faces.
| points | the surface points |
| faces | the surface faces |
| decompOffsets | begin/end offsets (size+1) into decompFaces |
| decompFaces | List of non-tri/quad decomposed into triangles |
Definition at line 295 of file NASCore.C.
References UList< T >::begin(), DynamicList< T, SizeMin >::clear(), f(), n, points, List< T >::resize(), and UList< T >::size().
Referenced by NASCore(), and nastranWriter::writeTemplate().


|
static |
Named/registered debug switch: 'nastran.debug'.
Definition at line 61 of file NASCore.H.
Referenced by NASsurfaceFormat< Face >::read().
|
static |
|
static |
Selection names for the NASTRAN load formats.
Definition at line 91 of file NASCore.H.
Referenced by nastranWriter::nastranWriter(), and nastranWriter::writeFaceValue().