NASCore Class Reference

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

Inheritance diagram for NASCore:
[legend]
Collaboration diagram for NASCore:
[legend]

Public Types

enum  fieldFormat { SHORT , LONG , FREE }
 File field formats. More...
 
enum  loadFormat { PLOAD2 , PLOAD4 }
 Output load format. More...
 

Public Member Functions

 NASCore ()=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, std::string::size_type len)
 A string::substr() 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)
 
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 const Enum< fieldFormatfieldFormatNames
 Selection names for the NASTRAN file field formats. More...
 
static const Enum< loadFormatloadFormatNames
 Selection names for the NASTRAN file field formats. More...
 

Detailed Description

Core routines used when reading/writing NASTRAN files.

Source files

Definition at line 58 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 63 of file NASCore.H.

◆ loadFormat

enum loadFormat

Output load format.

Enumerator
PLOAD2 
PLOAD4 

Definition at line 74 of file NASCore.H.

Constructor & Destructor Documentation

◆ NASCore()

NASCore ( )
default

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 75 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,
std::string::size_type  len 
)
static

A string::substr() to handle fixed-format and free-format NASTRAN.

Returns the substr to the next comma (if found) or the given length

Parameters
strThe string to extract from
posOn input, the position of the first character of the substring. On output, advances to the next position to use.
lenThe fixed-format length to use if a comma is not found.

Definition at line 121 of file NASCore.C.

References 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 145 of file NASCore.C.

References format(), and os().

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 179 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 213 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 279 of file NASCore.C.

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

Referenced by nastranWriter::writeTemplate().

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

Member Data Documentation

◆ fieldFormatNames

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

Selection names for the NASTRAN file field formats.

Definition at line 71 of file NASCore.H.

◆ loadFormatNames

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

Selection names for the NASTRAN file field formats.

Definition at line 81 of file NASCore.H.

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


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