NastranInterface is an interface class for I/O handling of BDF bulk nastran format *.nas. More...

#include <MimmoGeometry.hpp>

Public Member Functions

 NastranInterface ()
 
void absorbRBE2 (std::vector< std::string > &records, long &ID, long &PID, std::vector< long > &connectivity, std::string &components)
 
void absorbRBE3 (std::vector< std::string > &records, long &ID, long &PID, std::vector< long > &connectivity, std::string &components)
 
void appendLineRecords (std::string &sread, std::size_t recordlength, std::vector< std::string > &records)
 
std::string convertVertex (std::string in)
 
bool isEnabled (NastranElementType type)
 
bool isInteger (std::string &str)
 
void read (std::string &inputDir, std::string &surfaceName, dvecarr3E &points, livector1D &pointsID, livector2D &faces, livector1D &facesID, livector1D &PIDS)
 
void setWFormat (WFORMAT)
 
std::string trim (std::string in)
 
void write (std::string &outputDir, std::string &surfaceName, dvecarr3E &points, livector1D &pointsID, livector2D &faces, livector1D &facesID, livector1D *PIDS=nullptr, std::unordered_set< long > *PIDSSET=nullptr)
 
void writeCoord (const darray3E &p, const long &pointI, std::ofstream &os)
 
void writeFace (std::string faceType, const livector1D &facePts, const long &nFace, std::ofstream &os, long PID)
 
void writeFooter (std::ofstream &os, std::unordered_set< long > *PIDSSET=nullptr)
 
bool writeGeometry (dvecarr3E &points, livector1D &pointsID, livector2D &faces, livector1D &facesID, std::ofstream &os, livector1D *PIDS=nullptr)
 
void writeKeyword (std::string key, std::ofstream &os)
 

Public Attributes

std::map< NastranElementType, bool > m_enabled
 
WFORMAT m_wformat
 

Protected Member Functions

void disable (NastranElementType type)
 
void enable (NastranElementType type)
 
template<class Type >
void writeValue (Type &value, std::ofstream &os)
 

Detailed Description

NastranInterface is an interface class for I/O handling of BDF bulk nastran format *.nas.

Definition at line 258 of file MimmoGeometry.hpp.

Constructor & Destructor Documentation

◆ NastranInterface()

mimmo::NastranInterface::NastranInterface ( )

Default constructor

Definition at line 1282 of file MimmoGeometry.cpp.

Member Function Documentation

◆ absorbRBE2()

void mimmo::NastranInterface::absorbRBE2 ( std::vector< std::string > &  records,
long &  ID,
long &  PID,
std::vector< long > &  connectivity,
std::string &  components 
)

Absorb rbe2 element from a records structure

Parameters
[in]recordsvector of string records
[out]IDID of the RBE2 element
[out]PIDPID of the RBE2 element
[out]connectivityconnectivity of the RBE2 element
[out]componentsreaction components of the element

Definition at line 1895 of file MimmoGeometry.cpp.

◆ absorbRBE3()

void mimmo::NastranInterface::absorbRBE3 ( std::vector< std::string > &  records,
long &  ID,
long &  PID,
std::vector< long > &  connectivity,
std::string &  components 
)

Absorb rbe3 element from a records structure

Parameters
[in]recordsvector of string records
[out]IDID of the RBE3 element
[out]PIDPID of the RBE3 element
[out]connectivityconnectivity of the RBE3 element
[out]componentsreaction components of the element

Definition at line 1846 of file MimmoGeometry.cpp.

◆ appendLineRecords()

void mimmo::NastranInterface::appendLineRecords ( std::string &  sread,
std::size_t  recordlength,
std::vector< std::string > &  records 
)

Append records of given length of an input line in a records structure

Parameters
[in]sreadinput line given as string
[in]recordlengthlength of single record string
[out]recordsvector of string records to be filled

Definition at line 1822 of file MimmoGeometry.cpp.

◆ convertVertex()

std::string mimmo::NastranInterface::convertVertex ( std::string  in)

Convert nas string of numerical floats

Returns
string of regular floats

Definition at line 1801 of file MimmoGeometry.cpp.

◆ disable()

void mimmo::NastranInterface::disable ( NastranElementType  type)
protected

Disable an element type for the current read session

Parameters
[in]typeelement type

Definition at line 1954 of file MimmoGeometry.cpp.

◆ enable()

void mimmo::NastranInterface::enable ( NastranElementType  type)
protected

Enable an element type for the current read session

Parameters
[in]typeelement type

Definition at line 1945 of file MimmoGeometry.cpp.

◆ isEnabled()

bool mimmo::NastranInterface::isEnabled ( NastranElementType  type)

Get if an element type is enbaled

Parameters
[in]typeelement type
Returns
true if the element type is enbaled for the current read session

Definition at line 1932 of file MimmoGeometry.cpp.

◆ isInteger()

bool mimmo::NastranInterface::isInteger ( std::string &  str)

Check if a string contains an integer

