FEM: code formating, trailing whitespaces and flake8
This commit is contained in:
@@ -224,7 +224,7 @@ class FemGmshTools():
|
||||
|
||||
def get_group_data(self):
|
||||
self.group_elements = {}
|
||||
# TODO: solids, faces, edges and vertexes don't seem to work together in one group,
|
||||
# TODO: solids, faces, edges and vertexes don't seem to work together in one group,
|
||||
# some print or make them work together
|
||||
|
||||
# mesh groups and groups of analysis member
|
||||
@@ -271,8 +271,8 @@ class FemGmshTools():
|
||||
if (part.Proxy.Type == "FeatureBooleanFragments" or part.Proxy.Type == "FeatureSlice" or part.Proxy.Type == "FeatureXOR"):
|
||||
error_message = " The mesh to shape is a boolean split tools Compound and the mesh has mesh region list. GMSH could return unexpected meshes in such circumstances. It is strongly recommended to extract the shape to mesh from the Compound and use this one."
|
||||
FreeCAD.Console.PrintError(error_message + "\n")
|
||||
# TODO: no gui popup because FreeCAD will be in a endless print loop
|
||||
# as long as the pop up is on --> maybe find a better solution for
|
||||
# TODO: no gui popup because FreeCAD will be in a endless print loop
|
||||
# as long as the pop up is on --> maybe find a better solution for
|
||||
# either of both --> thus the pop up is in task panel
|
||||
for mr_obj in self.mesh_obj.MeshRegionList:
|
||||
# print(mr_obj.Name)
|
||||
|
||||
@@ -195,7 +195,7 @@ class FemInputWriter():
|
||||
# it means it does not work for mixed meshes and multiple materials, this is checked in check_prerequisites
|
||||
if self.femmesh.Volumes:
|
||||
# we only could do this for volumes, if a mesh contains volumes we're going to use them in the analysis
|
||||
# but a mesh could contain the element faces of the volumes as faces and the edges of the faces as edges,
|
||||
# but a mesh could contain the element faces of the volumes as faces and the edges of the faces as edges,
|
||||
# there we have to check of some geometric objects
|
||||
all_found = False
|
||||
if self.femmesh.GroupCount:
|
||||
|
||||
@@ -734,7 +734,7 @@ def get_ref_facenodes_table(femmesh, femelement_table, ref_face):
|
||||
if has_no_face_data(femmesh):
|
||||
print('No face date in volume mesh. We try to use getccxVolumesByFace() to retrieve the volume elements of the ref_face!')
|
||||
# there is no face data
|
||||
# the problem if we retrieve the nodes ourself is they are not sorted we just have the nodes.
|
||||
# the problem if we retrieve the nodes ourself is they are not sorted we just have the nodes.
|
||||
# We need to sort them according the shell mesh notation of tria3, tria6, quad4, quad8
|
||||
ref_face_nodes = femmesh.getNodesByFace(ref_face)
|
||||
# try to use getccxVolumesByFace() to get the volume ids of element with elementfaces on the ref_face --> should work for tetra4 and tetra10
|
||||
@@ -1029,7 +1029,7 @@ def get_ref_shape_node_sum_geom_table(node_geom_table):
|
||||
|
||||
|
||||
def get_mesh_group_elements(mesh_group_obj, aPart):
|
||||
'''the Reference shapes of the mesh_group_object are searched in the Shape of aPart.
|
||||
'''the Reference shapes of the mesh_group_object are searched in the Shape of aPart.
|
||||
If found in shape they are added to a dict
|
||||
{MeshGroupIdentifier : ['ShapeType of the Elements'], [ElementID, ElementID, ...], ...}
|
||||
'''
|
||||
@@ -1043,7 +1043,7 @@ def get_mesh_group_elements(mesh_group_obj, aPart):
|
||||
|
||||
|
||||
def get_analysis_group_elements(aAnalysis, aPart):
|
||||
''' all Reference shapes of all Analysis member are searched in the Shape of aPart.
|
||||
''' all Reference shapes of all Analysis member are searched in the Shape of aPart.
|
||||
If found in shape they are added to a dict
|
||||
{ConstraintName : ['ShapeType of the Elements'], [ElementID, ElementID, ...], ...}
|
||||
'''
|
||||
@@ -1063,12 +1063,12 @@ def get_analysis_group_elements(aAnalysis, aPart):
|
||||
else:
|
||||
FreeCAD.Console.PrintError('Problem: more than one object with empty references.\n')
|
||||
print('We are going to try to get the empty material references anyway.\n')
|
||||
# FemElementGeometry2D, ElementGeometry1D and FemElementFluid1D could have empty references,
|
||||
# FemElementGeometry2D, ElementGeometry1D and FemElementFluid1D could have empty references,
|
||||
# but on solid meshes only materials should have empty references
|
||||
for er in empty_references:
|
||||
print(er.Name)
|
||||
group_elements = get_anlysis_empty_references_group_elements(group_elements, aAnalysis, aPart.Shape)
|
||||
# check if all groups have at least one element,
|
||||
# check if all groups have at least one element,
|
||||
# it doesn't mean ALL reference shapes for a group have been found
|
||||
for g in group_elements:
|
||||
# print(group_elements[g])
|
||||
|
||||
@@ -35,7 +35,7 @@ def makeAnalysis(doc, name="Analysis"):
|
||||
'''makeAnalysis(document, [name]): makes a Fem Analysis object'''
|
||||
obj = doc.addObject("Fem::FemAnalysisPython", name)
|
||||
if FreeCAD.GuiUp:
|
||||
obj.ViewObject.Proxy=0
|
||||
obj.ViewObject.Proxy = 0
|
||||
return obj
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user