Skip to content

Commit f5e004d

Browse files
committed
Fem: Force z=0 for plane stress, plane strain and axisymmetric elements in writeABAQUS - fixes FreeCAD#12875
1 parent a6937d8 commit f5e004d

File tree

2 files changed

+37
-4
lines changed

2 files changed

+37
-4
lines changed

src/Mod/Fem/App/FemMesh.cpp

+24
Original file line numberDiff line numberDiff line change
@@ -2309,6 +2309,30 @@ void FemMesh::writeABAQUS(const std::string& Filename,
23092309
// write nodes
23102310
anABAQUS_Output << "** Nodes" << std::endl;
23112311
anABAQUS_Output << "*Node, NSET=Nall" << std::endl;
2312+
2313+
// Axisymmetric, plane strain and plane stress elements expect nodes in the plane z=0.
2314+
// Set the z coordinate to 0 to avoid possible rounding errors.
2315+
switch (faceVariant) {
2316+
case ABAQUS_FaceVariant::Stress:
2317+
case ABAQUS_FaceVariant::Stress_Reduced:
2318+
case ABAQUS_FaceVariant::Strain:
2319+
case ABAQUS_FaceVariant::Strain_Reduced:
2320+
case ABAQUS_FaceVariant::Axisymmetric:
2321+
case ABAQUS_FaceVariant::Axisymmetric_Reduced:
2322+
for (const auto& elMap : elementsMapFac) {
2323+
const NodesMap& nodeMap = elMap.second;
2324+
for (const auto& nodes : nodeMap) {
2325+
for (int n : nodes.second) {
2326+
Base::Vector3d& vertex = vertexMap[n];
2327+
vertex.z = 0.0;
2328+
}
2329+
}
2330+
}
2331+
break;
2332+
default:
2333+
break;
2334+
}
2335+
23122336
// This way we get sorted output.
23132337
// See https://forum.freecad.org/viewtopic.php?f=18&t=12646&start=40#p103004
23142338
for (const auto& it : vertexMap) {

src/Mod/Fem/App/FemMeshPy.xml

+13-4
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,17 @@
7777
<Methode Name="writeABAQUS" Const="true" Keyword="true">
7878
<Documentation>
7979
<UserDocu>Write out as ABAQUS inp
80-
writeABAQUS(file, int elemParam, bool groupParam)
81-
elemParam: 0 = all elements, 1 = highest elements only, 2 = FEM elements only (only edges not belonging to faces and faces not belonging to volumes)
82-
groupParam: true = write group data, false = do not write group data
80+
writeABAQUS(file, int elemParam, bool groupParam, str volVariant, str faceVariant, str edgeVariant)
81+
82+
elemParam:
83+
0: All elements
84+
1: Highest elements only
85+
2: FEM elements only (only edges not belonging to faces and faces not belonging to volumes)
86+
87+
groupParam:
88+
True: Write group data
89+
False: Do not write group data
90+
8391
volVariant: Volume elements
8492
"standard": Tetra4 -> C3D4, Penta6 -> C3D6, Hexa8 -> C3D8, Tetra10 -> C3D10, Penta15 -> C3D15, Hexa20 -> C3D20
8593
"reduced": Hexa8 -> C3D8R, Hexa20 -> C3D20R
@@ -107,7 +115,8 @@
107115

108116
Elements are selected according to CalculiX availability.
109117
For example if volume variant "modified" is selected, Tetra10 mesh
110-
elements are assigned to C3D10T and remain elements uses "standard"</UserDocu>
118+
elements are assigned to C3D10T and remain elements uses "standard".
119+
Axisymmetric, plane strain and plane stress elements expect nodes in the plane z=0.</UserDocu>
111120
</Documentation>
112121
</Methode>
113122
<Methode Name="setTransform">

0 commit comments

Comments
 (0)