@@ -150,6 +150,7 @@ def get_mesh_sets(self):
150
150
self .get_constraints_force_nodeloads ()
151
151
self .get_constraints_pressure_faces ()
152
152
self .get_constraints_heatflux_faces ()
153
+ self .get_constraints_electrostatic_faces ()
153
154
154
155
setstime = round ((time .process_time () - time_start ), 3 )
155
156
FreeCAD .Console .PrintMessage (f"Getting mesh data time: { setstime } seconds.\n " )
@@ -258,8 +259,11 @@ def get_constraints_electrostatic_nodes(self):
258
259
# get nodes
259
260
for femobj in self .member .cons_electrostatic :
260
261
# femobj --> dict, FreeCAD document object is femobj["Object"]
261
- print_obj_info (femobj ["Object" ])
262
- femobj ["Nodes" ] = meshtools .get_femnodes_by_femobj_with_references (self .femmesh , femobj )
262
+ if femobj ["Object" ].BoundaryCondition == "Dirichlet" :
263
+ print_obj_info (femobj ["Object" ])
264
+ femobj ["Nodes" ] = meshtools .get_femnodes_by_femobj_with_references (
265
+ self .femmesh , femobj
266
+ )
263
267
264
268
def get_constraints_force_nodeloads (self ):
265
269
if not self .member .cons_force :
@@ -365,6 +369,34 @@ def get_constraints_pressure_faces(self):
365
369
femobj ["PressureFaces" ] = [(some_string , pressure_faces )]
366
370
FreeCAD .Console .PrintLog ("{}\n " .format (femobj ["PressureFaces" ]))
367
371
372
+ def get_constraints_electrostatic_faces (self ):
373
+ if not self .member .cons_electrostatic :
374
+ return
375
+ if not self .femnodes_mesh :
376
+ self .femnodes_mesh = self .femmesh .Nodes
377
+ if not self .femelement_table :
378
+ self .femelement_table = meshtools .get_femelement_table (self .femmesh )
379
+ if not self .femnodes_ele_table :
380
+ self .femnodes_ele_table = meshtools .get_femnodes_ele_table (
381
+ self .femnodes_mesh , self .femelement_table
382
+ )
383
+
384
+ for femobj in self .member .cons_electrostatic :
385
+ # femobj --> dict, FreeCAD document object is femobj["Object"]
386
+ if femobj ["Object" ].BoundaryCondition == "Neumann" :
387
+ print_obj_info (femobj ["Object" ])
388
+
389
+ pressure_faces = meshtools .get_pressure_obj_faces (
390
+ self .femmesh , self .femelement_table , self .femnodes_ele_table , femobj
391
+ )
392
+ # the data model is for compatibility reason with deprecated version
393
+ # get_pressure_obj_faces_depreciated returns the face ids in a tuple per ref_shape
394
+ # some_string was the reference_shape_element_string in deprecated method
395
+ # [(some_string, [ele_id, ele_face_id], [ele_id, ele_face_id], ...])]
396
+ some_string = "{}: face electric flux" .format (femobj ["Object" ].Name )
397
+ femobj ["ElectricFluxFaces" ] = [(some_string , pressure_faces )]
398
+ FreeCAD .Console .PrintLog ("{}\n " .format (femobj ["ElectricFluxFaces" ]))
399
+
368
400
def get_constraints_contact_faces (self ):
369
401
if not self .member .cons_contact :
370
402
return
0 commit comments