FEM: Fix multiframe bugs and add correct units for all cxx analysis types

This commit is contained in:
Stefan Tröger
2025-02-27 17:13:28 +01:00
committed by Benjamin Nauck
parent 9738b9b6ea
commit c815612dc6
2 changed files with 18 additions and 6 deletions

View File

@@ -50,7 +50,7 @@ public:
short mustExecute() const override;
PyObject* getPyObject() override;
constexpr const char* getViewProviderName() const override
const char* getViewProviderName() const override
{
return "FemGui::ViewProviderFemPostBranchFilter";
}

View File

@@ -149,7 +149,6 @@ def importFrd(filename, analysis=None, result_name_prefix="", result_analysis_ty
else:
results_name = f"{result_name_prefix}Results"
multistep_value.append(step_time)
res_obj = make_result_mesh(results_name)
res_obj = importToolsFem.fill_femresult_mechanical(res_obj, result_set)
if analysis:
@@ -218,16 +217,29 @@ def importFrd(filename, analysis=None, result_name_prefix="", result_analysis_ty
res_obj = resulttools.fill_femresult_stats(res_obj)
# if we have multiple results we delay the pipeline creation
if len(m["Results"]) == 1:
if number_of_increments == 1:
setupPipeline(doc, analysis, results_name, [res_obj])
else:
multistep_value.append(step_time)
multistep_result.append(res_obj)
# we have collected all result objects, lets create the multistep result pipeline
if len(m["Results"]) > 1:
unit = FreeCAD.Units.Frequency
description = "Eigenmodes"
if number_of_increments > 1:
# figure out type and unit
unit = FreeCAD.Units.Unit("")
description = "Unknown"
if result_analysis_type == "frequency":
unit = FreeCAD.Units.Frequency
description = "Eigenmode"
elif result_analysis_type == "buckling":
description = "Buckling factor"
elif result_analysis_type == "thermomech":
unit = FreeCAD.Units.TimeSpan
description = "Timesteps"
elif result_analysis_type == "static":
description = "Load factor"
setupPipeline(doc, analysis, results_name, [multistep_result, multistep_value, unit, description])