Skip to content

Commit

Permalink
FEM: node sets, return sorted with unique values
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Feb 4, 2020
1 parent 7dcc02d commit 7e01116
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 135 deletions.
5 changes: 4 additions & 1 deletion src/Mod/Fem/femmesh/meshtools.py
Expand Up @@ -52,7 +52,10 @@ def get_femnodes_by_femobj_with_references(
node_set = get_femnodes_by_references(femmesh, femobj["Object"].References)
# FreeCAD.Console.PrintMessage("node_set_nogroup: {}\n".format(node_set))

return node_set
# use set for node sets to be sure all nodes are unique
# use sorted to be sure the order is the same on different runs
# be aware a sorted set returns a list, because set are not sorted by default
return sorted(set(node_set))


# ************************************************************************************************
Expand Down
6 changes: 6 additions & 0 deletions src/Mod/Fem/femsolver/writerbase.py
Expand Up @@ -123,6 +123,12 @@ def __init__(
self.femelement_edges_table = {}
self.femelement_count_test = True

# use set for node sets to be sure all nodes are unique
# use sorted to be sure the order is the same on different runs
# be aware a sorted set returns a list, because set are not sorted by default
# - done in return value of meshtools.get_femnodes_by_femobj_with_references
# might be appropriate for element sets too

def get_constraints_fixed_nodes(self):
# get nodes
for femobj in self.fixed_objects:
Expand Down
74 changes: 37 additions & 37 deletions src/Mod/Fem/femtest/data/ccx/constraint_contact_solid_solid.inp
Expand Up @@ -4346,15 +4346,22 @@ Evolumes
20,
21,
22,
1561,
1562,
1563,
1564,
1565,
1566,
1567,
1568,
1569,
91,
92,
93,
94,
95,
96,
97,
98,
99,
164,
165,
166,
167,
168,
274,
366,
559,
560,
561,
Expand All @@ -4373,15 +4380,6 @@ Evolumes
574,
575,
576,
91,
92,
93,
94,
95,
96,
97,
98,
99,
649,
650,
651,
Expand All @@ -4394,20 +4392,6 @@ Evolumes
658,
659,
660,
164,
165,
166,
167,
168,
1210,
1211,
1212,
1213,
1214,
1215,
1216,
1217,
1218,
727,
728,
729,
Expand All @@ -4426,8 +4410,24 @@ Evolumes
742,
743,
744,
274,
366,
1210,
1211,
1212,
1213,
1214,
1215,
1216,
1217,
1218,
1561,
1562,
1563,
1564,
1565,
1566,
1567,
1568,
1569,

***********************************************************
** Surfaces for contact constraint
Expand Down Expand Up @@ -5359,9 +5359,9 @@ RF
***********************************************************
** CalculiX Input file
** written by write_footer function
** written by --> FreeCAD 0.19.19441 (Git)
** written on --> Sat Feb 1 13:08:12 2020
** file name --> Constraint_Contact_Solid_Solid.FCStd
** written by --> FreeCAD 0.19.19463 (Git)
** written on --> Mon Feb 3 23:28:02 2020
** file name -->
** analysis name --> Analysis
**
**
Expand Down
30 changes: 15 additions & 15 deletions src/Mod/Fem/femtest/data/ccx/mat_multiple.inp
Expand Up @@ -1174,6 +1174,18 @@ Evolumes
10,
11,
12,
52,
53,
54,
58,
59,
60,
64,
65,
66,
67,
68,
69,
273,
274,
275,
Expand All @@ -1199,18 +1211,6 @@ Evolumes
295,
296,
297,
52,
53,
54,
58,
59,
60,
64,
65,
66,
67,
68,
69,

***********************************************************
** Materials
Expand Down Expand Up @@ -1293,9 +1293,9 @@ RF
***********************************************************
** CalculiX Input file
** written by write_footer function
** written by --> FreeCAD 0.17.13310 (Git)
** written on --> Tue Feb 20 07:42:43 2018
** file name --> multimat.fcstd
** written by --> FreeCAD 0.19.19432 (Git)
** written on --> Fri Jan 31 08:06:05 2020
** file name -->
** analysis name --> Analysis
**
**
Expand Down
164 changes: 82 additions & 82 deletions src/Mod/Fem/femtest/data/ccx/mat_nonlinear.inp
Expand Up @@ -19788,6 +19788,85 @@ Evolumes
7,
8,
11,
250,
409,
410,
411,
412,
413,
414,
415,
416,
417,
418,
419,
420,
421,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
439,
440,
441,
442,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
461,
462,
463,
464,
465,
466,
467,
468,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
481,
482,
483,
484,
485,
486,
1211,
1212,
1213,
Expand Down Expand Up @@ -19851,7 +19930,6 @@ Evolumes
1271,
1272,
1273,
250,
1274,
1275,
1276,
Expand Down Expand Up @@ -19908,84 +19986,6 @@ Evolumes
1327,
1328,
1329,
409,
410,
411,
412,
413,
414,
415,
416,
417,
418,
419,
420,
421,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
439,
440,
441,
442,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
461,
462,
463,
464,
465,
466,
467,
468,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
481,
482,
483,
484,
485,
486,

***********************************************************
** Materials
Expand Down Expand Up @@ -20130,9 +20130,9 @@ RF
***********************************************************
** CalculiX Input file
** written by write_footer function
** written by --> FreeCAD 0.19.19295 (Git)
** written on --> Sun Jan 19 12:59:27 2020
** file name --> Nonlinear_material_plate_with_hole.FCStd
** written by --> FreeCAD 0.19.19432 (Git)
** written on --> Fri Jan 31 08:04:49 2020
** file name -->
** analysis name --> Analysis
**
**
Expand Down

0 comments on commit 7e01116

Please sign in to comment.