diff --git a/src/Mod/Fem/App/FemMesh.cpp b/src/Mod/Fem/App/FemMesh.cpp index edb14ae3d8..8a57f250cf 100644 --- a/src/Mod/Fem/App/FemMesh.cpp +++ b/src/Mod/Fem/App/FemMesh.cpp @@ -1290,7 +1290,7 @@ void FemMesh::readNastran95(const std::string &Filename) std::ifstream inputfile; inputfile.open(Filename.c_str()); inputfile.seekg(std::ifstream::beg); - std::string line1,line2,temp,tcard; + std::string line1,line2,tcard; float cx, cy, cz; std::vector token_results; token_results.clear(); @@ -1300,7 +1300,7 @@ void FemMesh::readNastran95(const std::string &Filename) std::vector nodal_id; nodal_id.clear(); - + std::vector bar_element; std::vector tri_element; std::vector quad_element; @@ -1309,7 +1309,7 @@ void FemMesh::readNastran95(const std::string &Filename) std::vector hexa_element; std::vector > all_elements; - + std::vector element_id; std::vector element_type; @@ -1480,7 +1480,6 @@ void FemMesh::readNastran95(const std::string &Filename) std::getline(inputfile,line2); unsigned int id = atoi(line1.substr(8,16).c_str()); element_type.push_back(381); - int offset = 0; element_id.push_back(id); hexa_element.push_back(atoi(line1.substr(24,32).c_str())); @@ -1504,7 +1503,6 @@ void FemMesh::readNastran95(const std::string &Filename) std::getline(inputfile,line2); unsigned int id = atoi(line1.substr(8,16).c_str()); element_type.push_back(382); - int offset = 0; element_id.push_back(id); hexa_element.push_back(atoi(line1.substr(24,32).c_str())); @@ -1581,7 +1579,7 @@ void FemMesh::readNastran95(const std::string &Filename) } - for(unsigned int i=0;iAddFaceWithID( @@ -1701,7 +1702,6 @@ void FemMesh::readNastran95(const std::string &Filename) } } Base::Console().Log(" %f: Done \n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo())); - } void FemMesh::readAbaqus(const std::string &FileName) @@ -1794,8 +1794,12 @@ void FemMesh::read(const char *FileName) } else if (File.hasExtension("inp") ) { // read Abaqus inp mesh file - // readAbaqus(File.filePath()); - readNastran95(File.filePath()); + readAbaqus(File.filePath()); + + // if the file doesn't contain supported geometries try Nastran95 + SMESHDS_Mesh* meshds = this->myMesh->GetMeshDS(); + if (meshds->NbNodes() == 0) + readNastran95(File.filePath()); } else if (File.hasExtension("stl") ) { // read brep-file