Skip to content

Commit

Permalink
FEM: gmsh mesh tool, use gmsh names for properties
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Nov 28, 2016
1 parent 299d3d1 commit f9bc29f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions src/Mod/Fem/FemGmshTools.py
Expand Up @@ -48,13 +48,13 @@ def __init__(self, gmsh_mesh_obj, analysis=None):
# part to mesh
self.part_obj = self.mesh_obj.Part

# clmax, ElementSizeMax: float, 0.0 = 1e+22
self.clmax = Units.Quantity(self.mesh_obj.ElementSizeMax).Value
# clmax, CharacteristicLengthMax: float, 0.0 = 1e+22
self.clmax = Units.Quantity(self.mesh_obj.CharacteristicLengthMax).Value
if self.clmax == 0.0:
self.clmax = 1e+22

# clmin, ElementSizeMin: float
self.clmin = Units.Quantity(self.mesh_obj.ElementSizeMin).Value
# clmin, CharacteristicLengthMin: float
self.clmin = Units.Quantity(self.mesh_obj.CharacteristicLengthMin).Value

# order, ElementOrder: ['Auto', '1st', '2nd']
self.order = self.mesh_obj.ElementOrder
Expand All @@ -71,8 +71,8 @@ def __init__(self, gmsh_mesh_obj, analysis=None):
def create_mesh(self):
print("\nWe gone start GMSH FEM mesh run!")
print(' Part to mesh: Name --> ' + self.part_obj.Name + ', Label --> ' + self.part_obj.Label + ', ShapeType --> ' + self.part_obj.Shape.ShapeType)
print(' ElementSizeMax: ' + str(self.clmax))
print(' ElementSizeMin: ' + str(self.clmin))
print(' CharacteristicLengthMax: ' + str(self.clmax))
print(' CharacteristicLengthMin: ' + str(self.clmin))
print(' ElementOrder: ' + self.order)
self.get_dimension()
self.get_tmp_file_paths()
Expand Down
8 changes: 4 additions & 4 deletions src/Mod/Fem/_FemMeshGmsh.py
Expand Up @@ -44,11 +44,11 @@ def __init__(self, obj):
obj.addProperty("App::PropertyLink", "Part", "FEM Mesh", "Part object to mesh")
obj.Part = None

obj.addProperty("App::PropertyLength", "ElementSizeMax", "FEM Mesh Params", "Max mesh element size (0.0 = infinity)")
obj.ElementSizeMax = 0.0 # will be 1e+22
obj.addProperty("App::PropertyLength", "CharacteristicLengthMax", "FEM Mesh Params", "Max mesh element size (0.0 = infinity)")
obj.CharacteristicLengthMax = 0.0 # will be 1e+22

obj.addProperty("App::PropertyLength", "ElementSizeMin", "FEM Mesh Params", "Min mesh element size")
obj.ElementSizeMin = 0.0
obj.addProperty("App::PropertyLength", "CharacteristicLengthMin", "FEM Mesh Params", "Min mesh element size")
obj.CharacteristicLengthMin = 0.0

obj.addProperty("App::PropertyEnumeration", "ElementDimension", "FEM Mesh Params", "Dimension of mesh elements (Auto = according ShapeType of part to mesh)")
obj.ElementDimension = _FemMeshGmsh.known_element_dimensions
Expand Down
8 changes: 4 additions & 4 deletions src/Mod/Fem/_TaskPanelFemMeshGmsh.py
Expand Up @@ -78,14 +78,14 @@ def clicked(self, button):
self.run_gmsh()

def get_mesh_params(self):
self.clmax = self.mesh_obj.ElementSizeMax
self.clmin = self.mesh_obj.ElementSizeMin
self.clmax = self.mesh_obj.CharacteristicLengthMax
self.clmin = self.mesh_obj.CharacteristicLengthMin
self.order = self.mesh_obj.ElementOrder
self.dimension = self.mesh_obj.ElementDimension

def set_mesh_params(self):
self.mesh_obj.ElementSizeMax = self.clmax
self.mesh_obj.ElementSizeMin = self.clmin
self.mesh_obj.CharacteristicLengthMax = self.clmax
self.mesh_obj.CharacteristicLengthMin = self.clmin
self.mesh_obj.ElementOrder = self.order
self.mesh_obj.ElementDimension = self.dimension

Expand Down

0 comments on commit f9bc29f

Please sign in to comment.