From a601aa86e82022a45231dccb2973e0fe47490385 Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Tue, 6 Apr 2021 18:28:12 -0700 Subject: [PATCH] Issue #17471 test --- .../meshgenerators/FileMeshGenerator.md | 8 ++- .../source/variables/MooseVariableBase.md | 9 +++ .../tests/restart/scalar-var/gold/part1_out.e | Bin 0 -> 33224 bytes .../tests/restart/scalar-var/gold/part2_out.e | 1 + test/tests/restart/scalar-var/part1.i | 50 +++++++++++++++++ test/tests/restart/scalar-var/part2.i | 53 ++++++++++++++++++ test/tests/restart/scalar-var/tests | 19 +++++++ 7 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 test/tests/restart/scalar-var/gold/part1_out.e create mode 120000 test/tests/restart/scalar-var/gold/part2_out.e create mode 100644 test/tests/restart/scalar-var/part1.i create mode 100644 test/tests/restart/scalar-var/part2.i create mode 100644 test/tests/restart/scalar-var/tests diff --git a/framework/doc/content/source/meshgenerators/FileMeshGenerator.md b/framework/doc/content/source/meshgenerators/FileMeshGenerator.md index 9adb1f631ec4..baddfdd41a38 100644 --- a/framework/doc/content/source/meshgenerators/FileMeshGenerator.md +++ b/framework/doc/content/source/meshgenerators/FileMeshGenerator.md @@ -27,7 +27,13 @@ supports reading and writing a large number of formats and could be extended to | .cpr | Checkpoint file | When reading a mesh file in Sandia's ExodusII format, users can use parameter `exodus_extra_element_integers` to load elemental variables for setting extra element integers of the mesh. -The names of the extra element integers will be the same as the names of the element variables in the mesh file. +The names of the extra element integers will be the same as the names of the +element variables in the mesh file. This generator can also be used for +restarting variables from the Exodus file format. In order to indicate that the +mesh file can be used to restart variables, simply set the parameter +`use_for_exodus_restart = true`. The `initial_from_file_var` parameter must also +be set in the variables sub-block as described in [MooseVariableBase.md#restart] +in order to perform variable restart. ## Further FileMeshGenerator Documentation diff --git a/framework/doc/content/source/variables/MooseVariableBase.md b/framework/doc/content/source/variables/MooseVariableBase.md index 731044aa701c..3ab2daceace4 100644 --- a/framework/doc/content/source/variables/MooseVariableBase.md +++ b/framework/doc/content/source/variables/MooseVariableBase.md @@ -73,6 +73,15 @@ similar methods of `MooseVariableFE`. There are a myriad of ways to access Moose variables from user interfaces. We'll outline a few below. +## Restart + +Variables can be restarted/initialized from variable values in a file on disk by +setting the parameter `initial_from_file_var = source_var_name` in the variable +sub-block, where `source_var_name` is the name of the source variable in the +file. Note that the user will also have to set parameters in the `[Mesh]` block +in order for this to work, as described for example in the documentation of the +[FileMeshGenerator.md]. + ### SystemBase It's common for interface objects (`Kernel` objects for example) to have a `_sys` diff --git a/test/tests/restart/scalar-var/gold/part1_out.e b/test/tests/restart/scalar-var/gold/part1_out.e new file mode 100644 index 0000000000000000000000000000000000000000..59d64ba88cb34e41e4e53d36536ebbbf8caa6d09 GIT binary patch literal 33224 zcmeHQO>7*=b>_zQE+tWRHg=3XI6wuvfOp}gL{gM?rFg()Bx+5BB9$ej*xm%4o|&Fu zuX?)2-8~ek+g<{na>zNzAs74TQxYIK1op+JY!bjgf&{@LzYby~LF^nh7v=lvXZnZT zGgHmkK#Eo1uz#ld>-S#0dR6u6Rn5&?w|{0~Vc|J^&g1hr9s@6Qk~H?iKCTuPei5HV z-V6ND!}+h`^T}Q`ih0E6Tfz$N|{Q494oa1#Eb-jdl z78X8_&m!-6fyYcgkI#8^?X-gjxKcD;G|xGSm+EIpzr3ILUC>du|7nfkhlE*`IK=*p z#&L#TjCaZ}h_l4|3Mb)B$|ZkqP2amwF8x7i#Xm)C(dvMd>-i$PZKJVH9`4 z(<7Dz%ZoHD;&ZO&2auQgBKMu-84q4tN1?juh+;O+;dJ3sshqyhPE>W4|sAiS1kXUwoc-&V|XT_nnhD)jz&V z)3^8)o+E$$eat)UedhVQ$a^k1{XW)9lk)HTDsCUJL~&?6M3KSM9_|7oGF=5 z-X`(Xz-bz z!>5MEi(kNZOOnRoGo+2rnMB(7Zlw4B6#tgk205|UfmJZ|@w2#3eKra2PX1h7Tzm^h z^Bs@n^Zd1ZWaHcJZ@q-SjX%=I?{2^H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