diff --git a/src/Mod/Fem/FemInputWriterCcx.py b/src/Mod/Fem/FemInputWriterCcx.py index 824caa0a4..fd7aac360 100644 --- a/src/Mod/Fem/FemInputWriterCcx.py +++ b/src/Mod/Fem/FemInputWriterCcx.py @@ -63,17 +63,24 @@ class FemInputWriterCcx(FemInputWriter.FemInputWriter): inpfile = open(self.file_name, 'a') inpfile.write('\n\n') self.write_element_sets_material_and_femelement_type(inpfile) - self.write_node_sets_constraints_fixed(inpfile) - self.write_node_sets_constraints_displacement(inpfile) + if self.fixed_objects: + self.write_node_sets_constraints_fixed(inpfile) + if self.displacement_objects: + self.write_node_sets_constraints_displacement(inpfile) self.write_materials(inpfile) self.write_femelementsets(inpfile) self.write_step_begin(inpfile) - self.write_constraints_fixed(inpfile) - self.write_constraints_displacement(inpfile) + if self.fixed_objects: + self.write_constraints_fixed(inpfile) + if self.displacement_objects: + self.write_constraints_displacement(inpfile) if self.analysis_type is None or self.analysis_type == "static": - self.write_constraints_selfweight(inpfile) - self.write_constraints_force(inpfile) - self.write_constraints_pressure(inpfile) + if self.selfweight_objects: + self.write_constraints_selfweight(inpfile) + if self.force_objects: + self.write_constraints_force(inpfile) + if self.pressure_objects: + self.write_constraints_pressure(inpfile) elif self.analysis_type == "frequency": self.write_frequency(inpfile) self.write_outputs_types(inpfile) diff --git a/src/Mod/Fem/test_files/ccx/cube_frequency.inp b/src/Mod/Fem/test_files/ccx/cube_frequency.inp index 7bdbc8640..088efa6d4 100644 --- a/src/Mod/Fem/test_files/ccx/cube_frequency.inp +++ b/src/Mod/Fem/test_files/ccx/cube_frequency.inp @@ -464,10 +464,6 @@ Eall 68, 69, -*********************************************************** -** Node sets for prescribed displacement constraint -** written by write_node_sets_constraints_displacement function - *********************************************************** ** Materials ** written by write_materials function @@ -500,11 +496,6 @@ FemConstraintFixed,2 FemConstraintFixed,3 -*********************************************************** -** Displacement constraint applied -** written by write_constraints_displacement function - - *********************************************************** ** Frequency analysis ** written by write_frequency function diff --git a/src/Mod/Fem/test_files/ccx/cube_static.inp b/src/Mod/Fem/test_files/ccx/cube_static.inp index 17370ab8e..dd9bc3831 100644 --- a/src/Mod/Fem/test_files/ccx/cube_static.inp +++ b/src/Mod/Fem/test_files/ccx/cube_static.inp @@ -464,10 +464,6 @@ Eall 68, 69, -*********************************************************** -** Node sets for prescribed displacement constraint -** written by write_node_sets_constraints_displacement function - *********************************************************** ** Materials ** written by write_materials function @@ -500,11 +496,6 @@ FemConstraintFixed,2 FemConstraintFixed,3 -*********************************************************** -** Displacement constraint applied -** written by write_constraints_displacement function - - *********************************************************** ** Node loads ** written by write_constraints_force function