- input_filesThe input file for each App. If this parameter only contains one input file it will be used for all of the Apps. When using 'positions_from_file' it is also admissable to provide one input_file per file.
C++ Type:std::vector<FileName>
Controllable:No
Description:The input file for each App. If this parameter only contains one input file it will be used for all of the Apps. When using 'positions_from_file' it is also admissable to provide one input_file per file.
FullSolveMultiApp
Performs a complete simulation during each execution.
Overview
The FullSolveMultiApp object is designed to perform a complete simulation every time it executes, thus it can be used for creating simulations that have portions that are on drastically different time scales.
Example Input File Syntax
The following code snippet demonstrates how to create a FullSolveMultiApp object.
[MultiApps]
[full_solve]
type = FullSolveMultiApp
# not setting app_type to use the same app type of parent, i.e. MooseTestApp
execute_on = initial
positions = '0 0 0'
input_files = sub.i
[]
[]
(test/tests/multiapps/full_solve_multiapp/parent.i)Input Parameters
- app_typeThe type of application to build (applications not registered can be loaded with dynamic libraries. Parent application type will be used if not provided.
C++ Type:MooseEnum
Options:ChemicalReactionsApp, ChemicalReactionsTestApp, CombinedApp, CombinedTestApp, ContactApp, ContactTestApp, ElectromagneticsApp, ElectromagneticsTestApp, ExternalPetscSolverApp, ExternalPetscSolverTestApp, FluidPropertiesApp, FluidPropertiesTestApp, FsiApp, FsiTestApp, FunctionalExpansionToolsApp, FunctionalExpansionToolsTestApp, GeochemistryApp, GeochemistryTestApp, HeatTransferApp, HeatTransferTestApp, LevelSetApp, LevelSetTestApp, MiscApp, MiscTestApp, NavierStokesApp, NavierStokesTestApp, OptimizationApp, OptimizationTestApp, PeridynamicsApp, PeridynamicsTestApp, PhaseFieldApp, PhaseFieldTestApp, PorousFlowApp, PorousFlowTestApp, RayTracingApp, RayTracingTestApp, RdgApp, RdgTestApp, ReactorApp, ReactorTestApp, RichardsApp, RichardsTestApp, ScalarTransportApp, ScalarTransportTestApp, SolidMechanicsApp, SolidMechanicsTestApp, SolidPropertiesApp, SolidPropertiesTestApp, StochasticToolsApp, StochasticToolsTestApp, ThermalHydraulicsApp, ThermalHydraulicsTestApp, XFEMApp, XFEMTestApp
Controllable:No
Description:The type of application to build (applications not registered can be loaded with dynamic libraries. Parent application type will be used if not provided.
- bounding_box_inflation0.01Relative amount to 'inflate' the bounding box of this MultiApp.
Default:0.01
C++ Type:double
Controllable:No
Description:Relative amount to 'inflate' the bounding box of this MultiApp.
- bounding_box_padding0 0 0Additional padding added to the dimensions of the bounding box. The values are added to the x, y and z dimension respectively.
Default:0 0 0
C++ Type:libMesh::Point
Controllable:No
Description:Additional padding added to the dimensions of the bounding box. The values are added to the x, y and z dimension respectively.
- clone_parent_meshFalseTrue to clone parent app mesh and use it for this MultiApp.
Default:False
C++ Type:bool
Controllable:No
Description:True to clone parent app mesh and use it for this MultiApp.
- execute_onTIMESTEP_BEGINThe list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.
Default:TIMESTEP_BEGIN
C++ Type:ExecFlagEnum
Options:FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM
Controllable:No
Description:The list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.
- global_time_offset0The time offset relative to the parent application for the purpose of starting a subapp at a different time from the parent application. The global time will be ahead by the offset specified here.
Default:0
C++ Type:double
Controllable:No
Description:The time offset relative to the parent application for the purpose of starting a subapp at a different time from the parent application. The global time will be ahead by the offset specified here.
- ignore_solve_not_convergeFalseTrue to continue main app even if a sub app's solve does not converge.
Default:False
C++ Type:bool
Controllable:No
Description:True to continue main app even if a sub app's solve does not converge.
- keep_full_output_historyFalseWhether or not to keep the full output history when this multiapp has multiple entries
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not to keep the full output history when this multiapp has multiple entries
- no_backup_and_restoreFalseTrue to turn off backup/restore for this multiapp. This is useful when doing steady-state Picard iterations where we want to use the solution of previous Picard iteration as the initial guess of the current Picard iteration
Default:False
C++ Type:bool
Controllable:No
Description:True to turn off backup/restore for this multiapp. This is useful when doing steady-state Picard iterations where we want to use the solution of previous Picard iteration as the initial guess of the current Picard iteration
Optional Parameters
- cli_argsAdditional command line arguments to pass to the sub apps. If one set is provided the arguments are applied to all, otherwise there must be a set for each sub app.
C++ Type:std::vector<CLIArgString>
Controllable:Yes
Description:Additional command line arguments to pass to the sub apps. If one set is provided the arguments are applied to all, otherwise there must be a set for each sub app.
- cli_args_filesFile names that should be looked in for additional command line arguments to pass to the sub apps. Each line of a file is set to each sub app. If only one line is provided, it will be applied to all sub apps.
C++ Type:std::vector<FileName>
Controllable:No
Description:File names that should be looked in for additional command line arguments to pass to the sub apps. Each line of a file is set to each sub app. If only one line is provided, it will be applied to all sub apps.
Passing Command Line Argument Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
- wait_for_first_app_initFalseCreate the first sub-application on rank 0, then MPI_Barrier before creating the next N-1 apps (on all ranks). This is only needed if your sub-application needs to perform some setup actions in quiet, without other sub-applications working at the same time.
Default:False
C++ Type:bool
Controllable:No
Description:Create the first sub-application on rank 0, then MPI_Barrier before creating the next N-1 apps (on all ranks). This is only needed if your sub-application needs to perform some setup actions in quiet, without other sub-applications working at the same time.
Advanced Parameters
- keep_solution_during_restoreFalseThis is useful when doing MultiApp coupling iterations. It takes the final solution from the previous coupling iterationand re-uses it as the initial guess for the next coupling iteration
Default:False
C++ Type:bool
Controllable:No
Description:This is useful when doing MultiApp coupling iterations. It takes the final solution from the previous coupling iterationand re-uses it as the initial guess for the next coupling iteration
- relaxation_factor1Fraction of newly computed value to keep.Set between 0 and 2.
Default:1
C++ Type:double
Controllable:No
Description:Fraction of newly computed value to keep.Set between 0 and 2.
- transformed_postprocessorsList of subapp postprocessors to use coupling algorithm on during Multiapp coupling iterations
C++ Type:std::vector<PostprocessorName>
Controllable:No
Description:List of subapp postprocessors to use coupling algorithm on during Multiapp coupling iterations
- transformed_variablesList of subapp variables to use coupling algorithm on during Multiapp coupling iterations
C++ Type:std::vector<std::string>
Controllable:No
Description:List of subapp variables to use coupling algorithm on during Multiapp coupling iterations
Fixed Point Acceleration Of Multiapp Quantities Parameters
- library_load_dependenciesFalseTells MOOSE to manually load library dependencies. This should not be necessary and is here for debugging/troubleshooting.
Default:False
C++ Type:bool
Controllable:No
Description:Tells MOOSE to manually load library dependencies. This should not be necessary and is here for debugging/troubleshooting.
- library_nameThe file name of the library (*.la file) that will be dynamically loaded.
C++ Type:std::string
Controllable:No
Description:The file name of the library (*.la file) that will be dynamically loaded.
- library_pathPath to search for dynamic libraries (please avoid committing absolute paths in addition to MOOSE_LIBRARY_PATH)
C++ Type:std::string
Controllable:No
Description:Path to search for dynamic libraries (please avoid committing absolute paths in addition to MOOSE_LIBRARY_PATH)
Dynamic Loading Parameters
- max_procs_per_app4294967295Maximum number of processors to give to each App in this MultiApp. Useful for restricting small solves to just a few procs so they don't get spread out
Default:4294967295
C++ Type:unsigned int
Controllable:No
Description:Maximum number of processors to give to each App in this MultiApp. Useful for restricting small solves to just a few procs so they don't get spread out
- min_procs_per_app1Minimum number of processors to give to each App in this MultiApp. Useful for larger, distributed mesh solves.
Default:1
C++ Type:unsigned int
Controllable:No
Description:Minimum number of processors to give to each App in this MultiApp. Useful for larger, distributed mesh solves.
Parallelism Parameters
- move_appsApps, designated by their 'numbers' starting with 0 corresponding to the order of the App positions, to be moved at move_time to move_positions
C++ Type:std::vector<unsigned int>
Controllable:No
Description:Apps, designated by their 'numbers' starting with 0 corresponding to the order of the App positions, to be moved at move_time to move_positions
- move_positionsThe positions corresponding to each move_app.
C++ Type:std::vector<libMesh::Point>
Controllable:No
Description:The positions corresponding to each move_app.
- move_time1.79769e+308The time at which Apps designated by move_apps are moved to move_positions.
Default:1.79769e+308
C++ Type:double
Controllable:No
Description:The time at which Apps designated by move_apps are moved to move_positions.
Timed Move Of Multiapps Parameters
- output_in_positionFalseIf true this will cause the output from the MultiApp to be 'moved' by its position vector
Default:False
C++ Type:bool
Controllable:No
Description:If true this will cause the output from the MultiApp to be 'moved' by its position vector
- positionsThe positions of the App locations. Each set of 3 values will represent a Point. This and 'positions_file' cannot be both supplied. If this and 'positions_file'/'_objects' are not supplied, a single position (0,0,0) will be used
C++ Type:std::vector<libMesh::Point>
Controllable:No
Description:The positions of the App locations. Each set of 3 values will represent a Point. This and 'positions_file' cannot be both supplied. If this and 'positions_file'/'_objects' are not supplied, a single position (0,0,0) will be used
- positions_fileFilename(s) that should be looked in for positions. Each set of 3 values in that file will represent a Point. This and 'positions(_objects)' cannot be both supplied
C++ Type:std::vector<FileName>
Controllable:No
Description:Filename(s) that should be looked in for positions. Each set of 3 values in that file will represent a Point. This and 'positions(_objects)' cannot be both supplied
- positions_objectsThe name of a Positions object that will contain the locations of the sub-apps created. This and 'positions(_file)' cannot be both supplied
C++ Type:std::vector<PositionsName>
Controllable:No
Description:The name of a Positions object that will contain the locations of the sub-apps created. This and 'positions(_file)' cannot be both supplied
- run_in_positionFalseIf true this will cause the mesh from the MultiApp to be 'moved' by its position vector
Default:False
C++ Type:bool
Controllable:No
Description:If true this will cause the mesh from the MultiApp to be 'moved' by its position vector
Positions / Transformations Of The Multiapp Frame Of Reference Parameters
- reset_appsThe Apps that will be reset when 'reset_time' is hit. These are the App 'numbers' starting with 0 corresponding to the order of the App positions. Resetting an App means that it is destroyed and recreated, possibly modeling the insertion of 'new' material for that app.
C++ Type:std::vector<unsigned int>
Controllable:No
Description:The Apps that will be reset when 'reset_time' is hit. These are the App 'numbers' starting with 0 corresponding to the order of the App positions. Resetting an App means that it is destroyed and recreated, possibly modeling the insertion of 'new' material for that app.
- reset_timeThe time(s) at which to reset Apps given by the 'reset_apps' parameter. Resetting an App means that it is destroyed and recreated, possibly modeling the insertion of 'new' material for that app.
C++ Type:std::vector<double>
Controllable:No
Description:The time(s) at which to reset Apps given by the 'reset_apps' parameter. Resetting an App means that it is destroyed and recreated, possibly modeling the insertion of 'new' material for that app.
Reset Multiapp Parameters
Input Files
- (test/tests/misc/check_error/multi_parent.i)
- (test/tests/multiapps/picard_postprocessor/steady_main.i)
- (modules/optimization/examples/simpleTransient/main_gradient.i)
- (modules/optimization/test/tests/optimizationreporter/mesh_source/main_auto_adjoint.i)
- (test/tests/vectorpostprocessors/csv_reader/transfer/parent.i)
- (test/tests/transfers/multiapp_copy_transfer/linear_sys_to_aux/nonlinear_main.i)
- (modules/optimization/test/tests/optimizationreporter/material/main.i)
- (test/tests/multiapps/full_solve_multiapp/parent_eigen.i)
- (test/tests/transfers/multiapp_copy_transfer/constant_monomial_from_sub/parent.i)
- (test/tests/transfers/coord_transform/rz-xyz/3d-xyz.i)
- (test/tests/transfers/general_field/nearest_node/regular/main.i)
- (test/tests/multiapps/clone_parent_mesh/main.i)
- (test/tests/outputs/debug/show_execution_userobjects.i)
- (test/tests/multiapps/picard/pseudo_transient_picard_parent.i)
- (test/tests/transfers/coord_transform/both-transformed/mesh-function/main-app.i)
- (test/tests/controls/restrict_exec_flag/exec_flag_error.i)
- (test/tests/transfers/multiapp_conservative_transfer/parent_power_density.i)
- (modules/optimization/test/tests/optimizationreporter/point_loads/main_auto_adjoint.i)
- (test/tests/transfers/general_field/nearest_node/regular/main_array.i)
- (test/tests/multiapps/initial_failure/parent.i)
- (modules/optimization/test/tests/optimizationreporter/general_opt/function_optimization/main.i)
- (test/tests/transfers/multiapp_high_order_variable_transfer/parent_L2_Lagrange_conservative.i)
- (test/tests/transfers/multiapp_copy_transfer/array_variable_transfer/parent.i)
- (test/tests/transfers/coord_transform/main-app.i)
- (test/tests/transfers/coord_transform/transform-main-main-app.i)
- (test/tests/multiapps/steffensen/steady_main.i)
- (modules/combined/test/tests/optimization/invOpt_mechanics/main.i)
- (test/tests/transfers/multiapp_copy_transfer/second_lagrange_to_sub/parent.i)
- (test/tests/transfers/general_field/user_object/nearest_position/main.i)
- (modules/combined/test/tests/optimization/invOpt_multiExperiment/main.i)
- (modules/optimization/examples/simpleTransient/main_auto_adjoint.i)
- (test/tests/transfers/coord_transform/both-transformed/user_object/main-app.i)
- (test/tests/transfers/coord_transform/both-transformed/interpolation/main-app.i)
- (test/tests/positions/creating_multiapps/apps_from_positions.i)
- (test/tests/transfers/general_field/user_object/regular/main.i)
- (test/tests/multiapps/picard/picard_custom_postprocessor.i)
- (modules/optimization/test/tests/optimizationreporter/mesh_source/main.i)
- (test/tests/multiapps/secant_postprocessor/steady_main.i)
- (modules/stochastic_tools/test/tests/multiapps/commandline_control/parent_wrong_multiapp_type.i)
- (test/tests/transfers/general_field/shape_evaluation/regular/main_array.i)
- (modules/stochastic_tools/test/tests/multiapps/nested_multiapp/sub.i)
- (test/tests/multiapps/full_solve_multiapp_reset/parent.i)
- (modules/stochastic_tools/test/tests/multiapps/nested_multiapp/main.i)
- (test/tests/multiapps/command_line/parent.i)
- (test/tests/transfers/from_full_solve/parent.i)
- (test/tests/outputs/perf_graph/multi_app/parent_full.i)
- (test/tests/transfers/general_field/shape_evaluation/mesh_division/main.i)
- (test/tests/transfers/multiapp_copy_transfer/second_lagrange_from_sub/parent.i)
- (modules/optimization/test/tests/userobjects/adjoint_solution/adjoint.i)
- (modules/optimization/test/tests/executioners/constrained/shape_optimization/main.i)
- (modules/optimization/examples/simpleTransient/main.i)
- (test/tests/transfers/multiapp_conservative_transfer/parent_nearest_point.i)
- (modules/optimization/examples/simpleTransient/main_mesh.i)
- (test/tests/transfers/multiapp_variable_value_sample_transfer/parent_array_centroid.i)
- (modules/optimization/test/tests/optimizationreporter/general_opt/point_loads_gen_opt/main_separate_multiapps.i)
- (test/tests/multiapps/command_line/parent_common.i)
- (test/tests/transfers/multiapp_high_order_variable_transfer/parent_L2_Lagrange.i)
- (test/tests/problems/eigen_problem/eigensolvers/ne_coupled_picard.i)
- (test/tests/transfers/general_field/user_object/coord_transform/main-app.i)
- (test/tests/transfers/multiapp_copy_transfer/multivariable_copy/parent.i)
- (test/tests/transfers/general_field/nearest_node/duplicated_nearest_node_tests/target_boundary_parent.i)
- (test/tests/transfers/multiapp_nearest_node_transfer/target_boundary_parent.i)
- (test/tests/transfers/multiapp_copy_transfer/linear_lagrange_from_sub/parent.i)
- (test/tests/transfers/multiapp_projection_transfer/high_order_parent.i)
- (modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/main.i)
- (test/tests/multiapps/full_solve_multiapp/parent.i)
- (test/tests/transfers/general_field/nearest_node/nearest_position/main.i)
- (test/tests/multiapps/command_line/parent_wrong_size.i)
- (test/tests/multiapps/picard_multilevel/2level_picard/mutilevel_app.i)
- (modules/stochastic_tools/test/tests/multiapps/batch_commandline_control/parent_wrong_num_params.i)
- (test/tests/transfers/coord_transform/both-transformed/projection/main-app.i)
- (test/tests/transfers/multiapp_copy_transfer/third_monomial_from_sub/parent.i)
- (test/tests/transfers/coord_transform/both-transformed/nearest-node/main-app.i)
- (modules/optimization/test/tests/optimizationreporter/constant_heat_source/main_nonLinear.i)
- (test/tests/transfers/multiapp_transfer_transformation/transfer_transformation.i)
- (test/tests/multiapps/command_line/parent_common_vector.i)
- (modules/optimization/examples/diffusion_reaction/optimize.i)
- (test/tests/multiapps/secant/steady_main.i)
- (test/tests/problems/eigen_problem/eigensolvers/ne_coupled_picard_subT.i)
- (modules/optimization/test/tests/outputs/exodus_optimization_steady/main_auto_adjoint.i)
- (test/tests/transfers/multiapp_copy_transfer/tagged_solution/main.i)
- (modules/optimization/test/tests/executioners/constrained/inequality/main_auto_adjoint.i)
- (test/tests/restart/restart_transient_from_steady/steady_with_2subs.i)
- (modules/optimization/test/tests/optimizationreporter/constant_heat_source/main.i)
- (test/tests/transfers/general_field/nearest_node/mesh_division/main_match_subapps.i)
- (test/tests/utils/perf_graph_live_print/perf_graph_live_print.i)
- (test/tests/transfers/general_field/nearest_node/duplicated_nearest_node_tests/source_boundary_parent.i)
- (test/tests/transfers/multiapp_variable_value_sample_transfer/parent_array_sample.i)
- (test/tests/transfers/multiapp_high_order_variable_transfer/parent_L2_Lagrange_userobject.i)
- (modules/optimization/test/tests/optimizationreporter/general_opt/point_loads_gen_opt/main_auto_adjoint_transfer_data.i)
- (test/tests/transfers/multiapp_conservative_transfer/primary_skipped_adjuster.i)
- (modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/main_auto_adjoint.i)
- (modules/optimization/test/tests/optimizationreporter/mesh_source/main_linearRestart.i)
- (test/tests/multiapps/picard_multilevel/fullsolve_multilevel/parent.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/multiapp-scalar-transport/fluid-flow.i)
- (modules/optimization/test/tests/optimizationreporter/nonlinear_material/main.i)
- (modules/combined/test/tests/restart-transient-from-ss-with-stateful/parent_ss.i)
- (test/tests/transfers/multiapp_copy_transfer/linear_lagrange_to_sub/parent.i)
- (modules/optimization/test/tests/optimizationreporter/general_opt/point_loads_gen_opt/main_auto_adjoint.i)
- (test/tests/positions/multiapp_positions.i)
- (test/tests/transfers/multiapp_copy_transfer/third_monomial_to_sub/parent.i)
- (test/tests/transfers/general_field/nearest_node/mesh_division/main_match_division.i)
- (test/tests/transfers/coord_transform/both-transformed/copy/main-app.i)
- (test/tests/transfers/multiapp_copy_transfer/constant_monomial_to_sub/parent.i)
- (test/tests/restart/restart_subapp_not_parent/two_step_solve_parent.i)
- (test/tests/multiapps/initial_transfer/parent.i)
- (test/tests/transfers/multiapp_nearest_node_transfer/cached_multiple_apps/main.i)
- (test/tests/transfers/multiapp_conservative_transfer/parent_conservative_transfer.i)
- (test/tests/transfers/multiapp_conservative_transfer/primary_negative_adjuster.i)
- (modules/combined/test/tests/optimization/invOpt_bc_convective/main.i)
- (test/tests/multiapps/steffensen_postprocessor/steady_main.i)
- (test/tests/multiapps/picard/steady_picard_parent.i)
- (modules/combined/test/tests/optimization/invOpt_elasticity/main.i)
- (modules/optimization/test/tests/outputs/exodus_optimization_steady/main.i)
- (test/tests/transfers/multiapp_nearest_node_transfer/source_boundary_parent.i)
- (modules/optimization/test/tests/optimizationreporter/bimaterial/main.i)
- (modules/level_set/test/tests/transfers/copy_solution/parent.i)
- (test/tests/transfers/general_field/nearest_node/nearest_position/main_single_sub.i)
- (test/tests/multiapps/picard/steady_custom_picard_parent.i)
- (test/tests/transfers/general_field/nearest_node/mesh_division/main.i)
- (test/tests/transfers/multiapp_copy_transfer/errors/parent.i)
- (modules/optimization/test/tests/optimizationreporter/bimaterial/main_auto_adjoint.i)
- (modules/combined/test/tests/optimization/invOpt_nonlinear/main.i)
- (modules/stochastic_tools/test/tests/multiapps/batch_commandline_control/parent_wrong_size.i)
- (modules/optimization/examples/materialTransient/optimize_grad.i)
- (test/tests/transfers/general_field/shape_evaluation/mesh_division/main_match_subapps.i)
- (modules/optimization/examples/materialTransient/optimize_nograd.i)
- (test/tests/transfers/general_field/shape_evaluation/regular/main.i)
- (test/tests/restart/restart_transient_from_steady/steady_with_sub.i)
- (modules/optimization/test/tests/optimizationreporter/point_loads/main.i)
- (modules/optimization/examples/materialTransient/optimize_auto_adjoint.i)
Child Objects
(test/tests/multiapps/full_solve_multiapp/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
perf_graph = true
[]
[MultiApps]
[full_solve]
type = FullSolveMultiApp
# not setting app_type to use the same app type of parent, i.e. MooseTestApp
execute_on = initial
positions = '0 0 0'
input_files = sub.i
[]
[]
(test/tests/misc/check_error/multi_parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
perf_graph = true
[]
[MultiApps]
[./full_solve]
# not setting app_type to use the same app type of master, i.e. MooseTestApp
type = FullSolveMultiApp
execute_on = initial
positions = '0 0 0'
input_files = multi_sub.i
[../]
[]
(test/tests/multiapps/picard_postprocessor/steady_main.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
parallel_type = replicated
uniform_refine = 1
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[source]
type = BodyForce
variable = u
value = 1
[]
[]
[BCs]
[left]
type = PostprocessorDirichletBC
variable = u
boundary = left
postprocessor = 'from_sub'
[]
[]
[Postprocessors]
[from_sub]
type = Receiver
default = 0
[]
[to_sub]
type = SideAverageValue
variable = u
boundary = right
[]
[average]
type = ElementAverageValue
variable = u
[]
[]
[Executioner]
type = Steady
# Solve parameters
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
nl_abs_tol = 1e-14
# App coupling parameters
fixed_point_max_its = 100
fixed_point_rel_tol = 0.5 # pseudo transient is slow to converge
relaxation_factor = 0.8
transformed_postprocessors = 'from_sub'
[]
[Outputs]
csv = true
exodus = false
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = steady_sub.i
clone_parent_mesh = true
execute_on = 'timestep_begin'
# we keep the full postprocessor output history of the subapp
keep_full_output_history = true
relaxation_factor = 0.8
transformed_postprocessors = 'from_main'
[]
[]
[Transfers]
[left_from_sub]
type = MultiAppPostprocessorTransfer
from_multi_app = sub
from_postprocessor = 'to_main'
to_postprocessor = 'from_sub'
reduction_type = 'average'
[]
[right_to_sub]
type = MultiAppPostprocessorTransfer
to_multi_app = sub
from_postprocessor = 'to_sub'
to_postprocessor = 'from_main'
[]
[]
(modules/optimization/examples/simpleTransient/main_gradient.i)
[Optimization]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'source'
num_values = '44'
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = FORWARD
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint.i
execute_on = ADJOINT
[]
[]
[Transfers]
[to_forward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/source'
to_reporters = 'src_values/values'
[]
[from_forward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measured_data/misfit_values measured_data/simulation_values'
to_reporters = 'OptimizationReporter/misfit_values OptimizationReporter/simulation_values'
[]
[to_adjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/source OptimizationReporter/misfit_values'
to_reporters = 'src_values/values measured_data/misfit_values'
[]
[from_adjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'adjoint/inner_product'
to_reporters = 'OptimizationReporter/grad_source'
[]
[]
[Executioner]
type = Optimize
solve_on = none
tao_solver = taolmvm
petsc_options_iname = '-tao_gatol -tao_ls_type'
petsc_options_value = '1e-2 unit'
verbose = true
[]
[Postprocessors]
[./elapsed]
type = PerfGraphData
section_name = "Root"
data_type = total
[../]
[]
[Outputs]
[pgraph]
type = PerfGraphOutput
level = 1
[]
[]
(modules/optimization/test/tests/optimizationreporter/mesh_source/main_auto_adjoint.i)
[Optimization]
[]
[OptimizationReporter]
type = ParameterMeshOptimization
parameter_names = 'source'
parameter_meshes = 'parameter_mesh_in.e'
# Random points
measurement_points = '0.78193073 0.39115321 0
0.72531893 0.14319403 0
0.14052488 0.86976625 0
0.401893 0.54241797 0
0.02645427 0.43320192 0
0.28856889 0.0035165 0
0.51433644 0.94485949 0
0.29252255 0.7962032 0
0.04925654 0.58018889 0
0.04717357 0.9556314 0'
# sin(x*pi/2)*sin(y*pi/2)
measurement_values = '0.54299466 0.20259611 0.21438235 0.44418597 0.02613676
0.00241892 0.72014019 0.42096307 0.06108895 0.07385256'
[]
[Executioner]
type = Optimize
tao_solver = taobqnls
petsc_options_iname = '-tao_gatol'
petsc_options_value = '1e-4'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward_and_adjoint.i
execute_on = FORWARD
[]
[]
[Transfers]
[toForward_measument]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/source'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
src_rep/vals'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values
gradient_vpp/inner_product'
to_reporters = 'OptimizationReporter/simulation_values
OptimizationReporter/grad_source'
[]
[]
(test/tests/vectorpostprocessors/csv_reader/transfer/parent.i)
[Mesh]
type = GeneratedMesh
parallel_type = 'replicated'
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[MultiApps]
[./master]
type = FullSolveMultiApp
input_files = 'sub.i'
execute_on = initial
[../]
[]
[Transfers]
[./transfer]
type = MultiAppUserObjectTransfer
to_multi_app = master
user_object = data
variable = aux
[../]
[]
[VectorPostprocessors]
[./data]
type = CSVReader
csv_file = 'example.csv'
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(test/tests/transfers/multiapp_copy_transfer/linear_sys_to_aux/nonlinear_main.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[]
[Variables]
[u_main]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[transferred]
type = MooseLinearVariableFVReal
[]
[]
[Transfers]
[copy]
type = MultiAppCopyTransfer
from_multi_app = linear_sub
source_variable = u
variable = transferred
[]
[]
[MultiApps]
[linear_sub]
type = FullSolveMultiApp
input_files = 'linear_sub.i'
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u_main
coeff = 2
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u_main
boundary = left
value = 0
[]
[./right]
type = FVDirichletBC
variable = u_main
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
exodus = true
[]
(modules/optimization/test/tests/optimizationreporter/material/main.i)
[Optimization]
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'p1'
num_values = '1'
initial_condition = '7'
lower_bounds = '0'
upper_bounds = '10'
measurement_points = '0.2 0.2 0
0.8 0.6 0
0.2 1.4 0
0.8 1.8 0'
measurement_values = '226 254 214 146'
[]
[Executioner]
type = Optimize
tao_solver = taoblmvm
petsc_options_iname = '-tao_gatol'
petsc_options_value = '0.0001'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = "FORWARD"
clone_parent_mesh = true
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint.i
execute_on = "ADJOINT"
clone_parent_mesh = true
[]
[]
[Transfers]
[toForward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/p1'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
params/p1'
[]
[fromForward_mesh]
type = MultiAppCopyTransfer
from_multi_app = forward
to_multi_app = adjoint
source_variable = 'temperature'
variable = 'temperature_forward'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[toAdjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/p1'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
params/p1'
[]
[fromAdjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'adjoint_grad/inner_product'
to_reporters = 'OptimizationReporter/grad_p1'
[]
[]
[Outputs]
csv = true
[]
(test/tests/multiapps/full_solve_multiapp/parent_eigen.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[rhs]
type = MassEigenKernel
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = NonlinearEigen
bx_norm = 'unorm'
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Postprocessors]
[unorm]
type = ElementIntegralVariablePostprocessor
variable = u
# execute on residual is important for nonlinear eigen solver!
execute_on = linear
[]
[]
[Outputs]
exodus = true
perf_graph = true
[]
[MultiApps]
[full_solve]
type = FullSolveMultiApp
# not setting app_type to use the same app type of parent, i.e. MooseTestApp
execute_on = initial
positions = '0 0 0'
input_files = sub.i
[]
[]
(test/tests/transfers/multiapp_copy_transfer/constant_monomial_from_sub/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
family = MONOMIAL
order = CONSTANT
[../]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = initial
[../]
[]
[Transfers]
[./from_sub]
type = MultiAppCopyTransfer
source_variable = aux
variable = u
from_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/coord_transform/rz-xyz/3d-xyz.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 6
ny = 6
nz = 3
xmin = -1
ymin = -1
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[force]
type = BodyForce
function = 'x^2 + y^2 + z'
variable = u
[]
[]
[AuxVariables]
[v][]
[]
[BCs]
[square]
type = DirichletBC
variable = u
boundary = 'left right top bottom'
value = 0
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = '2d-rz.i'
execute_on = 'timestep_end'
[]
[]
[Transfers]
[to_sub]
type = MultiAppNearestNodeTransfer
to_multi_app = sub
source_variable = u
variable = v
execute_on = 'timestep_end'
skip_coordinate_collapsing = false
[]
[from_sub]
type = MultiAppNearestNodeTransfer
from_multi_app = sub
source_variable = u
variable = v
execute_on = 'timestep_end'
skip_coordinate_collapsing = false
[]
[]
(test/tests/transfers/general_field/nearest_node/regular/main.i)
# Base input for testing transfers. It has the following complexities:
# - more than one subapp
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[AuxVariables]
[from_sub]
initial_condition = -1
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[to_sub]
[InitialCondition]
type = FunctionIC
function = '1 + 2*x*x + 3*y*y*y'
[]
[]
[to_sub_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '2 + 2*x*x + 3*y*y*y'
[]
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
[out]
type = Exodus
hide = 'to_sub to_sub_elem'
overwrite = true
[]
[]
[MultiApps]
[sub]
# 1 on corner, one in the center and one close to a corner
# The offsets are to avoid equidistant points
positions = '0.000001 0 0 0.4111 0.4112 0 0.6999 0.099 0'
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = sub.i
output_in_position = true
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = to_sub
variable = from_main
[]
[to_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = to_sub_elem
variable = from_main_elem
[]
[from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main
variable = from_sub
[]
[from_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main_elem
variable = from_sub_elem
[]
[]
(test/tests/multiapps/clone_parent_mesh/main.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[]
[Variables/u]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[src]
type = BodyForce
variable = u
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = u
boundary = 'top right'
value = 0
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[AuxVariables]
[u_sub]
[]
[diff]
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = sub.i
clone_parent_mesh = true
[]
[]
[Transfers]
[transfer]
type = MultiAppCopyTransfer
from_multi_app = sub
variable = u_sub
source_variable = u
[]
[]
[AuxKernels]
[diff_aux]
type = ParsedAux
variable = diff
expression = 'abs(u - u_sub)'
coupled_variables = 'u u_sub'
[]
[]
[Postprocessors]
[diff_max]
type = ElementExtremeValue
variable = diff
[]
[]
[UserObjects]
[terminator]
type = Terminator
expression = 'diff_max > 1e-8'
fail_mode = HARD
error_level = ERROR
[]
[]
[Outputs]
exodus = true
[]
(test/tests/outputs/debug/show_execution_userobjects.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1.5 2.4'
dy = '1.3 0.9'
ix = '3 2'
iy = '2 3'
subdomain_id = '0 1
1 0'
[]
[add_interface]
type = SideSetsBetweenSubdomainsGenerator
input = 'cmg'
primary_block = 0
paired_block = 1
new_boundary = 'interface'
[]
second_order = true
[]
[Functions]
[forcing_fnu]
type = ParsedFunction
expression = -5.8*(x+y)+x*x*x-x+y*y*y-y
[]
[forcing_fnv]
type = ParsedFunction
expression = -4
[]
[slnu]
type = ParsedGradFunction
expression = x*x*x-x+y*y*y-y
grad_x = 3*x*x-1
grad_y = 3*y*y-1
[]
[slnv]
type = ParsedGradFunction
expression = x*x+y*y
grad_x = 2*x
grad_y = 2*y
[]
# NeumannBC functions
[bc_fnut]
type = ParsedFunction
expression = 3*y*y-1
[]
[bc_fnub]
type = ParsedFunction
expression = -3*y*y+1
[]
[bc_fnul]
type = ParsedFunction
expression = -3*x*x+1
[]
[bc_fnur]
type = ParsedFunction
expression = 3*x*x-1
[]
[]
[Variables]
[u]
order = SECOND
family = HIERARCHIC
[]
[v]
order = SECOND
family = LAGRANGE
initial_condition = 1
[]
[]
[AuxVariables]
[v_elem]
order = CONSTANT
family = MONOMIAL
[]
[]
[Kernels]
active = 'diff1 diff2 test1 forceu forcev react'
[diff1]
type = Diffusion
variable = u
[]
[test1]
type = CoupledConvection
variable = u
velocity_vector = v
[]
[diff2]
type = Diffusion
variable = v
[]
[react]
type = Reaction
variable = u
[]
[forceu]
type = BodyForce
variable = u
function = forcing_fnu
[]
[forcev]
type = BodyForce
variable = v
function = forcing_fnv
[]
[]
[AuxKernels]
[set_v_elem]
type = FunctionAux
variable = v_elem
# selected not to be the solution for no particular reason
function = forcing_fnv
[]
[]
[BCs]
[bc_v]
type = FunctionDirichletBC
variable = v
function = slnv
boundary = 'left right top bottom'
[]
[bc_u_tb]
type = CoupledKernelGradBC
variable = u
var2 = v
vel = '0.1 0.1'
boundary = 'top bottom left right'
[]
[bc_ul]
type = FunctionNeumannBC
variable = u
function = bc_fnul
boundary = 'left'
[]
[bc_ur]
type = FunctionNeumannBC
variable = u
function = bc_fnur
boundary = 'right'
[]
[bc_ut]
type = FunctionNeumannBC
variable = u
function = bc_fnut
boundary = 'top'
[]
[bc_ub]
type = FunctionNeumannBC
variable = u
function = bc_fnub
boundary = 'bottom'
[]
[]
[Postprocessors]
# Global user objects
[dofs]
type = NumDOFs
[]
[h]
type = AverageElementSize
[]
# Elemental user objects
[L2u]
type = ElementL2Error
variable = u
function = slnu
# Testing an option
force_preic = true
[]
[L2v]
type = ElementL2Error
variable = v
function = slnv
# Testing an option
force_preaux = true
[]
[H1error]
type = ElementH1Error
variable = u
function = slnu
[]
[H1Semierror]
type = ElementH1SemiError
variable = u
function = slnu
[]
[L2v_elem]
type = ElementL2Error
variable = v_elem
function = slnv
[]
[f_integral]
type = FunctionElementIntegral
function = slnv
[]
[int_v]
type = ElementIntegralVariablePostprocessor
variable = v
block = 1
execute_on = 'TIMESTEP_END transfer'
[]
[int_v_elem]
type = ElementIntegralVariablePostprocessor
variable = v_elem
block = 1
execute_on = 'TIMESTEP_END transfer'
[]
# Side user objects
[integral_v]
type = SideIntegralVariablePostprocessor
variable = v
boundary = 0
[]
[]
[VectorPostprocessors]
# General UOs
[memory]
type = VectorMemoryUsage
[]
[line]
type = LineValueSampler
variable = v
num_points = 10
start_point = '0 0 0'
end_point = '0.5 0.5 0'
sort_by = 'x'
[]
# Nodal UOs
[nodal_sampler_y]
type = NodalValueSampler
variable = v
sort_by = 'y'
[]
[nodal_sampler_x]
type = NodalValueSampler
variable = v
sort_by = 'x'
[]
# Element UO
[elem_sample]
type = ElementValueSampler
variable = v_elem
sort_by = 'x'
[]
[]
[UserObjects]
# Nodal user objects
[find_node]
type = NearestNodeNumberUO
point = '0.5 0.5 0'
[]
# Side user objects
[side_int]
type = LayeredSideIntegral
variable = v
boundary = 0
direction = y
num_layers = 4
[]
[side_int_2]
type = NearestPointLayeredSideIntegral
variable = v
boundary = 0
direction = x
num_layers = 3
points = '1 1 0'
[]
# Interface user objects
[values]
type = InterfaceQpValueUserObject
var = v
boundary = interface
[]
inactive = 'prime_1 prime_2'
# Threaded general user objects
[prime_2]
type = PrimeProductUserObject
[]
[prime_1]
type = PrimeProductUserObject
[]
# Domain user objects
[domain_2]
type = InterfaceDomainUserObject
u = u
v = v
block = '0'
robin_boundaries = 'left'
interface_boundaries = 'interface'
interface_penalty = 1e-10
nl_abs_tol = 1e1
[]
[domain_1]
type = InterfaceDomainUserObject
u = u
v = v
block = '0 1'
robin_boundaries = 'left'
interface_boundaries = 'interface'
interface_penalty = 1e-10
nl_abs_tol = 1e1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
l_tol = 1e-5
[]
[Problem]
kernel_coverage_check = false
[]
[MultiApps]
active = ''
[full_solve]
type = FullSolveMultiApp
execute_on = 'initial timestep_end final'
input_files = show_execution_userobjects.i
cli_args = 'Problem/solve=false'
[]
[]
[Transfers]
active = ''
[conservative]
type = MultiAppNearestNodeTransfer
from_multi_app = full_solve
source_variable = v
variable = v_elem
from_postprocessors_to_be_preserved = int_v
to_postprocessors_to_be_preserved = int_v_elem
[]
[]
[Debug]
show_execution_order = 'ALWAYS INITIAL NONLINEAR LINEAR TIMESTEP_BEGIN TIMESTEP_END FINAL'
[]
(test/tests/multiapps/picard/pseudo_transient_picard_parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
parallel_type = replicated
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[v]
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[force_u]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[unorm]
type = ElementL2Norm
variable = u
execute_on = 'initial timestep_end'
[]
[vnorm]
type = ElementL2Norm
variable = v
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
fixed_point_rel_tol = 1e-6
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = pseudo_transient_picard_sub.i
no_backup_and_restore = true
[]
[]
[Transfers]
[v_from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = v
variable = v
[]
[u_to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = u
variable = u
[]
[]
(test/tests/transfers/coord_transform/both-transformed/mesh-function/main-app.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = -1
ymax = 0
nx = 10
ny = 10
alpha_rotation = 90
[]
[Variables]
[u][]
[]
[AuxVariables]
[v][]
[v_elem]
order = CONSTANT
family = MONOMIAL
[]
[w][]
[w_elem]
order = CONSTANT
family = MONOMIAL
[]
[]
[ICs]
[w]
type = FunctionIC
function = 'cos(x)*sin(y)'
variable = w
[]
[w_elem]
type = FunctionIC
function = 'cos(x)*sin(y)'
variable = w_elem
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[force]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
verbose = true
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = 'sub-app.i'
execute_on = 'timestep_begin'
[]
[]
[Transfers]
[from_sub]
type = MultiAppShapeEvaluationTransfer
from_multi_app = sub
source_variable = v
variable = v
execute_on = 'timestep_begin'
error_on_miss = true
# extend the bounding box slightly since a transformed node
# may miss the bounding box by machine precision
bbox_factor = 1.1
[]
[from_sub_elem]
type = MultiAppShapeEvaluationTransfer
from_multi_app = sub
source_variable = v_elem
variable = v_elem
execute_on = 'timestep_begin'
error_on_miss = true
[]
[to_sub]
type = MultiAppShapeEvaluationTransfer
to_multi_app = sub
source_variable = w
variable = w
execute_on = 'timestep_begin'
error_on_miss = true
# extend the bounding box slightly since a transformed node
# may miss the bounding box by machine precision
bbox_factor = 1.1
[]
[to_sub_elem]
type = MultiAppShapeEvaluationTransfer
to_multi_app = sub
source_variable = w_elem
variable = w_elem
execute_on = 'timestep_begin'
error_on_miss = true
[]
[]
(test/tests/controls/restrict_exec_flag/exec_flag_error.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Steady
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
positions = '0 0 0'
input_files = sub.i
[]
[]
[Controls]
[test]
type = TestControl
test_type = 'execflag_error'
[]
[]
(test/tests/transfers/multiapp_conservative_transfer/parent_power_density.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmax = 1
ymax = 1
nx = 10
ny = 10
[]
[block1]
input = gen
type = SubdomainBoundingBoxGenerator
block_id = 1
bottom_left = '0.5 0 0'
top_right = '1 1 0'
[]
[]
[Variables]
[power_density]
[]
[]
[Functions]
[pwr_func]
type = ParsedFunction
expression = '1e3*x*(1-x)+5e2'
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = power_density
[]
[coupledforce]
type = BodyForce
variable = power_density
function = pwr_func
[]
[]
[BCs]
[left]
type = DirichletBC
variable = power_density
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = power_density
boundary = right
value = 1e3
[]
[]
[AuxVariables]
[from_sub]
[]
[]
[Postprocessors]
[pwr0]
type = ElementIntegralVariablePostprocessor
block = 0
variable = power_density
[]
[pwr1]
type = ElementIntegralVariablePostprocessor
block = 1
variable = power_density
[]
[from_sub0]
type = ElementIntegralVariablePostprocessor
block = 0
variable = from_sub
execute_on = 'transfer'
[]
[from_sub1]
type = ElementIntegralVariablePostprocessor
block = 1
variable = from_sub
execute_on = 'transfer'
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = sub_power_density.i
positions = '0 0 0 0.5 0 0'
execute_on = timestep_end
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
source_variable = power_density
variable = from_parent
to_multi_app = sub
execute_on = timestep_end
# The following inputs specify what postprocessors should be conserved
# N pps are specified on the parent side, where N is the number of subapps
# 1 pp is specified on the subapp side
from_postprocessors_to_be_preserved = 'pwr0 pwr1'
to_postprocessors_to_be_preserved = 'from_parent_pp'
[]
[from_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
source_variable = sink
variable = from_sub
from_multi_app = sub
execute_on = timestep_end
# The following inputs specify what postprocessors should be conserved
# N pps are specified on the parent side, where N is the number of subapps
# 1 pp is specified on the subapp side
to_postprocessors_to_be_preserved = 'from_sub0 from_sub1'
from_postprocessors_to_be_preserved = 'sink'
[]
[]
[Outputs]
exodus = true
[]
(modules/optimization/test/tests/optimizationreporter/point_loads/main_auto_adjoint.i)
[Optimization]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'parameter_results'
num_values = '3'
measurement_points = '0.5 0.28 0
0.5 0.6 0
0.5 0.8 0
0.5 1.1 0'
measurement_values = '293 304 315 320'
[]
[Executioner]
type = Optimize
tao_solver = taolmvm
petsc_options_iname='-tao_gttol -tao_ls_type'
petsc_options_value='1e-5 unit'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward_and_adjoint.i
execute_on = "FORWARD"
[]
[]
[Transfers]
# FORWARD transfers
[toForward_measument]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/parameter_results'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
point_source/value'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values
gradient/temperature_adjoint'
to_reporters = 'OptimizationReporter/simulation_values
OptimizationReporter/grad_parameter_results'
[]
[]
[Outputs]
csv = true
[]
(test/tests/transfers/general_field/nearest_node/regular/main_array.i)
# Base input for testing transfers. It has the following complexities:
# - more than one subapp
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[AuxVariables]
[from_sub]
initial_condition = '-1 -1'
components = 2
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = '-1 -1'
components = 2
[]
[to_sub]
components = 2
[InitialCondition]
type = ArrayFunctionIC
function = '1+2*x*x+3*y*y*y 1.5+2*x*x+3*y*y*y'
[]
[]
[to_sub_elem]
components = 2
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = ArrayFunctionIC
function = '2+2*x*x+3*y*y*y 3+2*x*x+3*y*y*y'
[]
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
[out]
type = Exodus
hide = 'to_sub to_sub_elem'
overwrite = true
[]
[]
[MultiApps]
[sub]
# 1 on corner, one in the center and one close to a corner
# The offsets are to avoid equidistant points
positions = '0.000001 0 0 0.4111 0.4112 0 0.6999 0.099 0'
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = sub_array.i
output_in_position = true
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = 'to_sub to_sub'
source_variable_components = '1 0'
variable = 'from_main from_main'
target_variable_components = '0 1'
source_type = 'nodes nodes'
[]
[to_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = 'to_sub_elem to_sub_elem'
source_variable_components = '1 0'
variable = 'from_main_elem from_main_elem'
target_variable_components = '0 1'
source_type = 'centroids centroids'
[]
[from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = 'to_main to_main'
source_variable_components = '1 0'
variable = 'from_sub from_sub'
target_variable_components = '0 1'
source_type = 'nodes nodes'
[]
[from_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = 'to_main_elem to_main_elem'
source_variable_components = '1 0'
variable = 'from_sub_elem from_sub_elem'
target_variable_components = '0 1'
source_type = 'centroids centroids'
[]
[]
(test/tests/multiapps/initial_failure/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./td]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 4
dt = 0.1
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
execute_on = initial
input_files = sub.i
[../]
[]
(modules/optimization/test/tests/optimizationreporter/general_opt/function_optimization/main.i)
[Optimization]
[]
[OptimizationReporter]
type = GeneralOptimization
parameter_names = 'vals'
num_values = '2'
objective_name = obj_value
[]
[Problem]
solve = false
[]
[Executioner]
type = Optimize
tao_solver = taobqnktr
petsc_options_iname = '-tao_gatol'
petsc_options_value = '1e-8 '
verbose = true
output_optimization_iterations = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = FORWARD
[]
[]
[Transfers]
[toForward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/vals'
to_reporters = 'vals/vals'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'obj_pp/value
grad_f/grad_f'
to_reporters = 'OptimizationReporter/obj_value
OptimizationReporter/grad_vals'
[]
[]
[Outputs]
[json]
type = JSON
execute_system_information_on = none
[]
[json_forward]
type = JSON
execute_on = 'FORWARD '
execute_system_information_on = none
[]
[]
(test/tests/transfers/multiapp_high_order_variable_transfer/parent_L2_Lagrange_conservative.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
[]
[Variables]
[power_density]
family = L2_LAGRANGE
order = FIRST
[]
[]
[Functions]
[pwr_func]
type = ParsedFunction
expression = '1e3*x*(1-x)+5e2'
[]
[]
[Kernels]
[diff]
type = Reaction
variable = power_density
[]
[coupledforce]
type = BodyForce
variable = power_density
function = pwr_func
[]
[]
[Postprocessors]
[pwr_avg]
type = ElementAverageValue
block = '0'
variable = power_density
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
petsc_options_value = 'hypre boomeramg 100'
nl_abs_tol = 1e-8
nl_rel_tol = 1e-12
[]
[Postprocessors]
[./from_postprocessor]
type = ElementIntegralVariablePostprocessor
variable = power_density
[../]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = sub_L2_Lagrange_conservative.i
execute_on = 'timestep_end'
[]
[]
[Transfers]
[p_to_sub]
type = MultiAppShapeEvaluationTransfer
source_variable = power_density
variable = power_density
to_multi_app = sub
execute_on = 'timestep_end'
from_postprocessors_to_be_preserved = 'from_postprocessor'
to_postprocessors_to_be_preserved = 'pwr_density'
[]
[]
[Outputs]
exodus = true
perf_graph = true
[]
(test/tests/transfers/multiapp_copy_transfer/array_variable_transfer/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
# Array variable with two components
[v]
order = FIRST
family = LAGRANGE
components = 2
[]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = initial
[../]
[]
[Transfers]
# Transfers all components together on the same mesh.
[./from_sub]
type = MultiAppCopyTransfer
source_variable = u
variable = v
from_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/coord_transform/main-app.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 1
xmax = 3
nx = 20
ny = 10
[]
[Variables]
[u][]
[]
[AuxVariables]
[v][]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[force]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '1 0 0'
input_files = 'sub-app.i'
execute_on = 'timestep_begin'
[]
[]
[Transfers]
[from_sub]
type = MultiAppNearestNodeTransfer
from_multi_app = sub
source_variable = v
variable = v
execute_on = 'timestep_begin'
[]
[]
(test/tests/transfers/coord_transform/transform-main-main-app.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 1
xmax = 3
nx = 20
ny = 10
length_unit = '5*m'
alpha_rotation = 90
[]
[Variables]
[u][]
[]
[AuxVariables]
[v][]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[force]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 5 0'
input_files = 'transform-main-sub-app.i'
execute_on = 'timestep_begin'
[]
[]
[Transfers]
[from_sub]
type = MultiAppNearestNodeTransfer
from_multi_app = sub
source_variable = v
variable = v
execute_on = 'timestep_begin'
[]
[]
(test/tests/multiapps/steffensen/steady_main.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
parallel_type = replicated
uniform_refine = 1
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[v]
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[force_u]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[unorm]
type = ElementL2Norm
variable = u
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
nl_abs_tol = 1e-14
fixed_point_algorithm = 'steffensen'
fixed_point_max_its = 30
transformed_variables = 'u'
accept_on_max_fixed_point_iteration = true
[]
[Outputs]
csv = true
exodus = false
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = 'steady_sub.i'
clone_parent_mesh = true
transformed_variables = 'v'
[]
[]
[Transfers]
[v_from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = v
variable = v
[]
[u_to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = u
variable = u
[]
[]
(modules/combined/test/tests/optimization/invOpt_mechanics/main.i)
[Optimization]
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 2
xmin = 0.0
xmax = 5.0
ymin = 0.0
ymax = 1.0
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'fy_right'
num_values = '1'
measurement_points = '5.0 1.0 0.0'
measurement_values = '80.9'
initial_condition = '100'
[]
[Executioner]
type = Optimize
tao_solver = taonls
petsc_options_iname = '-tao_gttol -tao_max_it -tao_nls_pc_type -tao_nls_ksp_type'
petsc_options_value = '1e-5 50 none cg'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = "FORWARD"
clone_parent_mesh = true
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint.i
execute_on = "ADJOINT"
clone_parent_mesh = true
[]
# the forward problem has homogeneous boundary conditions so it can be reused here.
[homogeneousForward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = "HOMOGENEOUS_FORWARD"
clone_parent_mesh = true
[]
[]
[Transfers]
[toForward_measument]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/fy_right'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
params/right_fy_value'
[]
[fromforward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[toAdjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/fy_right'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
params/right_fy_value'
[]
[fromAdjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'adjoint_pt/inner_product'
to_reporters = 'OptimizationReporter/grad_fy_right'
[]
[toHomogeneousForward_measument]
type = MultiAppReporterTransfer
to_multi_app = homogeneousForward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/fy_right'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
params/right_fy_value'
[]
[fromHomogeneousForward]
type = MultiAppReporterTransfer
from_multi_app = homogeneousForward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[]
[Reporters]
[optInfo]
type = OptimizationInfo
[]
[]
[Outputs]
csv = true
[]
(test/tests/transfers/multiapp_copy_transfer/second_lagrange_to_sub/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
elem_type = QUAD9
[]
[Variables]
[./u]
family = LAGRANGE
order = SECOND
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = timestep_end
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
source_variable = u
variable = u
to_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/general_field/user_object/nearest_position/main.i)
# Base input for testing transfers. It has the following complexities:
# - more than one subapp
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[AuxVariables]
[from_sub]
initial_condition = -1
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[to_sub]
[InitialCondition]
type = FunctionIC
function = '1 + 2*x*x + 3*y*y*y'
[]
[]
[to_sub_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '2 + 2*x*x + 3*y*y*y'
[]
[]
[]
[UserObjects]
[to_sub]
type = LayeredAverage
direction = x
num_layers = 10
variable = to_sub
execute_on = TIMESTEP_BEGIN
[]
[to_sub_elem]
type = LayeredAverage
direction = x
num_layers = 10
variable = to_sub_elem
execute_on = TIMESTEP_BEGIN
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
verbose_multiapps = true
[]
[Outputs]
[out]
type = Exodus
hide = 'to_sub to_sub_elem'
overwrite = true
[]
[]
[Positions]
[input]
type = InputPositions
positions = '1e-6 0 0 0.4 0.4001 0 0.700001 0.1 0'
[]
[]
[MultiApps]
[sub]
# 1 on corner, one in the center and one close to a corner
type = FullSolveMultiApp
positions_objects = input
app_type = MooseTestApp
input_files = sub.i
output_in_position = true
execute_on = TIMESTEP_END
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldUserObjectTransfer
to_multi_app = sub
source_user_object = to_sub
variable = from_main
[]
[to_sub_elem]
type = MultiAppGeneralFieldUserObjectTransfer
to_multi_app = sub
source_user_object = to_sub_elem
variable = from_main_elem
[]
[from_sub]
type = MultiAppGeneralFieldUserObjectTransfer
from_multi_app = sub
source_user_object = to_main
variable = from_sub
use_nearest_app = true
bbox_factor = 100
[]
[from_sub_elem]
type = MultiAppGeneralFieldUserObjectTransfer
from_multi_app = sub
source_user_object = to_main_elem
variable = from_sub_elem
use_nearest_app = true
bbox_factor = 100
[]
[]
(modules/combined/test/tests/optimization/invOpt_multiExperiment/main.i)
[Optimization]
[]
[OptimizationReporter]
type = GeneralOptimization
parameter_names = 'vals'
num_values = '2'
objective_name = obj_value
[]
[Executioner]
type = Optimize
tao_solver = taobqnktr
petsc_options_iname = '-tao_gatol'
petsc_options_value = '1e-8 '
verbose = true
[]
[MultiApps]
[forward_sampler]
type = FullSolveMultiApp
input_files = sampler_subapp.i
execute_on = FORWARD
[]
[]
[Transfers]
[toForward]
type = MultiAppReporterTransfer
to_multi_app = forward_sampler
from_reporters = 'OptimizationReporter/vals'
to_reporters = 'controllable_params/vals'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward_sampler
from_reporters = 'obj_sum/value
grad_sum/row_sum'
to_reporters = 'OptimizationReporter/obj_value
OptimizationReporter/grad_vals'
[]
[]
[Outputs]
csv = true
[]
(modules/optimization/examples/simpleTransient/main_auto_adjoint.i)
[Optimization]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'source'
num_values = '44'
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward_and_adjoint.i
execute_on = FORWARD
[]
[]
[Transfers]
[to_forward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/source'
to_reporters = 'src_values/values'
[]
[from_forward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measured_data/misfit_values measured_data/simulation_values adjoint/inner_product'
to_reporters = 'OptimizationReporter/misfit_values OptimizationReporter/simulation_values OptimizationReporter/grad_source'
[]
[]
[Executioner]
type = Optimize
solve_on = none
tao_solver = taolmvm
petsc_options_iname = '-tao_gatol -tao_ls_type'
petsc_options_value = '1e-2 unit'
verbose = true
[]
(test/tests/transfers/coord_transform/both-transformed/user_object/main-app.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = -1
ymax = 0
nx = 10
ny = 10
# Quarter turn around Z axis
alpha_rotation = -90
# Flips around Y axis
# beta_rotation = -180
[]
[Variables]
[u][]
[]
[AuxVariables]
[from_sub_app_var][]
[from_sub_app_var_elem]
order = CONSTANT
family = MONOMIAL
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[force]
type = CoupledForce
variable = u
v = from_sub_app_var
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
verbose = true
[]
[Outputs]
exodus = true
[]
[UserObjects]
[main_uo]
type = LayeredAverage
direction = x
num_layers = 5
variable = u
[]
[]
[MultiApps]
[sub_app]
# Shift is offset by sub-app mesh + rotations
# positions = '1 0 0.0'
type = FullSolveMultiApp
input_files = sub-app.i
app_type = MooseTestApp
bounding_box_padding = '0.25 0.25 0'
bounding_box_inflation = 0
use_displaced_mesh = true
execute_on = TIMESTEP_END
[]
[]
[Transfers]
[layered_transfer_to_sub_app]
type = MultiAppUserObjectTransfer
user_object = main_uo
variable = sub_app_var
to_multi_app = sub_app
displaced_target_mesh = true
[]
[layered_transfer_to_sub_app_elem]
type = MultiAppUserObjectTransfer
user_object = main_uo
variable = sub_app_var_elem
to_multi_app = sub_app
displaced_target_mesh = true
[]
[layered_transfer_from_sub_app]
type = MultiAppUserObjectTransfer
user_object = sub_app_uo
variable = from_sub_app_var
from_multi_app = sub_app
# displaced_source_mesh = true
[]
[layered_transfer_from_sub_app_elem]
type = MultiAppUserObjectTransfer
user_object = sub_app_uo
variable = from_sub_app_var_elem
from_multi_app = sub_app
# displaced_source_mesh = true
[]
[]
(test/tests/transfers/coord_transform/both-transformed/interpolation/main-app.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = -1
ymax = 0
nx = 10
ny = 10
alpha_rotation = 90
[]
[Variables]
[u][]
[]
[AuxVariables]
[v][]
[v_elem]
order = CONSTANT
family = MONOMIAL
[]
[w][]
[w_elem]
order = CONSTANT
family = MONOMIAL
[]
[]
[ICs]
[w]
type = FunctionIC
function = 'cos(x)*sin(y)'
variable = w
[]
[w_elem]
type = FunctionIC
function = 'cos(x)*sin(y)'
variable = w_elem
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[force]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
verbose = true
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = 'sub-app.i'
execute_on = 'timestep_begin'
[]
[]
[Transfers]
[from_sub]
type = MultiAppGeometricInterpolationTransfer
from_multi_app = sub
source_variable = v
variable = v
execute_on = 'timestep_begin'
[]
[from_sub_elem]
type = MultiAppGeometricInterpolationTransfer
from_multi_app = sub
source_variable = v_elem
variable = v_elem
execute_on = 'timestep_begin'
[]
[to_sub]
type = MultiAppGeometricInterpolationTransfer
to_multi_app = sub
source_variable = w
variable = w
execute_on = 'timestep_begin'
[]
[to_sub_elem]
type = MultiAppGeometricInterpolationTransfer
to_multi_app = sub
source_variable = w_elem
variable = w_elem
execute_on = 'timestep_begin'
[]
[]
(test/tests/positions/creating_multiapps/apps_from_positions.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dx = 1
dim = 1
[]
[]
[AuxVariables]
[u]
[]
[]
[Positions]
[input]
type = InputPositions
positions = '0 1 0
1 0 2'
outputs = none
[]
[file]
type = FilePositions
files = '../../multiapps/positions_from_file/positions.txt'
outputs = none
[]
[reporter_forward]
type = ReporterPositions
reporters = 'file/positions_1d'
outputs = none
[]
[mesh]
type = ElementCentroidPositions
outputs = none
[]
[results_m1]
type = MultiAppPositions
multiapps = 'm1'
[]
[results_m2]
type = MultiAppPositions
multiapps = 'm2'
[]
[results_m3]
type = MultiAppPositions
multiapps = 'm3'
[]
[results_m4]
type = MultiAppPositions
multiapps = 'm4'
[]
[]
[MultiApps]
[m1]
type = FullSolveMultiApp
input_files = 'apps_from_positions.i'
cli_args = "MultiApps/active='';Positions/active='';Outputs/active=''"
positions_objects = input
[]
[m2]
type = FullSolveMultiApp
input_files = 'apps_from_positions.i'
cli_args = "MultiApps/active='';Positions/active='';Outputs/active=''"
positions_objects = 'input file'
[]
# Those Positions are executed too late
[m3]
type = TransientMultiApp
input_files = 'apps_from_positions.i'
cli_args = "MultiApps/active='';Positions/active='';Outputs/active=''"
positions_objects = reporter_forward
[]
[m4]
type = TransientMultiApp
input_files = 'apps_from_positions.i'
cli_args = "MultiApps/active='';Positions/active='';Outputs/active=''"
positions_objects = mesh
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
[out]
type = JSON
execute_on = FINAL
execute_system_information_on = none
[]
[]
(test/tests/transfers/general_field/user_object/regular/main.i)
# Base input for testing transfers. It has the following complexities:
# - more than one subapp
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[AuxVariables]
[from_sub]
initial_condition = -1
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[to_sub]
[InitialCondition]
type = FunctionIC
function = '1 + 2*x*x + 3*y*y*y'
[]
[]
[to_sub_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '2 + 2*x*x + 3*y*y*y'
[]
[]
[]
[UserObjects]
[to_sub]
type = LayeredAverage
direction = x
num_layers = 10
variable = to_sub
[]
[to_sub_elem]
type = LayeredAverage
direction = x
num_layers = 10
variable = to_sub_elem
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
[out]
type = Exodus
hide = 'to_sub to_sub_elem'
overwrite = true
[]
[]
[MultiApps]
[sub]
# 1 on corner, one in the center and one close to a corner
positions = '0 0 0 0.4 0.4 0 0.7 0.1 0'
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = sub.i
output_in_position = true
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldUserObjectTransfer
to_multi_app = sub
source_user_object = to_sub
variable = from_main
extrapolation_constant = -1
[]
[to_sub_elem]
type = MultiAppGeneralFieldUserObjectTransfer
to_multi_app = sub
source_user_object = to_sub_elem
variable = from_main_elem
extrapolation_constant = -1
[]
[from_sub]
type = MultiAppGeneralFieldUserObjectTransfer
from_multi_app = sub
source_user_object = to_main
variable = from_sub
extrapolation_constant = -1
[]
[from_sub_elem]
type = MultiAppGeneralFieldUserObjectTransfer
from_multi_app = sub
source_user_object = to_main_elem
variable = from_sub_elem
extrapolation_constant = -1
[]
[]
(test/tests/multiapps/picard/picard_custom_postprocessor.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
parallel_type = replicated
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[v]
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[force_u]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[unorm_begin]
type = ElementL2Norm
variable = u
execute_on = 'initial timestep_begin'
outputs = none
[]
[unorm]
type = ElementL2Norm
variable = u
execute_on = 'initial timestep_end'
[]
[unorm_err]
type = RelativeDifferencePostprocessor
value1 = unorm
value2 = unorm_begin
outputs = none
[]
[vnorm]
type = ElementL2Norm
variable = v
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
disable_fixed_point_residual_norm_check = true
custom_pp = unorm_err
nl_abs_tol = 1e-14
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = steady_picard_sub.i
no_backup_and_restore = true
[]
[]
[Transfers]
[v_from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = v
variable = v
[]
[u_to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = u
variable = u
[]
[]
(modules/optimization/test/tests/optimizationreporter/mesh_source/main.i)
[Optimization]
[]
[OptimizationReporter]
type = ParameterMeshOptimization
parameter_names = 'source'
parameter_meshes ='parameter_mesh_in.e'
# Random points
measurement_points = '0.78193073 0.39115321 0
0.72531893 0.14319403 0
0.14052488 0.86976625 0
0.401893 0.54241797 0
0.02645427 0.43320192 0
0.28856889 0.0035165 0
0.51433644 0.94485949 0
0.29252255 0.7962032 0
0.04925654 0.58018889 0
0.04717357 0.9556314 0'
# sin(x*pi/2)*sin(y*pi/2)
measurement_values = '0.54299466 0.20259611 0.21438235 0.44418597 0.02613676
0.00241892 0.72014019 0.42096307 0.06108895 0.07385256'
[]
[Executioner]
type = Optimize
tao_solver = taolmvm
petsc_options_iname = '-tao_gatol'
petsc_options_value = '1e-4'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = FORWARD
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint.i
execute_on = ADJOINT
[]
[]
[Transfers]
[toForward_measument]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/source'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
src_rep/vals'
[]
[toAdjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/source'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
src_rep/vals'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[fromadjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'gradient_vpp/inner_product'
to_reporters = 'OptimizationReporter/grad_source'
[]
[]
(test/tests/multiapps/secant_postprocessor/steady_main.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
parallel_type = replicated
uniform_refine = 1
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[source]
type = BodyForce
variable = u
value = 1
[]
[]
[BCs]
[left]
type = PostprocessorDirichletBC
variable = u
boundary = left
postprocessor = 'from_sub'
[]
[]
[Postprocessors]
[from_sub]
type = Receiver
default = 0
[]
[to_sub]
type = SideAverageValue
variable = u
boundary = right
[]
[average]
type = ElementAverageValue
variable = u
[]
[]
[Executioner]
type = Steady
# Solve parameters
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
nl_abs_tol = 1e-14
# App coupling parameters
fixed_point_algorithm = 'secant'
fixed_point_max_its = 100
transformed_postprocessors = 'from_sub'
[]
[Outputs]
csv = true
exodus = false
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = steady_sub.i
clone_parent_mesh = true
execute_on = 'timestep_begin'
# we keep the full postprocessor output history of the subapp
keep_full_output_history = true
transformed_postprocessors = 'from_main'
[]
[]
[Transfers]
[left_from_sub]
type = MultiAppPostprocessorTransfer
from_multi_app = sub
from_postprocessor = 'to_main'
to_postprocessor = 'from_sub'
reduction_type = 'average'
[]
[right_to_sub]
type = MultiAppPostprocessorTransfer
to_multi_app = sub
from_postprocessor = 'to_sub'
to_postprocessor = 'from_main'
[]
[]
(modules/stochastic_tools/test/tests/multiapps/commandline_control/parent_wrong_multiapp_type.i)
[StochasticTools]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
positions = '0 0 0
1 1 1'
input_files = 'sub.i'
[]
[]
[Distributions]
[uniform]
type = Uniform
lower_bound = 5
upper_bound = 10
[]
[]
[Samplers]
[sample]
type = MonteCarlo
num_rows = 2
distributions = 'uniform'
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
sampler = sample
param_names = 'Mesh/nx'
[]
[]
(test/tests/transfers/general_field/shape_evaluation/regular/main_array.i)
# Base input for testing transfers. It has the following complexities:
# - more than one subapp
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[AuxVariables]
[from_sub]
initial_condition = '-1 -1'
components = 2
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = '-1 -1'
components = 2
[]
[to_sub]
components = 2
[InitialCondition]
type = ArrayFunctionIC
function = '1+2*x*x+3*y*y*y 1.5+2*x*x+3*y*y*y'
[]
[]
[to_sub_elem]
components = 2
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = ArrayFunctionIC
function = '2+2*x*x+3*y*y*y 3+2*x*x+3*y*y*y'
[]
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
[out]
type = Exodus
hide = 'to_sub to_sub_elem'
overwrite = true
[]
[]
[MultiApps]
[sub]
# 1 on corner, one in the center and one close to a corner
positions = '0 0 0 0.4 0.4 0 0.7 0.1 0'
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = sub_array.i
output_in_position = true
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
to_multi_app = sub
source_variable = 'to_sub to_sub'
source_variable_components = '1 0'
variable = 'from_main from_main'
target_variable_components = '0 1'
extrapolation_constant = -1
[]
[to_sub_elem]
type = MultiAppGeneralFieldShapeEvaluationTransfer
to_multi_app = sub
source_variable = 'to_sub_elem to_sub_elem'
source_variable_components = '1 0'
variable = 'from_main_elem from_main_elem'
target_variable_components = '0 1'
extrapolation_constant = -1
[]
[from_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
from_multi_app = sub
source_variable = 'to_main to_main'
source_variable_components = '1 0'
variable = 'from_sub from_sub'
target_variable_components = '0 1'
extrapolation_constant = -1
[]
[from_sub_elem]
type = MultiAppGeneralFieldShapeEvaluationTransfer
from_multi_app = sub
source_variable = 'to_main_elem to_main_elem'
source_variable_components = '1 0'
variable = 'from_sub_elem from_sub_elem'
target_variable_components = '0 1'
extrapolation_constant = -1
[]
[]
(modules/stochastic_tools/test/tests/multiapps/nested_multiapp/sub.i)
[Mesh/gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmax = 1
[]
[Variables/u]
[]
[Kernels/diff]
type = Diffusion
variable = u
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 10
[]
[]
[Postprocessors/val]
type = PointValue
variable = u
point = '0 0 0'
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Reporters/receive]
type = ConstantReporter
real_names = 'subsub0_left_val subsub1_left_val subsub0_right_val subsub1_right_val'
real_values = '0 0 0 0'
[]
[MultiApps/subsub]
type = FullSolveMultiApp
input_files = 'subsub.i'
positions = '0 0 0 1 0 0'
execute_on = timestep_begin
[]
[Transfers]
[subsub0]
type = MultiAppReporterTransfer
from_multi_app = subsub
from_reporters = 'lval/value rval/value'
to_reporters = 'receive/subsub0_left_val receive/subsub0_right_val'
subapp_index = 0
[]
[subsub1]
type = MultiAppReporterTransfer
from_multi_app = subsub
from_reporters = 'lval/value rval/value'
to_reporters = 'receive/subsub1_left_val receive/subsub1_right_val'
subapp_index = 1
[]
[]
[Controls/stm]
type = SamplerReceiver
[]
(test/tests/multiapps/full_solve_multiapp_reset/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[]
[Problem]
kernel_coverage_check = false
solve = false
[]
[Executioner]
type = Transient
num_steps = 2
[]
[MultiApps]
[full_solve]
type = FullSolveMultiApp
execute_on = initial
positions = '0 0 0'
input_files = sub.i
reset_apps = '0'
reset_time = 1
[../]
[]
(modules/stochastic_tools/test/tests/multiapps/nested_multiapp/main.i)
[Mesh/gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmax = 1
[]
[Variables/u]
[]
[Kernels/diff]
type = Diffusion
variable = u
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 10
[]
[]
[Postprocessors/val]
type = PointValue
variable = u
point = '0 0 0'
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Reporters/receive]
type = ConstantReporter
real_names = 'sub_val subsub0_left_val subsub1_left_val subsub0_right_val subsub1_right_val'
real_values = '0 0 0 0 0'
[]
[MultiApps/sub]
type = FullSolveMultiApp
input_files = 'sub.i'
execute_on = timestep_begin
[]
[Transfers/sub]
type = MultiAppReporterTransfer
from_multi_app = sub
from_reporters = 'val/value receive/subsub0_left_val receive/subsub0_right_val receive/subsub1_left_val receive/subsub1_right_val'
to_reporters = 'receive/sub_val receive/subsub0_left_val receive/subsub0_right_val receive/subsub1_left_val receive/subsub1_right_val'
[]
[Controls/stm]
type = SamplerReceiver
[]
(test/tests/multiapps/command_line/parent.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Steady
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
positions = '0 0 0
1 1 1'
input_files = 'sub.i'
cli_args = 'Mesh/mesh/type=GeneratedMeshGenerator;Mesh/mesh/dim=1;Mesh/mesh/nx=10
Mesh/mesh/type=GeneratedMeshGenerator;Mesh/mesh/dim=1;Mesh/mesh/nx=100'
[]
[]
(test/tests/transfers/from_full_solve/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
# This test currently diffs when run in parallel with DistributedMesh enabled,
# most likely due to the fact that CONSTANT MONOMIALS are currently not written
# out correctly in this case. For more information, see #2122.
parallel_type = replicated
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[from_full]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[MultiApps]
[full_solve]
type = FullSolveMultiApp
app_type = MooseTestApp
execute_on = initial
positions = '0 0 0'
input_files = sub.i
[]
[]
[Transfers]
[from_full]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = full_solve
source_variable = u
variable = from_full
[]
[]
(test/tests/outputs/perf_graph/multi_app/parent_full.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
perf_graph = true
[]
[MultiApps]
[./full_solve]
type = FullSolveMultiApp
execute_on = initial
positions = '0 0 0'
input_files = sub_full.i
[../]
[]
(test/tests/transfers/general_field/shape_evaluation/mesh_division/main.i)
# Base input for testing transfers. It has the following complexities:
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[MeshDivisions]
[middle]
type = CartesianGridDivision
bottom_left = '0.01 0.01 0'
top_right = '0.81 0.81 0'
nx = 4
ny = 4
nz = 1
[]
[]
[AuxVariables]
[from_sub]
initial_condition = -1
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[to_sub]
[InitialCondition]
type = FunctionIC
function = '1 + 2*x*x + 3*y*y*y'
[]
[]
[to_sub_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '2 + 2*x*x + 3*y*y*y'
[]
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
[out]
type = Exodus
hide = 'to_sub to_sub_elem div'
overwrite = true
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = sub.i
output_in_position = true
# we want to avoid sampling on a boundary
positions = '0.00001 0.0001 0'
cli_args = 'base_value=1'
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
to_multi_app = sub
source_variable = to_sub
variable = from_main
[]
[to_sub_elem]
type = MultiAppGeneralFieldShapeEvaluationTransfer
to_multi_app = sub
source_variable = to_sub_elem
variable = from_main_elem
[]
[from_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
from_multi_app = sub
source_variable = to_main
variable = from_sub
[]
[from_sub_elem]
type = MultiAppGeneralFieldShapeEvaluationTransfer
from_multi_app = sub
source_variable = to_main_elem
variable = from_sub_elem
[]
[]
# For debugging purposes
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'middle'
[]
[]
(test/tests/transfers/multiapp_copy_transfer/second_lagrange_from_sub/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
elem_type = QUAD8
[]
[Variables]
[./u]
family = LAGRANGE
order = SECOND
[../]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = initial
[../]
[]
[Transfers]
[./from_sub]
type = MultiAppCopyTransfer
source_variable = u
variable = u
from_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(modules/optimization/test/tests/userobjects/adjoint_solution/adjoint.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = INITIAL
[]
[]
[AuxVariables/u_reverse]
[]
[UserObjects]
[u_reverse_solution]
type = AdjointSolutionUserObject
mesh = forward_out.e
system_variables = 'u'
reverse_time_end = 10
[]
[terminate]
type = Terminator
expression = 'u_reverse_test > 1e-12'
error_level = ERROR
[]
[]
[AuxKernels]
[u_reverse_aux]
type = SolutionAux
variable = u_reverse
solution = u_reverse_solution
[]
[]
[Functions]
[u_reverse_fun]
type = ParsedFunction
expression = '(x + y) * (11 - t)'
[]
[]
[Postprocessors]
[u_reverse_test]
type = ElementL2Error
variable = u_reverse
function = u_reverse_fun
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
dt = 1
end_time = 10
[]
(modules/optimization/test/tests/executioners/constrained/shape_optimization/main.i)
[Optimization]
[]
[OptimizationReporter]
type = GeneralOptimization
parameter_names = 'radii'
num_values_name = num_radii
equality_names = 'volume_constraint'
initial_condition = '0 0'
lower_bounds = '-10'
upper_bounds = '10'
objective_name = max_temp
[]
[Executioner]
type = Optimize
tao_solver = taoalmm
petsc_options_iname = '-tao_almm_subsolver_tao_type -tao_gatol -tao_catol -tao_almm_type -tao_almm_mu_init -tao_fd_gradient -tao_fd_delta'
petsc_options_value = 'bqnktr 1e-3 1e-3 phr 1e9 true 1e-8 '
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
# Run on initial so the forward problem can determine number of parameters
execute_on = 'INITIAL FORWARD'
[]
[]
[Transfers]
[to_forward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/radii'
to_reporters = 'params/radii'
execute_on = FORWARD
[]
[from_forward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'params/num_params
objective/value
vol_constraint/vol_constraint
eq_grad/eq_grad'
to_reporters = 'OptimizationReporter/num_radii
OptimizationReporter/max_temp
OptimizationReporter/volume_constraint
OptimizationReporter/grad_volume_constraint'
[]
[]
[Outputs]
csv = true
print_linear_residuals = false
print_nonlinear_residuals = false
[]
(modules/optimization/examples/simpleTransient/main.i)
[Optimization]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'source'
num_values = '44'
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = FORWARD
[]
[]
[Transfers]
[params]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/source'
to_reporters = 'src_values/values'
[]
[data]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measured_data/misfit_values measured_data/simulation_values'
to_reporters = 'OptimizationReporter/misfit_values OptimizationReporter/simulation_values'
[]
[]
[Executioner]
type = Optimize
solve_on = none
tao_solver = taonm
petsc_options_iname = '-tao_gatol'
petsc_options_value = '1e1'
verbose = true
[]
[Outputs]
[]
(test/tests/transfers/multiapp_conservative_transfer/parent_nearest_point.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmax = 1
ymax = 1
nx = 10
ny = 10
[]
[block1]
input = gen
type = SubdomainBoundingBoxGenerator
block_id = 1
bottom_left = '0.5 0 0'
top_right = '1 1 0'
[]
[]
[Variables]
[power_density]
[]
[]
[Functions]
[pwr_func]
type = ParsedFunction
expression = '1e3*x*(1-x)+5e2'
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = power_density
[]
[coupledforce]
type = BodyForce
variable = power_density
function = pwr_func
[]
[]
[BCs]
[left]
type = DirichletBC
variable = power_density
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = power_density
boundary = right
value = 1e3
[]
[]
[AuxVariables]
[from_sub]
[]
[]
[VectorPostprocessors]
[from_nearest_point]
type = NearestPointIntegralVariablePostprocessor
variable = power_density
points = '0 0.5 0 1 0.5 0'
[]
[to_nearest_point]
type = NearestPointIntegralVariablePostprocessor
variable = from_sub
points = '0 0.5 0 1 0.5 0'
execute_on = 'transfer'
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = sub_nearest_point.i
positions = '0 0 0 0.5 0 0'
execute_on = timestep_end
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
source_variable = power_density
variable = from_parent
to_multi_app = sub
execute_on = timestep_end
# The following inputs specify what postprocessors should be conserved
# 1 NearestPointIntegralVariablePostprocessor is specified on the parent
# side with N points, where N is the number of subapps
# 1 pp is specified on the subapp side
from_postprocessors_to_be_preserved = 'from_nearest_point'
to_postprocessors_to_be_preserved = 'from_parent_pp'
[]
[from_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
source_variable = sink
variable = from_sub
from_multi_app = sub
execute_on = timestep_end
# The following inputs specify what postprocessors should be conserved
# 1 NearestPointIntegralVariablePostprocessor is specified on the parent
# with N points, where N is the number of subapps
# 1 pp is specified on the subapp side
to_postprocessors_to_be_preserved = 'to_nearest_point'
from_postprocessors_to_be_preserved = 'sink'
[]
[]
[Outputs]
csv = true
exodus = true
[]
(modules/optimization/examples/simpleTransient/main_mesh.i)
[Optimization]
[]
[OptimizationReporter]
type = ParameterMeshOptimization
parameter_names = 'source'
parameter_meshes = source_mesh_in.e
num_parameter_times = 11
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward_mesh.i
execute_on = FORWARD
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint_mesh.i
execute_on = ADJOINT
[]
[]
[Transfers]
[to_forward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/source'
to_reporters = 'src_values/values'
[]
[from_forward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measured_data/misfit_values measured_data/simulation_values'
to_reporters = 'OptimizationReporter/misfit_values OptimizationReporter/simulation_values'
[]
[to_adjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/source OptimizationReporter/misfit_values'
to_reporters = 'src_values/values measured_data/misfit_values'
[]
[from_adjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'adjoint/inner_product'
to_reporters = 'OptimizationReporter/grad_source'
[]
[]
[Executioner]
type = Optimize
solve_on = none
tao_solver = taolmvm
petsc_options_iname = '-tao_gatol -tao_ls_type'
petsc_options_value = '1e-2 unit'
verbose = true
[]
(test/tests/transfers/multiapp_variable_value_sample_transfer/parent_array_centroid.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
[]
[Variables]
[u_parent]
components = 2
[]
[]
[AuxVariables]
[u_sub]
family = MONOMIAL
order = CONSTANT
components = 2
[]
[]
[Functions]
[u0_fun]
type = ParsedFunction
expression = 'x'
[]
[u1_fun]
type = ParsedFunction
expression = 'y'
[]
[]
[ICs]
[uic]
type = ArrayFunctionIC
variable = u_parent
function = 'u0_fun u1_fun'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
[Positions]
[centroid]
type = ElementCentroidPositions
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = sub_array_sample.i
execute_on = timestep_end
positions_objects = 'centroid centroid'
[]
[]
[Transfers]
[to_transfer]
type = MultiAppVariableValueSamplePostprocessorTransfer
to_multi_app = sub
postprocessor = from_parent
source_variable = u_parent
map_array_variable_components_to_child_apps = true
[]
[from_transfer]
type = MultiAppVariableValueSamplePostprocessorTransfer
from_multi_app = sub
postprocessor = to_parent
source_variable = u_sub
map_array_variable_components_to_child_apps = true
[]
[]
(modules/optimization/test/tests/optimizationreporter/general_opt/point_loads_gen_opt/main_separate_multiapps.i)
measurement_points = '0.5 0.28 0
0.5 0.6 0
0.5 0.8 0
0.5 1.1 0'
measurement_values = '293 304 315 320'
[Optimization]
[]
[OptimizationReporter]
type = GeneralOptimization
objective_name = misfit_norm
parameter_names = 'parameter_results'
num_values = '3'
[]
[Reporters]
[main]
# We need to have an OptimizationData on the main app to allow the
# transferring of the correct information when doing Hessian based optimization.
type = OptimizationData
measurement_points = ${measurement_points}
measurement_values = ${measurement_values}
[]
[]
[Executioner]
type = Optimize
tao_solver = taonls
petsc_options_iname = '-tao_gttol -tao_max_it -tao_nls_pc_type -tao_nls_ksp_type'
petsc_options_value = '1e-5 10 none cg'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = "FORWARD"
cli_args = 'measurement_points="${measurement_points}";measurement_values="${measurement_values}"'
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint.i
execute_on = "ADJOINT"
cli_args = 'measurement_points="${measurement_points}";measurement_values="${measurement_values}"'
[]
[homogeneousForward]
type = FullSolveMultiApp
input_files = forward_homogeneous.i
execute_on = "HOMOGENEOUS_FORWARD"
cli_args = 'measurement_points="${measurement_points}";measurement_values="${measurement_values}"'
[]
[]
[Transfers]
# FORWARD transfers
[toForward_measument]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/parameter_results'
to_reporters = 'point_source/value'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
# Note: We are transferring the misfit values into main misfit
from_reporters = 'measure_data/misfit_norm measure_data/misfit_values'
to_reporters = 'OptimizationReporter/misfit_norm main/misfit_values'
[]
# ADJOINT transfers
#NOTE: the adjoint variable we are transferring is actually the gradient
[toAdjoint]
type = MultiAppReporterTransfer
# We are transferring directly from the forward app to the adjoint app
to_multi_app = adjoint
from_reporters = 'main/misfit_values'
to_reporters = 'misfit/misfit_values'
[]
[fromAdjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'gradient/adjoint'
to_reporters = 'OptimizationReporter/grad_parameter_results'
[]
# HESSIAN transfers. Same as forward.
[toHomoForward]
type = MultiAppReporterTransfer
to_multi_app = homogeneousForward
from_reporters = 'OptimizationReporter/parameter_results'
to_reporters = 'point_source/value'
[]
[fromHomoForward]
type = MultiAppReporterTransfer
from_multi_app = homogeneousForward
# Note: We are transferring the simulation values into misfit
# this has to be done when using general opt and homogenous forward.
from_reporters = 'measure_data/simulation_values'
to_reporters = 'main/misfit_values'
[]
[]
[Reporters]
[optInfo]
type = OptimizationInfo
[]
[]
[Outputs]
csv = true
file_base = main_out
[]
(test/tests/multiapps/command_line/parent_common.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Steady
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
positions = '0 0 0
1 1 1'
input_files = 'sub.i'
cli_args = 'Mesh/mesh/type=GeneratedMeshGenerator;Mesh/mesh/dim=1;Mesh/mesh/nx=42'
[]
[]
(test/tests/transfers/multiapp_high_order_variable_transfer/parent_L2_Lagrange.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
[]
[Variables]
[power_density]
family = L2_LAGRANGE
order = FIRST
[]
[]
[Functions]
[pwr_func]
type = ParsedFunction
expression = '1e3*x*(1-x)+5e2'
[]
[]
[Kernels]
[diff]
type = Reaction
variable = power_density
[]
[coupledforce]
type = BodyForce
variable = power_density
function = pwr_func
[]
[]
[Postprocessors]
[pwr_avg]
type = ElementAverageValue
block = '0'
variable = power_density
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
petsc_options_value = 'hypre boomeramg 100'
nl_abs_tol = 1e-8
nl_rel_tol = 1e-12
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = sub_L2_Lagrange.i
execute_on = 'timestep_end'
[]
[]
[Transfers]
[p_to_sub]
type = MultiAppShapeEvaluationTransfer
source_variable = power_density
variable = power_density
to_multi_app = sub
execute_on = 'timestep_end'
[]
[]
[Outputs]
exodus = true
perf_graph = true
[]
(test/tests/problems/eigen_problem/eigensolvers/ne_coupled_picard.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 10
elem_type = QUAD4
nx = 8
ny = 8
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
# set this so that the Picard initial norm is not zero
initial_condition = 1
[../]
[]
[AuxVariables]
[./T]
order = FIRST
family = LAGRANGE
# set this so that the Picard initial norm is not zero
initial_condition = 1
[../]
[./power]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = DiffMKernel
variable = u
mat_prop = diffusion
offset = 0.0
[../]
[./rhs]
type = CoefReaction
variable = u
coefficient = -1.0
extra_vector_tags = 'eigen'
[../]
[]
[AuxKernels]
[./power_ak]
type = NormalizationAux
variable = power
source_variable = u
normalization = unorm
# this coefficient will affect the eigenvalue.
normal_factor = 10
execute_on = timestep_end
[../]
[]
[BCs]
[./homogeneous]
type = DirichletBC
variable = u
boundary = '0 1 2 3'
value = 0
[../]
[./eigenU]
type = EigenDirichletBC
variable = u
boundary = '0 1 2 3'
[../]
[]
[Materials]
[./dc]
type = VarCouplingMaterial
var = T
block = 0
base = 1.0
coef = 1.0
[../]
[]
[Executioner]
type = Eigenvalue
solve_type = PJFNK
nl_abs_tol = 1e-8
nl_rel_tol = 1e-6
fixed_point_max_its = 10
fixed_point_rel_tol = 1e-6
[]
[Postprocessors]
[./unorm]
type = ElementIntegralVariablePostprocessor
variable = u
execute_on = linear
[../]
[]
[VectorPostprocessors]
[./eigenvalues]
type = Eigenvalues
execute_on = 'timestep_end'
[../]
[]
[Outputs]
csv = true
exodus =true
execute_on = 'timestep_end'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = ne_coupled_picard_sub.i
execute_on = timestep_end
[../]
[]
[Transfers]
[./T_from_sub]
type = MultiAppShapeEvaluationTransfer
from_multi_app = sub
source_variable = T
variable = T
[../]
[./power_to_sub]
type = MultiAppShapeEvaluationTransfer
to_multi_app = sub
source_variable = power
variable = power
[../]
[]
(test/tests/transfers/general_field/user_object/coord_transform/main-app.i)
# This input is a duplicate of test/tests/transfers/coord_transform/both_transformed/user_object
# The parameters are different between the GeneralFieldUserObject transfer and its deprecated
# ancestor
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = -1
ymax = 0
nx = 10
ny = 10
# Quarter turn around Z axis
alpha_rotation = -90
# Flips around Y axis
# beta_rotation = -180
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[from_sub_app_var]
[]
[from_sub_app_var_elem]
order = CONSTANT
family = MONOMIAL
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[force]
type = CoupledForce
variable = u
v = from_sub_app_var
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
verbose = true
[]
[Outputs]
exodus = true
[]
[UserObjects]
[main_uo]
type = LayeredAverage
direction = x
num_layers = 5
variable = u
[]
[]
[MultiApps]
[sub_app]
# Shift is offset by sub-app mesh + rotations
# positions = '1 0 0.0'
type = FullSolveMultiApp
input_files = sub-app.i
app_type = MooseTestApp
bounding_box_padding = '0.25 0.25 0'
bounding_box_inflation = 0
execute_on = TIMESTEP_END
[]
[]
[Transfers]
[layered_transfer_to_sub_app]
type = MultiAppGeneralFieldUserObjectTransfer
source_user_object = main_uo
variable = sub_app_var
to_multi_app = sub_app
[]
[layered_transfer_to_sub_app_elem]
type = MultiAppGeneralFieldUserObjectTransfer
source_user_object = main_uo
variable = sub_app_var_elem
to_multi_app = sub_app
[]
[layered_transfer_from_sub_app]
type = MultiAppGeneralFieldUserObjectTransfer
source_user_object = sub_app_uo
variable = from_sub_app_var
from_multi_app = sub_app
[]
[layered_transfer_from_sub_app_elem]
type = MultiAppGeneralFieldUserObjectTransfer
source_user_object = sub_app_uo
variable = from_sub_app_var_elem
from_multi_app = sub_app
[]
[]
(test/tests/transfers/multiapp_copy_transfer/multivariable_copy/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
# Create two variables
[./u]
[../]
[./v]
[../]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = initial
[../]
[]
[Transfers]
# Transfer both variables by inputting a vector of their names
[./from_sub]
type = MultiAppCopyTransfer
source_variable = 'u v'
variable = 'u v'
from_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/general_field/nearest_node/duplicated_nearest_node_tests/target_boundary_parent.i)
[Mesh]
[drmg]
type = DistributedRectilinearMeshGenerator
dim = 2
nx = 30
ny = 30
xmax = 2
elem_type = QUAD4
partition = square
[]
[]
[Variables]
[u][]
[]
[Kernels]
[conduction]
type = Diffusion
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = 'left'
value = 1
[]
[right]
type = DirichletBC
variable = u
boundary = 'right'
value = 10
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = 'target_boundary_sub.i'
positions = '-1.0 0.0 0.0
2. 0.0 0.0'
output_in_position = true
execute_on = 'timestep_end'
[]
[]
[Transfers]
[target_boundary]
type = MultiAppGeneralFieldNearestLocationTransfer
source_variable = u
to_multi_app = sub
variable = source
to_boundaries = 'right'
[]
[]
[Executioner]
type = Steady
nl_rel_tol = 1e-6
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/multiapp_nearest_node_transfer/target_boundary_parent.i)
[Mesh]
[drmg]
type = DistributedRectilinearMeshGenerator
dim = 2
nx = 30
ny = 30
xmax = 2
elem_type = QUAD4
partition = square
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[conduction]
type = Diffusion
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = 'left'
value = 1
[]
[right]
type = DirichletBC
variable = u
boundary = 'right'
value = 10
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = 'target_boundary_sub.i'
positions = '-1.0 0.0 0.0
2. 0.0 0.0'
output_in_position = true
execute_on = 'timestep_end'
[]
[]
[Transfers]
[target_boundary]
type = MultiAppNearestNodeTransfer
source_variable = u
to_multi_app = sub
variable = source
target_boundary = 'right'
[]
[]
[Executioner]
type = Steady
nl_rel_tol = 1e-6
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/multiapp_copy_transfer/linear_lagrange_from_sub/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = initial
[../]
[]
[Transfers]
[./from_sub]
type = MultiAppCopyTransfer
source_variable = u
variable = u
from_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/multiapp_projection_transfer/high_order_parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
[]
[Functions]
[./test_function]
type = ParsedFunction
expression = '2.5*x^2 + 0.75*y^2 + 0.15*x*y'
[../]
[]
[AuxVariables]
[./from_sub]
family = monomial
order = first
[../]
[./test_var]
family = monomial
order = first
[./InitialCondition]
type = FunctionIC
function = test_function
[../]
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = PJFNK
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
app_type = MooseTestApp
execute_on = initial
positions = '0.0 0.0 0.0'
input_files = high_order_sub.i
[../]
[]
[Transfers]
[./from]
type = MultiAppProjectionTransfer
execute_on = same_as_multiapp
from_multi_app = sub
source_variable = test_var
variable = from_sub
[../]
[./to]
type = MultiAppProjectionTransfer
execute_on = same_as_multiapp
to_multi_app = sub
source_variable = test_var
variable = from_parent
[../]
[]
(modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/main.i)
# This tests that a linear and constant function can be scaled in
# two separate functionNeumannBCs both applied to the same sideset using
# two parsed functions. The scale of the linear and constant functions
# are being parameterized.
[Optimization]
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 20
xmax = 1
ymax = 2
bias_x = 1.1
bias_y = 1.1
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'left right'
num_values = '2 1'
measurement_file = 'measurementData.csv'
file_xcoord = 'coordx'
file_ycoord ='y'
file_zcoord = 'z'
file_value = 'weightedMeasurement'
file_variable_weights = 'weight'
[]
[Executioner]
type = Optimize
tao_solver = taonls
petsc_options_iname = '-tao_gttol -tao_nls_pc_type -tao_nls_ksp_type'
petsc_options_value = '1e-3 none cg'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = "FORWARD"
clone_parent_mesh = true
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint.i
execute_on = "ADJOINT"
clone_parent_mesh = true
[]
[homogeneousForward]
type = FullSolveMultiApp
input_files = homogeneous_forward.i
execute_on = "HOMOGENEOUS_FORWARD"
clone_parent_mesh = true
[]
[]
[Transfers]
[toForward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/weight
OptimizationReporter/left
OptimizationReporter/right'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
measure_data/weightForTemperature
params_left/vals
params_right/vals'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[toAdjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/weight
OptimizationReporter/left
OptimizationReporter/right'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
misfit/weight
params_left/vals
params_right/vals'
[]
[fromadjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'grad_bc_left/inner_product
grad_bc_right/inner_product'
to_reporters = 'OptimizationReporter/grad_left
OptimizationReporter/grad_right'
[]
# HESSIAN transfers. Same as forward.
[toHomogeneousForward]
type = MultiAppReporterTransfer
to_multi_app = homogeneousForward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/weight
OptimizationReporter/left
OptimizationReporter/right'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
measure_data/weightForTemperature
params_left/vals
params_right/vals'
[]
[fromHomogeneousForward]
type = MultiAppReporterTransfer
from_multi_app = homogeneousForward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[]
[Reporters]
[optInfo]
type = OptimizationInfo
items = 'current_iterate function_value gnorm'
[]
[]
[Outputs]
csv = true
console = false
[]
(test/tests/multiapps/full_solve_multiapp/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
perf_graph = true
[]
[MultiApps]
[full_solve]
type = FullSolveMultiApp
# not setting app_type to use the same app type of parent, i.e. MooseTestApp
execute_on = initial
positions = '0 0 0'
input_files = sub.i
[]
[]
(test/tests/transfers/general_field/nearest_node/nearest_position/main.i)
# Base input for testing transfers. It has the following complexities:
# - more than one subapp
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[AuxVariables]
[to_sub]
[InitialCondition]
type = FunctionIC
function = '1 + 2*x*x + 3*y*y*y'
[]
[]
[to_sub_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '2 + 2*x*x + 3*y*y*y'
[]
[]
[from_sub]
initial_condition = -1
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
verbose_multiapps = true
[]
[Outputs]
[out]
type = Exodus
overwrite = true
hide = 'to_sub to_sub_elem'
[]
[]
[Positions]
[input]
type = InputPositions
positions = '1e-6 0 0 0.4 0.6001 0'
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
positions_objects = input
app_type = MooseTestApp
input_files = sub.i
output_in_position = true
execute_on = TIMESTEP_END
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = to_sub
variable = from_main
# Transfer relies on two nodes that are equidistant to the target point
search_value_conflicts = false
[]
[to_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = to_sub_elem
variable = from_main_elem
[]
[from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main
variable = from_sub
use_nearest_position = input
bbox_factor = 100
# Transfer relies on two nodes that are equidistant to the target point
search_value_conflicts = false
[]
[from_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main_elem
variable = from_sub_elem
use_nearest_position = input
bbox_factor = 100
[]
[]
(test/tests/multiapps/command_line/parent_wrong_size.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Steady
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
positions = '0 0 0
1 1 1'
input_files = 'sub.i'
cli_args = 'Mesh/xmax=1.1 Mesh/xmax=1.2 Mesh/xmax=1.3'
[]
[]
(test/tests/multiapps/picard_multilevel/2level_picard/mutilevel_app.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[v]
initial_condition = 50
[]
[]
[Kernels]
[diffusion]
type = Diffusion
variable = u
[]
[source]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[dirichlet0]
type = DirichletBC
variable = u
boundary = '3'
value = 0
[]
[dirichlet]
type = DirichletBC
variable = u
boundary = '1'
value = 100
[]
[]
[Postprocessors]
[avg_u]
type = ElementAverageValue
variable = u
execute_on = 'initial timestep_begin timestep_end'
[]
[avg_v]
type = ElementAverageValue
variable = v
execute_on = 'initial timestep_begin timestep_end'
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
petsc_options_value = 'hypre boomeramg 100'
fixed_point_rel_tol = 1E-3
fixed_point_abs_tol = 1.0e-05
fixed_point_max_its = 2
accept_on_max_fixed_point_iteration = true
[]
[MultiApps]
[level1-]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = sub_level1.i
execute_on = 'timestep_end'
keep_solution_during_restore = true
[]
[]
[Transfers]
[u_to_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
source_variable = u
variable = u
to_multi_app = level1-
execute_on = 'timestep_end'
[]
[v_from_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
source_variable = v
variable = v
from_multi_app = level1-
execute_on = 'timestep_end'
[]
[]
[Outputs]
exodus = true
perf_graph = true
[screen]
type = Console
execute_postprocessors_on = "timestep_end timestep_begin"
[]
[]
(modules/stochastic_tools/test/tests/multiapps/batch_commandline_control/parent_wrong_num_params.i)
[StochasticTools]
[]
[Distributions]
[uniform]
type = Uniform
lower_bound = 5
upper_bound = 10
[]
[]
[Samplers]
[sample]
type = MonteCarlo
num_rows = 3
distributions = 'uniform uniform'
execute_on = 'initial timestep_end'
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
positions = '0 0 0
1 1 1
2 2 2'
input_files = 'sub.i'
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
sampler = sample
param_names = 'Mesh/xmax Mesh/ymax Mesh/zmax'
[]
[]
(test/tests/transfers/coord_transform/both-transformed/projection/main-app.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = -1
ymax = 0
nx = 10
ny = 10
alpha_rotation = 90
[]
[Variables]
[u][]
[]
[AuxVariables]
[v][]
[v_elem]
order = CONSTANT
family = MONOMIAL
[]
[w][]
[w_elem]
order = CONSTANT
family = MONOMIAL
[]
[]
[ICs]
[w]
type = FunctionIC
function = 'cos(x)*sin(y)'
variable = w
[]
[w_elem]
type = FunctionIC
function = 'cos(x)*sin(y)'
variable = w_elem
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[force]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
verbose = true
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = 'sub-app.i'
execute_on = 'timestep_begin'
[]
[]
[Transfers]
[from_sub]
type = MultiAppProjectionTransfer
from_multi_app = sub
source_variable = v
variable = v
execute_on = 'timestep_begin'
[]
[from_sub_elem]
type = MultiAppProjectionTransfer
from_multi_app = sub
source_variable = v_elem
variable = v_elem
execute_on = 'timestep_begin'
[]
[to_sub]
type = MultiAppProjectionTransfer
to_multi_app = sub
source_variable = w
variable = w
execute_on = 'timestep_begin'
[]
[to_sub_elem]
type = MultiAppProjectionTransfer
to_multi_app = sub
source_variable = w_elem
variable = w_elem
execute_on = 'timestep_begin'
[]
[]
(test/tests/transfers/multiapp_copy_transfer/third_monomial_from_sub/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
family = MONOMIAL
order = THIRD
[../]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = initial
[../]
[]
[Transfers]
[./from_sub]
type = MultiAppCopyTransfer
source_variable = aux
variable = u
from_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/coord_transform/both-transformed/nearest-node/main-app.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = -1
ymax = 0
nx = 10
ny = 10
alpha_rotation = 90
[]
[Variables]
[u][]
[]
[AuxVariables]
[v][]
[v_elem]
order = CONSTANT
family = MONOMIAL
[]
[w][]
[w_elem]
order = CONSTANT
family = MONOMIAL
[]
[]
[ICs]
[w]
type = FunctionIC
function = 'cos(x)*sin(y)'
variable = w
[]
[w_elem]
type = FunctionIC
function = 'cos(x)*sin(y)'
variable = w_elem
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[force]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
verbose = true
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = 'sub-app.i'
execute_on = 'timestep_begin'
[]
[]
[Transfers]
[from_sub]
type = MultiAppNearestNodeTransfer
from_multi_app = sub
source_variable = v
variable = v
execute_on = 'timestep_begin'
[]
[from_sub_elem]
type = MultiAppNearestNodeTransfer
from_multi_app = sub
source_variable = v_elem
variable = v_elem
execute_on = 'timestep_begin'
[]
[to_sub]
type = MultiAppNearestNodeTransfer
to_multi_app = sub
source_variable = w
variable = w
execute_on = 'timestep_begin'
[]
[to_sub_elem]
type = MultiAppNearestNodeTransfer
to_multi_app = sub
source_variable = w_elem
variable = w_elem
execute_on = 'timestep_begin'
[]
[]
(modules/optimization/test/tests/optimizationreporter/constant_heat_source/main_nonLinear.i)
[Optimization]
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'parameter_results'
num_values = '1'
initial_condition = '500'
lower_bounds = '0.1'
upper_bounds = '10000'
measurement_points = '0.2 0.2 0
0.8 0.6 0
0.2 1.4 0
0.8 1.8 0'
measurement_values = '270 339 321 221'
[]
[Executioner]
type = Optimize
tao_solver = taoblmvm
petsc_options_iname = '-tao_gatol'
petsc_options_value = '.01'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward_nonLinear.i
execute_on = FORWARD
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint_nonLinear.i
execute_on = ADJOINT
[]
[]
[Transfers]
[toForward_measument]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/parameter_results'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
params/q'
[]
[toAdjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/parameter_results'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
params/q'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[fromadjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'gradient_vpp/inner_product'
to_reporters = 'OptimizationReporter/grad_parameter_results'
[]
#for temperature dependent material
[fromforwardMesh]
type = MultiAppCopyTransfer
from_multi_app = forward
to_multi_app = adjoint
source_variable = 'T'
variable = 'T'
[]
[]
[Reporters]
[optInfo]
type = OptimizationInfo
[]
[]
[Outputs]
csv = true
[]
(test/tests/transfers/multiapp_transfer_transformation/transfer_transformation.i)
[Mesh]
[./gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 3
ny = 5
nz = 0
xmax = 0.8
xmin = 0.2
zmin = 0
zmax = 0
elem_type = QUAD4
[]
[./subdomain_id]
type = SubdomainPerElementGenerator
input = gmg
subdomain_ids = '0 1 2
0 1 2
0 1 2
0 1 2
0 1 2'
[]
[./boundary01]
type = SideSetsBetweenSubdomainsGenerator
input = subdomain_id
primary_block = '0'
paired_block = '1'
new_boundary = 'boundary01'
[]
[./boundary10]
type = SideSetsBetweenSubdomainsGenerator
input = boundary01
primary_block = '1'
paired_block = '0'
new_boundary = 'boundary10'
[]
[./boundary12]
type = SideSetsBetweenSubdomainsGenerator
input = boundary10
primary_block = '1'
paired_block = '2'
new_boundary = 'boundary12'
[]
[./boundary21]
type = SideSetsBetweenSubdomainsGenerator
input = boundary12
primary_block = '2'
paired_block = '1'
new_boundary = 'boundary21'
[]
uniform_refine = 3
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxVariables]
[./fromsubelem]
order = constant
family = monomial
[../]
[./fromsub]
[]
[]
[BCs]
[./left0]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right0]
type = DirichletBC
variable = u
boundary = boundary01
value = 1
[../]
[./right1]
type = DirichletBC
variable = u
boundary = boundary12
value = 0
[../]
[./right2]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0.0 0.0 0.0'
execute_on = 'timestep_end'
input_files = transfer_transformation_sub.i
[]
[]
[Transfers]
[from_sub]
type = MultiAppGeometricInterpolationTransfer
from_multi_app = sub
num_points = 1
shrink_gap_width = 0.2
shrink_mesh = 'source'
source_variable = 'u'
variable = 'fromsub'
exclude_gap_blocks = '1 3'
[]
[from_sub_elem]
type = MultiAppGeometricInterpolationTransfer
from_multi_app = sub
num_points = 4
shrink_gap_width = 0.2
shrink_mesh = 'source'
source_variable = 'u'
variable = 'fromsubelem'
exclude_gap_blocks = '1 3'
[]
[from_parent]
type = MultiAppGeometricInterpolationTransfer
to_multi_app = sub
num_points = 1
shrink_gap_width = 0.2
shrink_mesh = 'target'
source_variable = 'u'
exclude_gap_blocks = '1 3'
variable = 'fromparent'
[]
[from_parent_elem]
type = MultiAppGeometricInterpolationTransfer
to_multi_app = sub
num_points = 4
shrink_gap_width = 0.2
shrink_mesh = 'target'
source_variable = 'u'
exclude_gap_blocks = '1 3'
variable = 'fromparentelem'
[]
[]
(test/tests/multiapps/command_line/parent_common_vector.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Steady
[]
[MultiApps]
active = 'sub_1'
[sub_1]
type = FullSolveMultiApp
positions = '0 0 0
1 1 1'
input_files = 'sub.i'
cli_args = 'Mesh/mesh/type=CartesianMeshGenerator;Mesh/mesh/dim=1;Mesh/mesh/dx="1 2 1";Mesh/mesh/ix="4 3 1"'
[]
[sub_1_split]
type = FullSolveMultiApp
positions = '0 0 0
1 1 1'
input_files = 'sub.i'
cli_args = 'Mesh/mesh/type=CartesianMeshGenerator;Mesh/mesh/dim=1;Mesh/mesh/dx="1 2 1";Mesh/mesh/ix="4 3 1" Mesh/mesh/type=CartesianMeshGenerator;Mesh/mesh/dim=1;Mesh/mesh/dx="1 2 1";Mesh/mesh/ix="4 3 1"'
[]
[sub_2]
type = FullSolveMultiApp
positions = '0 0 0
1 1 1'
input_files = 'sub.i'
cli_args = "Mesh/mesh/type=CartesianMeshGenerator;Mesh/mesh/dim=1;Mesh/mesh/dx='1 2 "
"1';Mesh/mesh/ix='4 3 1'"
[]
[sub_2_split]
type = FullSolveMultiApp
positions = '0 0 0
1 1 1'
input_files = 'sub.i'
cli_args = "Mesh/mesh/type=CartesianMeshGenerator;Mesh/mesh/dim=1;Mesh/mesh/dx='1 2 "
"1';Mesh/mesh/ix='4 3 1' "
"Mesh/mesh/type=CartesianMeshGenerator;Mesh/mesh/dim=1;Mesh/mesh/dx='1 2 "
"1';Mesh/mesh/ix='4 3 1'"
[]
[]
(modules/optimization/examples/diffusion_reaction/optimize.i)
[Optimization]
[]
[OptimizationReporter]
type = ParameterMeshOptimization
parameter_names = 'reaction_rate'
parameter_meshes = 'parameter_mesh_out.e'
constant_group_initial_condition = 0
constant_group_lower_bounds = 0
measurement_file = forward_exact_csv_sample_0011.csv
file_xcoord = measurement_xcoord
file_ycoord = measurement_ycoord
file_zcoord = measurement_zcoord
file_time = measurement_time
file_value = simulation_values
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward_and_adjoint.i
execute_on = FORWARD
[]
[]
[Transfers]
[to_forward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/reaction_rate'
to_reporters = 'data/measurement_xcoord
data/measurement_ycoord
data/measurement_zcoord
data/measurement_time
data/measurement_values
params/reaction_rate'
[]
[from_forward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'data/simulation_values
adjoint/inner_product'
to_reporters = 'OptimizationReporter/simulation_values
OptimizationReporter/grad_reaction_rate'
[]
[]
[Reporters]
[optInfo]
type = OptimizationInfo
items = 'current_iterate function_value gnorm'
[]
[]
[Executioner]
type = Optimize
tao_solver = taobqnls
petsc_options_iname = '-tao_gttol -tao_max_it'
#petsc_options_value = '1e-5 100' #use this to get results for paper
petsc_options_value = '1e-5 5'
solve_on = 'NONE'
verbose = true
[]
[Outputs]
csv = true
[]
(test/tests/multiapps/secant/steady_main.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
parallel_type = replicated
uniform_refine = 1
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[v]
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[force_u]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[unorm]
type = ElementL2Norm
variable = u
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
nl_abs_tol = 1e-14
fixed_point_algorithm = 'secant'
fixed_point_max_its = 30
transformed_variables = 'u'
[]
[Outputs]
csv = true
exodus = false
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = 'steady_sub.i'
clone_parent_mesh = true
transformed_variables = 'v'
[]
[]
[Transfers]
[v_from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = v
variable = v
[]
[u_to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = u
variable = u
[]
[]
(test/tests/problems/eigen_problem/eigensolvers/ne_coupled_picard_subT.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 10
elem_type = QUAD4
nx = 8
ny = 8
[]
[Variables]
[./T]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./power]
order = FIRST
family = LAGRANGE
initial_condition = 0.1
[../]
[]
[Kernels]
[./diff_T]
type = Diffusion
variable = T
[../]
[./src_T]
type = CoupledForce
variable = T
v = power
[../]
[]
[BCs]
[./homogeneousT]
type = DirichletBC
variable = T
boundary = '0 1 2 3'
value = 0
[../]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-8
nl_rel_tol = 1e-6
fixed_point_max_its = 20
fixed_point_rel_tol = 1e-6
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
keep_solution_during_restore = true
input_files = ne_coupled_picard_subT_sub.i
execute_on = timestep_end
[../]
[]
[Transfers]
[./T_to_sub]
type = MultiAppShapeEvaluationTransfer
to_multi_app = sub
source_variable = T
variable = T
execute_on = timestep_end
[../]
[./power_from_sub]
type = MultiAppShapeEvaluationTransfer
from_multi_app = sub
source_variable = power
variable = power
execute_on = timestep_end
[../]
[]
[Outputs]
csv = true
exodus =true
execute_on = 'timestep_end'
[]
(modules/optimization/test/tests/outputs/exodus_optimization_steady/main_auto_adjoint.i)
[Optimization]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'parameter_results'
num_values = '3'
measurement_points = '0.5 0.28 0
0.5 0.6 0
0.5 0.8 0
0.5 1.1 0'
measurement_values = '293 304 315 320'
[]
[Executioner]
type = Optimize
tao_solver = taolmvm
petsc_options_iname='-tao_gttol -tao_ls_type'
petsc_options_value='1e-5 unit'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward_and_adjoint.i
execute_on = "FORWARD"
[]
[]
[Transfers]
# FORWARD transfers
[toForward_measument]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/parameter_results'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
point_source/value'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values
gradient/temperature_adjoint'
to_reporters = 'OptimizationReporter/simulation_values
OptimizationReporter/grad_parameter_results'
[]
[]
[Outputs]
csv = true
[]
(test/tests/transfers/multiapp_copy_transfer/tagged_solution/main.i)
[Problem]
solve = false
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
[]
[MultiApps/sub]
type = FullSolveMultiApp
input_files = sub.i
[]
[Transfers/to_sub]
type = MultiAppCopyTransfer
to_multi_app = sub
source_variable = x
to_solution_tag = tagged_aux_sol
variable = force
[]
[AuxVariables/x]
initial_condition = 1
[]
[Executioner]
type = Steady
[]
(modules/optimization/test/tests/executioners/constrained/inequality/main_auto_adjoint.i)
# This tests constrained optimization of a linear and constant function
# that are used to apply NuemannBCs on a side.
[Optimization]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'left'
num_values = '2'
initial_condition = '10 10'
lower_bounds = '0'
upper_bounds = '1000'
inequality_names = 'ineq'
measurement_points = '0.2 0.2 0'
measurement_values = '207'
file_value = 'measured_value'
[]
[Executioner]
type = Optimize
tao_solver = taoalmm
petsc_options_iname = '-tao_gatol -tao_catol -tao_almm_type -tao_almm_mu_factor -tao_almm_mu_init -tao_almm_subsolver_tao_type'
petsc_options_value = ' 1e-3 1e-3 phr 1.1 1.0 bqnktr'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward_and_adjoint.i
execute_on = "FORWARD"
[]
[]
[Reporters]
[optInfo]
type = OptimizationInfo
[]
[]
[Transfers]
[toForward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/left'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
params/left'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values
grad_bc_left/inner_product
ineq/ineq
gradient_c/gradient_c'
to_reporters = 'OptimizationReporter/simulation_values
OptimizationReporter/grad_left
OptimizationReporter/ineq
OptimizationReporter/grad_ineq'
[]
[]
(test/tests/restart/restart_transient_from_steady/steady_with_2subs.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
parallel_type = 'replicated'
[]
[AuxVariables]
[Tf]
[]
[]
[Variables]
[power_density]
[]
[]
[Functions]
[pwr_func]
type = ParsedFunction
expression = '1e3*x*(1-x)+5e2'
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = power_density
[]
[coupledforce]
type = BodyForce
variable = power_density
function = pwr_func
[]
[]
[BCs]
[left]
type = DirichletBC
variable = power_density
boundary = left
value = 50
[]
[right]
type = DirichletBC
variable = power_density
boundary = right
value = 1e3
[]
[]
[Postprocessors]
[pwr_avg]
type = ElementAverageValue
variable = power_density
execute_on = 'initial timestep_end'
[]
[temp_avg]
type = ElementAverageValue
variable = Tf
execute_on = 'initial final'
[]
[temp_max]
type = ElementExtremeValue
value_type = max
variable = Tf
execute_on = 'initial final'
[]
[temp_min]
type = ElementExtremeValue
value_type = min
variable = Tf
execute_on = 'initial final'
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
petsc_options_value = 'hypre boomeramg 100'
nl_abs_tol = 1e-8
nl_rel_tol = 1e-12
fixed_point_rel_tol = 1E-7
fixed_point_abs_tol = 1.0e-07
fixed_point_max_its = 12
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0
0.5 0 0'
input_files = steady_with_sub_sub.i
execute_on = 'timestep_end'
[]
[]
[Transfers]
[p_to_sub]
type = MultiAppProjectionTransfer
source_variable = power_density
variable = power_density
to_multi_app = sub
execute_on = 'timestep_end'
[]
[t_from_sub]
type = MultiAppGeometricInterpolationTransfer
source_variable = temp
variable = Tf
from_multi_app = sub
execute_on = 'timestep_end'
[]
[]
[Outputs]
exodus = true
perf_graph = true
checkpoint = true
execute_on = 'INITIAL TIMESTEP_END FINAL'
[]
(modules/optimization/test/tests/optimizationreporter/constant_heat_source/main.i)
[Optimization]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'parameter_results'
num_values = '1'
initial_condition = '500'
lower_bounds = '0.1'
upper_bounds = '10000'
measurement_points = '0.2 0.2 0
0.8 0.6 0
0.2 1.4 0
0.8 1.8 0'
measurement_values = '226 254 214 146'
[]
[Executioner]
type = Optimize
tao_solver = taoblmvm
petsc_options_iname = '-tao_gatol'
petsc_options_value = '1e-6'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = FORWARD
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint.i
execute_on = ADJOINT
[]
[]
[Transfers]
[toForward_measument]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/parameter_results'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
params/q'
[]
[toAdjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/parameter_results'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
params/q'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[fromadjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'gradient_vpp/inner_product'
to_reporters = 'OptimizationReporter/grad_parameter_results'
[]
[]
[Outputs]
csv = true
[]
(test/tests/transfers/general_field/nearest_node/mesh_division/main_match_subapps.i)
# Base input for testing transfers with mesh divisions restrictions. The mesh divisions
# in the parent app will be matched with a subapp index.
# In the to_multiapp direction, the main app data at the mesh division bins of index 1-4 will
# be transferred to subapps of index 1-4 respectively
# In the from_multiapp direction, the main app fields at the mesh divisions bins of index 1-4
# will receive data (be transferred) from subapps of index 1-4 respectively
# It has the following complexities:
# - several sub-applications
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
[]
[MeshDivisions]
[middle]
type = CartesianGridDivision
bottom_left = '0.21 0.21 0'
# cover more and sample more bins
top_right = '1.001 1.001 0'
nx = 2
ny = 2
nz = 1
[]
[]
[AuxVariables]
[from_sub]
initial_condition = -1
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[to_sub]
[InitialCondition]
type = FunctionIC
function = '1 + 2*x*x + 3*y*y*y'
[]
[]
[to_sub_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '2 + 2*x*x + 3*y*y*y'
[]
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
[out]
type = Exodus
hide = 'to_sub to_sub_elem div'
overwrite = true
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = sub.i
output_in_position = true
# The positions are randomly offset to prevent equi-distant nearest-locations
positions = '0.1001 0.0000013 0
0.30054 0.600001985 0
0.70021 0.4000022 0
0.800212 0.8500022 0'
# To differentiate the values received from each subapp
cli_args = 'base_value=1 base_value=2 base_value=3 base_value=4'
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = to_sub
variable = from_main
from_mesh_division = middle
from_mesh_division_usage = 'matching_subapp_index'
[]
[to_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = to_sub_elem
variable = from_main_elem
from_mesh_division = middle
from_mesh_division_usage = 'matching_subapp_index'
[]
[from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main
variable = from_sub
to_mesh_division = middle
to_mesh_division_usage = 'matching_subapp_index'
[]
[from_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main_elem
variable = from_sub_elem
to_mesh_division = middle
to_mesh_division_usage = 'matching_subapp_index'
[]
[]
# For debugging purposes
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'middle'
[]
[]
(test/tests/utils/perf_graph_live_print/perf_graph_live_print.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Problem]
type = SlowProblem
seconds_to_sleep = 4
print_during_section = false
nest_inside_section = false
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
active = ''
[subapp]
type = FullSolveMultiApp
input_files = 'perf_graph_live_print.i'
cli_args = "perf_graph_live_print.i"
[]
[]
[Outputs]
perf_graph_live_time_limit = 1
[console]
type = Console
fit_mode = 80
[]
[]
(test/tests/transfers/general_field/nearest_node/duplicated_nearest_node_tests/source_boundary_parent.i)
[Mesh]
[drmg]
type = DistributedRectilinearMeshGenerator
dim = 2
nx = 30
ny = 30
xmax = 2
elem_type = QUAD4
partition = square
[]
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[from_sub]
[]
[]
[Kernels]
[conduction]
type = Diffusion
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = 'left'
value = 1
[]
[right]
type = DirichletBC
variable = u
boundary = 'right'
value = 10
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = 'source_boundary_sub.i'
positions = '-1.0 0.0 0.0
2. 0.0 0.0'
output_in_position = true
cli_args = 'BCs/right/value="1" BCs/right/value="10"'
[]
[]
[Transfers]
[source_boundary]
type = MultiAppGeneralFieldNearestLocationTransfer
source_variable = u
from_multi_app = sub
variable = from_sub
from_boundaries = 'right'
[]
[]
[Executioner]
type = Steady
nl_rel_tol = 1e-6
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/multiapp_variable_value_sample_transfer/parent_array_sample.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u_parent]
components = 2
[]
[]
[AuxVariables]
[u_sub]
family = MONOMIAL
order = CONSTANT
components = 2
[]
[]
[Functions]
[u0_fun]
type = ParsedFunction
expression = 'x'
[]
[u1_fun]
type = ParsedFunction
expression = 'y'
[]
[]
[ICs]
[uic]
type = ArrayFunctionIC
variable = u_parent
function = 'u0_fun u1_fun'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = sub_array_sample.i
execute_on = timestep_end
positions = '0.25 0.25 0 0.75 0.25 0 0.25 0.75 0 0.75 0.75 0
0.25 0.25 0 0.75 0.25 0 0.25 0.75 0 0.75 0.75 0'
[]
[]
[Transfers]
[to_transfer]
type = MultiAppVariableValueSamplePostprocessorTransfer
to_multi_app = sub
postprocessor = from_parent
source_variable = u_parent
map_array_variable_components_to_child_apps = true
[]
[from_transfer]
type = MultiAppVariableValueSamplePostprocessorTransfer
from_multi_app = sub
postprocessor = to_parent
source_variable = u_sub
map_array_variable_components_to_child_apps = true
[]
[]
(test/tests/transfers/multiapp_high_order_variable_transfer/parent_L2_Lagrange_userobject.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
parallel_type = replicated
[]
[Variables]
[power_density]
family = L2_LAGRANGE
order = FIRST
[]
[]
[AuxVariables]
[./multi_layered_average]
family = LAGRANGE
order = FIRST
[../]
[]
[UserObjects]
[./multi_layered_average]
type = LayeredAverage
variable = power_density
direction = y
num_layers = 4
[../]
[]
[AuxKernels]
[./layered_aux]
type = SpatialUserObjectAux
variable = multi_layered_average
execute_on = 'nonlinear TIMESTEP_END'
user_object = multi_layered_average
[../]
[]
[Functions]
[pwr_func]
type = ParsedFunction
expression = '1e3*x*(1-x)+5e2'
[]
[]
[Kernels]
[diff]
type = Reaction
variable = power_density
[]
[coupledforce]
type = BodyForce
variable = power_density
function = pwr_func
[]
[]
[Postprocessors]
[layered_avg]
type = ElementAverageValue
block = '0'
variable = multi_layered_average
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
petsc_options_value = 'hypre boomeramg 100'
nl_abs_tol = 1e-8
nl_rel_tol = 1e-12
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = sub_L2_Lagrange.i
execute_on = 'timestep_end'
[]
[]
[Transfers]
[p_to_sub]
type = MultiAppUserObjectTransfer
user_object = multi_layered_average
variable = power_density
to_multi_app = sub
execute_on = 'timestep_end'
[]
[]
[Outputs]
exodus = true
perf_graph = true
[]
(modules/optimization/test/tests/optimizationreporter/general_opt/point_loads_gen_opt/main_auto_adjoint_transfer_data.i)
[Optimization]
[]
[OptimizationReporter]
type = GeneralOptimization
objective_name = misfit_norm
parameter_names = 'parameter_results'
num_values = '3'
[]
[Reporters]
[measure_data]
type = OptimizationData
measurement_points = '0.5 0.28 0
0.5 0.6 0
0.5 0.8 0
0.5 1.1 0'
measurement_values = '293 304 315 320'
[]
[]
[Executioner]
type = Optimize
tao_solver = taolmvm
petsc_options_iname = '-tao_gttol -tao_ls_type'
petsc_options_value = '1e-5 unit'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward_and_adjoint_transfer_data.i
execute_on = "FORWARD"
[]
[]
[Transfers]
# FORWARD transfers
[toForward_measument]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
OptimizationReporter/parameter_results'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
point_source/value'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'gradient/temperature_adjoint
measure_data/misfit_norm'
to_reporters = 'OptimizationReporter/grad_parameter_results
OptimizationReporter/misfit_norm'
[]
[]
[Outputs]
csv = true
file_base = main_out
[]
(test/tests/transfers/multiapp_conservative_transfer/primary_skipped_adjuster.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 1
ny = 1
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[AuxVariables]
[var]
family = MONOMIAL
order = THIRD
[]
[]
[ICs]
[var_ic]
type = FunctionIC
variable = var
function = '-exp(x * y)'
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = secondary_negative_adjuster.i
execute_on = timestep_begin
[]
[]
[Postprocessors]
[from_postprocessor]
type = ElementIntegralVariablePostprocessor
variable = var
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
source_variable = var
variable = var
to_multi_app = sub
from_postprocessors_to_be_preserved = 'from_postprocessor'
to_postprocessors_to_be_preserved = 'to_postprocessor'
allow_skipped_adjustment = true
[]
[]
[Outputs]
exodus = true
[]
(modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/main_auto_adjoint.i)
# This tests that a linear and constant function can be scaled in
# two separate functionNeumannBCs both applied to the same sideset using
# two parsed functions. The scale of the linear and constant functions
# are being parameterized.
[Optimization]
[]
[OptimizationReporter]
type = GeneralOptimization
parameter_names = 'left right'
num_values = '2 1'
objective_name = obj_value
[]
[Executioner]
type = Optimize
tao_solver = taobqnls
petsc_options_iname = '-tao_gatol -tao_ls_type'
petsc_options_value = '1e-5 unit'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward_and_adjoint.i
execute_on = "FORWARD"
[]
[]
[Transfers]
[toForward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/left
OptimizationReporter/right'
to_reporters = 'params/left
params/right'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'obj_sum/value
grad_bc_left/inner_product
grad_bc_right/inner_product'
to_reporters = 'OptimizationReporter/obj_value
OptimizationReporter/grad_left
OptimizationReporter/grad_right'
[]
[]
(modules/optimization/test/tests/optimizationreporter/mesh_source/main_linearRestart.i)
[Optimization]
[]
[OptimizationReporter]
type = ParameterMeshOptimization
parameter_names = 'source'
parameter_meshes = 'parameter_mesh_restart_out.e'
exodus_timesteps_for_parameter_mesh_variable = 2
initial_condition_mesh_variable = restart_source
constant_group_lower_bounds = -1
constant_group_upper_bounds = 5
# Random points
measurement_points = '0.78193073 0.39115321 0
0.72531893 0.14319403 0
0.14052488 0.86976625 0
0.401893 0.54241797 0
0.02645427 0.43320192 0
0.28856889 0.0035165 0
0.51433644 0.94485949 0
0.29252255 0.7962032 0
0.04925654 0.58018889 0
0.04717357 0.9556314 0'
# sin(x*pi/2)*sin(y*pi/2)
measurement_values = '0.54299466 0.20259611 0.21438235 0.44418597 0.02613676
0.00241892 0.72014019 0.42096307 0.06108895 0.07385256'
outputs = none
[]
[Executioner]
type = Optimize
tao_solver = taoblmvm
petsc_options_iname = '-tao_gatol'
petsc_options_value = '1e-4'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = FORWARD
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint.i
execute_on = ADJOINT
[]
[]
[Transfers]
[toForward_measument]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/source'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
src_rep/vals'
[]
[toAdjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/source'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
src_rep/vals'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[fromadjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'gradient_vpp/inner_product'
to_reporters = 'OptimizationReporter/grad_source'
[]
[]
[Reporters]
[optInfo]
type = OptimizationInfo
items = 'current_iterate function_value gnorm'
[]
[]
[Outputs]
csv = true
[]
(test/tests/multiapps/picard_multilevel/fullsolve_multilevel/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[v]
initial_condition = 50
[]
[]
[Kernels]
[diffusion]
type = Diffusion
variable = u
[]
[source]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[dirichlet0]
type = DirichletBC
variable = u
boundary = '3'
value = 0
[]
[dirichlet]
type = DirichletBC
variable = u
boundary = '1'
value = 100
[]
[]
[Postprocessors]
[avg_u]
type = ElementAverageValue
variable = u
execute_on = 'initial linear'
[]
[avg_v]
type = ElementAverageValue
variable = v
execute_on = 'initial linear'
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
petsc_options_value = 'hypre boomeramg 100'
fixed_point_rel_tol = 1E-3
fixed_point_abs_tol = 1.0e-05
fixed_point_max_its = 12
[]
[MultiApps]
[level1-]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = sub_level1.i
execute_on = 'timestep_end'
# We have to make backups of the full tree in order to do a proper restore for the Picard iteration.
no_backup_and_restore = false
[]
[]
[Transfers]
[u_to_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
source_variable = u
variable = u
to_multi_app = level1-
execute_on = 'timestep_end'
[]
[v_from_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
source_variable = v
variable = v
from_multi_app = level1-
execute_on = 'timestep_end'
[]
[]
[Outputs]
exodus = true
perf_graph = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/multiapp-scalar-transport/fluid-flow.i)
mu=1
rho=1
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method='average'
velocity_interp_method='rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = -1
ymax = 1
nx = 100
ny = 20
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 1
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[AuxVariables]
[ax_out]
type = MooseVariableFVReal
[]
[ay_out]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[ax_out]
type = FunctorAux
functor = ax
variable = ax_out
execute_on = timestep_end
[]
[ay_out]
type = FunctorAux
functor = ay
variable = ay_out
execute_on = timestep_end
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = u
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = v
function = 0
[]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = u
function = 0
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = v
function = 0
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 0
[]
[]
[MultiApps]
[scalar]
type = FullSolveMultiApp
execute_on = 'timestep_end'
input_files = 'scalar-transport.i'
[]
[]
[Transfers]
[ax]
type = MultiAppCopyTransfer
source_variable = ax_out
variable = ax
execute_on = 'timestep_end'
to_multi_app = 'scalar'
[]
[ay]
type = MultiAppCopyTransfer
source_variable = ay_out
variable = ay
execute_on = 'timestep_end'
to_multi_app = 'scalar'
[]
[u]
type = MultiAppCopyTransfer
source_variable = u
variable = u
execute_on = 'timestep_end'
to_multi_app = 'scalar'
[]
[v]
type = MultiAppCopyTransfer
source_variable = v
variable = v
execute_on = 'timestep_end'
to_multi_app = 'scalar'
[]
[pressure]
type = MultiAppCopyTransfer
source_variable = pressure
variable = pressure
execute_on = 'timestep_end'
to_multi_app = 'scalar'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/optimization/test/tests/optimizationreporter/nonlinear_material/main.i)
[Optimization]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'heat_source'
num_values = '1'
initial_condition = '0'
lower_bounds = '0.1'
upper_bounds = '10000'
measurement_points = '0.2 0.2 0
0.8 0.6 0
0.2 1.4 0
0.8 1.8 0'
measurement_values = '1.98404 1.91076 1.56488 1.23863'
[]
[Executioner]
type = Optimize
tao_solver = taolmvm
petsc_options_iname = '-tao_gttol'
petsc_options_value = ' 1e-5'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward_and_adjoint.i
execute_on = FORWARD
[]
[]
[Transfers]
[to_forward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/heat_source'
to_reporters = 'measurement_locations/measurement_xcoord
measurement_locations/measurement_ycoord
measurement_locations/measurement_zcoord
measurement_locations/measurement_time
measurement_locations/measurement_values
params/heat_source'
[]
[from_forward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measurement_locations/simulation_values
gradient_vpp/inner_product'
to_reporters = 'OptimizationReporter/simulation_values
OptimizationReporter/grad_heat_source'
[]
[]
[Outputs]
csv = true
[]
(modules/combined/test/tests/restart-transient-from-ss-with-stateful/parent_ss.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
nx = 8
ny = 8
xmin = -82.627
xmax = 82.627
ymin = -82.627
ymax = 82.627
dim = 2
[]
[]
[Variables]
[./temp]
order = FIRST
family = LAGRANGE
initial_condition = 500
[../]
[]
[AuxVariables]
[./power]
order = FIRST
family = L2_LAGRANGE
initial_condition = 350
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = temp
[../]
[./heat_source_fuel]
type = CoupledForce
variable = temp
v = 'power'
[../]
[]
[BCs]
[./all]
type = DirichletBC
variable = temp
boundary = 'bottom top left right'
value = 300
[../]
[]
[Materials]
[./heat_material]
type = HeatConductionMaterial
temp = temp
specific_heat = 1000
thermal_conductivity = 500
[../]
[./density]
type = Density
density = 2000
[../]
[]
[Postprocessors]
[./avg_temp]
type = ElementAverageValue
variable = temp
execute_on = 'initial timestep_end'
[../]
[./avg_power]
type = ElementAverageValue
variable = power
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
petsc_options_value = 'hypre boomeramg 300'
line_search = 'none'
l_tol = 1e-05
nl_rel_tol = 1e-12
nl_abs_tol = 1e-9
l_max_its = 50
nl_max_its = 25
[]
[Outputs]
perf_graph = true
color = true
exodus = true
[checkpoint]
type = Checkpoint
num_files = 2
additional_execute_on = 'FINAL' # seems to be a necessary to avoid a Checkpoint bug
[]
[]
[MultiApps]
[./bison]
type = FullSolveMultiApp
positions = '0 0 0'
input_files = 'sub_ss.i'
execute_on = 'timestep_end'
[../]
[]
[Transfers]
[./to_bison_mechanics]
type = MultiAppProjectionTransfer
to_multi_app = bison
variable = temp
source_variable = temp
execute_on = 'timestep_end'
[../]
[]
(test/tests/transfers/multiapp_copy_transfer/linear_lagrange_to_sub/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = timestep_end
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
source_variable = u
variable = u
to_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(modules/optimization/test/tests/optimizationreporter/general_opt/point_loads_gen_opt/main_auto_adjoint.i)
[Optimization]
[]
[OptimizationReporter]
type = GeneralOptimization
objective_name = misfit_norm
parameter_names = 'parameter_results'
num_values = '3'
[]
[Reporters]
[measure_data]
type = OptimizationData
measurement_points = '0.5 0.28 0
0.5 0.6 0
0.5 0.8 0
0.5 1.1 0'
measurement_values = '293 304 315 320'
[]
[]
[Executioner]
type = Optimize
tao_solver = taolmvm
petsc_options_iname = '-tao_gttol -tao_ls_type'
petsc_options_value = '1e-5 unit'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward_and_adjoint.i
execute_on = "FORWARD"
[]
[]
[Transfers]
# FORWARD transfers
[toForward_measument]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/parameter_results'
to_reporters = 'point_source/value'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'gradient/temperature_adjoint
measure_data/misfit_norm'
to_reporters = 'OptimizationReporter/grad_parameter_results
OptimizationReporter/misfit_norm'
[]
[]
[Outputs]
csv = true
file_base = main_out
[]
(test/tests/positions/multiapp_positions.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dx = 1
dim = 1
[]
[]
[Positions]
[multiapp]
type = MultiAppPositions
multiapps = 'm1 m2 m3'
[]
[]
[MultiApps]
[m1]
type = CentroidMultiApp
input_files = 'multiapp_positions.i'
cli_args = "MultiApps/active='';Positions/active=''"
[]
[m2]
type = FullSolveMultiApp
input_files = 'multiapp_positions.i'
cli_args = "MultiApps/active='';Positions/active=''"
[]
[m3]
type = FullSolveMultiApp
input_files = 'multiapp_positions.i'
positions = '0.2 0.4 1
0 0 6'
cli_args = "MultiApps/active='';Positions/active=''"
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
[out]
type = JSON
execute_on = FINAL
execute_system_information_on = none
[]
[]
(test/tests/transfers/multiapp_copy_transfer/third_monomial_to_sub/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[AuxVariables]
[./aux]
family = MONOMIAL
order = THIRD
[../]
[]
[AuxKernels]
[./aux]
type = FunctionAux
function = x*y
variable = aux
execute_on = initial
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = timestep_end
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
source_variable = aux
variable = u
to_multi_app = sub
[../]
[]
[Outputs]
hide = 'u'
exodus = true
[]
(test/tests/transfers/general_field/nearest_node/mesh_division/main_match_division.i)
# Base input for testing transfers with mesh divisions restrictions with a mapping from
# source mesh divisions to target mesh divisions. It has the following complexities:
# - multiple sub-applications
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
# Explaining results on the main app:
# Each value on the main app comes from a region with the same division index on a subapp
# Because the subapp is not very discretized in Y, some source mesh division indices
# are not represented in the subapps. Therefore these mesh divisions are not present in the
# main app.
# Explaining results on the sub apps:
# Each subapp receives results for all its target mesh divisions. They are naturally all the
# same because they are all matched with the same source app (parent app) source division
# and the division on the parent app is too small to have more than 1 valid point + value
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[MeshDivisions]
[middle]
type = CartesianGridDivision
bottom_left = '0.21 0.21 0'
# cover more and sample more bins
top_right = '1.001 1.001 0'
nx = 5
ny = 5
nz = 1
[]
[]
[AuxVariables]
[from_sub]
initial_condition = -1
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[to_sub]
[InitialCondition]
type = FunctionIC
function = '1 + 2*x*x + 3*y*y*y'
[]
[]
[to_sub_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '2 + 2*x*x + 3*y*y*y'
[]
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
[out]
type = Exodus
hide = 'to_sub to_sub_elem div'
overwrite = true
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = sub.i
output_in_position = true
# The positions are randomly offset to prevent equi-distant nearest-locations
positions = '0.1001 0.0000013 0
0.30054 0.600001985 0
0.70021 0.0000022 0
0.800212 0.5500022 0'
cli_args = "base_value=1;MeshDivisions/middle_sub/nx=5;MeshDivisions/middle_sub/ny=5;Mesh/nx=10 "
"base_value=2;MeshDivisions/middle_sub/nx=5;MeshDivisions/middle_sub/ny=5;Mesh/nx=10 "
"base_value=3;MeshDivisions/middle_sub/nx=5;MeshDivisions/middle_sub/ny=5;Mesh/nx=10 "
"base_value=4;MeshDivisions/middle_sub/nx=5;MeshDivisions/middle_sub/ny=5;Mesh/nx=10"
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = to_sub
variable = from_main
from_mesh_division = middle
from_mesh_division_usage = 'matching_division'
to_mesh_division = middle_sub
to_mesh_division_usage = 'matching_division'
# we avoid bounding boxes because the parent and children apps do
# not overlap so unless we grow the boxes to cover the entire source,
# the transfer will not pick up all the source mesh divisions
greedy_search = true
use_bounding_boxes = false
[]
[to_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = to_sub_elem
variable = from_main_elem
from_mesh_division = middle
from_mesh_division_usage = 'matching_division'
to_mesh_division = middle_sub
to_mesh_division_usage = 'matching_division'
greedy_search = true
use_bounding_boxes = false
[]
[from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main
variable = from_sub
from_mesh_division = middle_sub
from_mesh_division_usage = 'matching_division'
to_mesh_division = middle
to_mesh_division_usage = 'matching_division'
greedy_search = true
use_bounding_boxes = false
[]
[from_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main_elem
variable = from_sub_elem
from_mesh_division = middle_sub
from_mesh_division_usage = 'matching_division'
to_mesh_division = middle
to_mesh_division_usage = 'matching_division'
greedy_search = true
use_bounding_boxes = false
[]
[]
# For debugging purposes
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'middle'
[]
[]
(test/tests/transfers/coord_transform/both-transformed/copy/main-app.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = -1
ymax = 0
nx = 10
ny = 10
alpha_rotation = 90
[]
[Variables]
[u][]
[]
[AuxVariables]
[v][]
[v_elem]
order = CONSTANT
family = MONOMIAL
[]
[w][]
[w_elem]
order = CONSTANT
family = MONOMIAL
[]
[]
[ICs]
[w]
type = FunctionIC
function = 'cos(x)*sin(y)'
variable = w
[]
[w_elem]
type = FunctionIC
function = 'cos(x)*sin(y)'
variable = w_elem
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[force]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
verbose = true
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = 'sub-app.i'
execute_on = 'timestep_begin'
[]
[]
[Transfers]
[from_sub]
type = MultiAppCopyTransfer
from_multi_app = sub
source_variable = v
variable = v
execute_on = 'timestep_begin'
[]
[from_sub_elem]
type = MultiAppCopyTransfer
from_multi_app = sub
source_variable = v_elem
variable = v_elem
execute_on = 'timestep_begin'
[]
[to_sub]
type = MultiAppCopyTransfer
to_multi_app = sub
source_variable = w
variable = w
execute_on = 'timestep_begin'
[]
[to_sub_elem]
type = MultiAppCopyTransfer
to_multi_app = sub
source_variable = w_elem
variable = w_elem
execute_on = 'timestep_begin'
[]
[]
(test/tests/transfers/multiapp_copy_transfer/constant_monomial_to_sub/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[AuxVariables]
[./aux]
family = MONOMIAL
order = CONSTANT
[../]
[]
[AuxKernels]
[./aux]
type = FunctionAux
function = x*y
variable = aux
execute_on = initial
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = timestep_end
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
source_variable = aux
variable = u
to_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/restart/restart_subapp_not_parent/two_step_solve_parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 2
ny = 2
elem_type = QUAD9
[]
[Functions]
[./exact_fn]
type = ParsedFunction
expression = t*t*(x*x+y*y)
[../]
[./forcing_fn]
type = ParsedFunction
expression = 2*t*(x*x+y*y)-4*t*t
[../]
[]
[Variables]
[./u]
family = LAGRANGE
order = SECOND
[../]
[]
[ICs]
active = ''
[./u_var]
type = FunctionIC
variable = u
function = exact_fn
[../]
[]
[Kernels]
[./td]
type = TimeDerivative
variable = u
[../]
[./diff]
type = Diffusion
variable = u
[../]
[./ffn]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./all]
type = FunctionDirichletBC
variable = u
boundary = 'left right top bottom'
function = exact_fn
[../]
[]
[Postprocessors]
[./average]
type = ElementAverageValue
variable = u
execute_on = 'initial timestep_end'
[../]
[]
[Executioner]
type = Transient
start_time = 2.0
end_time = 4.0
dt = 1.0
[]
[MultiApps]
[./full_solve]
type = FullSolveMultiApp
execute_on = initial
positions = '0 0 0'
# input file will come from cli-coupled_variables
[../]
[]
[Transfers]
[./transfer_u]
type = MultiAppProjectionTransfer
multi_app = full_solve
direction = FROM_MULTIAPP
variable = u
source_variable = u
[../]
[]
[Outputs]
#file_base will come from cli-coupled_variables
exodus = true
[]
(test/tests/multiapps/initial_transfer/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 2
ny = 2
[]
[Problem]
kernel_coverage_check = false
[]
[Variables][dummy][][]
[Functions]
[func]
type = ConstantFunction
value = 1
[]
[]
[Postprocessors]
[c]
type = FunctionValuePostprocessor
function = func
execute_on = initial
# this will force this postprocessor to be evaluated before transfer on initial
force_preic = true
[]
[]
[Executioner]
type = Steady
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = initial
[../]
[]
[Transfers]
[to_sub]
type = MultiAppPostprocessorTransfer
to_multi_app = sub
from_postprocessor = c
to_postprocessor = receiver
[]
[]
(test/tests/transfers/multiapp_nearest_node_transfer/cached_multiple_apps/main.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 3
dx = 2
dy = 2
dz = 2
ix = 1
iy = 5
iz = 5
[]
[translate]
type = TransformGenerator
input = cmg
transform = TRANSLATE
vector_value = '-1 -1 -1'
[]
[]
[Variables]
[dummy]
[]
[]
[AuxVariables]
[Temperature]
[]
[Layered_Average]
[]
[Layered_Average_elem]
family = MONOMIAL
order = CONSTANT
[]
[Subapp_Temp]
[]
[Subapp_Temp_elem]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[extra]
type = ADDiffusion
variable = dummy
[]
[]
[AuxKernels]
[Location_Based]
type = ParsedAux
variable = Temperature
expression = 'x+y+z'
use_xyzt = true
[]
[Layered_Average_User_Object]
type = SpatialUserObjectAux
variable = Layered_Average
user_object = Tfuel_UO
[]
[Layered_Average_User_Object_elem]
type = SpatialUserObjectAux
variable = Layered_Average_elem
user_object = Tfuel_UO
[]
[]
[UserObjects]
[Tfuel_UO]
type = NearestPointLayeredAverage
variable = Temperature
direction = x
num_layers = 1
points_file = 'locations.txt'
execute_on = 'initial timestep_end'
[]
[]
[MultiApps]
[TF_sub]
type = FullSolveMultiApp
positions_file = 'locations.txt'
input_files = 'child.i'
execute_on = 'TIMESTEP_END'
[]
[]
[GlobalParams]
bbox_factor = 2
[]
[Transfers]
[to_sub_layers]
type = MultiAppNearestNodeTransfer
to_multi_app = TF_sub
source_variable = Layered_Average
variable = Temperature
fixed_meshes = True
[]
[to_sub_layers_elem]
type = MultiAppNearestNodeTransfer
to_multi_app = TF_sub
source_variable = Layered_Average_elem
variable = Temperature_elem
[]
[from_sub_recover_layers]
type = MultiAppNearestNodeTransfer
from_multi_app = TF_sub
source_variable = Temperature
variable = Subapp_Temp
[]
[from_sub_recover_layers_elem]
type = MultiAppNearestNodeTransfer
from_multi_app = TF_sub
source_variable = Temperature_elem
variable = Subapp_Temp_elem
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
# First step does not use Transfers caching
# Second step does
num_steps = 2
[]
[Outputs]
[out]
type = Exodus
hide = 'dummy Temperature Layered_Average Layered_Average_elem'
[]
[]
(test/tests/transfers/multiapp_conservative_transfer/parent_conservative_transfer.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = sub_conservative_transfer.i
execute_on = timestep_end
[]
[]
[Postprocessors]
[from_postprocessor]
type = ElementIntegralVariablePostprocessor
variable = u
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
source_variable = u
variable = aux_u
to_multi_app = sub
from_postprocessors_to_be_preserved = 'from_postprocessor'
to_postprocessors_to_be_preserved = 'to_postprocessor'
[]
[]
[Outputs]
exodus = true
[console]
type = Console
execute_postprocessors_on = 'INITIAL nonlinear TIMESTEP_END'
[]
[]
(test/tests/transfers/multiapp_conservative_transfer/primary_negative_adjuster.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 1
ny = 1
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[AuxVariables]
[var]
family = MONOMIAL
order = THIRD
[]
[]
[ICs]
[var_ic]
type = FunctionIC
variable = var
function = '-exp(x * y)'
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = secondary_negative_adjuster.i
execute_on = timestep_end
[]
[]
[Postprocessors]
[from_postprocessor]
type = ElementIntegralVariablePostprocessor
variable = var
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
source_variable = var
variable = var
to_multi_app = sub
from_postprocessors_to_be_preserved = 'from_postprocessor'
to_postprocessors_to_be_preserved = 'to_postprocessor'
[]
[]
[Outputs]
exodus = true
[]
(modules/combined/test/tests/optimization/invOpt_bc_convective/main.i)
[Optimization]
[]
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 20
xmax = 1
ymax = 2
[]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'p1'
num_values = '1'
initial_condition = '9'
upper_bounds = '10'
lower_bounds = '1'
measurement_points = '0.1 0 0
0.1 0.1 0
0.1 0.2 0
0.1 0.3 0
0.1 0.4 0
0.1 0.5 0
0.1 0.6 0
0.1 0.7 0
0.1 0.8 0
0.1 0.9 0
0.1 1 0
0.1 1.1 0
0.1 1.2 0
0.1 1.3 0
0.1 1.4 0
0.1 1.5 0
0.1 1.6 0
0.1 1.7 0
0.1 1.8 0
0.1 1.9 0
0.1 2 0'
measurement_values = '500
472.9398111
450.8117197
434.9560747
423.3061045
414.9454912
409.3219399
406.1027006
405.0865428
406.1604905
409.2772668
414.4449772
421.7253934
431.2401042
443.1862012
457.8664824
475.7450186
497.5582912
524.4966003
559.1876637
600'
[]
[Executioner]
type = Optimize
tao_solver = taoblmvm #taolmvm#taonm #taolmvm
petsc_options_iname = '-tao_gatol' # -tao_fd_gradient -tao_fd_delta'
petsc_options_value = '1e-4' #1e-1 '#true 1e-4'
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = "FORWARD"
clone_parent_mesh = true
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint.i
execute_on = "ADJOINT"
clone_parent_mesh = true
[]
[]
[Transfers]
#these are usually the same for all input files.
[toForward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/p1'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
params/vals'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[toAdjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/p1'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
params/vals'
[]
[fromAdjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'adjoint_pt/inner_product'
to_reporters = 'OptimizationReporter/grad_p1'
[]
# these are transferring data from subapp to subapp because the adjoint problem
# needs the forward solution to compute the gradient. Maybe this step could be
# done on the main app. The adjoint only passes the adjoint variable (whole mesh)
# to the main app and the main app computes the gradient from this.
[fromForwardtoAdjoint_temp]
type = MultiAppCopyTransfer
from_multi_app = forward
to_multi_app = adjoint
source_variable = 'temperature'
variable = 'temperature_forward'
[]
[]
[Outputs]
csv = true
[]
(test/tests/multiapps/steffensen_postprocessor/steady_main.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
parallel_type = replicated
uniform_refine = 1
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[source]
type = BodyForce
variable = u
value = 1
[]
[]
[BCs]
[left]
type = PostprocessorDirichletBC
variable = u
boundary = left
postprocessor = 'from_sub'
[]
[]
[Postprocessors]
[from_sub]
type = Receiver
default = 0
[]
[to_sub]
type = SideAverageValue
variable = u
boundary = right
[]
[average]
type = ElementAverageValue
variable = u
[]
[]
[Executioner]
type = Steady
# Solve parameters
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
nl_abs_tol = 1e-14
# App coupling parameters
fixed_point_algorithm = 'steffensen'
fixed_point_max_its = 100
transformed_postprocessors = 'from_sub'
[]
[Outputs]
csv = true
exodus = false
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = steady_sub.i
clone_parent_mesh = true
execute_on = 'timestep_begin'
# we keep the full postprocessor output history of the subapp
keep_full_output_history = true
transformed_postprocessors = 'from_main'
[]
[]
[Transfers]
[left_from_sub]
type = MultiAppPostprocessorTransfer
from_multi_app = sub
from_postprocessor = 'to_main'
to_postprocessor = 'from_sub'
reduction_type = 'average'
[]
[right_to_sub]
type = MultiAppPostprocessorTransfer
to_multi_app = sub
from_postprocessor = 'to_sub'
to_postprocessor = 'from_main'
[]
[]
(test/tests/multiapps/picard/steady_picard_parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
parallel_type = replicated
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[v]
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[force_u]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[unorm]
type = ElementL2Norm
variable = u
execute_on = 'initial timestep_end'
[]
[vnorm]
type = ElementL2Norm
variable = v
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = Steady
nl_abs_tol = 1e-14
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 10
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = steady_picard_sub.i
no_backup_and_restore = true
[]
[]
[Transfers]
[v_from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = v
variable = v
[]
[u_to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = u
variable = u
[]
[]
(modules/combined/test/tests/optimization/invOpt_elasticity/main.i)
[Optimization]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'youngs_modulus'
num_values = '3'
#initial_condition = '5 4 3'
initial_condition = '5.0 5.0 5.0'
lower_bounds = '0.1'
upper_bounds = '10.0'
measurement_points = '-1.0 -1.0 0.0
-1.0 0.0 0.0
-1.0 1.0 0.0
0.0 -1.0 0.0
0.0 0.0 0.0
0.0 1.0 0.0
1.0 -1.0 0.0
1.0 0.0 0.0
1.0 1.0 0.0'
measurement_values = '2.270471e+00 3.448233e+00 4.766029e+00
2.205754e+00 3.374848e+00 4.691352e+00
2.172435e+00 3.326780e+00 4.642104e+00'
[]
[Executioner]
type = Optimize
tao_solver = taobqnls #taobncg #taoblmvm
petsc_options_iname = '-tao_gatol -tao_ls_type -tao_max_it'
petsc_options_value = '1e-10 unit 1000'
# THESE OPTIONS ARE FOR TESTING THE ADJOINT GRADIENT
# petsc_options_iname = '-tao_max_it -tao_fd_test -tao_test_gradient -tao_fd_gradient -tao_fd_delta -tao_gatol'
# petsc_options_value = '1 true true false 1e-8 0.1'
# petsc_options = '-tao_test_gradient_view'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = FORWARD
[]
[adjoint]
type = FullSolveMultiApp
input_files = grad.i
execute_on = ADJOINT
[]
[]
[Transfers]
[toForward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/youngs_modulus'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
parametrization/youngs_modulus'
[]
[get_misfit]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[set_state_for_adjoint]
type = MultiAppCopyTransfer
from_multi_app = forward
to_multi_app = adjoint
source_variable = 'ux uy'
variable = 'state_x state_y'
[]
[setup_adjoint_run]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/youngs_modulus'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
parametrization/youngs_modulus'
[]
[get_grad_youngs_modulus]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'grad_youngs_modulus/inner_product'
to_reporters = 'OptimizationReporter/grad_youngs_modulus'
[]
[]
[Reporters]
[optInfo]
type = OptimizationInfo
items = 'current_iterate function_value gnorm'
[]
[]
[Outputs]
console = false
csv = true
[]
(modules/optimization/test/tests/outputs/exodus_optimization_steady/main.i)
[Optimization]
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'p1'
num_values = '1'
initial_condition = '7'
lower_bounds = '0'
upper_bounds = '10'
measurement_points = '0.2 0.2 0
0.8 0.6 0
0.2 1.4 0
0.8 1.8 0'
measurement_values = '226 254 214 146'
[]
[Executioner]
type = Optimize
tao_solver = taoblmvm
petsc_options_iname = '-tao_gatol'
petsc_options_value = '0.0001'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = "FORWARD"
clone_parent_mesh = true
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint.i
execute_on = "ADJOINT"
clone_parent_mesh = true
[]
[]
[Transfers]
[toForward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/p1'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
params/p1'
[]
[fromForward_mesh]
type = MultiAppCopyTransfer
from_multi_app = forward
to_multi_app = adjoint
source_variable = 'temperature'
variable = 'temperature_forward'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[toAdjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/p1'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
params/p1'
[]
[fromAdjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'adjoint_grad/inner_product'
to_reporters = 'OptimizationReporter/grad_p1'
[]
[]
[Outputs]
csv = true
[]
(test/tests/transfers/multiapp_nearest_node_transfer/source_boundary_parent.i)
[Mesh]
[drmg]
type = DistributedRectilinearMeshGenerator
dim = 2
nx = 30
ny = 30
xmax = 2
elem_type = QUAD4
partition = square
[]
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[from_sub]
[]
[]
[Kernels]
[conduction]
type = Diffusion
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = 'left'
value = 1
[]
[right]
type = DirichletBC
variable = u
boundary = 'right'
value = 10
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = 'source_boundary_sub.i'
positions = '-1.0 0.0 0.0
2. 0.0 0.0'
output_in_position = true
cli_args = 'BCs/right/value="1" BCs/right/value="10"'
[]
[]
[Transfers]
[source_boundary]
type = MultiAppNearestNodeTransfer
source_variable = u
from_multi_app = sub
variable = from_sub
source_boundary = 'right'
[]
[]
[Executioner]
type = Steady
nl_rel_tol = 1e-6
[]
[Outputs]
exodus = true
[]
(modules/optimization/test/tests/optimizationreporter/bimaterial/main.i)
# This main.i file runs the subapps model.i and grad.i, using an FullSolveMultiApp
# The purpose of main.i is to find the two diffusivity_values
# (one in the bottom material of model.i, and one in the top material of model.i)
# such that the misfit between experimental observations (defined in model.i) and MOOSE predictions is minimised.
# The adjoint computed in grad.i is used to compute the gradient for the gradient based LMVM solver in TAO
# PETSc-TAO optimisation is used to perform this inversion
#
[Optimization]
[]
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 16
ny = 16
xmin = -4
xmax = 4
ymin = -4
ymax = 4
[]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = diffusivity_values
num_values = 2 # diffusivity in the bottom material and in the top material of model.i
initial_condition = '15 15' # the expected result is about '1 10' so this initial condition is not too bad
lower_bounds = '1'
upper_bounds = '50'
measurement_file = 'synthetic_data.csv'
file_value = 'temperature'
[]
[Executioner]
# type = Optimize
# tao_solver = taoblmvm
# petsc_options_iname = '-tao_fd_gradient -tao_gatol'
# petsc_options_value = ' true 0.001'
type = Optimize
tao_solver = taobqnktr
petsc_options_iname = '-tao_gatol'
petsc_options_value = '1e-3'
## THESE OPTIONS ARE FOR TESTING THE ADJOINT GRADIENT
# petsc_options_iname='-tao_max_it -tao_fd_test -tao_test_gradient -tao_fd_gradient -tao_fd_delta -tao_gatol'
# petsc_options_value='1 true true false 1e-8 0.1'
# petsc_options = '-tao_test_gradient_view'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = model.i
execute_on = FORWARD
[]
[adjoint]
type = FullSolveMultiApp
input_files = grad.i #write this input file to compute the adjoint solution and the gradient
execute_on = ADJOINT
[]
[]
[Transfers]
[toForward] #pass the coordinates where we knew the measurements to the forward model to do the extraction of the simulation data at the location of the measurements to compute the misfit
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/diffusivity_values'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
data/diffusivity'
[]
[from_forward] #get the simulation values
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
#############
#copy the temperature variable - we will need this for the computation of the gradient
[fromforwardMesh]
type = MultiAppCopyTransfer
from_multi_app = forward
to_multi_app = adjoint
source_variable = 'temperature'
variable = 'temperature_forward'
[]
#############
[toAdjoint] #pass the misfit to the adjoint
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/diffusivity_values'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
data/diffusivity'
[]
[fromadjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'gradvec/inner_product'
to_reporters = 'OptimizationReporter/grad_diffusivity_values'
[]
[]
[Outputs]
console = false
csv = true
[]
(modules/level_set/test/tests/transfers/copy_solution/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[ICs]
[./u_ic]
type = FunctionIC
function = 'x*x*y'
variable = u
[../]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = 'sub.i'
execute_on = timestep_end
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
variable = u
source_variable = u
to_multi_app = sub
execute_on = timestep_end
check_multiapp_execute_on = false
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/general_field/nearest_node/nearest_position/main_single_sub.i)
# Base input for testing transfers. It has the following complexities:
# - more than one subapp
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[AuxVariables]
[to_sub]
[InitialCondition]
type = FunctionIC
function = '1 + 2*x*x + 3*y*y*y'
[]
[]
[to_sub_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '2 + 2*x*x + 3*y*y*y'
[]
[]
[from_sub]
initial_condition = -1
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
verbose_multiapps = true
[]
[Outputs]
[out]
type = Exodus
overwrite = true
hide = 'to_sub to_sub_elem'
[]
[]
[Positions]
[single]
type = InputPositions
# Tiny offset to steer clear of equidistance
positions = '0.000001 0.0000000001 0'
[]
[partition_app_domain]
type = InputPositions
# Tiny offsets to steer clear of equi-distance
# The top left and bottom right are closer to top right than to the bottom left corner
# This makes it so that the bottom left "nearest-area" is larger
# and the top-right "nearest" area is smaller
positions = '0.1 0.12 0
0.900008 0.130000000001 0
0.85000007 0.8500001 0
0.10001 0.75003 0'
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
positions_objects = single
app_type = MooseTestApp
input_files = sub_holes.i
output_in_position = true
execute_on = TIMESTEP_END
[]
[]
[Transfers]
[from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main
variable = from_sub
use_nearest_position = partition_app_domain
search_value_conflicts = true
bbox_factor = 10
group_subapps = true
[]
[from_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main_elem
variable = from_sub_elem
use_nearest_position = partition_app_domain
search_value_conflicts = true
bbox_factor = 10
group_subapps = true
[]
[]
(test/tests/multiapps/picard/steady_custom_picard_parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
parallel_type = replicated
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[v]
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[force_u]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[unorm]
type = ElementL2Norm
variable = u
execute_on = 'initial timestep_end'
[]
[vnorm]
type = ElementL2Norm
variable = v
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = SteadyWithPicardCheck
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
disable_fixed_point_residual_norm_check = true
pp_name = unorm
pp_step_tol = 1e-4
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = steady_picard_sub.i
no_backup_and_restore = true
[]
[]
[Transfers]
[v_from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = v
variable = v
[]
[u_to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = u
variable = u
[]
[]
(test/tests/transfers/general_field/nearest_node/mesh_division/main.i)
# Base input for testing transfers. It has the following complexities:
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[MeshDivisions]
[middle]
type = CartesianGridDivision
bottom_left = '0.21 0.21 0'
top_right = '0.81 0.81 0'
nx = 2
ny = 2
nz = 1
[]
[]
[AuxVariables]
[from_sub]
initial_condition = -1
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[to_sub]
[InitialCondition]
type = FunctionIC
function = '1 + 2*x*x + 3*y*y*y'
[]
[]
[to_sub_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '2 + 2*x*x + 3*y*y*y'
[]
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
[out]
type = Exodus
hide = 'to_sub to_sub_elem div'
overwrite = true
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = sub.i
output_in_position = true
# The positions are randomly offset to prevent equi-distant nearest-locations
positions = '0.1001 0.0000013 0
0.30054 0.600001985 0
0.70021 0.0000022 0
0.800212 0.5500022 0'
cli_args = 'base_value=1 base_value=2 base_value=3 base_value=4'
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = to_sub
variable = from_main
[]
[to_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = to_sub_elem
variable = from_main_elem
[]
[from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main
variable = from_sub
[]
[from_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main_elem
variable = from_sub_elem
[]
[]
# For debugging purposes
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'middle'
[]
[]
(test/tests/transfers/multiapp_copy_transfer/errors/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = timestep_end
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
source_variable = u
variable = u
to_multi_app = sub
[../]
[]
(modules/optimization/test/tests/optimizationreporter/bimaterial/main_auto_adjoint.i)
# This main.i file runs the subapps model.i and grad.i, using an FullSolveMultiApp
# The purpose of main.i is to find the two diffusivity_values
# (one in the bottom material of model.i, and one in the top material of model.i)
# such that the misfit between experimental observations (defined in model.i) and MOOSE predictions is minimised.
# The adjoint computed in grad.i is used to compute the gradient for the gradient based LMVM solver in TAO
# PETSc-TAO optimisation is used to perform this inversion
#
[Optimization]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = diffusivity_values
num_values = 2 # diffusivity in the bottom material and in the top material of model.i
initial_condition = '3 4' # the expected result is about '1 10' so this initial condition is not too bad
lower_bounds = '1'
upper_bounds = '20'
measurement_file = 'synthetic_data.csv'
file_value = 'temperature'
[]
[Executioner]
type = Optimize
tao_solver = taoblmvm
petsc_options_iname = '-tao_gatol'
petsc_options_value = '1e-3'
## THESE OPTIONS ARE FOR TESTING THE ADJOINT GRADIENT
# petsc_options_iname='-tao_max_it -tao_fd_test -tao_test_gradient -tao_fd_gradient -tao_fd_delta -tao_gatol'
# petsc_options_value='1 true true false 1e-8 0.1'
# petsc_options = '-tao_test_gradient_view'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = model_and_adjoint.i
execute_on = FORWARD
[]
[]
[Transfers]
[toForward] #pass the coordinates where we knew the measurements to the forward model to do the extraction of the simulation data at the location of the measurements to compute the misfit
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/diffusivity_values'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
data/diffusivity'
[]
[from_forward] #get the simulation values
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values
gradvec/inner_product'
to_reporters = 'OptimizationReporter/simulation_values
OptimizationReporter/grad_diffusivity_values'
[]
[]
[Outputs]
console = true
csv = true
[]
(modules/combined/test/tests/optimization/invOpt_nonlinear/main.i)
[Optimization]
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'heat_source'
num_values = '1'
initial_condition = '0'
lower_bounds = '0.1'
upper_bounds = '10000'
measurement_points = '0.2 0.2 0
0.8 0.6 0
0.2 1.4 0
0.8 1.8 0'
measurement_values = '1.98404 1.91076 1.56488 1.23863'
[]
[Executioner]
type = Optimize
tao_solver = taonls
petsc_options_iname = '-tao_gttol -tao_max_it -tao_nls_pc_type -tao_nls_ksp_type'
petsc_options_value = ' 1e-5 5 none cg'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = FORWARD
clone_parent_mesh = true
[]
[homogeneous_forward]
type = FullSolveMultiApp
input_files = homogeneous_forward.i
execute_on = HOMOGENEOUS_FORWARD
clone_parent_mesh = true
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint.i
execute_on = ADJOINT
clone_parent_mesh = true
[]
[]
[Transfers]
## RUN FORWARD SIMULATION WITH CURRENT PARAMETERS AS FORCE,
## AND EXTRACT SIMULATED VALUES AT MEASUREMENT POINTS
## AS WELL AS TOTAL FIELD VARIABLE FOR NONLINEAR PURPOSES
[MeasurementLocationsToForward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/heat_source'
to_reporters = 'measurement_locations/measurement_xcoord
measurement_locations/measurement_ycoord
measurement_locations/measurement_zcoord
measurement_locations/measurement_time
measurement_locations/measurement_values
params/heat_source'
[]
[SimulatedDataFromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measurement_locations/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
### RUN THE HOMOGENEOUS_FORWARD WITH CURRENT NONLINEAR STATE, PARAMETER_STEP,
### AND EXTRACT SIMULATED DATA AT MEASURMENT POINTS
[CurrentStateFromForwardNonlinearToHomogeneousForwardNonlinear]
type = MultiAppCopyTransfer
from_multi_app = forward
to_multi_app = homogeneous_forward
source_variable = 'forwardT'
variable = 'forwardT'
[]
[MeasurementLocationsToHomogeneousForward]
type = MultiAppReporterTransfer
to_multi_app = homogeneous_forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/heat_source'
to_reporters = 'measurement_locations/measurement_xcoord
measurement_locations/measurement_ycoord
measurement_locations/measurement_zcoord
measurement_locations/measurement_time
measurement_locations/measurement_values
params/heat_source'
[]
[SimulatedDataFromHomogeneousForward]
type = MultiAppReporterTransfer
from_multi_app = homogeneous_forward
from_reporters = 'measurement_locations/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
### RUN THE ADJOINT WITH CURRENT NONLINEAR STATE, WITH MISFIT AS EXCITATION,
### AND EXTRACT GRADIENT
[CurrentStateToAdjointNonlinear]
type = MultiAppCopyTransfer
from_multi_app = forward
to_multi_app = adjoint
source_variable = 'forwardT'
variable = 'forwardT'
[]
[MisfitToAdjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/heat_source'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
params/heat_source'
[]
[GradientFromAdjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'gradient_vpp/inner_product'
to_reporters = 'OptimizationReporter/grad_heat_source'
[]
[]
[Reporters]
[optInfo]
type = OptimizationInfo
[]
[]
[Outputs]
csv = true
[]
(modules/stochastic_tools/test/tests/multiapps/batch_commandline_control/parent_wrong_size.i)
[StochasticTools]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
positions = '0 0 0
1 1 1'
input_files = 'sub.i'
[]
[]
[Distributions]
[uniform]
type = Uniform
lower_bound = 5
upper_bound = 10
[]
[]
[Samplers]
[sample]
type = MonteCarlo
num_rows = 10
distributions = 'uniform'
execute_on = 'initial timestep_end'
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
sampler = sample
arguments = 'Mesh/nx'
[]
[]
(modules/optimization/examples/materialTransient/optimize_grad.i)
[Optimization]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'D'
num_values = '4'
initial_condition = '0.01 0.01 0.01 0.01'
upper_bounds = '1e2'
lower_bounds = '1e-3'
measurement_file = forward_out_data_0011.csv
file_xcoord = measurement_xcoord
file_ycoord = measurement_ycoord
file_zcoord = measurement_zcoord
file_time = measurement_time
file_value = simulation_values
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
cli_args = 'Outputs/csv=false;Outputs/console=false'
execute_on = FORWARD
[]
[adjoint]
type = FullSolveMultiApp
input_files = gradient.i
cli_args = 'Outputs/console=false;UserObjects/load_u/mesh=optimize_grad_out_forward0.e'
execute_on = ADJOINT
[]
[]
[Transfers]
[to_forward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/D'
to_reporters = 'data/measurement_xcoord
data/measurement_ycoord
data/measurement_zcoord
data/measurement_time
data/measurement_values
diffc_rep/D_vals'
[]
[from_forward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[to_adjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/D'
to_reporters = 'data/measurement_xcoord
data/measurement_ycoord
data/measurement_zcoord
data/measurement_time
data/misfit_values
diffc_rep/D_vals'
[]
[from_adjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'adjoint/inner_product'
to_reporters = 'OptimizationReporter/grad_D'
[]
[]
[Executioner]
type = Optimize
tao_solver = taobqnls
petsc_options_iname = '-tao_gatol'
petsc_options_value = '1e-4'
[]
(test/tests/transfers/general_field/shape_evaluation/mesh_division/main_match_subapps.i)
# Base input for testing transfers with mesh divisions restrictions. The mesh divisions
# in the parent app will be matched with a subapp index.
# In the to_multiapp direction, the main app data at the mesh division bins of index 1-4 will
# be transferred to subapps of index 1-4 respectively
# In the from_multiapp direction, the main app fields at the mesh divisions bins of index 1-4
# will receive data (be transferred) from subapps of index 1-4 respectively
# It has the following complexities:
# - several sub-applications
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
[]
[MeshDivisions]
[middle]
type = CartesianGridDivision
bottom_left = '0.21 0.21 0'
# cover more and sample more bins
top_right = '1.001 1.001 0'
nx = 2
ny = 2
nz = 1
[]
[]
[AuxVariables]
[from_sub]
initial_condition = -1
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[to_sub]
[InitialCondition]
type = FunctionIC
function = '1 + 2*x*x + 3*y*y*y'
[]
[]
[to_sub_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '2 + 2*x*x + 3*y*y*y'
[]
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
[out]
type = Exodus
hide = 'to_sub to_sub_elem div'
overwrite = true
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = sub.i
output_in_position = true
# The positions are randomly offset to prevent equi-distant nearest-locations
# They are offset so they overlap with the division they are being matched to
positions = '-0.5001 -0.3000013 0
0.30054 -0.300001985 0
-0.30021 0.2000022 0
0.200212 0.4100022 0'
# To differentiate the values received from each subapp
cli_args = 'base_value=10 base_value=20 base_value=30 base_value=40'
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
to_multi_app = sub
source_variable = to_sub
variable = from_main
from_mesh_division = middle
from_mesh_division_usage = 'matching_subapp_index'
[]
[to_sub_elem]
type = MultiAppGeneralFieldShapeEvaluationTransfer
to_multi_app = sub
source_variable = to_sub_elem
variable = from_main_elem
from_mesh_division = middle
from_mesh_division_usage = 'matching_subapp_index'
[]
[from_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
from_multi_app = sub
source_variable = to_main
variable = from_sub
to_mesh_division = middle
to_mesh_division_usage = 'matching_subapp_index'
[]
[from_sub_elem]
type = MultiAppGeneralFieldShapeEvaluationTransfer
from_multi_app = sub
source_variable = to_main_elem
variable = from_sub_elem
to_mesh_division = middle
to_mesh_division_usage = 'matching_subapp_index'
[]
[]
# For debugging purposes
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'middle'
[]
[]
(modules/optimization/examples/materialTransient/optimize_nograd.i)
[Optimization]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'D'
num_values = '4'
initial_condition = '0.01 0.01 0.01 0.01'
measurement_file = forward_out_data_0011.csv
file_xcoord = measurement_xcoord
file_ycoord = measurement_ycoord
file_zcoord = measurement_zcoord
file_time = measurement_time
file_value = simulation_values
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
cli_args = 'Outputs/csv=false;Outputs/console=false'
execute_on = FORWARD
[]
[]
[Transfers]
[to_forward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_values
OptimizationReporter/D'
to_reporters = 'data/measurement_values
diffc_rep/D_vals'
[]
[from_forward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[]
[Executioner]
type = Optimize
tao_solver = taonm
petsc_options_iname = '-tao_gatol'
petsc_options_value = '1e-6'
verbose = true
[]
(test/tests/transfers/general_field/shape_evaluation/regular/main.i)
# Base input for testing transfers. It has the following complexities:
# - more than one subapp
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[AuxVariables]
[from_sub]
initial_condition = -1
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[to_sub]
[InitialCondition]
type = FunctionIC
function = '1 + 2*x*x + 3*y*y*y'
[]
[]
[to_sub_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '2 + 2*x*x + 3*y*y*y'
[]
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
[out]
type = Exodus
hide = 'to_sub to_sub_elem'
overwrite = true
[]
[]
[MultiApps]
[sub]
# 1 on corner, one in the center and one close to a corner
positions = '0 0 0 0.4 0.4 0 0.7 0.1 0'
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = sub.i
output_in_position = true
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
to_multi_app = sub
source_variable = to_sub
variable = from_main
extrapolation_constant = -1
[]
[to_sub_elem]
type = MultiAppGeneralFieldShapeEvaluationTransfer
to_multi_app = sub
source_variable = to_sub_elem
variable = from_main_elem
extrapolation_constant = -1
[]
[from_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
from_multi_app = sub
source_variable = to_main
variable = from_sub
extrapolation_constant = -1
[]
[from_sub_elem]
type = MultiAppGeneralFieldShapeEvaluationTransfer
from_multi_app = sub
source_variable = to_main_elem
variable = from_sub_elem
extrapolation_constant = -1
[]
[]
(test/tests/restart/restart_transient_from_steady/steady_with_sub.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[AuxVariables]
[Tf]
[]
[]
[Variables]
[power_density]
[]
[]
[Functions]
[pwr_func]
type = ParsedFunction
expression = '1e3*x*(1-x)+5e2'
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = power_density
[]
[coupledforce]
type = BodyForce
variable = power_density
function = pwr_func
[]
[]
[BCs]
[left]
type = DirichletBC
variable = power_density
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = power_density
boundary = right
value = 1e3
[]
[]
[Postprocessors]
[pwr_avg]
type = ElementAverageValue
variable = power_density
execute_on = 'initial timestep_end'
[]
[temp_avg]
type = ElementAverageValue
variable = Tf
execute_on = 'initial final'
[]
[temp_max]
type = ElementExtremeValue
value_type = max
variable = Tf
execute_on = 'initial final'
[]
[temp_min]
type = ElementExtremeValue
value_type = min
variable = Tf
execute_on = 'initial final'
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
petsc_options_value = 'hypre boomeramg 100'
nl_abs_tol = 1e-8
nl_rel_tol = 1e-12
fixed_point_rel_tol = 1E-7
fixed_point_abs_tol = 1.0e-07
fixed_point_max_its = 12
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = steady_with_sub_sub.i
execute_on = 'timestep_end'
[]
[]
[Transfers]
[p_to_sub]
type = MultiAppShapeEvaluationTransfer
source_variable = power_density
variable = power_density
to_multi_app = sub
execute_on = 'timestep_end'
[]
[t_from_sub]
type = MultiAppShapeEvaluationTransfer
source_variable = temp
variable = Tf
from_multi_app = sub
execute_on = 'timestep_end'
[]
[]
[Outputs]
exodus = true
perf_graph = true
checkpoint = true
execute_on = 'INITIAL TIMESTEP_END FINAL'
[]
(modules/optimization/test/tests/optimizationreporter/point_loads/main.i)
# DO NOT CHANGE THIS TEST
# this test is documented as an example in forceInv_pointLoads.md
# if this test is changed, the figures will need to be updated.
[Optimization]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'parameter_results'
num_values = '3'
measurement_points = '0.5 0.28 0
0.5 0.6 0
0.5 0.8 0
0.5 1.1 0'
measurement_values = '293 304 315 320'
[]
[Executioner]
type = Optimize
tao_solver=taonls
petsc_options_iname='-tao_gttol -tao_max_it -tao_nls_pc_type -tao_nls_ksp_type'
petsc_options_value='1e-5 10 none cg'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = "FORWARD"
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint.i
execute_on = "ADJOINT"
[]
[homogeneousForward]
type = FullSolveMultiApp
input_files = forward_homogeneous.i
execute_on = "HOMOGENEOUS_FORWARD"
[]
[]
[Transfers]
# FORWARD transfers
[toForward_measument]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/parameter_results'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
point_source/value'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
# ADJOINT transfers
#NOTE: the adjoint variable we are transferring is actually the gradient
[toAdjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values'
[]
[fromAdjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'gradient/adjoint'
to_reporters = 'OptimizationReporter/grad_parameter_results'
[]
# HESSIAN transfers. Same as forward.
[toHomoForward]
type = MultiAppReporterTransfer
multi_app = homogeneousForward
direction = to_multiapp
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/parameter_results'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
point_source/value'
[]
[fromHomoForward]
type = MultiAppReporterTransfer
multi_app = homogeneousForward
direction = from_multiapp
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[]
[Reporters]
[optInfo]
type = OptimizationInfo
[]
[]
[Outputs]
csv = true
[]
(modules/optimization/examples/materialTransient/optimize_auto_adjoint.i)
[Optimization]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'D'
num_values = '4'
initial_condition = '0.01 0.01 0.01 0.01'
upper_bounds = '1e2'
lower_bounds = '1e-3'
measurement_file = forward_out_data_0011.csv
file_xcoord = measurement_xcoord
file_ycoord = measurement_ycoord
file_zcoord = measurement_zcoord
file_time = measurement_time
file_value = simulation_values
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward_and_adjoint.i
execute_on = FORWARD
[]
[]
[Transfers]
[to_forward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/D'
to_reporters = 'data/measurement_xcoord
data/measurement_ycoord
data/measurement_zcoord
data/measurement_time
data/measurement_values
diffc_rep/D_vals'
[]
[from_forward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'data/simulation_values
adjoint/inner_product'
to_reporters = 'OptimizationReporter/simulation_values
OptimizationReporter/grad_D'
[]
[]
[Executioner]
type = Optimize
tao_solver = taobqnls
petsc_options_iname = '-tao_gatol'
petsc_options_value = '1e-4'
[]
(test/include/multiapps/OverrideCliArgs.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "FullSolveMultiApp.h"
#include "Transient.h"
#include "CommandLine.h"
// libMesh
#include "libmesh/mesh_tools.h"
class OverrideCliArgs : public FullSolveMultiApp
{
public:
static InputParameters validParams();
OverrideCliArgs(const InputParameters & parameters);
protected:
/// function that provides cli_args to subapps
virtual std::vector<std::string> cliArgs() const override;
};
(modules/stochastic_tools/include/multiapps/SamplerFullSolveMultiApp.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
// MOOSE includes
#include "FullSolveMultiApp.h"
#include "SamplerInterface.h"
#include "StochasticToolsTypes.h"
class Sampler;
class StochasticToolsTransfer;
class SamplerFullSolveMultiApp : public FullSolveMultiApp,
public SamplerInterface,
public ReporterInterface
{
public:
static InputParameters validParams();
SamplerFullSolveMultiApp(const InputParameters & parameters);
virtual bool solveStep(Real dt, Real target_time, bool auto_advance = true) override;
virtual void preTransfer(Real dt, Real target_time) override;
/**
* Helper for inserting row data into commandline arguments
* Used here and in SamplerTransientMultiApp
*
* How it works:
* - Scalar parameters are done in order of row data:
* param1;param2;param3 -> param1=row[0] param2=row[1] param3=row[2]
* - Vector parameters are assigned with brackets:
* vec_param1[0,1];vec_param2[1,2] -> vec_param1='row[0] row[1]' vec_param2='row[1] row[2]'
* - Any parameter already with an equal sign is not modified:
* param1=3.14;param2[0,1,2] -> param1=3.14 param2='row[0] row[1] row[2]'
*/
static std::string sampledCommandLineArgs(const std::vector<Real> & row,
const std::vector<std::string> & full_args_name);
/**
* Helper for executing transfers when doing batch stochastic simulations
*
* @param transfers A vector of transfers to execute
* @param global_row_index The global row index of the run
* @param row_data The current sampler row of data for the transfer to utilize
* @param type The current execution flag, used for info printing
* @param direction The direction of the transfer, used for info printing
* @param verbose Whether or not print information about the transfer
* @param console The console stream to output to
*/
static void
execBatchTransfers(const std::vector<std::shared_ptr<StochasticToolsTransfer>> & transfers,
dof_id_type global_row_index,
const std::vector<Real> & row_data,
Transfer::DIRECTION direction,
bool verbose,
const ConsoleStream & console);
protected:
/// Override to avoid 'solve converged' message and print when processors are finished
virtual void showStatusMessage(unsigned int i) const override;
/// Sampler to utilize for creating MultiApps
Sampler & _sampler;
/// The Sup-application solve mode
const StochasticTools::MultiAppMode _mode;
/// Counter for extracting command line arguments in batch mode
dof_id_type _local_batch_app_index;
/// Override to allow for batch mode to get correct cli_args
virtual std::string getCommandLineArgsParamHelper(unsigned int local_app) override;
private:
/**
* Helper method for running in mode='batch'
* */
bool solveStepBatch(Real dt, Real target_time, bool auto_advance = true);
/**
* Helper function for updating _row_data and _local_row_index.
* This allows multiple calls to the same row index
*/
void updateRowData(dof_id_type local_index);
/**
* Helper for getting StochasticToolsTransfer objects.
*/
std::vector<std::shared_ptr<StochasticToolsTransfer>>
getActiveStochasticToolsTransfers(Transfer::DIRECTION direction);
// Flag indicating a solve has occured
bool _solved_once;
// Sampler size, to test if the MultiApp object needs to be re-initialize
dof_id_type _number_of_sampler_rows;
/// Current row of data updated by updateRowData. Used by transfers and setting command line args
std::vector<Real> _row_data;
/// Current local index representing _row_data
dof_id_type _local_row_index = std::numeric_limits<dof_id_type>::max();
/// Reporter value determining whether the sub-app should be run for a certain sample
const std::vector<bool> * _should_run = nullptr;
};