Loading...
Searching...
No Matches
NASCore Class Reference

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

#include <NASCore.H>

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.

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 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.
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< fieldFormatfieldFormatNames
 Selection names for the NASTRAN file field formats.
static const Enum< loadFormatloadFormatNames
 Selection names for the NASTRAN load formats.

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.

References faceDecomposition(), format(), nextNasField(), Foam::noexcept, os(), p, points, Foam::pos(), readNasScalar(), setPrecision(), writeCoord(), and writeKeyword().

Here is the call graph for this function:

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

Referenced by NASCore(), NASedgeFormat::read(), and NASsurfaceFormat< Face >::read().

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

References Foam::pos().

Referenced by NASCore(), NASedgeFormat::read(), and NASsurfaceFormat< Face >::read().

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

◆ setPrecision()

void setPrecision ( Ostream & os,
const fieldFormat format )
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().

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

References format(), FREE, LONG, os(), Foam::setw(), and SHORT.

Referenced by NASCore(), and writeCoord().

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

References format(), FREE, LONG, Foam::nl, os(), p, Foam::putValue(), SHORT, and writeKeyword().

Referenced by NASCore().

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

Here is the call graph for this function:
Here is the caller 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.

Referenced by NASsurfaceFormat< Face >::read().

◆ 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(), and nastranWriter::writeFaceValue().


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