diff --git a/kratos.gid/apps/ConjugateHeatTransfer/xml/XmlController.tcl b/kratos.gid/apps/ConjugateHeatTransfer/xml/XmlController.tcl index ca2a967f9..d98738dc0 100644 --- a/kratos.gid/apps/ConjugateHeatTransfer/xml/XmlController.tcl +++ b/kratos.gid/apps/ConjugateHeatTransfer/xml/XmlController.tcl @@ -8,7 +8,7 @@ namespace eval ::ConjugateHeatTransfer::xml { proc ConjugateHeatTransfer::xml::Init { } { # Namespace variables initialization variable dir - Model::InitVariables dir $ConjugateHeatTransfer::dir + Model::InitVariables dir $::ConjugateHeatTransfer::dir Model::getConditions Conditions.xml Model::getMaterials "../../ConvectionDiffusion/xml/Materials.xml" diff --git a/kratos.gid/apps/FSI/write/writeProjectParameters.tcl b/kratos.gid/apps/FSI/write/writeProjectParameters.tcl index b4398db0b..541b339ab 100644 --- a/kratos.gid/apps/FSI/write/writeProjectParameters.tcl +++ b/kratos.gid/apps/FSI/write/writeProjectParameters.tcl @@ -39,7 +39,7 @@ proc ::FSI::write::writeParametersEvent { } { proc ::FSI::write::GetProblemDataDict { } { # Copy the section from the Fluid, who owns the time parameters of the model - set problem_data_dict [dict get $FSI::write::fluid_project_parameters problem_data] + set problem_data_dict [dict get $::FSI::write::fluid_project_parameters problem_data] return $problem_data_dict } @@ -55,8 +55,8 @@ proc ::FSI::write::GetSolverSettingsDict { } { # TODO: place an echo level in coupling dict set solver_settings_dict echo_level 1 - dict set solver_settings_dict structure_solver_settings [dict get $FSI::write::structure_project_parameters solver_settings] - dict set solver_settings_dict fluid_solver_settings [dict get $FSI::write::fluid_project_parameters solver_settings] + dict set solver_settings_dict structure_solver_settings [dict get $::FSI::write::structure_project_parameters solver_settings] + dict set solver_settings_dict fluid_solver_settings [dict get $::FSI::write::fluid_project_parameters solver_settings] # TODO: place an echo level in meshing set mesh_settings_dict [dict create ] @@ -114,14 +114,14 @@ proc ::FSI::write::GetProcessesDict { } { set processes_dict [dict create] # Fluid - dict set processes_dict fluid_initial_conditions_process_list [dict get $FSI::write::fluid_project_parameters processes initial_conditions_process_list] - dict set processes_dict fluid_boundary_conditions_process_list [GetNonDeprecatedProcessList [dict get $FSI::write::fluid_project_parameters processes boundary_conditions_process_list]] - dict set processes_dict fluid_gravity [dict get $FSI::write::fluid_project_parameters processes gravity] - dict set processes_dict fluid_auxiliar_process_list [dict get $FSI::write::fluid_project_parameters processes auxiliar_process_list] + dict set processes_dict fluid_initial_conditions_process_list [dict get $::FSI::write::fluid_project_parameters processes initial_conditions_process_list] + dict set processes_dict fluid_boundary_conditions_process_list [GetNonDeprecatedProcessList [dict get $::FSI::write::fluid_project_parameters processes boundary_conditions_process_list]] + dict set processes_dict fluid_gravity [dict get $::FSI::write::fluid_project_parameters processes gravity] + dict set processes_dict fluid_auxiliar_process_list [dict get $::FSI::write::fluid_project_parameters processes auxiliar_process_list] # Structure - dict set processes_dict structure_constraints_process_list [dict get $FSI::write::structure_project_parameters processes constraints_process_list] - dict set processes_dict structure_loads_process_list [GetNonDeprecatedProcessList [dict get $FSI::write::structure_project_parameters processes loads_process_list]] + dict set processes_dict structure_constraints_process_list [dict get $::FSI::write::structure_project_parameters processes constraints_process_list] + dict set processes_dict structure_loads_process_list [GetNonDeprecatedProcessList [dict get $::FSI::write::structure_project_parameters processes loads_process_list]] return $processes_dict } @@ -139,9 +139,9 @@ proc ::FSI::write::GetOutputProcessesDict { } { set gid_output_list [list ] # Set a different output_name for the fluid and structure domains - set structure_output [lindex [dict get $FSI::write::structure_project_parameters output_processes gid_output] 0] + set structure_output [lindex [dict get $::FSI::write::structure_project_parameters output_processes gid_output] 0] dict set structure_output Parameters output_name "[dict get $structure_output Parameters output_name]_structure" - set fluid_output [lindex [dict get $FSI::write::fluid_project_parameters output_processes gid_output] 0] + set fluid_output [lindex [dict get $::FSI::write::fluid_project_parameters output_processes gid_output] 0] dict set fluid_output Parameters output_name "[dict get $fluid_output Parameters output_name]_fluid" # Append the fluid and structure output processes to the output processes dictionary @@ -183,7 +183,7 @@ proc ::FSI::write::InitExternalProjectParameters { } { UpdateUniqueNames Fluid apps::setActiveAppSoft Fluid write::initWriteConfiguration [Fluid::write::GetAttributes] - set FSI::write::fluid_project_parameters [Fluid::write::getParametersDict] + set ::FSI::write::fluid_project_parameters [Fluid::write::getParametersDict] # Structure section UpdateUniqueNames Structure @@ -191,7 +191,7 @@ proc ::FSI::write::InitExternalProjectParameters { } { Structural::write::SetAttribute time_parameters_un FLTimeParameters write::initWriteConfiguration [Structural::write::GetAttributes] Structural::SetWriteProperty enable_dynamic_substepping [::FSI::GetWriteProperty "enable_dynamic_substepping"] - set FSI::write::structure_project_parameters [Structural::write::getParametersDict] + set ::FSI::write::structure_project_parameters [Structural::write::getParametersDict] apps::setActiveAppSoft FSI } diff --git a/kratos.gid/apps/PfemFluid/xml/XmlController.tcl b/kratos.gid/apps/PfemFluid/xml/XmlController.tcl index 79bba8e5e..d5dde392b 100644 --- a/kratos.gid/apps/PfemFluid/xml/XmlController.tcl +++ b/kratos.gid/apps/PfemFluid/xml/XmlController.tcl @@ -453,7 +453,7 @@ proc PfemFluid::xml::getBodyNodalConditionById { id } { } proc PfemFluid::xml::getBodyNodalConditions { filename } { variable bodyNodalCondition - dom parse [tDOM::xmlReadFile [file join $PfemFluid::dir xml $filename]] doc + dom parse [tDOM::xmlReadFile [file join $::PfemFluid::dir xml $filename]] doc set NCList [$doc getElementsByTagName NodalConditionItem] foreach Node $NCList { diff --git a/kratos.gid/apps/PfemMelting/examples/cube.tcl b/kratos.gid/apps/PfemMelting/examples/cube.tcl index f4475e120..a3a8b6f15 100644 --- a/kratos.gid/apps/PfemMelting/examples/cube.tcl +++ b/kratos.gid/apps/PfemMelting/examples/cube.tcl @@ -71,7 +71,7 @@ proc PfemMelting::examples::Cube::TreeAssignation {args} { # Laser file into model set laser_filename "LaserSettings.json" - set laser_filename_origin [file join $PfemMelting::dir examples $laser_filename] + set laser_filename_origin [file join $::PfemMelting::dir examples $laser_filename] set laser_filename [::FileSelector::_ProcessFile $laser_filename_origin] ::spdAux::SaveModelFile $laser_filename @@ -89,7 +89,7 @@ proc PfemMelting::examples::Cube::TreeAssignation {args} { # Temperature file into model set temp_filename "temperature_dynamicviscosity.csv" - set temp_filename_origin [file join $PfemMelting::dir examples $temp_filename] + set temp_filename_origin [file join $::PfemMelting::dir examples $temp_filename] set temp_filename [::FileSelector::_ProcessFile $temp_filename_origin] ::spdAux::SaveModelFile $temp_filename diff --git a/kratos.gid/kratos.tcl b/kratos.gid/kratos.tcl index d4380f353..10ad2a9d4 100644 --- a/kratos.gid/kratos.tcl +++ b/kratos.gid/kratos.tcl @@ -446,11 +446,32 @@ proc Kratos::Event_MeshProgress { total_percent partial_percents_0 partial_perce apps::ExecuteOnCurrentApp MeshProgress $total_percent $partial_percents_0 $partial_percents_1 $partial_percents_2 $partial_percents_3 $n_nodes n_elems } +proc Kratos::CheckFailMeshAndVolumesNotAssignedToParts {} { + set volume_ids [GiD_Geometry list volume] + if { [objarray length $volume_ids] } { + set all_volumes_set_no_mesh 1 + objarray foreach volume_id [GiD_Geometry list volume] { + if { [GidUtils::GetMeshData volumes $volume_id Meshing] != "No" } { + set all_volumes_set_no_mesh 0 + break + } + } + if { $all_volumes_set_no_mesh } { + set document [$::gid_groups_conds::doc documentElement] + set num_groups_assigned [llength [$document selectNodes {/Kratos_data//condition[@n='Parts']/group}]] + if { $num_groups_assigned ==0 } { + W [= "The volumes to be meshed must be assigned to Kratos 'Parts'"] + } + } + } +} + proc Kratos::Event_AfterMeshGeneration {fail} { variable tmp_init_mesh_time if {$fail} { Kratos::Log "Mesh generation failed" + Kratos::CheckFailMeshAndVolumesNotAssignedToParts return } diff --git a/kratos.gid/scripts/Controllers/TreeInjections.tcl b/kratos.gid/scripts/Controllers/TreeInjections.tcl index 8550e4f55..69ab7b600 100644 --- a/kratos.gid/scripts/Controllers/TreeInjections.tcl +++ b/kratos.gid/scripts/Controllers/TreeInjections.tcl @@ -787,8 +787,7 @@ proc spdAux::injectConstitutiveLawOutputs { tempnode args} { proc spdAux::injectProcs { basenode args} { set appId [apps::getActiveAppId] if {$appId ne ""} { - set f "::$appId" - append f "::dir" + set f "::${appId}::dir" set nf [file join [subst $$f] xml Procs.spd] set xml [tDOM::xmlReadFile $nf] set newnode [dom parse [string trim $xml]]