Skip to content

Commit

Permalink
Merge pull request #959 from KratosMultiphysics/app-mesh-type
Browse files Browse the repository at this point in the history
App mesh type
  • Loading branch information
jginternational authored Nov 20, 2023
2 parents 237ce6b + 28d11bb commit 0b1e943
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kratos.gid/apps/GeoMechanics/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"start_script": "::GeoMechanics::Init",
"requirements": {
"apps": ["Structural"],
"minimum_gid_version": "16.1.4d"
"minimum_gid_version": "16.1.4d",
"mesh_type": "quadratic"
},
"permissions": {
"open_tree": true,
Expand Down
14 changes: 14 additions & 0 deletions kratos.gid/scripts/Applications.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,20 @@ proc apps::ActivateApp_do {app} {
set app_minimum_gid_version [dict get [$app getProperty requirements] minimum_gid_version]
if {[GiDVersionCmp $app_minimum_gid_version] < 0} {W "Caution. Minimum GiD version is $app_minimum_gid_version"}
}

# If mesh_type is not defined, do not touch it
if {[dict exists [$app getProperty requirements] mesh_type]} {
set mesh_type [dict get [$app getProperty requirements] mesh_type]
# If its quadratic, warn user and set it
if {$mesh_type eq "quadratic"} {
GiD_Set Model(QuadraticType) 1
::GidUtils::SetWarnLine "Setting mesh mode: $mesh_type"
} else {
# If it's set to anything else, set it to linear
GiD_Set Model(QuadraticType) 0
::GidUtils::SetWarnLine "Setting mesh mode: linear"
}
}
if {[write::isBooleanTrue [$app getPermission import_files]]} { Kratos::LoadImportFiles }
if {[write::isBooleanTrue [$app getPermission wizard]]} { Kratos::LoadWizardFiles }
if {[$app getProperty start_script] ne ""} {eval [$app getProperty start_script] $app}
Expand Down

0 comments on commit 0b1e943

Please sign in to comment.