FEM: prefs, add an option to deactivate group meshing for analysis

This commit is contained in:
Bernd Hahnebach
2017-11-24 08:20:07 +01:00
committed by Yorik van Havre
parent 2ee72456e2
commit 3e2da0cd71
3 changed files with 44 additions and 10 deletions

View File

@@ -231,7 +231,7 @@ class FemGmshTools():
# 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
# mesh group objects
if not self.mesh_obj.MeshGroupList:
# print (' No mesh group objects.')
pass
@@ -244,8 +244,11 @@ class FemGmshTools():
self.group_elements[ge] = new_group_elements[ge]
else:
FreeCAD.Console.PrintError(" A group with this name exists already.\n")
if self.analysis:
print(' Group meshing.')
# group meshing for analysis
analysis_group_meshing = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/General").GetBool("AnalysisGroupMeshing", True)
if self.analysis and analysis_group_meshing:
print(' Group meshing for analysis.')
self.group_nodes_export = True
new_group_elements = FemMeshTools.get_analysis_group_elements(self.analysis, self.part_obj)
for ge in new_group_elements:
@@ -254,7 +257,8 @@ class FemGmshTools():
else:
FreeCAD.Console.PrintError(" A group with this name exists already.\n")
else:
print(' No anlysis members for group meshing.')
print(' No Group meshing for analysis.')
if self.group_elements:
print(' {}'.format(self.group_elements))

View File

@@ -23,7 +23,7 @@
<item row="1" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="gb_analysis">
<widget class="QGroupBox" name="gb_1_analysis">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -67,9 +67,6 @@
<property name="prefEntry" stdset="0">
<cstring>WorkingDir</cstring>
</property>
<property name="mode">
<enum>Gui::FileChooser::Directory</enum>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Fem/General</cstring>
</property>
@@ -99,7 +96,36 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_materials">
<widget class="QGroupBox" name="gb_2_mesh">
<property name="title">
<string>Mesh</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QGridLayout" name="gl_2">
<item row="0" column="0">
<widget class="Gui::PrefCheckBox" name="cb_analysis_group_meshing">
<property name="text">
<string>Create mesh groups for analysis reference shpapes</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>AnalysisGroupMeshing</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Fem/General</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_3_materials">
<property name="title">
<string>Materials</string>
</property>
@@ -205,7 +231,7 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_results">
<widget class="QGroupBox" name="gb_4_results">
<property name="title">
<string>Results</string>
</property>

View File

@@ -46,6 +46,8 @@ void DlgSettingsFemGeneralImp::saveSettings()
{
fc_analysis_working_directory->onSave();
cb_analysis_group_meshing->onSave();
cb_use_built_in_materials->onSave();
cb_use_mat_from_config_dir->onSave();
cb_use_mat_from_custom_dir->onSave();
@@ -60,6 +62,8 @@ void DlgSettingsFemGeneralImp::loadSettings()
{
fc_analysis_working_directory->onRestore();
cb_analysis_group_meshing->onRestore();
cb_use_built_in_materials->onRestore();
cb_use_mat_from_config_dir->onRestore();
cb_use_mat_from_custom_dir->onRestore();