From 1460b5413847b7d5fa6db95464f6c966c0146b32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20G=C3=A1rate?= Date: Thu, 19 Oct 2023 21:04:16 +0200 Subject: [PATCH 1/2] Add conditions nodes to Grid.mdpa --- kratos.gid/apps/MPM/write/write.tcl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/kratos.gid/apps/MPM/write/write.tcl b/kratos.gid/apps/MPM/write/write.tcl index 688c2f82e..aa3f788ca 100644 --- a/kratos.gid/apps/MPM/write/write.tcl +++ b/kratos.gid/apps/MPM/write/write.tcl @@ -38,7 +38,8 @@ proc MPM::write::writeModelPartEvent { } { write::WriteString "End Properties" # Nodal coordinates - write::writeNodalCoordinatesOnGroups [MPM::write::GetPartsGroups grid] + set list_of_groups [concat [MPM::write::GetPartsGroups grid] [MPM::write::GetConditionsGroups]] + write::writeNodalCoordinatesOnGroups $list_of_groups # Grid element connectivities writeGridConnectivities @@ -147,6 +148,19 @@ proc MPM::write::writeSubmodelparts { type } { } } +proc MPM::write::GetConditionsGroups { } { + set xp1 "[spdAux::getRoute [GetAttribute conditions_un]]/condition/group" + set condition_groups [list ] + foreach gNode [[customlib::GetBaseRoot] selectNodes $xp1] { + set group_name [get_domnode_attribute $gNode n] + set good_group_name [write::GetWriteGroupName $group_name] + if {$good_group_name ne $condition_groups} { + lappend condition_groups $good_group_name + } + } + return $condition_groups +} + proc MPM::write::writeLoads { } { variable ConditionsDictGroupIterators set root [customlib::GetBaseRoot] From 6357b8a7a9740946462096e6499c9fd503a2d958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20G=C3=A1rate?= Date: Thu, 19 Oct 2023 21:10:32 +0200 Subject: [PATCH 2/2] also nodal conditions --- kratos.gid/apps/MPM/write/write.tcl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/kratos.gid/apps/MPM/write/write.tcl b/kratos.gid/apps/MPM/write/write.tcl index aa3f788ca..6ea310010 100644 --- a/kratos.gid/apps/MPM/write/write.tcl +++ b/kratos.gid/apps/MPM/write/write.tcl @@ -38,7 +38,7 @@ proc MPM::write::writeModelPartEvent { } { write::WriteString "End Properties" # Nodal coordinates - set list_of_groups [concat [MPM::write::GetPartsGroups grid] [MPM::write::GetConditionsGroups]] + set list_of_groups [concat [MPM::write::GetPartsGroups grid] [MPM::write::GetConditionsGroups] [MPM::write::GetNodalConditionsGroups]] write::writeNodalCoordinatesOnGroups $list_of_groups # Grid element connectivities @@ -161,6 +161,19 @@ proc MPM::write::GetConditionsGroups { } { return $condition_groups } +proc MPM::write::GetNodalConditionsGroups { } { + set xp1 "[spdAux::getRoute [GetAttribute nodal_conditions_un]]/condition/group" + set condition_groups [list ] + foreach gNode [[customlib::GetBaseRoot] selectNodes $xp1] { + set group_name [get_domnode_attribute $gNode n] + set good_group_name [write::GetWriteGroupName $group_name] + if {$good_group_name ne $condition_groups} { + lappend condition_groups $good_group_name + } + } + return $condition_groups +} + proc MPM::write::writeLoads { } { variable ConditionsDictGroupIterators set root [customlib::GetBaseRoot]