NASCore Class Reference

Core routines used when reading/writing NASTRAN files. More...

Inheritance diagram for NASCore:
Collaboration diagram for NASCore:

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. More...
 

Static Public Member Functions

static scalar readNasScalar (const std::string &str)
 Extract numbers from things like "-2.358-8" (same as "-2.358e-8") More...
 
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. More...
 
static void setPrecision (Ostream &os, const fieldFormat format)
 Set output stream precision and format flags. More...
 
static OstreamwriteKeyword (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. More...
 
static void writeCoord (Ostream &os, const point &p, const label pointId, const fieldFormat format)
 Write a GRID point. More...
 
static label faceDecomposition (const UList< point > &points, const UList< face > &faces, labelList &decompOffsets, DynamicList< face > &decompFaces)
 Calculate face decomposition for non tri/quad faces. More...
 

Static Public Attributes

static int debug
 Named/registered debug switch: 'nastran.debug'. More...
 
static const Enum< fieldFormatfieldFormatNames
 Selection names for the NASTRAN file field formats. More...
 
static const Enum< loadFormatloadFormatNames
 Selection names for the NASTRAN load formats. More...
 

Detailed Description

Core routines used when reading/writing NASTRAN files.

Source files

Definition at line 52 of file NASCore.H.

Member Enumeration Documentation

◆ fieldFormat

File field formats.

Enumerator
SHORT 

Short format (field width = 8)

LONG 

Long format (field width = 16)

FREE 

Free format (comma-separated fields)

Definition at line 67 of file NASCore.H.

◆ loadFormat

enum loadFormat

Output load format.

Enumerator
PLOAD2 

Face load (eg, pressure)

PLOAD4 

Vertex load.

Definition at line 82 of file NASCore.H.

Constructor & Destructor Documentation

◆ NASCore()

NASCore ( )
defaultnoexcept

Default construct.

Member Function Documentation

◆ readNasScalar()

Foam::scalar readNasScalar ( const std::string &  str)
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().

Here is the call graph for this function:

◆ nextNasField()

std::string nextNasField ( const std::string &  str,
std::string::size_type pos,
const std::string::size_type  width,
const bool  free_format = false 
)
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

Parameters
strThe string to extract from
[in,out]posThe parse position within str
widthThe fixed-format width to use (if comma is not found)
free_formatThe input is known to be free-format

Definition at line 129 of file NASCore.C.

References Foam::SVG::end, and Foam::pos().

Here is the call graph for this function:

◆ setPrecision()

void setPrecision ( Ostream os,
const fieldFormat  format 
)
static

Set output stream precision and format flags.

Definition at line 162 of file NASCore.C.

References format(), os(), and Foam::scientific().

Referenced by nastranWriter::write(), and nastranWriter::writeTemplate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeKeyword()

Foam::Ostream & writeKeyword ( Ostream os,
const word keyword,
const fieldFormat  format 
)
static

Write initial keyword (eg, 'GRID' or 'GRID*') followed by the requisite number of spaces for the field-width.

Definition at line 196 of file NASCore.C.

References format(), os(), and Foam::setw().

Here is the call graph for this function:

◆ writeCoord()

void writeCoord ( Ostream os,
const point p,
const label  pointId,
const fieldFormat  format 
)
static

Write a GRID point.

Parameters
pointId0-based Point Id

Definition at line 230 of file NASCore.C.

References format(), Foam::nl, os(), p, and Foam::putValue().

Here is the call graph for this function:

◆ faceDecomposition()

Foam::label faceDecomposition ( const UList< point > &  points,
const UList< face > &  faces,
labelList decompOffsets,
DynamicList< face > &  decompFaces 
)
static

Calculate face decomposition for non tri/quad faces.

Parameters
pointsthe surface points
facesthe surface faces
decompOffsetsbegin/end offsets (size+1) into decompFaces
decompFacesList of non-tri/quad decomposed into triangles
Returns
number of decomposed faces

Definition at line 296 of file NASCore.C.

References UList< T >::begin(), DynamicList< T, SizeMin >::clear(), f(), n, points, List< T >::resize(), and UList< T >::size().

Here is the call graph for this function:

Member Data Documentation

◆ debug

int debug
static

Named/registered debug switch: 'nastran.debug'.

Definition at line 61 of file NASCore.H.

◆ fieldFormatNames

const Foam::Enum< Foam::fileFormats::NASCore::fieldFormat > fieldFormatNames
static

Selection names for the NASTRAN file field formats.

Definition at line 77 of file NASCore.H.

◆ loadFormatNames

const Foam::Enum< Foam::fileFormats::NASCore::loadFormat > loadFormatNames
static

Selection names for the NASTRAN load formats.

Definition at line 91 of file NASCore.H.

Referenced by nastranWriter::nastranWriter().


The documentation for this class was generated from the following files: