FEM: gmsh mesh tool, use gmsh names for properties
This commit is contained in:
@@ -48,13 +48,13 @@ class FemGmshTools():
|
||||
# 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
|
||||
@@ -71,8 +71,8 @@ class FemGmshTools():
|
||||
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()
|
||||
|
||||
@@ -44,11 +44,11 @@ class _FemMeshGmsh():
|
||||
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
|
||||
|
||||
@@ -78,14 +78,14 @@ class _TaskPanelFemMeshGmsh:
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user