Parameters
[in]strstring to test
Returns
true if the string has only digits

Definition at line 1918 of file MimmoGeometry.cpp.

◆ read()

void mimmo::NastranInterface::read ( std::string &  inputDir,
std::string &  surfaceName,
dvecarr3E points,
livector1D pointsID,
livector2D faces,
livector1D facesID,
livector1D PIDS 
)

Read a bdf nastran file

Parameters
[in]inputDirinput directory
[in]surfaceNameinput filename
[out]pointsreference of a point container that has to be filled
[out]pointsIDreference to a label point container to be filled
[out]facesreference to element-point connectivity that has to be filled
[out]facesIDreference to a label element container to be filled
[out]PIDSreference to long int vector for Part Identifier storage

Definition at line 1587 of file MimmoGeometry.cpp.

◆ setWFormat()

void mimmo::NastranInterface::setWFormat ( WFORMAT  wf)

Set the format Short/Long of data in your nastran file

Parameters
[in]wfWFORMAT Short/Long of your nastran file

Definition at line 1297 of file MimmoGeometry.cpp.

◆ trim()

std::string mimmo::NastranInterface::trim ( std::string  in)

Custom trimming of nas string

Returns
trimmed string

Definition at line 1781 of file MimmoGeometry.cpp.

◆ write()

void mimmo::NastranInterface::write ( std::string &  outputDir,
std::string &  surfaceName,
dvecarr3E points,
livector1D pointsID,
livector2D faces,
livector1D facesID,
livector1D PIDS = nullptr,
std::unordered_set< long > *  PIDSSET = nullptr 
)

Write a bdf nastran file

Parameters
[in]outputDiroutput directory
[in]surfaceNameoutput filename
[in]pointsreference of a point container that has to be written
[in]pointsIDreference of a label point container
[in]facesreference to element-point connectivity that has to be written
[in]facesIDreference to a label element container
[in]PIDSreference to long int vector for Part Identifiers that need to be associated to elements
[in]PIDSSETmap of overall available Part Identifiers

Definition at line 1561 of file MimmoGeometry.cpp.

◆ writeCoord()

void mimmo::NastranInterface::writeCoord ( const darray3E p,
const long &  pointI,
std::ofstream &  os 
)

Write a 3D point to an ofstream

Parameters
[in]ppoint
[in]pointIpoint label
[in,out]osofstream where the point is written

Definition at line 1330 of file MimmoGeometry.cpp.

◆ writeFace()

void mimmo::NastranInterface::writeFace ( std::string  faceType,
const livector1D facePts,
const long &  nFace,
std::ofstream &  os,
long  PID 
)

Write a face to an ofstream

Parameters
[in]faceTypestring reporting label fo the type of element
[in]facePtsElement Points connectivity
[in]nFaceelement label
[in,out]osofstream where the face is written
[in]PIDpart identifier associated to the element

Definition at line 1391 of file MimmoGeometry.cpp.

◆ writeFooter()

void mimmo::NastranInterface::writeFooter ( std::ofstream &  os,
std::unordered_set< long > *  PIDSSET = nullptr 
)

Write nastran footer to an ofstream

Parameters
[in,out]osofstream where the footer is written
[in]PIDSSETlist of overall available part identifiers

Definition at line 1502 of file MimmoGeometry.cpp.

◆ writeGeometry()

bool mimmo::NastranInterface::writeGeometry ( dvecarr3E points,
livector1D pointsID,
livector2D faces,
livector1D facesID,
std::ofstream &  os,
livector1D PIDS = nullptr 
)

Write a face to an std::ofstream

Parameters
[in]pointslist of vertices
[in]pointsIDlist of vertices labels
[in]faceselement points connectivity
[in]facesIDlist of element labels
[in,out]osofstream where the geometry is written
[in]PIDSlist of Part Identifiers for each cells (optional)
Returns
true if the geometry is correctly written.

Definition at line 1465 of file MimmoGeometry.cpp.

◆ writeKeyword()

void mimmo::NastranInterface::writeKeyword ( std::string  key,
std::ofstream &  os 
)

Write a keyword string according to WFORMAT chosen by the User

Parameters
[in]keykeyword
[in,out]osofstream where the keyword is written

Definition at line 1306 of file MimmoGeometry.cpp.

◆ writeValue()

template<class Type >
void mimmo::NastranInterface::writeValue ( Type &  value,
std::ofstream &  os 
)
inlineprotected

Write a template value according to WFORMAT chosen by the User

Parameters
[in]valuevalue of class Type
[in,out]osofstream where the value is written

Definition at line 298 of file MimmoGeometry.hpp.

Member Data Documentation

◆ m_enabled

std::map<NastranElementType, bool> mimmo::NastranInterface::m_enabled

element type enabled for the current session

Definition at line 264 of file MimmoGeometry.hpp.

◆ m_wformat

WFORMAT mimmo::NastranInterface::m_wformat

member storing the file type format Short/Long

Definition at line 262 of file MimmoGeometry.hpp.


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