diff --git a/src/Mod/Fem/App/FemMesh.cpp b/src/Mod/Fem/App/FemMesh.cpp index a794b465c5..259e934938 100644 --- a/src/Mod/Fem/App/FemMesh.cpp +++ b/src/Mod/Fem/App/FemMesh.cpp @@ -1189,9 +1189,12 @@ void FemMesh::writeABAQUS(const std::string &Filename) const std::ofstream anABAQUS_Output; anABAQUS_Output.open(Filename.c_str()); anABAQUS_Output.precision(15); + // add some text + anABAQUS_Output << "** written by FreeCAD inp file writer for CalculiX,Abaqus meshes" << std::endl << std::endl; // add nodes // + anABAQUS_Output << "** Nodes" << std::endl; anABAQUS_Output << "*Node, NSET=Nall" << std::endl; typedef std::map VertexMap; VertexMap vertexMap; @@ -1215,6 +1218,7 @@ void FemMesh::writeABAQUS(const std::string &Filename) const << it->second.y << ", " << it->second.z << std::endl; } + anABAQUS_Output << std::endl << std::endl;; typedef std::map > NodesMap; typedef std::map ElementsMap; @@ -1239,6 +1243,7 @@ void FemMesh::writeABAQUS(const std::string &Filename) const } for (ElementsMap::iterator it = elementsMap.begin(); it != elementsMap.end(); ++it) { + anABAQUS_Output << "** Volume elements" << std::endl; anABAQUS_Output << "*Element, TYPE=" << it->first << ", ELSET=Eall" << std::endl; for (NodesMap::iterator jt = it->second.begin(); jt != it->second.end(); ++jt) { anABAQUS_Output << jt->first; @@ -1260,6 +1265,7 @@ void FemMesh::writeABAQUS(const std::string &Filename) const anABAQUS_Output << std::endl; } } + anABAQUS_Output << std::endl; if (!elementsMap.empty()) { anABAQUS_Output.close(); @@ -1286,6 +1292,7 @@ void FemMesh::writeABAQUS(const std::string &Filename) const } for (ElementsMap::iterator it = elementsMap.begin(); it != elementsMap.end(); ++it) { + anABAQUS_Output << "** Face elements" << std::endl; anABAQUS_Output << "*Element, TYPE=" << it->first << ", ELSET=Eall" << std::endl; for (NodesMap::iterator jt = it->second.begin(); jt != it->second.end(); ++jt) { anABAQUS_Output << jt->first; @@ -1295,6 +1302,7 @@ void FemMesh::writeABAQUS(const std::string &Filename) const anABAQUS_Output << std::endl; } } + anABAQUS_Output << std::endl; if (!elementsMap.empty()) { anABAQUS_Output.close(); @@ -1321,6 +1329,7 @@ void FemMesh::writeABAQUS(const std::string &Filename) const } for (ElementsMap::iterator it = elementsMap.begin(); it != elementsMap.end(); ++it) { + anABAQUS_Output << "** Edge elements" << std::endl; anABAQUS_Output << "*Element, TYPE=" << it->first << ", ELSET=Eall" << std::endl; for (NodesMap::iterator jt = it->second.begin(); jt != it->second.end(); ++jt) { anABAQUS_Output << jt->first; @@ -1330,6 +1339,7 @@ void FemMesh::writeABAQUS(const std::string &Filename) const anABAQUS_Output << std::endl; } } + anABAQUS_Output << std::endl; elementsMap.clear(); anABAQUS_Output.close(); diff --git a/src/Mod/Fem/test_files/ccx/cube_frequency.inp b/src/Mod/Fem/test_files/ccx/cube_frequency.inp index 8bcc8bc739..047a6fd621 100644 --- a/src/Mod/Fem/test_files/ccx/cube_frequency.inp +++ b/src/Mod/Fem/test_files/ccx/cube_frequency.inp @@ -1,3 +1,6 @@ +** written by FreeCAD inp file writer for CalculiX,Abaqus meshes + +** Nodes *Node, NSET=Nall 1, 0, 0, 0 2, 0, 0, 10 @@ -279,6 +282,9 @@ 278, 3.75, 8.75, 2.5 279, 2.5, 3.75, 8.75 280, 1.25, 7.5, 3.75 + + +** Volume elements *Element, TYPE=C3D10, ELSET=Eall 1, 95, 98, 47, 196, 103, 197, 198, 200, 199, 201 2, 147, 121, 145, 196, 203, 202, 161, 205, 204, 206 @@ -412,6 +418,7 @@ + *********************************************************** ** Element sets for materials and FEM element type (solid, shell, beam, fluid) ** written by write_element_sets_material_and_femelement_type function diff --git a/src/Mod/Fem/test_files/ccx/cube_static.inp b/src/Mod/Fem/test_files/ccx/cube_static.inp index a9bc57630f..29b756a4a6 100644 --- a/src/Mod/Fem/test_files/ccx/cube_static.inp +++ b/src/Mod/Fem/test_files/ccx/cube_static.inp @@ -1,3 +1,6 @@ +** written by FreeCAD inp file writer for CalculiX,Abaqus meshes + +** Nodes *Node, NSET=Nall 1, 0, 0, 0 2, 0, 0, 10 @@ -279,6 +282,9 @@ 278, 3.75, 8.75, 2.5 279, 2.5, 3.75, 8.75 280, 1.25, 7.5, 3.75 + + +** Volume elements *Element, TYPE=C3D10, ELSET=Eall 1, 95, 98, 47, 196, 103, 197, 198, 200, 199, 201 2, 147, 121, 145, 196, 203, 202, 161, 205, 204, 206 @@ -412,6 +418,7 @@ + *********************************************************** ** Element sets for materials and FEM element type (solid, shell, beam, fluid) ** written by write_element_sets_material_and_femelement_type function diff --git a/src/Mod/Fem/test_files/ccx/spine_thermomech.inp b/src/Mod/Fem/test_files/ccx/spine_thermomech.inp index a30205faad..5b803b81dc 100644 --- a/src/Mod/Fem/test_files/ccx/spine_thermomech.inp +++ b/src/Mod/Fem/test_files/ccx/spine_thermomech.inp @@ -1,3 +1,6 @@ +** written by FreeCAD inp file writer for CalculiX,Abaqus meshes + +** Nodes *Node, NSET=Nall 1, 203.2, 25.4, 0 2, 203.2, 25.4, 25.4 @@ -44,6 +47,9 @@ 43, 51.308, 12.7, 12.7 44, 100.482, 12.7, 12.7 45, 152.908, 12.7, 12.7 + + +** Volume elements *Element, TYPE=C3D10, ELSET=Eall 1, 5, 6, 12, 11, 26, 43, 33, 20, 37, 34 2, 9, 12, 11, 2, 44, 34, 39, 15, 45, 38 @@ -60,6 +66,7 @@ + *********************************************************** ** Element sets for materials and FEM element type (solid, shell, beam, fluid) ** written by write_element_sets_material_and_femelement_type function