FEM: constraint contact ccx writer, use name to identify constr data in writer file

This commit is contained in:
Bernd Hahnebach
2020-02-03 23:10:03 +01:00
parent efe534bfca
commit 285d8547df
3 changed files with 19 additions and 20 deletions

View File

@@ -591,22 +591,20 @@ class FemInputWriterCcx(writerbase.FemInputWriter):
f.write("\n***********************************************************\n")
f.write("** Surfaces for contact constraint\n")
f.write("** written by {} function\n".format(sys._getframe().f_code.co_name))
obj = 0
for femobj in self.contact_objects:
# femobj --> dict, FreeCAD document object is femobj["Object"]
contact_obj = femobj["Object"]
f.write("** " + contact_obj.Label + "\n")
cnt = 0
obj = obj + 1
for o, elem_tup in contact_obj.References:
for elem in elem_tup:
ref_shape = o.Shape.getElement(elem)
cnt = cnt + 1
if ref_shape.ShapeType == "Face":
if cnt == 1:
name = "DEP" + str(obj)
name = "DEP" + contact_obj.Name
else:
name = "IND" + str(obj)
name = "IND" + contact_obj.Name
f.write("*SURFACE, NAME=" + name + "\n")
v = self.mesh_object.FemMesh.getccxVolumesByFace(ref_shape)
@@ -1044,17 +1042,18 @@ class FemInputWriterCcx(writerbase.FemInputWriter):
f.write("\n***********************************************************\n")
f.write("** Contact Constraints\n")
f.write("** written by {} function\n".format(sys._getframe().f_code.co_name))
obj = 0
for femobj in self.contact_objects:
# femobj --> dict, FreeCAD document object is femobj["Object"]
obj = obj + 1
contact_obj = femobj["Object"]
f.write("** " + contact_obj.Label + "\n")
f.write("*CONTACT PAIR, INTERACTION=INT{},TYPE=SURFACE TO SURFACE\n".format(obj))
ind_surf = "IND" + str(obj)
dep_surf = "DEP" + str(obj)
f.write(
"*CONTACT PAIR, INTERACTION=INT{},TYPE=SURFACE TO SURFACE\n"
.format(contact_obj.Name)
)
ind_surf = "IND" + contact_obj.Name
dep_surf = "DEP" + contact_obj.Name
f.write(dep_surf + "," + ind_surf + "\n")
f.write("*SURFACE INTERACTION, NAME=INT{}\n".format(obj))
f.write("*SURFACE INTERACTION, NAME=INT{}\n".format(contact_obj.Name))
f.write("*SURFACE BEHAVIOR,PRESSURE-OVERCLOSURE=LINEAR\n")
slope = contact_obj.Slope
f.write(str(slope) + " \n")

View File

@@ -23072,7 +23072,7 @@ Efaces
** Surfaces for contact constraint
** written by write_surfaces_constraints_contact function
** ConstraintContact
*SURFACE, NAME=DEP1
*SURFACE, NAME=DEPConstraintContact
329,S2
330,S2
331,S2
@@ -30571,7 +30571,7 @@ Efaces
7824,S2
7825,S2
7826,S2
*SURFACE, NAME=IND1
*SURFACE, NAME=INDConstraintContact
7827,S2
7828,S2
7829,S2
@@ -38371,9 +38371,9 @@ Efaces
** Contact Constraints
** written by write_constraints_contact function
** ConstraintContact
*CONTACT PAIR, INTERACTION=INT1,TYPE=SURFACE TO SURFACE
DEP1,IND1
*SURFACE INTERACTION, NAME=INT1
*CONTACT PAIR, INTERACTION=INTConstraintContact,TYPE=SURFACE TO SURFACE
DEPConstraintContact,INDConstraintContact
*SURFACE INTERACTION, NAME=INTConstraintContact
*SURFACE BEHAVIOR,PRESSURE-OVERCLOSURE=LINEAR
1000000.0

View File

@@ -4433,7 +4433,7 @@ Evolumes
** Surfaces for contact constraint
** written by write_surfaces_constraints_contact function
** ConstraintContact
*SURFACE, NAME=DEP1
*SURFACE, NAME=DEPConstraintContact
1344,S4
1655,S1
1703,S3
@@ -4892,7 +4892,7 @@ Evolumes
2594,S3
2595,S2
2596,S3
*SURFACE, NAME=IND1
*SURFACE, NAME=INDConstraintContact
1283,S2
1286,S1
1289,S1
@@ -5057,9 +5057,9 @@ Evolumes
** Contact Constraints
** written by write_constraints_contact function
** ConstraintContact
*CONTACT PAIR, INTERACTION=INT1,TYPE=SURFACE TO SURFACE
DEP1,IND1
*SURFACE INTERACTION, NAME=INT1
*CONTACT PAIR, INTERACTION=INTConstraintContact,TYPE=SURFACE TO SURFACE
DEPConstraintContact,INDConstraintContact
*SURFACE INTERACTION, NAME=INTConstraintContact
*SURFACE BEHAVIOR,PRESSURE-OVERCLOSURE=LINEAR
1000000.0