diff --git a/src/Mod/Fem/femsolver/calculix/writer.py b/src/Mod/Fem/femsolver/calculix/writer.py index c7335b03af..32d37eec1a 100644 --- a/src/Mod/Fem/femsolver/calculix/writer.py +++ b/src/Mod/Fem/femsolver/calculix/writer.py @@ -228,15 +228,7 @@ class FemInputWriterCcx(writerbase.FemInputWriter): self.write_constraints_fixed(inpfileMain) self.write_constraints_displacement(inpfileMain) self.write_constraints_selfweight(inpfileMain) - - if self.force_objects: - inpfileMain.write("\n***********************************************************\n") - inpfileMain.write("** Node loads\n") - inpfileMain.write("** written by write_constraints_force\n") - inpfileMain.write("*INCLUDE,INPUT=" + self.mesh_name + "_Node_Force.inp \n") - inpfileForce = open(self.include + "_Node_Force.inp", "w") - self.write_constraints_force(inpfileForce) - inpfileForce.close() + self.write_constraints_force(inpfileMain, True) if self.pressure_objects: inpfileMain.write("\n***********************************************************\n") @@ -1174,7 +1166,7 @@ class FemInputWriterCcx(writerbase.FemInputWriter): # different element sets for different density # are written in the material element sets already - def write_constraints_force(self, f): + def write_constraints_force(self, f, splitted=None): if not self.force_objects: return if not (self.analysis_type == "static" or self.analysis_type == "thermomech"): @@ -1183,10 +1175,23 @@ class FemInputWriterCcx(writerbase.FemInputWriter): # check shape type of reference shape and get node loads self.get_constraints_force_nodeloads() - # write node loads to file + write_name = "constraints_force_node_loads" f.write("\n***********************************************************\n") - f.write("** Node loads Constraints\n") + f.write("** {}\n".format(write_name.replace("_", " "))) f.write("** written by {} function\n".format(sys._getframe().f_code.co_name)) + + if splitted is True: + file_name_splitt = self.mesh_name + "_" + write_name + ".inp" + f.write("** {}\n".format(write_name.replace("_", " "))) + f.write("*INCLUDE,INPUT={}\n".format(file_name_splitt)) + inpfile_splitt = open(join(self.dir_name, file_name_splitt), "w") + self.write_nodeloads_constraints_force(inpfile_splitt) + inpfile_splitt.close() + else: + self.write_nodeloads_constraints_force(f) + + def write_nodeloads_constraints_force(self, f): + # write node loads to file f.write("*CLOAD\n") for femobj in self.force_objects: # femobj --> dict, FreeCAD document object is femobj["Object"] diff --git a/src/Mod/Fem/femtest/data/ccx/canti_ccx_faceload_hexa20.inp b/src/Mod/Fem/femtest/data/ccx/canti_ccx_faceload_hexa20.inp index f99a670b09..66fe784525 100644 --- a/src/Mod/Fem/femtest/data/ccx/canti_ccx_faceload_hexa20.inp +++ b/src/Mod/Fem/femtest/data/ccx/canti_ccx_faceload_hexa20.inp @@ -405,7 +405,7 @@ ConstraintFixed,3 *********************************************************** -** Node loads Constraints +** constraints force node loads ** written by write_constraints_force function *CLOAD ** ConstraintForce diff --git a/src/Mod/Fem/femtest/data/ccx/constraint_contact_shell_shell.inp b/src/Mod/Fem/femtest/data/ccx/constraint_contact_shell_shell.inp index 8370b8867c..55685fa4ed 100644 --- a/src/Mod/Fem/femtest/data/ccx/constraint_contact_shell_shell.inp +++ b/src/Mod/Fem/femtest/data/ccx/constraint_contact_shell_shell.inp @@ -38398,7 +38398,7 @@ ConstraintFixed,6 *********************************************************** -** Node loads Constraints +** constraints force node loads ** written by write_constraints_force function *CLOAD ** ConstraintForce diff --git a/src/Mod/Fem/femtest/data/ccx/constraint_tie.inp b/src/Mod/Fem/femtest/data/ccx/constraint_tie.inp index 8e1d25f6d7..fdd44fa9c1 100644 --- a/src/Mod/Fem/femtest/data/ccx/constraint_tie.inp +++ b/src/Mod/Fem/femtest/data/ccx/constraint_tie.inp @@ -18634,7 +18634,7 @@ ConstraintFixed,3 *********************************************************** -** Node loads Constraints +** constraints force node loads ** written by write_constraints_force function *CLOAD ** ConstraintForce diff --git a/src/Mod/Fem/femtest/data/ccx/cube_static.inp b/src/Mod/Fem/femtest/data/ccx/cube_static.inp index 83960fa30f..f886615828 100644 --- a/src/Mod/Fem/femtest/data/ccx/cube_static.inp +++ b/src/Mod/Fem/femtest/data/ccx/cube_static.inp @@ -509,7 +509,7 @@ FemConstraintFixed,3 *********************************************************** -** Node loads Constraints +** constraints force node loads ** written by write_constraints_force function *CLOAD ** FemConstraintForce