diff --git a/src/Mod/Fem/FemInputWriterCcx.py b/src/Mod/Fem/FemInputWriterCcx.py index d5c0de662..7141fb03d 100644 --- a/src/Mod/Fem/FemInputWriterCcx.py +++ b/src/Mod/Fem/FemInputWriterCcx.py @@ -47,17 +47,18 @@ class FemInputWriterCcx(FemInputWriter.FemInputWriter): analysis_type=None, eigenmode_parameters=None, dir_name=None ): - FemInputWriter.FemInputWriter.__init__(self, - analysis_obj, solver_obj, - mesh_obj, mat_obj, - fixed_obj, displacement_obj, - contact_obj, planerotation_obj, - selfweight_obj, force_obj, pressure_obj, - temperature_obj, heatflux_obj, initialtemperature_obj, - beamsection_obj, shellthickness_obj, - analysis_type, eigenmode_parameters, - dir_name - ) + + FemInputWriter.FemInputWriter.__init__( + self, + analysis_obj, solver_obj, + mesh_obj, mat_obj, + fixed_obj, displacement_obj, + contact_obj, planerotation_obj, + selfweight_obj, force_obj, pressure_obj, + temperature_obj, heatflux_obj, initialtemperature_obj, + beamsection_obj, shellthickness_obj, + analysis_type, eigenmode_parameters, + dir_name) self.file_name = self.dir_name + '/' + self.mesh_object.Name + '.inp' print('FemInputWriterCcx --> self.dir_name --> ' + self.dir_name) print('FemInputWriterCcx --> self.file_name --> ' + self.file_name) diff --git a/src/Mod/Fem/FemInputWriterZ88.py b/src/Mod/Fem/FemInputWriterZ88.py index ccf4af1df..19432f7ab 100644 --- a/src/Mod/Fem/FemInputWriterZ88.py +++ b/src/Mod/Fem/FemInputWriterZ88.py @@ -44,17 +44,18 @@ class FemInputWriterZ88(FemInputWriter.FemInputWriter): analysis_type=None, eigenmode_parameters=None, dir_name=None ): - FemInputWriter.FemInputWriter.__init__(self, - analysis_obj, solver_obj, - mesh_obj, mat_obj, - fixed_obj, displacement_obj, - contact_obj, planerotation_obj, - selfweight_obj, force_obj, pressure_obj, - temperature_obj, heatflux_obj, initialtemperature_obj, - beamsection_obj, shellthickness_obj, - analysis_type, eigenmode_parameters, - dir_name - ) + + FemInputWriter.FemInputWriter.__init__( + self, + analysis_obj, solver_obj, + mesh_obj, mat_obj, + fixed_obj, displacement_obj, + contact_obj, planerotation_obj, + selfweight_obj, force_obj, pressure_obj, + temperature_obj, heatflux_obj, initialtemperature_obj, + beamsection_obj, shellthickness_obj, + analysis_type, eigenmode_parameters, + dir_name) self.file_name = self.dir_name + '/z88' print('FemInputWriterZ88 --> self.dir_name --> ' + self.dir_name) print('FemInputWriterZ88 --> self.file_name --> ' + self.file_name) diff --git a/src/Mod/Fem/FemToolsCcx.py b/src/Mod/Fem/FemToolsCcx.py index b7b713523..200ed1380 100644 --- a/src/Mod/Fem/FemToolsCcx.py +++ b/src/Mod/Fem/FemToolsCcx.py @@ -88,16 +88,15 @@ class FemToolsCcx(FemTools.FemTools): self.inp_file_name = "" try: inp_writer = iw.FemInputWriterCcx( - self.analysis, self.solver, - self.mesh, self.materials, - self.fixed_constraints, self.displacement_constraints, - self.contact_constraints, self.planerotation_constraints, - self.selfweight_constraints, self.force_constraints, self.pressure_constraints, - self.temperature_constraints, self.heatflux_constraints, self.initialtemperature_constraints, - self.beam_sections, self.shell_thicknesses, - self.analysis_type, self.eigenmode_parameters, - self.working_dir - ) + self.analysis, self.solver, + self.mesh, self.materials, + self.fixed_constraints, self.displacement_constraints, + self.contact_constraints, self.planerotation_constraints, + self.selfweight_constraints, self.force_constraints, self.pressure_constraints, + self.temperature_constraints, self.heatflux_constraints, self.initialtemperature_constraints, + self.beam_sections, self.shell_thicknesses, + self.analysis_type, self.eigenmode_parameters, + self.working_dir) self.inp_file_name = inp_writer.write_calculix_input_file() except: print("Unexpected error when writing CalculiX input file:", sys.exc_info()[0]) @@ -158,7 +157,7 @@ class FemToolsCcx(FemTools.FemTools): if not ont_backup: ont_backup = str(num_cpu_pref) if num_cpu_pref > 1: - _env = os.putenv('OMP_NUM_THREADS', str(num_cpu_pref)) # if user picked a number use that instead + _env = os.putenv('OMP_NUM_THREADS', str(num_cpu_pref)) # if user picked a number use that instead else: _env = os.putenv('OMP_NUM_THREADS', str(multiprocessing.cpu_count())) # change cwd because ccx may crash if directory has no write permission diff --git a/src/Mod/Fem/FemToolsZ88.py b/src/Mod/Fem/FemToolsZ88.py index bc965bbac..0c7595b71 100644 --- a/src/Mod/Fem/FemToolsZ88.py +++ b/src/Mod/Fem/FemToolsZ88.py @@ -81,16 +81,15 @@ class FemToolsZ88(FemTools.FemTools): self.inp_file_name = "" try: inp_writer = iw.FemInputWriterZ88( - self.analysis, self.solver, - self.mesh, self.materials, - self.fixed_constraints, self.displacement_constraints, - self.contact_constraints, self.planerotation_constraints, - self.selfweight_constraints, self.force_constraints, self.pressure_constraints, - self.temperature_constraints, self.heatflux_constraints, self.initialtemperature_constraints, - self.beam_sections, self.shell_thicknesses, - self.analysis_type, None, - self.working_dir - ) + self.analysis, self.solver, + self.mesh, self.materials, + self.fixed_constraints, self.displacement_constraints, + self.contact_constraints, self.planerotation_constraints, + self.selfweight_constraints, self.force_constraints, self.pressure_constraints, + self.temperature_constraints, self.heatflux_constraints, self.initialtemperature_constraints, + self.beam_sections, self.shell_thicknesses, + self.analysis_type, None, + self.working_dir) self.inp_file_name = inp_writer.write_z88_input() except: print("Unexpected error when writing Z88 input files:", sys.exc_info()[0]) diff --git a/src/Mod/Fem/InitGui.py b/src/Mod/Fem/InitGui.py index 7fc560f86..fce8f835a 100644 --- a/src/Mod/Fem/InitGui.py +++ b/src/Mod/Fem/InitGui.py @@ -60,7 +60,6 @@ class FemWorkbench (Workbench): import _CommandSolverZ88 import _CommandConstraintSelfWeight - import subprocess from platform import system ccx_path = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem").GetString("ccxBinaryPath") @@ -78,7 +77,6 @@ class FemWorkbench (Workbench): FreeCAD.Console.PrintError("CalculiX ccx binary not found! Please set it manually in FEM preferences.\n") except Exception as e: FreeCAD.Console.PrintError(e.message) - fem_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem") import os working_dir = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem").GetString("WorkingDir")