20 #ifndef __mast_nastran_io_h__ 21 #define __mast_nastran_io_h__ 29 #include <libmesh/libmesh_common.h> 30 #include <libmesh/mesh_input.h> 31 #include <libmesh/elem.h> 62 class NastranIO :
public libMesh::MeshInput<libMesh::MeshBase> {
71 explicit NastranIO(libMesh::MeshBase& mesh,
const bool python_preinit=
false);
82 virtual void read(
const std::string & filename)
override;
188 {
"CELAS1_1", libMesh::NODEELEM}, {
"CELAS2_1", libMesh::NODEELEM},
189 {
"CELAS3_1", libMesh::NODEELEM}, {
"CELAS4_1", libMesh::NODEELEM},
190 {
"CBUSH_1", libMesh::NODEELEM}, {
"CBUSH1D_1", libMesh::NODEELEM},
193 {
"CELAS1_2", libMesh::EDGE2}, {
"CELAS2_2", libMesh::EDGE2},
194 {
"CELAS3_2", libMesh::EDGE2}, {
"CELAS4_2", libMesh::EDGE2},
195 {
"CBUSH_2", libMesh::EDGE2}, {
"CBUSH1D_2", libMesh::EDGE2},
196 {
"CBUSH2D_2",libMesh::EDGE2},
197 {
"CROD_2", libMesh::EDGE2}, {
"CBAR_2", libMesh::EDGE2},
198 {
"CBEAM_2", libMesh::EDGE2}, {
"CBEAM3_3", libMesh::EDGE3},
201 {
"CTRIA3_3", libMesh::TRI3}, {
"CTRIA6_6", libMesh::TRI6},
202 {
"CTRIAR_3", libMesh::TRI3},
203 {
"CQUAD4_4", libMesh::QUAD4}, {
"CQUAD8_8", libMesh::QUAD8},
204 {
"CQUADR_4", libMesh::QUADSHELL4}, {
"CQUAD_4", libMesh::QUAD4},
205 {
"CQUAD_8", libMesh::QUAD8}, {
"CQUAD_9", libMesh::QUAD9},
206 {
"CQUADX_4", libMesh::QUAD4}, {
"CQUADX_8", libMesh::QUAD8},
207 {
"CQUADX_9", libMesh::QUAD9},
210 {
"CTETRA_4", libMesh::TET4}, {
"CTETRA_10", libMesh::TET10},
211 {
"CPENTA_6", libMesh::PRISM6}, {
"CPENTA_15", libMesh::PRISM15},
212 {
"CPYRAM_5", libMesh::PYRAMID5}, {
"CPYRAM_13", libMesh::PYRAMID13},
213 {
"CHEXA_8", libMesh::HEX8}, {
"CHEXA_20", libMesh::HEX20}
221 void printElementMap(std::map<std::string, std::vector<std::vector<int>>> elementMap);
225 #endif // __mast_nastran_io_h__
void print_pid_to_subdomain_id_map()
Print map between Nastran property ID's (PID) to libMesh subdomain ID's (SID) to libMesh::out.
NastranIO(libMesh::MeshBase &mesh, const bool python_preinit=false)
Constructor.
std::map< uint64_t, libMesh::Node * > nastran_to_libmesh_node_map
Mapping from Nastran grid IDs from BDF input to pointers to libMesh/MAST nodes.
std::map< const libMesh::Node *, uint64_t > get_libmesh_to_nastran_node_map()
Returns mapping between libMesh/MAST nodes and Nastran BDF grid ID's.
std::map< uint64_t, libMesh::Elem * > nastran_to_libmesh_elem_map
Mapping from Nastran element IDs from BDF input to pointers to libMesh/MAST elements.
void read_node_boundaries(BDFModel *model, libMesh::MeshBase &the_mesh)
void printNodeCoords(std::vector< std::vector< double >> nodes)
virtual ~NastranIO()
Destructor.
void read_elements(BDFModel *model, libMesh::MeshBase &the_mesh)
std::map< libMesh::Elem *, uint64_t > get_libmesh_to_nastran_elem_map()
Returns mapping between libMesh/MAST elements and Nastran BDF element ID's.
void read_nodes(BDFModel *model, libMesh::MeshBase &the_mesh)
std::map< std::pair< int, int >, int > get_nastran_pid_elemtype_to_libmesh_subdomain_map()
Provides mapping between Nastran property ID & element-type pairs and corresponding libMesh/MAST subdomai...
std::map< std::string, libMesh::ElemType > nastran_to_libmesh_elem_type_map
Map from Nastran elements to equivalent libMesh/MAST element types.
std::map< libMesh::Elem *, uint64_t > libmesh_to_nastran_elem_map
Mapping from libMesh/MAST element pointers to Nastran element IDs from BDF input. ...
bool python_initialized
Indicates is Python has been initialized.
void printElementMap(std::map< std::string, std::vector< std::vector< int >>> elementMap)
std::map< uint64_t, libMesh::Elem * > get_nastran_to_libmesh_elem_map()
Returns mapping between Nastran BDF element ID's and libMesh/MAST elements.
virtual void read(const std::string &filename) override
Read ASCII NASTRAN BDF given by filename.
std::map< uint64_t, libMesh::Node * > get_nastran_to_libmesh_node_map()
Returns mapping between Nastran BDF grid ID's and libMesh/MAST nodes.
const bool python_preinitialized
Indicates if Python was initialized outside of NastranIO class.
std::map< const libMesh::Node *, uint64_t > libmesh_to_nastran_node_map
Mapping from libMesh/MAST node pointers to Nastran grid IDs from BDF input.
std::map< std::pair< int, int >, int > nastran_pid_elemtype_to_libmesh_subdomain_map
Mapping from Nastran property ID/element-type pair to libMesh/MAST subdomain.
std::map< int, std::set< int > > get_nastran_property_to_libmesh_subdomains_map()
Returns mapping between Nastran property ID's and sets of libMesh/MAST subdomains.