Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions kratos.gid/apps/MPM/write/writeProjectParameters.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -183,47 +183,47 @@ proc ::MPM::write::GetOutputProcessesList { } {

set need_vtk [write::getValue EnableVtkOutput]
if {[write::isBooleanTrue $need_vtk]} {
#set vtk_options_xpath "[spdAux::getRoute $results_UN]/container\[@n='VtkOutput'\]/container\[@n='VtkOptions'\]"

set body_output_configuration_dict [lindex [dict get $project_parameters_dict output_processes vtk_output] 0]
set grid_output_configuration_dict [lindex [dict get $project_parameters_dict output_processes vtk_output] 0]


dict set body_output_configuration_dict python_module mpm_vtk_output_process
dict set body_output_configuration_dict kratos_module KratosMultiphysics.MPMApplication
dict set body_output_configuration_dict process_name MPMVtkOutputProcess
dict set body_output_configuration_dict Parameters model_part_name MPM_Material
dict unset body_output_configuration_dict Parameters nodal_data_value_variables
dict unset body_output_configuration_dict Parameters element_data_value_variables
dict unset body_output_configuration_dict Parameters condition_data_value_variables
dict unset body_output_configuration_dict Parameters nodal_solution_step_data_variables
#dict unset body_output_configuration_dict Parameters output_interval
#set outputCT [getValueByXPath $vtk_options_xpath OutputControlType]
#dict set resultDict output_control_type $outputCT
#if {$outputCT eq "time"} {set frequency [getValueByXPath $vtk_options_xpath OutputDeltaTime]} {set frequency [getValueByXPath $vtk_options_xpath OutputDeltaStep]}
dict set body_output_configuration_dict Parameters output_path "vtk_output_Body"
dict unset body_output_configuration_dict Parameters gauss_point_variables_extrapolated_to_nodes
dict set body_output_configuration_dict Parameters gauss_point_variables_in_elements [write::GetResultsList ElementResults]

dict set body_output_configuration_dict python_module mpm_vtk_output_process
dict set body_output_configuration_dict kratos_module KratosMultiphysics.MPMApplication
dict set body_output_configuration_dict process_name MPMVtkOutputProcess
dict set body_output_configuration_dict Parameters model_part_name MPM_Material
dict set body_output_configuration_dict Parameters output_path "vtk_output_Body"
dict set body_output_configuration_dict Parameters gauss_point_variables_in_elements [write::GetResultsList ElementResults]
dict set body_output_configuration_dict Parameters entity_type "automatic"
dict set body_output_configuration_dict Parameters write_ids false

dict set grid_output_configuration_dict Parameters model_part_name Background_Grid
dict unset grid_output_configuration_dict Parameters gauss_point_variables_extrapolated_to_nodes
dict unset grid_output_configuration_dict Parameters nodal_data_value_variables
dict unset grid_output_configuration_dict Parameters element_data_value_variables
dict unset grid_output_configuration_dict Parameters condition_data_value_variables
dict unset grid_output_configuration_dict Parameters gauss_point_results

dict set grid_output_configuration_dict Parameters model_part_name Background_Grid
dict set grid_output_configuration_dict Parameters output_path "vtk_output_Grid"
dict set grid_output_configuration_dict Parameters entity_type "automatic"
dict set grid_output_configuration_dict Parameters write_ids false

dict set project_parameters_dict output_processes body_output_process [list $body_output_configuration_dict]
#dict set project_parameters_dict output_processes grid_output_process [list $grid_output_configuration_dict]
dict unset project_parameters_dict output_processes vtk_output
dict unset grid_output_configuration_dict Parameters gauss_point_results

# Append the fluid and solid output processes to the output processes list
lappend vtk_output_processes_list $grid_output_configuration_dict
lappend vtk_output_processes_list $body_output_configuration_dict
set vtk_output_type [write::getValue VtkOptions VtkOutputType]
if {$vtk_output_type eq "grid" || $vtk_output_type eq "both"} {
lappend vtk_output_processes_list $grid_output_configuration_dict
}
if {$vtk_output_type eq "mpm" || $vtk_output_type eq "both"} {
lappend vtk_output_processes_list $body_output_configuration_dict
}
dict set output_process vtk_output_processes $vtk_output_processes_list


}

# Restart
Expand Down
8 changes: 3 additions & 5 deletions kratos.gid/apps/MPM/xml/Results.spd
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<container n="Results" pn="Results" un="Results" state="normal" open="1" open_window="0" icon="results">
<container n="OnElement" pn="On element" un="ElementResults" icon="triangle" help="Activate the results you want to see in the elements" state="[ActiveIfAnyPartState]" open_window="0">
<container n="OnElement" pn="On Material Points" un="ElementResults" icon="triangle" help="Activate the results you want to see in the elements" open_window="0">
<dynamicnode command="spdAux::injectElementOutputs" args=""/>
<dynamicnode command="spdAux::injectConstitutiveLawOutputs" args=""/>
</container>
<container n="OnNodes" pn="On nodes" un="NodalResults" icon="point3d" help="Activate the results you want to see in the nodes" open_window="1">
<container n="OnNodes" pn="On nodes" un="NodalResults" icon="point3d" help="Activate the results you want to see in the nodes" open_window="0">
<value n="PARTITION_INDEX" pn="Partition index" v="Yes" values="Yes,No" help="" state="[checkStateByUniqueName ParallelType MPI]"/>
<dynamicnode command="spdAux::injectNodalConditionsOutputs" args=""/>
</container>
Expand Down Expand Up @@ -40,13 +39,13 @@
<container n="VtkOutput" pn="Vtk-Output" un="VtkOutput" state="normal" open="1" open_window="0" icon="results">
<value n="EnableVtkOutput" pn="Enable output" v="Yes" values="Yes,No" un="EnableVtkOutput" help="Writing output for Vtk or not" />
<container n="VtkOptions" pn="Options" un="VtkOptions" help="Vtk postprocess options" open_window="1" icon="options" state="[checkStateByUniqueName EnableVtkOutput Yes]">
<value n="VtkOutputType" pn="Output type" v="both" values="both,grid,mpm" dict="both,grid and body,grid,only grid,mpm,only body" help="Vtk result output type" />
<value n="VtkFileFormat" pn="Result format" v="ascii" values="ascii,binary" dict="ascii,Ascii,binary,Binary" help="Vtk result file format" />
<value n="OutputControlType" pn="Units used for output frequency" v="step" values="time,step" dict="time,Time (s),step,Steps" help="" update_proc="spdAux::RequestRefresh">
<dependencies node="../value" actualize="1"/>
</value>
<value n="OutputDeltaTime" pn="Time between outputs (s)" v="1.0" help="Output will be printed in intervals of this time" state="[getStateFromXPathValue {string(../value[@n='OutputControlType']/@v)} time]"/>
<value n="OutputDeltaStep" pn="Time steps between outputs" v="1" help="Output will be printed in intervals of this number of steps" state="[getStateFromXPathValue {string(../value[@n='OutputControlType']/@v)} step]"/>

</container>
</container>
<container n="RestartOutput" pn="Restart-Output" un="RestartOutput" state="normal" open="1" open_window="0" icon="results">
Expand All @@ -57,7 +56,6 @@
</value>
<value n="OutputDeltaTime" pn="Time between outputs (s)" v="1.0" help="Output will be printed in intervals of this time" state="[getStateFromXPathValue {string(../value[@n='OutputControlType']/@v)} time]"/>
<value n="OutputDeltaStep" pn="Time steps between outputs" v="1" help="Output will be printed in intervals of this number of steps" state="[getStateFromXPathValue {string(../value[@n='OutputControlType']/@v)} step]"/>

</container>
</container>

Expand Down