FEM: node sets, return sorted with unique values

This commit is contained in:
Bernd Hahnebach
2020-01-31 08:20:38 +01:00
parent 62577019cf
commit 99ce8a55ff
5 changed files with 184 additions and 175 deletions

View File

@@ -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))
# ************************************************************************************************

View File

@@ -123,6 +123,12 @@ class FemInputWriter():
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:

View File

@@ -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,
@@ -4373,15 +4380,6 @@ Evolumes
574,
575,
576,
91,
92,
93,
94,
95,
96,
97,
98,
99,
649,
650,
651,
@@ -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,
@@ -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
@@ -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
**
**

View File

@@ -1174,6 +1174,18 @@ Evolumes
10,
11,
12,
52,
53,
54,
58,
59,
60,
64,
65,
66,
67,
68,
69,
273,
274,
275,
@@ -1199,18 +1211,6 @@ Evolumes
295,
296,
297,
52,
53,
54,
58,
59,
60,
64,
65,
66,
67,
68,
69,
***********************************************************
** Materials
@@ -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
**
**

View File

@@ -19788,126 +19788,7 @@ Evolumes
7,
8,
11,
1211,
1212,
1213,
1214,
1215,
1216,
1217,
1218,
1219,
1220,
1221,
1222,
1223,
1224,
1225,
1226,
1227,
1228,
1229,
1230,
1231,
1232,
1233,
1234,
1235,
1236,
1237,
1238,
1239,
1240,
1241,
1242,
1243,
1244,
1245,
1246,
1247,
1248,
1249,
1250,
1251,
1252,
1253,
1254,
1255,
1256,
1257,
1258,
1259,
1260,
1261,
1262,
1263,
1264,
1265,
1266,
1267,
1268,
1269,
1270,
1271,
1272,
1273,
250,
1274,
1275,
1276,
1277,
1278,
1279,
1280,
1281,
1282,
1283,
1284,
1285,
1286,
1287,
1288,
1289,
1290,
1291,
1292,
1293,
1294,
1295,
1296,
1297,
1298,
1299,
1300,
1301,
1302,
1303,
1304,
1305,
1306,
1307,
1308,
1309,
1310,
1311,
1312,
1313,
1314,
1315,
1316,
1317,
1318,
1319,
1320,
1321,
1322,
1323,
1324,
1325,
1326,
1327,
1328,
1329,
409,
410,
411,
@@ -19986,6 +19867,125 @@ Evolumes
484,
485,
486,
1211,
1212,
1213,
1214,
1215,
1216,
1217,
1218,
1219,
1220,
1221,
1222,
1223,
1224,
1225,
1226,
1227,
1228,
1229,
1230,
1231,
1232,
1233,
1234,
1235,
1236,
1237,
1238,
1239,
1240,
1241,
1242,
1243,
1244,
1245,
1246,
1247,
1248,
1249,
1250,
1251,
1252,
1253,
1254,
1255,
1256,
1257,
1258,
1259,
1260,
1261,
1262,
1263,
1264,
1265,
1266,
1267,
1268,
1269,
1270,
1271,
1272,
1273,
1274,
1275,
1276,
1277,
1278,
1279,
1280,
1281,
1282,
1283,
1284,
1285,
1286,
1287,
1288,
1289,
1290,
1291,
1292,
1293,
1294,
1295,
1296,
1297,
1298,
1299,
1300,
1301,
1302,
1303,
1304,
1305,
1306,
1307,
1308,
1309,
1310,
1311,
1312,
1313,
1314,
1315,
1316,
1317,
1318,
1319,
1320,
1321,
1322,
1323,
1324,
1325,
1326,
1327,
1328,
1329,
***********************************************************
** Materials
@@ -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
**
**