From 86dc590a8a9317bc195ee6b79188f53ba7ba849a Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Fri, 15 Mar 2019 21:06:15 +0100 Subject: [PATCH] FEM: stress and strain components, use more comon order and notation --- src/Mod/Fem/feminout/importCcxFrdResults.py | 10 ++++++++-- src/Mod/Fem/feminout/importToolsFem.py | 10 +++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/Mod/Fem/feminout/importCcxFrdResults.py b/src/Mod/Fem/feminout/importCcxFrdResults.py index f800e591d3..b62fa1fb11 100644 --- a/src/Mod/Fem/feminout/importCcxFrdResults.py +++ b/src/Mod/Fem/feminout/importCcxFrdResults.py @@ -425,7 +425,10 @@ def read_frd_result(frd_input): stress_4 = float(line[49:61]) stress_5 = float(line[61:73]) stress_6 = float(line[73:85]) - mode_stress[elem] = (stress_1, stress_2, stress_3, stress_4, stress_5, stress_6) + # CalculiX frd files: (Sxx, Syy, Szz, Sxy, Syz, Szx) + # FreeCAD: (Sxx, Syy, Szz, Sxy, Sxz, Syz) + # thus exchange the last two entries + mode_stress[elem] = (stress_1, stress_2, stress_3, stress_4, stress_6, stress_5) # Check if we found strain section if line[5:13] == "TOSTRAIN": @@ -439,7 +442,10 @@ def read_frd_result(frd_input): strain_4 = float(line[49:61]) strain_5 = float(line[61:73]) strain_6 = float(line[73:85]) - mode_strain[elem] = (strain_1, strain_2, strain_3, strain_4, strain_5, strain_6) + # CalculiX frd files: (Exx, Eyy, Ezz, Exy, Eyz, Ezx) + # FreeCAD: (Exx, Eyy, Ezz, Exy, Exz, Eyz) + # thus exchange the last two entries + mode_strain[elem] = (strain_1, strain_2, strain_3, strain_4, strain_6, strain_5) # Check if we found an equivalent plastic strain section if line[5:7] == "PE": diff --git a/src/Mod/Fem/feminout/importToolsFem.py b/src/Mod/Fem/feminout/importToolsFem.py index 2bc812f95a..56269de301 100644 --- a/src/Mod/Fem/feminout/importToolsFem.py +++ b/src/Mod/Fem/feminout/importToolsFem.py @@ -349,8 +349,8 @@ def calculate_von_mises(i): s22 = i[1] s33 = i[2] s12 = i[3] - s23 = i[4] - s31 = i[5] + s31 = i[4] + s23 = i[5] s11s22 = pow(s11 - s22, 2) s22s33 = pow(s22 - s33, 2) s33s11 = pow(s33 - s11, 2) @@ -360,9 +360,9 @@ def calculate_von_mises(i): def calculate_principal_stress(i): - sigma = np.array([[i[0], i[3], i[5]], - [i[3], i[1], i[4]], - [i[5], i[4], i[2]]]) # https://forum.freecadweb.org/viewtopic.php?f=18&t=24637&start=10#p240408 + sigma = np.array([[i[0], i[3], i[4]], + [i[3], i[1], i[5]], + [i[4], i[5], i[2]]]) # https://forum.freecadweb.org/viewtopic.php?f=18&t=24637&start=10#p240408 try: # it will fail if NaN is inside the array, # compute principal stresses