FEM: ccx input writer, splitted, improve node sets for fixed constraint
This commit is contained in:
@@ -195,14 +195,7 @@ class FemInputWriterCcx(writerbase.FemInputWriter):
|
||||
self.write_element_sets_material_and_femelement_type(inpfileMain)
|
||||
|
||||
# node sets and surface sets
|
||||
if self.fixed_objects:
|
||||
inpfileMain.write("\n***********************************************************\n")
|
||||
inpfileMain.write("** Node sets for constraints\n")
|
||||
inpfileNodes = open(self.include + "_Node_sets.inp", "w")
|
||||
if self.fixed_objects:
|
||||
inpfileMain.write("** written by write_node_sets_constraints_fixed\n")
|
||||
self.write_node_sets_constraints_fixed(inpfileNodes)
|
||||
|
||||
self.write_node_sets_constraints_fixed(inpfileMain, True)
|
||||
self.write_node_sets_constraints_displacement(inpfileMain, True)
|
||||
self.write_node_sets_constraints_planerotation(inpfileMain, True)
|
||||
self.write_surfaces_constraints_contact(inpfileMain, True)
|
||||
@@ -382,7 +375,7 @@ class FemInputWriterCcx(writerbase.FemInputWriter):
|
||||
for elid in ccx_elset["ccx_elset"]:
|
||||
f.write(str(elid) + ",\n")
|
||||
|
||||
def write_node_sets_constraints_fixed(self, f):
|
||||
def write_node_sets_constraints_fixed(self, f, splitted=None):
|
||||
if not self.fixed_objects:
|
||||
return
|
||||
# write for all analysis types
|
||||
@@ -390,10 +383,23 @@ class FemInputWriterCcx(writerbase.FemInputWriter):
|
||||
# get nodes
|
||||
self.get_constraints_fixed_nodes()
|
||||
|
||||
# write nodes to file
|
||||
write_name = "constraints_fixed_node_sets"
|
||||
f.write("\n***********************************************************\n")
|
||||
f.write("** Node sets for fixed constraint\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_node_sets_nodes_constraints_fixed(inpfile_splitt)
|
||||
inpfile_splitt.close()
|
||||
else:
|
||||
self.write_node_sets_nodes_constraints_fixed(f)
|
||||
|
||||
def write_node_sets_nodes_constraints_fixed(self, f):
|
||||
# write nodes to file
|
||||
for femobj in self.fixed_objects:
|
||||
# femobj --> dict, FreeCAD document object is femobj["Object"]
|
||||
fix_obj = femobj["Object"]
|
||||
|
||||
@@ -346,7 +346,7 @@ Evolumes
|
||||
Evolumes
|
||||
|
||||
***********************************************************
|
||||
** Node sets for fixed constraint
|
||||
** constraints fixed node sets
|
||||
** written by write_node_sets_constraints_fixed function
|
||||
** ConstraintFixed
|
||||
*NSET,NSET=ConstraintFixed
|
||||
|
||||
@@ -22999,7 +22999,7 @@ Efaces
|
||||
Efaces
|
||||
|
||||
***********************************************************
|
||||
** Node sets for fixed constraint
|
||||
** constraints fixed node sets
|
||||
** written by write_node_sets_constraints_fixed function
|
||||
** ConstraintFixed
|
||||
*NSET,NSET=ConstraintFixed
|
||||
|
||||
@@ -4320,7 +4320,7 @@ Evolumes
|
||||
Evolumes
|
||||
|
||||
***********************************************************
|
||||
** Node sets for fixed constraint
|
||||
** constraints fixed node sets
|
||||
** written by write_node_sets_constraints_fixed function
|
||||
** ConstraintFixed
|
||||
*NSET,NSET=ConstraintFixed
|
||||
|
||||
@@ -18535,7 +18535,7 @@ Evolumes
|
||||
Evolumes
|
||||
|
||||
***********************************************************
|
||||
** Node sets for fixed constraint
|
||||
** constraints fixed node sets
|
||||
** written by write_node_sets_constraints_fixed function
|
||||
** ConstraintFixed
|
||||
*NSET,NSET=ConstraintFixed
|
||||
|
||||
@@ -430,7 +430,7 @@ Evolumes
|
||||
Evolumes
|
||||
|
||||
***********************************************************
|
||||
** Node sets for fixed constraint
|
||||
** constraints fixed node sets
|
||||
** written by write_node_sets_constraints_fixed function
|
||||
** FemConstraintFixed
|
||||
*NSET,NSET=FemConstraintFixed
|
||||
|
||||
@@ -1166,7 +1166,7 @@ Evolumes
|
||||
148,
|
||||
|
||||
***********************************************************
|
||||
** Node sets for fixed constraint
|
||||
** constraints fixed node sets
|
||||
** written by write_node_sets_constraints_fixed function
|
||||
** ConstraintFixed
|
||||
*NSET,NSET=ConstraintFixed
|
||||
|
||||
@@ -19779,7 +19779,7 @@ Evolumes
|
||||
Evolumes
|
||||
|
||||
***********************************************************
|
||||
** Node sets for fixed constraint
|
||||
** constraints fixed node sets
|
||||
** written by write_node_sets_constraints_fixed function
|
||||
** ConstraintFixed
|
||||
*NSET,NSET=ConstraintFixed
|
||||
|
||||
@@ -78,7 +78,7 @@ Evolumes
|
||||
Evolumes
|
||||
|
||||
***********************************************************
|
||||
** Node sets for fixed constraint
|
||||
** constraints fixed node sets
|
||||
** written by write_node_sets_constraints_fixed function
|
||||
** FemConstraintFixed
|
||||
*NSET,NSET=FemConstraintFixed
|
||||
|
||||
@@ -6114,7 +6114,7 @@ Evolumes
|
||||
2930,
|
||||
|
||||
***********************************************************
|
||||
** Node sets for fixed constraint
|
||||
** constraints fixed node sets
|
||||
** written by write_node_sets_constraints_fixed function
|
||||
** ConstraintFixed
|
||||
*NSET,NSET=ConstraintFixed
|
||||
|
||||
104
~diff
Normal file
104
~diff
Normal file
@@ -0,0 +1,104 @@
|
||||
[1mdiff --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[m
|
||||
[1mindex bbc16785e6..f99a670b09 100644[m
|
||||
[1m--- a/src/Mod/Fem/femtest/data/ccx/canti_ccx_faceload_hexa20.inp[m
|
||||
[1m+++ b/src/Mod/Fem/femtest/data/ccx/canti_ccx_faceload_hexa20.inp[m
|
||||
[36m@@ -346,7 +346,7 @@[m [mEvolumes[m
|
||||
Evolumes[m
|
||||
[m
|
||||
***********************************************************[m
|
||||
[31m-** Node sets for fixed constraint[m
|
||||
[32m+[m[32m** constraints fixed node sets[m
|
||||
** written by write_node_sets_constraints_fixed function[m
|
||||
** ConstraintFixed[m
|
||||
*NSET,NSET=ConstraintFixed[m
|
||||
[1mdiff --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[m
|
||||
[1mindex cb2763d1b3..d4bc2c111e 100644[m
|
||||
[1m--- a/src/Mod/Fem/femtest/data/ccx/constraint_contact_shell_shell.inp[m
|
||||
[1m+++ b/src/Mod/Fem/femtest/data/ccx/constraint_contact_shell_shell.inp[m
|
||||
[36m@@ -22999,7 +22999,7 @@[m [mEfaces[m
|
||||
Efaces[m
|
||||
[m
|
||||
***********************************************************[m
|
||||
[31m-** Node sets for fixed constraint[m
|
||||
[32m+[m[32m** constraints fixed node sets[m
|
||||
** written by write_node_sets_constraints_fixed function[m
|
||||
** ConstraintFixed[m
|
||||
*NSET,NSET=ConstraintFixed[m
|
||||
[1mdiff --git a/src/Mod/Fem/femtest/data/ccx/constraint_contact_solid_solid.inp b/src/Mod/Fem/femtest/data/ccx/constraint_contact_solid_solid.inp[m
|
||||
[1mindex 718c6ab8b1..26d50fcacc 100644[m
|
||||
[1m--- a/src/Mod/Fem/femtest/data/ccx/constraint_contact_solid_solid.inp[m
|
||||
[1m+++ b/src/Mod/Fem/femtest/data/ccx/constraint_contact_solid_solid.inp[m
|
||||
[36m@@ -4320,7 +4320,7 @@[m [mEvolumes[m
|
||||
Evolumes[m
|
||||
[m
|
||||
***********************************************************[m
|
||||
[31m-** Node sets for fixed constraint[m
|
||||
[32m+[m[32m** constraints fixed node sets[m
|
||||
** written by write_node_sets_constraints_fixed function[m
|
||||
** ConstraintFixed[m
|
||||
*NSET,NSET=ConstraintFixed[m
|
||||
[1mdiff --git a/src/Mod/Fem/femtest/data/ccx/constraint_tie.inp b/src/Mod/Fem/femtest/data/ccx/constraint_tie.inp[m
|
||||
[1mindex 8ee42ed0b9..9f9360f387 100644[m
|
||||
[1m--- a/src/Mod/Fem/femtest/data/ccx/constraint_tie.inp[m
|
||||
[1m+++ b/src/Mod/Fem/femtest/data/ccx/constraint_tie.inp[m
|
||||
[36m@@ -18535,7 +18535,7 @@[m [mEvolumes[m
|
||||
Evolumes[m
|
||||
[m
|
||||
***********************************************************[m
|
||||
[31m-** Node sets for fixed constraint[m
|
||||
[32m+[m[32m** constraints fixed node sets[m
|
||||
** written by write_node_sets_constraints_fixed function[m
|
||||
** ConstraintFixed[m
|
||||
*NSET,NSET=ConstraintFixed[m
|
||||
[1mdiff --git a/src/Mod/Fem/femtest/data/ccx/mat_multiple.inp b/src/Mod/Fem/femtest/data/ccx/mat_multiple.inp[m
|
||||
[1mindex 8bdc2c489f..aa87ef3771 100644[m
|
||||
[1m--- a/src/Mod/Fem/femtest/data/ccx/mat_multiple.inp[m
|
||||
[1m+++ b/src/Mod/Fem/femtest/data/ccx/mat_multiple.inp[m
|
||||
[36m@@ -1166,7 +1166,7 @@[m [mEvolumes[m
|
||||
148,[m
|
||||
[m
|
||||
***********************************************************[m
|
||||
[31m-** Node sets for fixed constraint[m
|
||||
[32m+[m[32m** constraints fixed node sets[m
|
||||
** written by write_node_sets_constraints_fixed function[m
|
||||
** ConstraintFixed[m
|
||||
*NSET,NSET=ConstraintFixed[m
|
||||
[1mdiff --git a/src/Mod/Fem/femtest/data/ccx/mat_nonlinear.inp b/src/Mod/Fem/femtest/data/ccx/mat_nonlinear.inp[m
|
||||
[1mindex a0a36a3cf9..349f0b98c5 100644[m
|
||||
[1m--- a/src/Mod/Fem/femtest/data/ccx/mat_nonlinear.inp[m
|
||||
[1m+++ b/src/Mod/Fem/femtest/data/ccx/mat_nonlinear.inp[m
|
||||
[36m@@ -19779,7 +19779,7 @@[m [mEvolumes[m
|
||||
Evolumes[m
|
||||
[m
|
||||
***********************************************************[m
|
||||
[31m-** Node sets for fixed constraint[m
|
||||
[32m+[m[32m** constraints fixed node sets[m
|
||||
** written by write_node_sets_constraints_fixed function[m
|
||||
** ConstraintFixed[m
|
||||
*NSET,NSET=ConstraintFixed[m
|
||||
[1mdiff --git a/src/Mod/Fem/femtest/data/ccx/spine_thermomech.inp b/src/Mod/Fem/femtest/data/ccx/spine_thermomech.inp[m
|
||||
[1mindex 210cadd779..2f5113e35b 100644[m
|
||||
[1m--- a/src/Mod/Fem/femtest/data/ccx/spine_thermomech.inp[m
|
||||
[1m+++ b/src/Mod/Fem/femtest/data/ccx/spine_thermomech.inp[m
|
||||
[36m@@ -78,7 +78,7 @@[m [mEvolumes[m
|
||||
Evolumes[m
|
||||
[m
|
||||
***********************************************************[m
|
||||
[31m-** Node sets for fixed constraint[m
|
||||
[32m+[m[32m** constraints fixed node sets[m
|
||||
** written by write_node_sets_constraints_fixed function[m
|
||||
** FemConstraintFixed[m
|
||||
*NSET,NSET=FemConstraintFixed[m
|
||||
[1mdiff --git a/src/Mod/Fem/femtest/data/ccx/thermomech_bimetall.inp b/src/Mod/Fem/femtest/data/ccx/thermomech_bimetall.inp[m
|
||||
[1mindex b98472ac71..eb2d2d2bca 100644[m
|
||||
[1m--- a/src/Mod/Fem/femtest/data/ccx/thermomech_bimetall.inp[m
|
||||
[1m+++ b/src/Mod/Fem/femtest/data/ccx/thermomech_bimetall.inp[m
|
||||
[36m@@ -6114,7 +6114,7 @@[m [mEvolumes[m
|
||||
2930,[m
|
||||
[m
|
||||
***********************************************************[m
|
||||
[31m-** Node sets for fixed constraint[m
|
||||
[32m+[m[32m** constraints fixed node sets[m
|
||||
** written by write_node_sets_constraints_fixed function[m
|
||||
** ConstraintFixed[m
|
||||
*NSET,NSET=ConstraintFixed[m
|
||||
Reference in New Issue
Block a user