FEM: abaqus writer, some comments

This commit is contained in:
Bernd Hahnebach
2017-06-06 16:55:57 +01:00
committed by Yorik van Havre
parent 546c02a71e
commit b01e482e07
4 changed files with 31 additions and 0 deletions

View File

@@ -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<int, Base::Vector3d> 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<int, std::vector<int> > NodesMap;
typedef std::map<std::string, NodesMap> 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();

View File

@@ -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

View File

@@ -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

View File

@@ -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