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 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 
LONG 
FREE 

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 60 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 107 of file NASCore.C.

References stdFoam::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 131 of file NASCore.C.

References format(), Ostream::precision(), Foam::scientific(), and IOstream::setf().

Referenced by nastranWriter::write().

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

References format(), IOstream::setf(), Foam::setw(), and IOstream::unsetf().

Referenced by nastranSetWriter< Type >::write().

Here is the call graph for this function:
Here is the caller 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 201 of file NASCore.C.

References 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

◆ 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().


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