Skip to content

Commit 0b1e943

Browse files
Merge pull request #959 from KratosMultiphysics/app-mesh-type
App mesh type
2 parents 237ce6b + 28d11bb commit 0b1e943

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

kratos.gid/apps/GeoMechanics/app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"start_script": "::GeoMechanics::Init",
2525
"requirements": {
2626
"apps": ["Structural"],
27-
"minimum_gid_version": "16.1.4d"
27+
"minimum_gid_version": "16.1.4d",
28+
"mesh_type": "quadratic"
2829
},
2930
"permissions": {
3031
"open_tree": true,

kratos.gid/scripts/Applications.tcl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,20 @@ proc apps::ActivateApp_do {app} {
333333
set app_minimum_gid_version [dict get [$app getProperty requirements] minimum_gid_version]
334334
if {[GiDVersionCmp $app_minimum_gid_version] < 0} {W "Caution. Minimum GiD version is $app_minimum_gid_version"}
335335
}
336+
337+
# If mesh_type is not defined, do not touch it
338+
if {[dict exists [$app getProperty requirements] mesh_type]} {
339+
set mesh_type [dict get [$app getProperty requirements] mesh_type]
340+
# If its quadratic, warn user and set it
341+
if {$mesh_type eq "quadratic"} {
342+
GiD_Set Model(QuadraticType) 1
343+
::GidUtils::SetWarnLine "Setting mesh mode: $mesh_type"
344+
} else {
345+
# If it's set to anything else, set it to linear
346+
GiD_Set Model(QuadraticType) 0
347+
::GidUtils::SetWarnLine "Setting mesh mode: linear"
348+
}
349+
}
336350
if {[write::isBooleanTrue [$app getPermission import_files]]} { Kratos::LoadImportFiles }
337351
if {[write::isBooleanTrue [$app getPermission wizard]]} { Kratos::LoadWizardFiles }
338352
if {[$app getProperty start_script] ne ""} {eval [$app getProperty start_script] $app}

0 commit comments

Comments
 (0)