diff --git a/src/Mod/Fem/App/FemMesh.cpp b/src/Mod/Fem/App/FemMesh.cpp index dc5e93e2ed..e669cb7038 100644 --- a/src/Mod/Fem/App/FemMesh.cpp +++ b/src/Mod/Fem/App/FemMesh.cpp @@ -2309,6 +2309,30 @@ void FemMesh::writeABAQUS(const std::string& Filename, // write nodes anABAQUS_Output << "** Nodes" << std::endl; anABAQUS_Output << "*Node, NSET=Nall" << std::endl; + + // Axisymmetric, plane strain and plane stress elements expect nodes in the plane z=0. + // Set the z coordinate to 0 to avoid possible rounding errors. + switch (faceVariant) { + case ABAQUS_FaceVariant::Stress: + case ABAQUS_FaceVariant::Stress_Reduced: + case ABAQUS_FaceVariant::Strain: + case ABAQUS_FaceVariant::Strain_Reduced: + case ABAQUS_FaceVariant::Axisymmetric: + case ABAQUS_FaceVariant::Axisymmetric_Reduced: + for (const auto& elMap : elementsMapFac) { + const NodesMap& nodeMap = elMap.second; + for (const auto& nodes : nodeMap) { + for (int n : nodes.second) { + Base::Vector3d& vertex = vertexMap[n]; + vertex.z = 0.0; + } + } + } + break; + default: + break; + } + // This way we get sorted output. // See https://forum.freecad.org/viewtopic.php?f=18&t=12646&start=40#p103004 for (const auto& it : vertexMap) { diff --git a/src/Mod/Fem/App/FemMeshPy.xml b/src/Mod/Fem/App/FemMeshPy.xml index d101aaf584..c9710a5eb7 100755 --- a/src/Mod/Fem/App/FemMeshPy.xml +++ b/src/Mod/Fem/App/FemMeshPy.xml @@ -77,9 +77,17 @@ Write out as ABAQUS inp - writeABAQUS(file, int elemParam, bool groupParam) - elemParam: 0 = all elements, 1 = highest elements only, 2 = FEM elements only (only edges not belonging to faces and faces not belonging to volumes) - groupParam: true = write group data, false = do not write group data + writeABAQUS(file, int elemParam, bool groupParam, str volVariant, str faceVariant, str edgeVariant) + + elemParam: + 0: All elements + 1: Highest elements only + 2: FEM elements only (only edges not belonging to faces and faces not belonging to volumes) + + groupParam: + True: Write group data + False: Do not write group data + volVariant: Volume elements "standard": Tetra4 -> C3D4, Penta6 -> C3D6, Hexa8 -> C3D8, Tetra10 -> C3D10, Penta15 -> C3D15, Hexa20 -> C3D20 "reduced": Hexa8 -> C3D8R, Hexa20 -> C3D20R @@ -107,7 +115,8 @@ Elements are selected according to CalculiX availability. For example if volume variant "modified" is selected, Tetra10 mesh - elements are assigned to C3D10T and remain elements uses "standard" + elements are assigned to C3D10T and remain elements uses "standard". + Axisymmetric, plane strain and plane stress elements expect nodes in the plane z=0.