@@ -148,11 +148,10 @@ proc DEM::write::writeConditions { wall_properties } {
148148proc DEM::write::GetWallsGroups { } {
149149 set groups [list ]
150150 if {$::Model::SpatialDimension eq " 2D" } {set xp1 " [ spdAux::getRoute [GetAttribute conditions_un] ]/condition\[ @n = 'DEM-FEM-Wall2D'\] /group"
151- } else { set xp1 " [ spdAux::getRoute [GetAttribute conditions_un] ]/condition\[ @n = 'DEM-FEM-Wall'\] /group"
152- }
151+ } else { set xp1 " [ spdAux::getRoute [GetAttribute conditions_un] ]/condition\[ @n = 'DEM-FEM-Wall'\] /group" }
153152 foreach group [[customlib::GetBaseRoot] selectNodes $xp1 ] {
154- set groupid [$group @n]
155- lappend groups [write::GetWriteGroupName $groupid ]
153+ set groupid [$group @n]
154+ lappend groups [write::GetWriteGroupName $groupid ]
156155 }
157156 return $groups
158157}
@@ -219,7 +218,6 @@ proc DEM::write::GetConditionsGroups { } {
219218}
220219
221220proc DEM::write::writeWallConditionMeshes { } {
222- W " DEMwalls- proc DEM::write::writeWallConditionMeshes"
223221 set i 0
224222 set cond " DEM-FEM-Wall"
225223 foreach group [GetWallsGroups] {
@@ -423,14 +421,59 @@ proc DEM::write::writeWallConditionMeshes { } {
423421 write::WriteString " IS_GHOST $is_ghost "
424422 write::WriteString " IDENTIFIER [ write::transformGroupName $group ] "
425423
426-
427-
428- set GraphPrint [write::getValueByNode [$group_node selectNodes " ./value\[ @n='GraphPrint'\] " ]]
429- if {$GraphPrint == " true" } {
430- set GraphPrintval 1
431- } else {
432- set GraphPrintval 0
433- }
424+ W " xxxxxxxxxxxxxxxxxxxxxx"
425+ W [apps::getActiveAppId]
426+ W " xxxxxxxxxxxxxxxxxxxxxx"
427+ DEM::DefineMaterialTestConditions
428+
429+ # proc DEM::write::DefineMaterialTestConditions { } {
430+ # if CDEM:
431+
432+ # set material_analysis [write::getValue DEMTestMaterial Active]
433+ # if {$material_analysis == "true"} {
434+ # set is_material_test [write::getValueByNode [$group_node selectNodes "./value\[@n='MaterialTest'\]"]]
435+ # if {$is_material_test == "true"} {
436+ # set as_condition [write::getValueByNode [$group_node selectNodes "./value\[@n='DefineTopBot'\]"]]
437+ # if {$as_condition eq "top"} {
438+ # write::WriteString " TOP 1"
439+ # write::WriteString " BOTTOM 0"
440+ # } else {
441+ # write::WriteString " TOP 0"
442+ # write::WriteString " BOTTOM 1"
443+ # }
444+ # }
445+ # } else {
446+ # write::WriteString " TOP 0"
447+ # write::WriteString " BOTTOM 0"
448+ # }
449+
450+ # set GraphPrint [write::getValueByNode [$group_node selectNodes "./value\[@n='GraphPrint'\]"]]
451+ # if {$GraphPrint == "true" || $material_analysis == "true"} {
452+ # set GraphPrintval 1
453+ # } else {
454+ # set GraphPrintval 0
455+ # }
456+ # }
457+
458+ # else DEM:
459+
460+ # set GraphPrint [write::getValueByNode [$group_node selectNodes "./value\[@n='GraphPrint'\]"]]
461+ # if {$GraphPrint == "true"} {
462+ # set GraphPrintval 1
463+ # } else {
464+ # set GraphPrintval 0
465+ # }
466+
467+
468+
469+
470+
471+ # set GraphPrint [write::getValueByNode [$group_node selectNodes "./value\[@n='GraphPrint'\]"]]
472+ # if {$GraphPrint == "true"} {
473+ # set GraphPrintval 1
474+ # } else {
475+ # set GraphPrintval 0
476+ # }
434477 write::WriteString " FORCE_INTEGRATION_GROUP $GraphPrintval "
435478 }
436479 write::WriteString " End SubModelPartData"
@@ -454,7 +497,6 @@ proc DEM::write::writeWallConditionMeshes { } {
454497
455498
456499proc DEM::write::writeWallConditionMeshes2D { } {
457- W " DEMwalls- proc DEM::write::writeWallConditionMeshes2d"
458500 set i 0
459501 set cond " DEM-FEM-Wall2D"
460502 foreach group [GetWallsGroups] {
@@ -653,16 +695,22 @@ proc DEM::write::writeWallConditionMeshes2D { } {
653695 set is_ghost [write::getValueByNode [$group_node selectNodes " ./value\[ @n='IsGhost'\] " ]]
654696 write::WriteString " IS_GHOST $is_ghost "
655697 write::WriteString " IDENTIFIER [ write::transformGroupName $group ] "
656- write::WriteString " TOP 0"
657- write::WriteString " BOTTOM 0"
658-
659- set GraphPrint [write::getValueByNode [$group_node selectNodes " ./value\[ @n='GraphPrint'\] " ]]
660- if {$GraphPrint == " true" } {
661- set GraphPrintval 1
662- } else {
663- set GraphPrintval 0
664- }
665- write::WriteString " FORCE_INTEGRATION_GROUP $GraphPrintval "
698+
699+ W " xxxxxxxxxxxxxxxxxxxxxx"
700+ W [apps::getActiveAppId]
701+ W " xxxxxxxxxxxxxxxxxxxxxx"
702+ DEM::write::DefineMaterialTestConditions $group_node
703+
704+ # write::WriteString " TOP 0"
705+ # write::WriteString " BOTTOM 0"
706+
707+ # set GraphPrint [write::getValueByNode [$group_node selectNodes "./value\[@n='GraphPrint'\]"]]
708+ # if {$GraphPrint == "true"} {
709+ # set GraphPrintval 1
710+ # } else {
711+ # set GraphPrintval 0
712+ # }
713+ # write::WriteString " FORCE_INTEGRATION_GROUP $GraphPrintval"
666714 }
667715 write::WriteString " End SubModelPartData"
668716
@@ -683,3 +731,40 @@ proc DEM::write::writeWallConditionMeshes2D { } {
683731 }
684732}
685733
734+ proc DEM::write::DefineMaterialTestConditions {group_node} {
735+ if {[apps::getActiveAppId] eq " CDEM" } {
736+ set material_analysis [write::getValue DEMTestMaterial Active]
737+ if {$material_analysis == " true" } {
738+ set is_material_test [write::getValueByNode [$group_node selectNodes " ./value\[ @n='MaterialTest'\] " ]]
739+ if {$is_material_test == " true" } {
740+ set as_condition [write::getValueByNode [$group_node selectNodes " ./value\[ @n='DefineTopBot'\] " ]]
741+ if {$as_condition eq " top" } {
742+ write::WriteString " TOP 1"
743+ write::WriteString " BOTTOM 0"
744+ } else {
745+ write::WriteString " TOP 0"
746+ write::WriteString " BOTTOM 1"
747+ }
748+ }
749+ } else {
750+ write::WriteString " TOP 0"
751+ write::WriteString " BOTTOM 0"
752+ }
753+
754+ set GraphPrint [write::getValueByNode [$group_node selectNodes " ./value\[ @n='GraphPrint'\] " ]]
755+ if {$GraphPrint == " true" || $material_analysis == " true" } {
756+ set GraphPrintval 1
757+ } else {
758+ set GraphPrintval 0
759+ }
760+ } else {
761+
762+ set GraphPrint [write::getValueByNode [$group_node selectNodes " ./value\[ @n='GraphPrint'\] " ]]
763+ if {$GraphPrint == " true" } {
764+ set GraphPrintval 1
765+ } else {
766+ set GraphPrintval 0
767+ }
768+ }
769+ write::WriteString " FORCE_INTEGRATION_GROUP $GraphPrintval "
770+ }
0 commit comments