- dof_id_type_namesNames for each dof_id_type value.
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each dof_id_type value.
- dof_id_type_valuesValues for dof_id_types.
C++ Type:std::vector<unsigned long>
Controllable:No
Description:Values for dof_id_types.
- dof_id_type_vector_namesNames for each vector of dof_id_types value.
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each vector of dof_id_types value.
- dof_id_type_vector_valuesValues for vectors of dof_id_types.
C++ Type:std::vector<std::vector<unsigned long>>
Controllable:No
Description:Values for vectors of dof_id_types.
- dof_id_type_vector_vector_namesNames for each vector of vectors of dof_id_types value.
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each vector of vectors of dof_id_types value.
- dof_id_type_vector_vector_valuesValues for vectors of vectors of dof_id_types.
C++ Type:std::vector<std::vector<std::vector<unsigned long, std::allocator<unsigned long>>>>
Controllable:No
Description:Values for vectors of vectors of dof_id_types.
- integer_namesNames for each integer value.
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each integer value.
- integer_valuesValues for integers.
C++ Type:std::vector<int>
Controllable:No
Description:Values for integers.
- integer_vector_namesNames for each vector of integers value.
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each vector of integers value.
- integer_vector_valuesValues for vectors of integers.
C++ Type:std::vector<std::vector<int>>
Controllable:No
Description:Values for vectors of integers.
- integer_vector_vector_namesNames for each vector of vectors of integers value.
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each vector of vectors of integers value.
- integer_vector_vector_valuesValues for vectors of vectors of integers.
C++ Type:std::vector<std::vector<std::vector<int, std::allocator<int>>>>
Controllable:No
Description:Values for vectors of vectors of integers.
- point_namesNames for each point value.
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each point value.
- point_valuesValues for points.
C++ Type:std::vector<libMesh::Point>
Controllable:No
Description:Values for points.
- point_vector_namesNames for each vector of points value.
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each vector of points value.
- point_vector_valuesValues for vectors of points.
C++ Type:std::vector<std::vector<libMesh::Point>>
Controllable:No
Description:Values for vectors of points.
- point_vector_vector_namesNames for each vector of vectors of points value.
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each vector of vectors of points value.
- point_vector_vector_valuesValues for vectors of vectors of points.
C++ Type:std::vector<std::vector<std::vector<libMesh::Point, std::allocator<libMesh::Point>>>>
Controllable:No
Description:Values for vectors of vectors of points.
- real_namesNames for each real value.
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each real value.
- real_valuesValues for reals.
C++ Type:std::vector<double>
Unit:(no unit assumed)
Controllable:No
Description:Values for reals.
- real_vector_namesNames for each vector of reals value.
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each vector of reals value.
- real_vector_valuesValues for vectors of reals.
C++ Type:std::vector<std::vector<double>>
Unit:(no unit assumed)
Controllable:No
Description:Values for vectors of reals.
- real_vector_vector_namesNames for each vector of vectors of reals value.
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each vector of vectors of reals value.
- real_vector_vector_valuesValues for vectors of vectors of reals.
C++ Type:std::vector<std::vector<std::vector<double, std::allocator<double>>>>
Unit:(no unit assumed)
Controllable:No
Description:Values for vectors of vectors of reals.
- string_namesNames for each string value.
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each string value.
- string_valuesValues for strings.
C++ Type:std::vector<std::string>
Controllable:No
Description:Values for strings.
- string_vector_namesNames for each vector of strings value.
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each vector of strings value.
- string_vector_valuesValues for vectors of strings.
C++ Type:std::vector<std::vector<std::string>>
Controllable:No
Description:Values for vectors of strings.
- string_vector_vector_namesNames for each vector of vectors of strings value.
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each vector of vectors of strings value.
- string_vector_vector_valuesValues for vectors of vectors of strings.
C++ Type:std::vector<std::vector<std::vector<std::string, std::allocator<std::string>>>>
Controllable:No
Description:Values for vectors of vectors of strings.
ConstantReporter
Reporter with constant values to be accessed by other objects, can be modified using transfers.
Overview
ConstantReporter gives the ability to produce integer, real number, and string reporter data along with vectors of each type. The user must specify the following parameters for each type:
int
: "integer_names" and "integer_values"Real
: "real_names" and "real_values"std::string
: "string_names" and "string_values"std::vector<int>
: "integer_vector_names" and "integer_vector_values"std::vector<Real>
: "real_vector_names" and "real_vector_values"std::vector<std::string>
: "string_vector_names" and "string_vector_values"
The user may specify more than one value of the same type, which will create multiple reporter values of that type.
The reporter names created by the ConstantReporter
match the names passed in each of the _names
parameters.
Example Input File Syntax
[Reporters<<<{"href": "../../syntax/Reporters/index.html"}>>>]
[Reporters]
[constant]
type = ConstantReporter
integer_names = 'int_1 int_2 int_3'
integer_values = '1 2 -3'
real_names = 'num_1 num_2'
real_values = '4.0 5.0'
string_names = 'str'
string_values = 'six'
dof_id_type_names = 'dofid_1 dofid_2 dofid_3'
dof_id_type_values = '1 2 3'
integer_vector_names = 'int_vec'
integer_vector_values = '7 8'
real_vector_names = 'vec_1 vec_2'
real_vector_values = '8.0 80.0 800.0; 9.0 90.0'
string_vector_names = 'str_vec'
string_vector_values = 'ten eleven twelve thirteen'
dof_id_type_vector_names = 'dofid_vec'
dof_id_type_vector_values = '7 3'
[]
[]
[]
(test/tests/reporters/constant_reporter/constant_reporter.i)Input Parameters
- allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
Default:False
C++ Type:bool
Controllable:No
Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
- execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Options:XFEM_MARK, FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, LINEAR_CONVERGENCE, NONLINEAR, NONLINEAR_CONVERGENCE, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, MULTIAPP_FIXED_POINT_CONVERGENCE, FINAL, CUSTOM
Controllable:No
Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
- execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
Default:0
C++ Type:int
Controllable:No
Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in POSTAUX
- force_preauxFalseForces the UserObject to be executed in PREAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREAUX
- force_preicFalseForces the UserObject to be executed in PREIC during initial setup
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
Execution Scheduling 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.
- outputsVector of output names where you would like to restrict the output of variables(s) associated with this object
C++ Type:std::vector<OutputName>
Controllable:No
Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object
- 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.
Advanced Parameters
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Material Property Retrieval Parameters
Input Files
- (modules/optimization/test/tests/optimizationreporter/bimaterial/grad.i)
- (modules/stochastic_tools/test/tests/reporters/directperturbation/sub.i)
- (modules/combined/test/tests/optimization/invOpt_mechanics/forward_and_adjoint.i)
- (test/tests/transfers/multiapp_reporter_transfer/clone.i)
- (modules/optimization/test/tests/optimizationreporter/general_opt/point_loads_gen_opt/forward_and_adjoint_transfer_data.i)
- (modules/stochastic_tools/examples/parameter_study/main_time.i)
- (modules/optimization/examples/simpleTransient/adjoint_mesh.i)
- (modules/combined/test/tests/optimization/invOpt_bc_convective/forward.i)
- (modules/combined/test/tests/optimization/invOpt_elasticity_modular/forward.i)
- (modules/optimization/test/tests/optimizationreporter/function_misfit/forward_and_adjoint.i)
- (modules/stochastic_tools/test/tests/reporters/bootstrap_statistics/bca/sub.i)
- (modules/optimization/test/tests/optimizationreporter/general_opt/function_optimization/forward.i)
- (modules/combined/test/tests/optimization/invOpt_nonlinear/forward.i)
- (modules/stochastic_tools/test/tests/reporters/sobol/sub.i)
- (modules/optimization/test/tests/executioners/constrained/inequality/forward_and_adjoint.i)
- (test/tests/transfers/multiapp_reporter_transfer/main.i)
- (modules/stochastic_tools/test/tests/actions/parameter_study_action/sub_not_controllable.i)
- (modules/stochastic_tools/test/tests/samplers/AdaptiveImportanceSampler/ais_error1.i)
- (modules/optimization/test/tests/outputs/exodus_optimization_steady/forward.i)
- (test/tests/transfers/multiapp_reporter_transfer/dist_vector/main_send.i)
- (modules/optimization/test/tests/optimizationreporter/material/adjoint.i)
- (test/tests/actions/debug_show_reporters/debug_show_reporters.i)
- (test/tests/reporters/constant_reporter/constant_reporter.i)
- (modules/optimization/test/tests/dirackernels/reporter_time_point_source.i)
- (modules/stochastic_tools/test/tests/reporters/stochastic_reporter/sub.i)
- (test/tests/transfers/multiapp_reporter_transfer/dist_vector/main_dist.i)
- (modules/optimization/test/tests/misc/scaling_test/forward_and_adjoint.i)
- (modules/optimization/test/tests/optimizationreporter/constant_heat_source/forward_nonLinear.i)
- (modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/forward_and_adjoint.i)
- (modules/optimization/test/tests/functions/nearest_reporter_coord/nearest_reporter_point.i)
- (test/tests/outputs/json/specific_reporter/specific_reporter.i)
- (modules/optimization/examples/materialTransient/forward.i)
- (modules/optimization/test/tests/optimizationreporter/mesh_source/forward.i)
- (test/tests/markers/reporter_point_marker/point_marker_test.i)
- (modules/optimization/examples/diffusion_reaction_XYDelaunay/forward_and_adjoint.i)
- (test/tests/outputs/reporters/reporter.i)
- (modules/stochastic_tools/test/tests/samplers/mcmc/main_des.i)
- (modules/stochastic_tools/test/tests/samplers/mcmc/main_imh.i)
- (modules/optimization/test/tests/optimizationreporter/point_loads/forward_and_adjoint.i)
- (modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/adjoint.i)
- (test/tests/outputs/json/one_file_per_timestep/json.i)
- (modules/optimization/test/tests/optimizationreporter/function_misfit/forward_and_adjoint_side.i)
- (test/tests/reporters/accumulated_reporter/accumulate_reporter.i)
- (modules/combined/test/tests/optimization/invOpt_mechanics/forward.i)
- (modules/porous_flow/test/tests/dirackernels/pls02reporter.i)
- (test/tests/transfers/multiapp_reporter_transfer/sub0.i)
- (modules/optimization/test/tests/optimizationreporter/mesh_source/adjoint.i)
- (modules/optimization/test/tests/vectorpostprocessors/element_reaction_inner_product/element_reaction_inner_product.i)
- (modules/stochastic_tools/test/tests/reporters/statistics/constant_sub.i)
- (modules/optimization/test/tests/vectorpostprocessors/element_source_inner_product/element_source_inner_product.i)
- (modules/optimization/test/tests/reporters/multiExperiment/forward.i)
- (test/tests/dirackernels/reporter_point_source/2d_vpp.i)
- (test/tests/transfers/multiapp_reporter_transfer/dist_vector/main.i)
- (modules/optimization/test/tests/optimizationreporter/reporter_offset/reporter_offset_mat.i)
- (modules/combined/test/tests/optimization/invOpt_bc_convective/adjoint.i)
- (test/tests/transfers/multiapp_reporter_transfer/dist_vector/main_rec.i)
- (modules/optimization/test/tests/optimizationreporter/constant_heat_source/adjoint_nonLinear.i)
- (test/tests/markers/reporter_point_marker/reporter_marker_adapt_test.i)
- (modules/optimization/examples/materialTransient/forward_and_adjoint.i)
- (modules/combined/test/tests/optimization/invOpt_nonlinear/homogeneous_forward.i)
- (modules/optimization/test/tests/optimizationreporter/constant_heat_source/forward.i)
- (modules/optimization/test/tests/optimizationreporter/material/forward.i)
- (modules/optimization/test/tests/optimizationreporter/bimaterial/model.i)
- (modules/optimization/examples/materialFrequency/wave1D/model_grad.i)
- (modules/optimization/test/tests/optimizationreporter/bimaterial/model_and_adjoint.i)
- (modules/stochastic_tools/examples/libtorch_drl_control/libtorch_drl_control_trainer.i)
- (modules/stochastic_tools/test/tests/transfers/libtorch_nn_transfer/libtorch_drl_control_trainer.i)
- (modules/optimization/test/tests/outputs/exodus_optimization_steady/adjoint_iteration_output.i)
- (test/tests/outputs/hide_via_reporters_block/reporter.i)
- (test/tests/transfers/multiapp_reporter_transfer/dist_vector/sub.i)
- (modules/optimization/test/tests/functions/parameter_mesh/parameter_mesh_transient.i)
- (modules/stochastic_tools/test/tests/reporters/basic/statistics_reporter_ci.i)
- (modules/stochastic_tools/test/tests/reporters/morris/sub.i)
- (modules/stochastic_tools/test/tests/likelihoods/gaussian_derived/main.i)
- (modules/combined/test/tests/optimization/invOpt_mechanics/adjoint.i)
- (modules/optimization/test/tests/optimizationreporter/constant_heat_source/adjoint.i)
- (modules/optimization/test/tests/reporters/vector_math/vectorMath.i)
- (test/tests/transfers/multiapp_reporter_transfer/clone_type.i)
- (modules/optimization/test/tests/optimizationreporter/nonlinear_material/forward_and_adjoint.i)
- (modules/optimization/test/tests/executioners/constrained/shape_optimization/forward.i)
- (modules/stochastic_tools/test/tests/samplers/mcmc/main_base.i)
- (modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/forward.i)
- (modules/optimization/examples/materialFrequency/wave1D/sampler.i)
- (modules/optimization/test/tests/optimizationreporter/general_opt/point_loads_gen_opt/forward_and_adjoint.i)
- (modules/stochastic_tools/test/tests/reporters/bootstrap_statistics/percentile/sub.i)
- (modules/optimization/test/tests/outputs/exodus_optimization_steady/forward_and_adjoint_iteration_output.i)
- (modules/stochastic_tools/test/tests/multiapps/nested_multiapp/main.i)
- (test/tests/outputs/perf_graph_json/perf_graph_json.i)
- (modules/optimization/test/tests/reporters/multiExperiment/sampler_subapp.i)
- (modules/stochastic_tools/test/tests/transfers/sampler_reporter/sub.i)
- (modules/optimization/examples/materialTransient/gradient.i)
- (modules/optimization/examples/simpleTransient/forward_mesh.i)
- (modules/stochastic_tools/test/tests/reporters/basic/statistics_reporter_error.i)
- (modules/optimization/examples/diffusion_reaction/forward_and_adjoint.i)
- (modules/optimization/test/tests/optimizationreporter/mesh_source/forward_and_adjoint.i)
- (test/tests/outputs/perf_graph_json_file/perf_graph_json_file.i)
- (modules/stochastic_tools/test/tests/multiapps/nested_multiapp/sub.i)
- (modules/combined/test/tests/optimization/invOpt_nonlinear/adjoint.i)
- (modules/optimization/test/tests/functions/parsed_function/parsed_function.i)
- (modules/stochastic_tools/test/tests/actions/parameter_study_action/sub.i)
- (modules/combined/test/tests/optimization/invOpt_elasticity_modular/grad.i)
- (modules/stochastic_tools/test/tests/samplers/mcmc/main_ss.i)
- (modules/stochastic_tools/test/tests/reporters/basic/statistics_reporter.i)
- (modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/homogeneous_forward.i)
integer_names
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each integer value.
integer_values
C++ Type:std::vector<int>
Controllable:No
Description:Values for integers.
real_names
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each real value.
real_values
C++ Type:std::vector<double>
Unit:(no unit assumed)
Controllable:No
Description:Values for reals.
string_names
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each string value.
string_values
C++ Type:std::vector<std::string>
Controllable:No
Description:Values for strings.
integer_vector_names
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each vector of integers value.
integer_vector_values
C++ Type:std::vector<std::vector<int>>
Controllable:No
Description:Values for vectors of integers.
real_vector_names
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each vector of reals value.
real_vector_values
C++ Type:std::vector<std::vector<double>>
Unit:(no unit assumed)
Controllable:No
Description:Values for vectors of reals.
string_vector_names
C++ Type:std::vector<ReporterValueName>
Controllable:No
Description:Names for each vector of strings value.
string_vector_values
C++ Type:std::vector<std::vector<std::string>>
Controllable:No
Description:Values for vectors of strings.
(test/tests/reporters/constant_reporter/constant_reporter.i)
[Mesh/mesh]
type = GeneratedMeshGenerator
dim = 1
[]
[Problem]
kernel_coverage_check = false
solve = false
[]
[Reporters]
active = constant
[constant]
type = ConstantReporter
integer_names = 'int_1 int_2 int_3'
integer_values = '1 2 -3'
real_names = 'num_1 num_2'
real_values = '4.0 5.0'
string_names = 'str'
string_values = 'six'
dof_id_type_names = 'dofid_1 dofid_2 dofid_3'
dof_id_type_values = '1 2 3'
integer_vector_names = 'int_vec'
integer_vector_values = '7 8'
real_vector_names = 'vec_1 vec_2'
real_vector_values = '8.0 80.0 800.0; 9.0 90.0'
string_vector_names = 'str_vec'
string_vector_values = 'ten eleven twelve thirteen'
dof_id_type_vector_names = 'dofid_vec'
dof_id_type_vector_values = '7 3'
[]
[error]
type = ConstantReporter
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
execute_on = 'timestep_end'
[out]
type = JSON
[]
[]
(modules/optimization/test/tests/optimizationreporter/bimaterial/grad.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 16
ny = 16
xmin = -4
xmax = 4
ymin = -4
ymax = 4
[]
[]
[Variables]
[adjoint_T]
[]
[]
[Kernels]
[conduction]
type = MatDiffusion
diffusivity = diffusivity
variable = adjoint_T
[]
[]
[Reporters]
[misfit]
type = OptimizationData
[]
[data]
type = ConstantReporter
real_vector_names = 'coordx coordy diffusivity'
real_vector_values = '0 0; -2 2; 5 10'
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjoint_T
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[BCs]
[bottom]
type = DirichletBC
variable = adjoint_T
boundary = bottom
value = 0
[]
[]
[AuxVariables]
[temperature_forward]
[]
[]
[Functions]
[diffusivity_function]
type = NearestReporterCoordinatesFunction
x_coord_name = data/coordx
y_coord_name = data/coordy
value_name = data/diffusivity
[]
[]
[Materials] #same material as what was used in the forward model
[mat]
type = GenericFunctionMaterial
prop_names = diffusivity
prop_values = diffusivity_function
[]
[]
[VectorPostprocessors]
[gradvec]
type = ElementOptimizationDiffusionCoefFunctionInnerProduct
variable = adjoint_T
forward_variable = temperature_forward
function = diffusivity_function
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_forced_its = 1
line_search = none
nl_abs_tol = 1e-8
[]
[Outputs]
console = false
file_base = 'adjoint'
[]
(modules/stochastic_tools/test/tests/reporters/directperturbation/sub.i)
x = 0
y = 0
z = 0
f1 = ${fparse 1*x+2*y+3*z}
f2 = ${fparse 4*x+5*y+6*z}
f3 = ${fparse 7*x+8*y+9*z}
[StochasticTools]
[]
[Reporters/const]
type = ConstantReporter
real_names = 'f1 f2 f3'
real_values = '${f1} ${f2} ${f3}'
real_vector_names = 'f_combined'
real_vector_values = '${f1} ${f2} ${f3}'
[]
(modules/combined/test/tests/optimization/invOpt_mechanics/forward_and_adjoint.i)
# DO NOT CHANGE THIS TEST
# this test is documented as an example in forceInv_NeumannBC.md
# if this test is changed, the figures will need to be updated.
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 2
xmin = 0.0
xmax = 5.0
ymin = 0.0
ymax = 1.0
use_displaced_mesh = false
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[Physics]
[SolidMechanics]
[QuasiStatic]
displacements = 'disp_x disp_y'
[all]
displacements = 'disp_x disp_y'
strain = SMALL
[]
[]
[]
[]
[BCs]
[left_ux]
type = DirichletBC
variable = disp_x
boundary = left
value = 0
[]
[left_uy]
type = DirichletBC
variable = disp_y
boundary = left
value = 0
[]
[right_fy]
type = FunctionNeumannBC
variable = disp_y
boundary = right
function = right_fy_func
[]
[right_fx]
type = FunctionNeumannBC
variable = disp_x
boundary = right
function = right_fx_func
[]
[]
[Functions]
[right_fy_func]
type = ParsedOptimizationFunction
expression = 'val_y'
param_symbol_names = 'val_x val_y'
param_vector_name = 'params/right_values'
[]
[right_fx_func]
type = ParsedOptimizationFunction
expression = 'val_x'
param_symbol_names = 'val_x val_y'
param_vector_name = 'params/right_values'
[]
[]
[Materials]
[elasticity]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 10e3
poissons_ratio = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[]
[Preconditioning]
[nl0]
type = SMP
nl_sys = 'nl0'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
full = true
[]
[adjoint]
type = SMP
nl_sys = 'adjoint'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
full = true
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
nl_abs_tol = 1e-6
nl_rel_tol = 1e-8
[]
[VectorPostprocessors]
[point_sample]
type = PointValueSampler
variable = 'disp_x disp_y'
points = '5.0 1.0 0'
sort_by = x
[]
[]
[Reporters]
[measure_data_x]
type = OptimizationData
objective_name = objective_value
variable = disp_x
measurement_points = '5.0 1.0 0.0'
measurement_values = '-13.00873469088'
[]
[measure_data_y]
type = OptimizationData
objective_name = objective_value
variable = disp_y
measurement_points = '5.0 1.0 0.0'
measurement_values = '85.008027719915'
[]
[params]
type = ConstantReporter
real_vector_names = 'right_values'
real_vector_values = '-1300 2100 ' # True Values
[]
[combined]
type = ParsedVectorReporter
name = gradient
reporter_names = 'adjoint_pt_x/inner_product adjoint_pt_y/inner_product'
reporter_symbols = 'a b'
expression = 'a+b'
execute_on = ADJOINT_TIMESTEP_END
# Just to confirm this happens after the gradient calcutions
execution_order_group = 1
[]
[obj]
type = ParsedScalarReporter
name = obj_val
reporter_names = 'measure_data_x/objective_value
measure_data_y/objective_value'
reporter_symbols = 'a b'
expression = 'a+b'
execute_on = ADJOINT_TIMESTEP_END
# Just to confirm this happens after the gradient calcutions
execution_order_group = 1
[]
[]
[Outputs]
csv = false
console = false
exodus = false
file_base = 'forward'
execute_on = 'FINAL'
json = false
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
skip_nl_system_check = true
[]
[Variables]
[adjoint_x]
initial_condition = 0
solver_sys = adjoint
outputs = none
[]
[adjoint_y]
initial_condition = 0
solver_sys = adjoint
outputs = none
[]
[]
[DiracKernels]
[pt_x]
type = ReporterPointSource
variable = adjoint_x
x_coord_name = measure_data_x/measurement_xcoord
y_coord_name = measure_data_x/measurement_ycoord
z_coord_name = measure_data_x/measurement_zcoord
value_name = measure_data_x/misfit_values
[]
[pt_y]
type = ReporterPointSource
variable = adjoint_y
x_coord_name = measure_data_y/measurement_xcoord
y_coord_name = measure_data_y/measurement_ycoord
z_coord_name = measure_data_y/measurement_zcoord
value_name = measure_data_y/misfit_values
[]
[]
[VectorPostprocessors]
[adjoint_pt_x]
type = SideOptimizationNeumannFunctionInnerProduct
variable = adjoint_x
function = right_fx_func
boundary = right
execute_on = ADJOINT_TIMESTEP_END
[]
[adjoint_pt_y]
type = SideOptimizationNeumannFunctionInnerProduct
variable = adjoint_y
function = right_fy_func
boundary = right
execute_on = ADJOINT_TIMESTEP_END
[]
[]
(test/tests/transfers/multiapp_reporter_transfer/clone.i)
[Mesh/generate]
type = GeneratedMeshGenerator
dim = 1
[]
[Problem]
kernel_coverage_check = false
solve = false
[]
[Reporters]
[receiver]
type = ConstantReporter
[]
[]
[MultiApps]
[multi_vector]
type = TransientMultiApp
input_files = 'sub0.i sub0.i sub1.i sub1.i'
positions = '0 0 0
0 0 0
0 0 0
0 0 0'
cli_args = 'Outputs/active="" Outputs/active="" Outputs/active="" Outputs/active=""'
[]
[multi_reporter]
type = TransientMultiApp
input_files = 'sub0.i sub0.i sub0.i sub0.i'
positions = '0 0 0
0 0 0
0 0 0
0 0 0'
cli_args = 'Postprocessors/from_sub_pp/default=3.1415926;Reporters/from_sub_rep/integer_values=10;Reporters/from_sub_rep/string_values=ten;Outputs/active=""
Postprocessors/from_sub_pp/default=1.5707963;Reporters/from_sub_rep/integer_values=11;Reporters/from_sub_rep/string_values=twenty;Outputs/active=""
Postprocessors/from_sub_pp/default=1.0471975;Reporters/from_sub_rep/integer_values=12;Reporters/from_sub_rep/string_values=thirty;Outputs/active=""
Postprocessors/from_sub_pp/default=0.7853981;Reporters/from_sub_rep/integer_values=13;Reporters/from_sub_rep/string_values=forty;Outputs/active=""'
[]
[single_app]
type = TransientMultiApp
input_files = 'sub0.i'
cli_args = 'Outputs/active=""'
[]
[]
[Transfers]
[multi_vpp]
type = MultiAppCloneReporterTransfer
from_reporters = 'from_sub_vpp/a from_sub_vpp/b'
to_reporter = receiver
from_multi_app = multi_vector
[]
[multi_rep]
type = MultiAppCloneReporterTransfer
from_reporters = 'from_sub_pp/value from_sub_rep/int from_sub_rep/str'
to_reporter = receiver
from_multi_app = multi_reporter
[]
[single]
type = MultiAppCloneReporterTransfer
from_reporters = 'from_sub_pp/value from_sub_rep/int from_sub_rep/str'
to_reporter = receiver
from_multi_app = single_app
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
[out]
type = JSON
vectorpostprocessors_as_reporters = true
[]
execute_on = timestep_end
[]
(modules/optimization/test/tests/optimizationreporter/general_opt/point_loads_gen_opt/forward_and_adjoint_transfer_data.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmax = 1
ymax = 1.4
[]
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
[]
[Variables]
[temperature]
[]
[temperature_adjoint]
solver_sys = adjoint
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = thermal_conductivity
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = temperature
x_coord_name = 'point_source/x'
y_coord_name = 'point_source/y'
z_coord_name = 'point_source/z'
value_name = 'point_source/value'
[]
[misfit]
type = ReporterPointSource
variable = temperature_adjoint
x_coord_name = measure_data/measurement_xcoord
y_coord_name = measure_data/measurement_ycoord
z_coord_name = measure_data/measurement_zcoord
value_name = measure_data/misfit_values
[]
[]
[BCs]
[left]
type = DirichletBC
variable = temperature
boundary = left
value = 300
[]
[right]
type = DirichletBC
variable = temperature
boundary = right
value = 300
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 300
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 300
[]
[]
[Materials]
[steel]
type = GenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
nl_rel_tol = 1e-12
l_tol = 1e-12
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[VectorPostprocessors]
[gradient]
type = PointValueSampler
points = '0.2 0.2 0
0.7 0.56 0
0.4 1 0'
variable = temperature_adjoint
sort_by = id
execute_on = ADJOINT_TIMESTEP_END
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
variable = temperature
objective_name = misfit_norm
[]
[point_source]
type = ConstantReporter
real_vector_names = 'x y z value'
real_vector_values = '0.2 0.7 0.4;
0.2 0.56 1;
0 0 0;
-1000 120 500'
[]
[]
[Outputs]
console = false
[]
(modules/stochastic_tools/examples/parameter_study/main_time.i)
[StochasticTools]
[]
[Distributions]
[gamma]
type = Uniform
lower_bound = 0.5
upper_bound = 2.5
[]
[q_0]
type = Weibull
location = -110
scale = 20
shape = 1
[]
[T_0]
type = Normal
mean = 300
standard_deviation = 45
[]
[s]
type = Normal
mean = 100
standard_deviation = 25
[]
[]
[Samplers]
[hypercube]
type = LatinHypercube
num_rows = 5000
distributions = 'gamma q_0 T_0 s'
[]
[]
[MultiApps]
[runner]
type = SamplerTransientMultiApp
sampler = hypercube
input_files = 'diffusion_time.i'
mode = batch-restore
[]
[]
[Transfers]
[parameters]
type = SamplerParameterTransfer
to_multi_app = runner
sampler = hypercube
parameters = 'Materials/constant/prop_values Kernels/source/value BCs/right/value BCs/left/value'
[]
[results]
type = SamplerReporterTransfer
from_multi_app = runner
sampler = hypercube
stochastic_reporter = results
from_reporter = 'T_avg/value q_left/value T_vec/T'
[]
[x_transfer]
type = MultiAppReporterTransfer
from_multi_app = runner
subapp_index = 0
from_reporters = T_vec/x
to_reporters = const/x
[]
[]
[Reporters]
[results]
type = StochasticReporter
outputs = none
[]
[stats]
type = StatisticsReporter
reporters = 'results/results:T_avg:value results/results:q_left:value results/results:T_vec:T'
compute = 'mean stddev'
ci_method = 'percentile'
ci_levels = '0.05 0.95'
[]
[const]
type = ConstantReporter
real_vector_names = 'x'
real_vector_values = '0'
[]
[]
[Executioner]
type = Transient
num_steps = 4
dt = 0.25
[]
[Outputs]
execute_on = timestep_end
[out]
type = JSON
[]
[]
(modules/optimization/examples/simpleTransient/adjoint_mesh.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = -1
xmax = 1
ymin = -1
ymax = 1
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[dt]
type = TimeDerivative
variable = u
[]
[diff]
type = Diffusion
variable = u
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = u
boundary = 'left right top bottom'
value = 0
[]
[]
[Reporters]
[measured_data]
type = OptimizationData
measurement_file = mms_data.csv
file_xcoord = x
file_ycoord = y
file_zcoord = z
file_time = t
file_value = u
[]
[src_values]
type = ConstantReporter
real_vector_names = 'time values'
real_vector_values = '0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0;
0' # dummy
[]
[]
[DiracKernels]
[misfit]
type = ReporterTimePointSource
variable = u
value_name = measured_data/misfit_values
x_coord_name = measured_data/measurement_xcoord
y_coord_name = measured_data/measurement_ycoord
z_coord_name = measured_data/measurement_zcoord
time_name = measured_data/measurement_time
reverse_time_end = 1
[]
[]
[Functions]
[source]
type = ParameterMeshFunction
exodus_mesh = source_mesh_in.e
time_name = src_values/time
parameter_name = src_values/values
[]
[]
[VectorPostprocessors]
[adjoint]
type = ElementOptimizationSourceFunctionInnerProduct
variable = u
function = source
reverse_time_end = 1
[]
[]
[Executioner]
type = Transient
num_steps = 100
end_time = 1
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
console = false
[]
(modules/combined/test/tests/optimization/invOpt_bc_convective/forward.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 20
xmax = 1
ymax = 2
[]
[]
[Variables]
[temperature]
[]
[]
[Kernels]
[heat_conduction]
type = ADHeatConduction
variable = temperature
[]
[]
[BCs]
[left]
type = ConvectiveFluxFunction
variable = temperature
boundary = 'left'
T_infinity = 100.0
coefficient = function1
[]
[right]
type = NeumannBC
variable = temperature
boundary = right
value = -100
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 500
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 600
[]
[]
[Materials]
[steel]
type = ADGenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-6
nl_rel_tol = 1e-8
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Functions]
[function1]
type = ParsedOptimizationFunction
expression = 'a'
param_symbol_names = 'a'
param_vector_name = 'params/vals'
[]
[]
[VectorPostprocessors]
[vertical]
type = LineValueSampler
variable = 'temperature'
start_point = '0.1 0.0 0.0'
end_point = '0.1 2.0 0.0'
num_points = 21
sort_by = id
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
objective_name = objective_value
variable = temperature
[]
[params]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '0' # Dummy value
[]
[]
[Outputs]
csv = true
exodus = false
console = false
file_base = 'forward'
[]
(modules/combined/test/tests/optimization/invOpt_elasticity_modular/forward.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 11
ny = 11
xmin = -4
xmax = 4
ymin = -4
ymax = 4
[]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[T]
[]
[]
[Physics]
[SolidMechanics]
[QuasiStatic]
displacements = 'disp_x disp_y'
[all]
strain = SMALL
new_system = true
formulation = TOTAL
incremental = true
volumetric_locking_correction = false
displacements = 'disp_x disp_y'
[]
[]
[]
[]
[NEML2]
input = 'elasticity.i'
verbose = true
device = 'cpu'
[all]
model = 'forward_elasticity_model'
moose_input_types = 'MATERIAL'
moose_inputs = 'neml2_strain'
neml2_inputs = 'forces/E'
moose_parameter_types = 'MATERIAL'
moose_parameters = 'E_material'
neml2_parameters = 'E'
moose_output_types = 'MATERIAL'
moose_outputs = 'neml2_stress'
neml2_outputs = 'state/S'
moose_derivative_types = 'MATERIAL'
moose_derivatives = 'neml2_jacobian'
neml2_derivatives = 'state/S forces/E'
[]
[]
[BCs]
[bottom_x]
type = DirichletBC
variable = disp_x
boundary = bottom
value = 0.0
[]
[bottom_y]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[top_x]
type = NeumannBC
variable = disp_x
boundary = top
value = 1.0
[]
[top_y]
type = NeumannBC
variable = disp_y
boundary = top
value = 1.0
[]
[]
[Materials]
[convert_strain]
type = RankTwoTensorToSymmetricRankTwoTensor
from = 'mechanical_strain'
to = 'neml2_strain'
[]
[stress]
type = ComputeLagrangianObjectiveCustomSymmetricStress
custom_small_stress = 'neml2_stress'
custom_small_jacobian = 'neml2_jacobian'
[]
[E_material]
type = GenericFunctionMaterial
prop_names = 'E_material'
prop_values = 'E'
[]
[]
[Functions]
[E]
type = NearestReporterCoordinatesFunction
x_coord_name = parametrization/coordx
y_coord_name = parametrization/coordy
value_name = parametrization/youngs_modulus
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
variable = disp_x
objective_name = objective_value
[]
[parametrization]
type = ConstantReporter
real_vector_names = 'coordx coordy youngs_modulus'
real_vector_values = '0 0 0; ${fparse 8/3} 0 ${fparse -8/3}; 5 5 5'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
# better efficiency if we compute them together
residual_and_jacobian_together = true
nl_rel_tol = 1e-10
nl_abs_tol = 1e-14
[]
[Postprocessors]
[point1]
type = PointValue
point = '-1.0 -1.0 0.0'
variable = disp_x
execute_on = TIMESTEP_END
[]
[point2]
type = PointValue
point = '-1.0 0.0 0.0'
variable = disp_x
execute_on = TIMESTEP_END
[]
[point3]
type = PointValue
point = '-1.0 1.0 0.0'
variable = disp_x
execute_on = TIMESTEP_END
[]
[point4]
type = PointValue
point = '0.0 -1.0 0.0'
variable = disp_x
execute_on = TIMESTEP_END
[]
[point5]
type = PointValue
point = '0.0 0.0 0.0'
variable = disp_x
execute_on = TIMESTEP_END
[]
[point6]
type = PointValue
point = '0.0 1.0 0.0'
variable = disp_x
execute_on = TIMESTEP_END
[]
[point7]
type = PointValue
point = '1.0 -1.0 0.0'
variable = disp_x
execute_on = TIMESTEP_END
[]
[point8]
type = PointValue
point = '1.0 0.0 0.0'
variable = disp_x
execute_on = TIMESTEP_END
[]
[point9]
type = PointValue
point = '1.0 1.0 0.0'
variable = disp_x
execute_on = TIMESTEP_END
[]
[]
[Outputs]
file_base = 'forward'
console = false
[]
(modules/optimization/test/tests/optimizationreporter/function_misfit/forward_and_adjoint.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 15
ny = 15
xmin = 0
ymin = 0
xmax = 1
ymax = 1.4
[]
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
[]
[Variables]
[temperature]
[]
[temperature_adjoint]
solver_sys = adjoint
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = thermal_conductivity
[]
# apply gradient material as a body force since the integral is over the whole domain
[adj_source]
type = MatBodyForce
variable = temperature_adjoint
material_property = obj_misfit_gradient
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = temperature
x_coord_name = 'point_source/x'
y_coord_name = 'point_source/y'
z_coord_name = 'point_source/z'
value_name = 'point_source/value'
[]
[]
[BCs]
[left]
type = DirichletBC
variable = temperature
boundary = left
value = 300
[]
[right]
type = DirichletBC
variable = temperature
boundary = right
value = 300
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 300
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 300
[]
[]
[Materials]
[steel]
type = GenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
# Create two materials.
# 1. Material which the integral of is our objective
# 2. dM/du material which is used for our adjoint problem
[beam]
type = MisfitReporterOffsetFunctionMaterial
x_coord_name = measure_data/measurement_xcoord
y_coord_name = measure_data/measurement_ycoord
z_coord_name = measure_data/measurement_zcoord
measurement_value_name = measure_data/measurement_values
forward_variable = temperature
property_name = 'obj_misfit'
function = gauss
[]
[]
[Functions]
[gauss]
type = ParsedFunction
expression = 'exp(-2.0 *(x^2 + y^2 + z^2)/(beam_radii^2))'
symbol_names = 'beam_radii'
symbol_values = '.025'
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
nl_rel_tol = 1e-12
l_tol = 1e-12
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[VectorPostprocessors]
[gradient]
type = PointValueSampler
points = '0.2 0.2 0
0.7 0.56 0
0.4 1 0'
variable = temperature_adjoint
sort_by = id
execute_on = ADJOINT_TIMESTEP_END
[]
[]
[Postprocessors]
[objective]
type = ElementIntegralMaterialProperty
mat_prop = obj_misfit
execute_on = 'ADJOINT_TIMESTEP_END TIMESTEP_END'
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
variable = temperature
[]
[point_source]
type = ConstantReporter
real_vector_names = 'x y z value'
real_vector_values = '0.2 0.7 0.4;
0.2 0.56 1;
0 0 0;
-1000 120 500'
[]
[]
[Outputs]
console = false
[]
(modules/stochastic_tools/test/tests/reporters/bootstrap_statistics/bca/sub.i)
[StochasticTools]
[]
[Reporters/const]
type = ConstantReporter
real_vector_names = 'num_vec'
real_vector_values = '1 1 1 1 1'
[]
(modules/optimization/test/tests/optimizationreporter/general_opt/function_optimization/forward.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Functions]
[obj_func]
type = ParsedOptimizationFunction
expression = 'pow(x_val + 2 * y_val - 7, 2) + pow(2 * x_val + y_val - 5, 2)'
param_symbol_names = 'x_val y_val'
param_vector_name = vals/vals
[]
[df_dx]
type = ParsedOptimizationFunction
expression = '2 * (x_val + 2 * y_val - 7) + 4 * (2 * x_val + y_val - 5)'
param_symbol_names = 'x_val y_val'
param_vector_name = vals/vals
[]
[df_dy]
type = ParsedOptimizationFunction
expression = '4 * (x_val + 2 * y_val - 7) + 2 * (2 * x_val + y_val - 5)'
param_symbol_names = 'x_val y_val'
param_vector_name = vals/vals
[]
[]
[Postprocessors]
[obj_pp]
type = FunctionValuePostprocessor
function = obj_func
execute_on = 'INITIAL TIMESTEP_END'
outputs = console
[]
[df_dx]
type = FunctionValuePostprocessor
function = df_dx
[]
[df_dy]
type = FunctionValuePostprocessor
function = df_dy
[]
[]
[VectorPostprocessors]
[grad_f]
type = VectorOfPostprocessors
postprocessors = 'df_dx df_dy'
[]
[]
[Reporters]
[vals]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '0 4'
[]
[]
(modules/combined/test/tests/optimization/invOpt_nonlinear/forward.i)
[Executioner]
type = Steady
solve_type = NEWTON
line_search = none
nl_abs_tol = 1e-12
nl_rel_tol = 1e-12
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Mesh]
[]
[Variables]
[forwardT]
[]
[]
[Kernels]
[heat_conduction]
type = ADHeatConduction
thermal_conductivity = 'conductivity'
variable = forwardT
[]
[heat_source]
type = ADMatHeatSource
material_property = 'volumetric_heat'
variable = forwardT
[]
[]
[Materials]
[NonlinearConductivity]
type = ADParsedMaterial
f_name = 'conductivity'
function = '10+500*forwardT'
args = 'forwardT'
[]
[volumetric_heat]
type = ADGenericFunctionMaterial
prop_names = 'volumetric_heat'
prop_values = 'volumetric_heat_func'
[]
[]
[Functions]
[volumetric_heat_func]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params/heat_source'
[]
[]
[BCs]
[left]
type = NeumannBC
variable = forwardT
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = forwardT
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = forwardT
boundary = bottom
value = 2
[]
[top]
type = DirichletBC
variable = forwardT
boundary = top
value = 1
[]
[]
[Reporters]
[measurement_locations]
type = OptimizationData
objective_name = objective_value
variable = forwardT
[]
[params]
type = ConstantReporter
real_vector_names = 'heat_source'
real_vector_values = '0' # Dummy
[]
[]
[Outputs]
console = false
[]
(modules/stochastic_tools/test/tests/reporters/sobol/sub.i)
q0 = 0
q1 = 0.5
q2 = 3
q3 = 9
q4 = 99
q5 = 99
x0 = 0
x1 = 0
x2 = 0
x3 = 0
x4 = 0
x5 = 0
y0 = ${fparse (abs(4 * x0 - 2) + q0) / (1 + q0)}
y1 = ${fparse (abs(4 * x1 - 2) + q1) / (1 + q1)}
y2 = ${fparse (abs(4 * x2 - 2) + q2) / (1 + q2)}
y3 = ${fparse (abs(4 * x3 - 2) + q3) / (1 + q3)}
y4 = ${fparse (abs(4 * x4 - 2) + q4) / (1 + q4)}
y5 = ${fparse (abs(4 * x5 - 2) + q5) / (1 + q5)}
y = ${fparse y0 * y1 * y2 * y3 * y4 * y5}
ya0 = ${fparse abs(4 * x0 - 2)}
ya1 = ${fparse abs(4 * x1 - 2)}
ya2 = ${fparse abs(4 * x2 - 2)}
ya3 = ${fparse abs(4 * x3 - 2)}
ya = ${fparse ya0 * ya1 * ya2 * ya3}
[StochasticTools]
[]
[Reporters/const]
type = ConstantReporter
real_names = 'gf gfa'
real_values = '${y} ${ya}'
real_vector_names = 'gf_vec'
real_vector_values = '${y} ${ya}'
[]
(modules/optimization/test/tests/executioners/constrained/inequality/forward_and_adjoint.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 20
xmax = 1
ymax = 1
[]
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
[]
[Variables]
[temperature]
[]
[temperature_adjoint]
solver_sys = adjoint
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = thermal_conductivity
[]
[]
[BCs]
[left]
type = FunctionNeumannBC
variable = temperature
boundary = left
function = left_function
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 200
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 100
[]
[]
[Functions]
[left_function]
type = ParsedOptimizationFunction
expression = 'a + b*y'
param_symbol_names = 'a b'
param_vector_name = 'params/left'
[]
[dc_db]
type = ParsedFunction
expression = 'y'
[]
[]
[Materials]
[steel]
type = GenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Preconditioning]
[nl0]
type = SMP
nl_sys = 'nl0'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[adjoint]
type = SMP
nl_sys = 'adjoint'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
line_search = none
nl_rel_tol = 1e-12
l_tol = 1e-12
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = temperature_adjoint
x_coord_name = measure_data/measurement_xcoord
y_coord_name = measure_data/measurement_ycoord
z_coord_name = measure_data/measurement_zcoord
value_name = measure_data/misfit_values
[]
[]
[VectorPostprocessors]
[grad_bc_left]
type = SideOptimizationNeumannFunctionInnerProduct
variable = temperature_adjoint
function = left_function
boundary = left
execute_on = ADJOINT_TIMESTEP_END
[]
[]
[Postprocessors]
[sum]
type = FunctionSideIntegral
boundary = left
function = left_function
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
variable = temperature
objective_name = objective_value
[]
[params]
type = ConstantReporter
real_vector_names = 'left'
real_vector_values = '0 0' # Dummy
execute_on = NONE
[]
[]
[Outputs]
console = false
exodus = false
json = true
[]
#---------Inequality constraints------------#
[VectorPostprocessors]
[gradient_c]
type = VectorOfPostprocessors
postprocessors = 'dc_da dc_db'
[]
[ineq]
type = VectorOfPostprocessors
postprocessors = 'constraint'
[]
[]
[Postprocessors]
[constraint]
type = ParsedPostprocessor
expression = '150 - sum' # 150 is the constraint we want to satisfy
pp_names = sum
[]
[dc_da]
type = FunctionSideIntegral
boundary = left
function = -1
[]
[dc_db]
type = FunctionSideIntegral
boundary = left
function = '-y'
[]
[]
(test/tests/transfers/multiapp_reporter_transfer/main.i)
[Mesh/generate]
type = GeneratedMeshGenerator
dim = 1
[]
[Problem]
kernel_coverage_check = false
solve = false
[]
[VectorPostprocessors]
[from_main_vpp]
type = ConstantVectorPostprocessor
vector_names = 'a b c'
value = '1 1 1; 2 2 2; 3 3 3'
execute_on = initial
#outputs = none
[]
[to_main_vpp]
type = ConstantVectorPostprocessor
vector_names = 'a b c'
value = '4 4 4; 5 5 5; 6 6 6'
#outputs = none
[]
[]
[Reporters]
[from_main_rep]
type = ConstantReporter
integer_names = int
integer_values = 1
real_names = num
real_values = 2.0
real_vector_names = vec
real_vector_values = '3 4'
string_names = str
string_values = 'five'
[]
[to_main_rep]
type = ConstantReporter
integer_names = int
integer_values = 0
real_names = num
real_values = 0.0
real_vector_names = vec
real_vector_values = '0'
string_names = str
string_values = 'foo'
[]
[]
[MultiApps/sub]
type = TransientMultiApp
input_files = 'sub0.i sub1.i'
positions = '0 0 0 0 0 0'
[]
[Transfers]
# VPP transfers
[vpp_to_vpp]
type = MultiAppReporterTransfer
to_reporters = 'to_sub_vpp/a to_sub_vpp/b'
from_reporters = 'from_main_vpp/a from_main_vpp/b'
to_multi_app = sub
[]
[vpp_from_vpp]
type = MultiAppReporterTransfer
to_reporters = 'to_main_vpp/a to_main_vpp/b'
from_reporters = 'from_sub_vpp/a from_sub_vpp/b'
from_multi_app = sub
subapp_index = 0
[]
# Vector-VPP transfers
[vector_to_vpp]
type = MultiAppReporterTransfer
to_reporters = 'to_sub_vpp/a'
from_reporters = 'from_main_rep/vec'
to_multi_app = sub
subapp_index = 0
[]
[vector_from_vpp]
type = MultiAppReporterTransfer
to_reporters = 'to_main_rep/vec'
from_reporters = 'from_sub_vpp/a'
from_multi_app = sub
subapp_index = 0
[]
# Real-PP transfers
[real_to_pp]
type = MultiAppReporterTransfer
to_reporters = 'to_sub_pp/value'
from_reporters = 'from_main_rep/num'
to_multi_app = sub
subapp_index = 0
[]
[real_from_pp]
type = MultiAppReporterTransfer
to_reporters = 'to_main_rep/num'
from_reporters = 'from_sub_pp/value'
from_multi_app = sub
subapp_index = 0
[]
# Int-Int transfers
[int_to_int]
type = MultiAppReporterTransfer
to_reporters = 'to_sub_rep/int'
from_reporters = 'from_main_rep/int'
to_multi_app = sub
subapp_index = 0
[]
[int_from_int]
type = MultiAppReporterTransfer
to_reporters = 'to_main_rep/int'
from_reporters = 'from_sub_rep/int'
from_multi_app = sub
subapp_index = 0
[]
# String-String transfers
[string_to_string]
type = MultiAppReporterTransfer
to_reporters = 'to_sub_rep/str'
from_reporters = 'from_main_rep/str'
to_multi_app = sub
subapp_index = 0
[]
[string_from_string]
type = MultiAppReporterTransfer
to_reporters = 'to_main_rep/str'
from_reporters = 'from_sub_rep/str'
from_multi_app = sub
subapp_index = 0
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
[out]
type = JSON
vectorpostprocessors_as_reporters = true
[]
execute_on = timestep_end
[]
(modules/stochastic_tools/test/tests/actions/parameter_study_action/sub_not_controllable.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[]
[BCs]
[left]
type = FunctionDirichletBC
variable = u
boundary = left
function = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[average]
type = AverageNodalVariableValue
variable = u
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
# This is for testing distributions
p0 = 0
p1 = 0
p2 = 0
p3 = 0
p4 = 0
p5 = 0
p6 = 0
[Reporters]
[const]
type = ConstantReporter
real_names = 'p0 p1 p2 p3 p4 p5 p6'
real_values = '${p0} ${p1} ${p2} ${p3} ${p4} ${p5} ${p6}'
[]
[]
(modules/stochastic_tools/test/tests/samplers/AdaptiveImportanceSampler/ais_error1.i)
[StochasticTools]
[]
[Samplers/sample]
type = CartesianProduct
linear_space_items = '0 1 1'
[]
[Reporters]
[constant]
type = ConstantReporter
real_vector_names = 'reporter_transfer:average:value'
real_vector_values = '0'
[]
[adaptive_MC]
type = AdaptiveMonteCarloDecision
output_value = constant/reporter_transfer:average:value
inputs = 'inputs'
sampler = sample
[]
[]
(modules/optimization/test/tests/outputs/exodus_optimization_steady/forward.i)
[Mesh]
[]
[Variables]
[temperature]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = thermal_conductivity
[]
[heat_source]
type = BodyForce
value = 1000
variable = temperature
[]
[]
[BCs]
[left]
type = NeumannBC
variable = temperature
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = temperature
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 200
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 100
[]
[]
[Functions]
[thermo_conduct]
type = ParsedOptimizationFunction
expression = 'alpha'
param_symbol_names = 'alpha'
param_vector_name = 'params/p1'
[]
[]
[Materials]
[steel]
type = GenericFunctionMaterial
prop_names = 'thermal_conductivity'
prop_values = 'thermo_conduct'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[Reporters]
[measure_data]
type = OptimizationData
objective_name = objective_value
variable = temperature
outputs = none
[]
[params]
type = ConstantReporter
real_vector_names = 'p1'
real_vector_values = '0' # Dummy value
[]
[]
[Outputs]
console = false
file_base = 'forward'
[exo]
type = ExodusOptimizationSteady
execute_on = 'TIMESTEP_END'
[]
[]
(test/tests/transfers/multiapp_reporter_transfer/dist_vector/main_send.i)
[Mesh]
[generate]
type = GeneratedMeshGenerator
nx = 4
dim = 1
[]
[]
[Problem]
kernel_coverage_check = false
solve = false
[]
[Reporters]
[to_sub_rep]
type = ConstantReporter
real_vector_vector_names = 'sent_vec'
real_vector_vector_values = '1.; 2. 1003.;-5.0 -10 1000;3.3'
real_vector_names = 'sent_real'
real_vector_values = "1. 2. 3. 4."
execute_on = INITIAL
outputs = out
[]
[]
[Positions]
[elem]
type = ElementCentroidPositions
auto_sort = true
outputs = none
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = 'sub.i'
positions_objects = elem
execute_on = TIMESTEP_END
[]
[]
[Transfers]
[to_sub]
type = MultiAppReporterTransfer
to_multi_app = sub
from_reporters = 'to_sub_rep/sent_vec to_sub_rep/sent_real'
to_reporters = 'from_main_rep/rec_vec from_main_rep/rec_real'
distribute_reporter_vector = true
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
file_base = 1_to_N
[out]
type = JSON
execute_system_information_on = NONE
execute_on = TIMESTEP_END
[]
[]
(modules/optimization/test/tests/optimizationreporter/material/adjoint.i)
[Mesh]
[]
[Variables]
[adjointVar]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = adjointVar
diffusivity = thermal_conductivity
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjointVar
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Reporters]
[misfit]
type = OptimizationData
[]
[params]
type = ConstantReporter
real_vector_names = 'p1'
real_vector_values = '0' # Dummy value
[]
[]
[AuxVariables]
[temperature_forward]
[]
[]
[BCs]
[left]
type = NeumannBC
variable = adjointVar
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = adjointVar
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = adjointVar
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = adjointVar
boundary = top
value = 0
[]
[]
[Functions]
[thermo_conduct]
type = ParsedOptimizationFunction
expression = 'alpha'
param_symbol_names = 'alpha'
param_vector_name = 'params/p1'
[]
[]
[Materials]
[thermalProp]
type = GenericFunctionMaterial
prop_names = 'thermal_conductivity'
prop_values = 'thermo_conduct'
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[VectorPostprocessors]
[adjoint_grad]
type = ElementOptimizationDiffusionCoefFunctionInnerProduct
variable = adjointVar
forward_variable = temperature_forward
function = thermo_conduct
[]
[]
[Outputs]
console = false
file_base = 'adjoint'
[]
(test/tests/actions/debug_show_reporters/debug_show_reporters.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
[]
[]
[Postprocessors]
[scale]
type = ScalePostprocessor
value = function
scaling_factor = 2
[]
[function]
type = FunctionValuePostprocessor
function = 1
[]
[]
[VectorPostprocessors/constant_vpp]
type = ConstantVectorPostprocessor
vector_names = 'value1 value2'
value = '1; 2'
[]
[Reporters/constant_reporter]
type = ConstantReporter
integer_names = integer
integer_values = 1
real_names = real
real_values = 2
string_names = string
string_values = 'funny'
[]
[Debug]
show_reporters = true
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
(test/tests/reporters/constant_reporter/constant_reporter.i)
[Mesh/mesh]
type = GeneratedMeshGenerator
dim = 1
[]
[Problem]
kernel_coverage_check = false
solve = false
[]
[Reporters]
active = constant
[constant]
type = ConstantReporter
integer_names = 'int_1 int_2 int_3'
integer_values = '1 2 -3'
real_names = 'num_1 num_2'
real_values = '4.0 5.0'
string_names = 'str'
string_values = 'six'
dof_id_type_names = 'dofid_1 dofid_2 dofid_3'
dof_id_type_values = '1 2 3'
integer_vector_names = 'int_vec'
integer_vector_values = '7 8'
real_vector_names = 'vec_1 vec_2'
real_vector_values = '8.0 80.0 800.0; 9.0 90.0'
string_vector_names = 'str_vec'
string_vector_values = 'ten eleven twelve thirteen'
dof_id_type_vector_names = 'dofid_vec'
dof_id_type_vector_values = '7 3'
[]
[error]
type = ConstantReporter
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
execute_on = 'timestep_end'
[out]
type = JSON
[]
[]
(modules/optimization/test/tests/dirackernels/reporter_time_point_source.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 4
ny = 4
nz = 4
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[dot]
type = TimeDerivative
variable = u
[]
[]
[DiracKernels]
[vpp_point_source]
type = ReporterTimePointSource
variable = u
value_name = values4D/value
x_coord_name = values4D/coordx
y_coord_name = values4D/coordy
z_coord_name = values4D/coordz
weight_name = values4D/weight
time_name = values4D/time
combine_duplicates=true
[]
[]
[Reporters]
[values4D]
type = ConstantReporter
real_vector_names = 'coordx coordy coordz time value weight'
real_vector_values = '0.25 0.25 0.75 0.25 0.75 0.25 0.75 0.25 0.75
0.25 0.25 0.75 0.25 0.75 0.25 0.75 0.25 0.75
0.25 0.25 0.75 0.25 0.75 0.25 0.75 0.25 0.75;
0.25 0.25 0.25 0.75 0.75 0.25 0.25 0.75 0.75
0.25 0.25 0.25 0.75 0.75 0.25 0.25 0.75 0.75
0.25 0.25 0.25 0.75 0.75 0.25 0.25 0.75 0.75;
0.25 0.25 0.25 0.25 0.25 0.75 0.75 0.75 0.75
0.25 0.25 0.25 0.25 0.25 0.75 0.75 0.75 0.75
0.25 0.25 0.25 0.25 0.25 0.75 0.75 0.75 0.75;
0.10 0.10 0.10 0.10 0.10 0.10 0.10 0.10 0.10
0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20
0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30;
0.00 0.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00
4.00 1.00 9.00 10.0 11.0 12.0 13.0 14.0 15.0
4.0 1.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0;
1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00
1.00 4.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00
2.00 8.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00'
outputs = none
[]
[]
[VectorPostprocessors]
[sample]
type = PointValueSampler
variable = u
points = '0.25 0.25 0.25
0.75 0.25 0.25
0.25 0.75 0.25
0.75 0.75 0.25
0.25 0.25 0.75
0.75 0.25 0.75
0.25 0.75 0.75
0.75 0.75 0.75'
sort_by = id
execute_on = 'initial timestep_end'
[]
[]
[BCs]
[bc]
type = DirichletBC
variable = u
boundary = 'left right top bottom front back'
value = 0
[]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 3
solve_type = 'PJFNK'
nl_rel_tol = 1e-10
[]
[Outputs]
csv = true
execute_on = 'initial timestep_end'
[]
(modules/stochastic_tools/test/tests/reporters/stochastic_reporter/sub.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[time]
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 = 5
dt = 0.01
dtmin = 0.01
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
error_on_dtmin = false
[]
[Postprocessors]
[pp]
type = Receiver
default = 0
[]
[]
vector_val0 = 0
vector_val1= ${fparse vector_val0 * 10}
vector_val2= ${fparse vector_val0 * 100}
vector_val3= ${fparse vector_val0 * 1000}
[VectorPostprocessors]
[vpp]
type = ConstantVectorPostprocessor
vector_names = 'vec'
value = '${vector_val0} ${vector_val1} ${vector_val2} ${vector_val3}'
[]
[]
[Reporters]
[constant]
type = ConstantReporter
integer_names = 'int'
integer_values = 0
string_names = 'str'
string_values = 'this_value'
[]
[mesh]
type = MeshInfo
items = sidesets
[]
[]
(test/tests/transfers/multiapp_reporter_transfer/dist_vector/main_dist.i)
[Mesh]
[generate]
type = GeneratedMeshGenerator
nx = 1
dim = 1
[]
[]
[Problem]
kernel_coverage_check = false
solve = false
[]
[Reporters]
[from_sub_rep]
type = ConstantReporter
real_vector_vector_names = 'rec_vec_vec'
real_vector_vector_values = '10000000.'
execute_on = INITIAL
outputs = out
[]
[main]
type = TestDeclareReporter
distributed_vector_name = dis_vec
[]
[]
[Positions]
[elem]
type = ElementCentroidPositions
auto_sort = true
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = 'sub_dist.i'
positions_objects = elem
execute_on = TIMESTEP_END
[]
[]
[Transfers]
active = to_sub
[to_sub]
type = MultiAppReporterTransfer
to_multi_app = sub
from_reporters = 'main/dis_vec'
to_reporters = 'sub/value'
distribute_reporter_vector = true
[]
[from_sub]
type = MultiAppReporterTransfer
from_multi_app = sub
from_reporters = 'sub_rep/dis_vec'
to_reporters = 'from_sub_rep/rec_vec_vec '
distribute_reporter_vector = true
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
[out]
type = JSON
execute_system_information_on = NONE
execute_on = TIMESTEP_END
[]
[]
(modules/optimization/test/tests/misc/scaling_test/forward_and_adjoint.i)
[Mesh]
[generated]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
ymin = 0
xmin = 0
xmax = 10
ymax = 10
[]
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = FALSE
[]
[Variables]
[T_real]
initial_condition = 1e-8
scaling = 10
[]
[T_imag]
initial_condition = 1e-8
[]
[T_real_adj]
solver_sys = adjoint
[]
[T_imag_adj]
solver_sys = adjoint
[]
[]
[Kernels]
[heat_conduction_real]
type = MatDiffusion
variable = T_real
diffusivity = k
[]
[heat_source_real]
type = MatCoupledForce
variable = T_real
v = T_imag
material_properties = 'force_mat'
[]
[heat_conduction_imag]
type = MatDiffusion
variable = T_imag
diffusivity = k
[]
[heat_source_imag]
type = MatCoupledForce
variable = T_imag
v = T_real
material_properties = 'force_mat'
coef = -1
[]
[]
[Materials]
[k_mat]
type = GenericFunctionMaterial
prop_names = 'k'
prop_values = 'kappa_func'
[]
[mats]
type = GenericConstantMaterial
prop_names = 'rho omega cp '
prop_values = '1.0 1.0 1.0 '
[]
[force_mat]
type = ParsedMaterial
property_name = force_mat
expression = 'rho * omega * cp'
material_property_names = 'rho omega cp'
[]
[phase]
type = ADParsedMaterial
coupled_variables = 'T_real T_imag'
expression = 'atan2(T_imag, T_real)'
property_name = phase
[]
[]
[Functions]
[gauss]
type = ParsedFunction
expression = 'exp(-2.0 *(x^2 + y^2 + z^2)/(beam_radii^2))'
symbol_names = 'beam_radii'
symbol_values = '0.1'
[]
[kappa_func]
type = ParsedOptimizationFunction
expression = 'k '
param_symbol_names = 'k '
param_vector_name = 'params/k'
[]
[]
[BCs]
[real_top]
type = FunctionNeumannBC
variable = T_real
boundary = top
function = 'exp((-2.0 *(x)^2)/0.1)'
[]
[]
[DiracKernels]
[misfit_real]
type = ReporterPointSource
variable = T_real_adj
x_coord_name = measure_data_real/measurement_xcoord
y_coord_name = measure_data_real/measurement_ycoord
z_coord_name = measure_data_real/measurement_zcoord
value_name = measure_data_real/misfit_values
[]
[misfit_imag]
type = ReporterPointSource
variable = T_imag_adj
x_coord_name = measure_data_imag/measurement_xcoord
y_coord_name = measure_data_imag/measurement_ycoord
z_coord_name = measure_data_imag/measurement_zcoord
value_name = measure_data_imag/misfit_values
[]
[]
[AuxVariables]
[phase]
[]
[]
[AuxKernels]
[phase]
type = ParsedAux
variable = phase
coupled_variables = 'T_imag T_real'
expression = 'atan2(T_imag, T_real)'
execute_on = 'TIMESTEP_END'
[]
[]
[Reporters]
[measure_data_real]
type = OptimizationData
variable = T_real
objective_name = objective_value
measurement_values = '0.10391 -0.0064'
measurement_points = '0.55 10 0
3.55 10 0'
[]
[measure_data_imag]
type = OptimizationData
objective_name = objective_value
variable = T_imag
measurement_values = '-0.08234 -0.00181'
measurement_points = '0.55 10 0
3.55 10 0'
[]
[params]
type = ConstantReporter
real_vector_names = 'k'
real_vector_values = '2' # Dummy value
[]
[gradient]
type = ParsedVectorReporter
name = inner
reporter_names = 'gradient_real/inner_product gradient_imag/inner_product'
reporter_symbols = 'a b'
expression = 'a+b'
execute_on = ADJOINT_TIMESTEP_END
execution_order_group = 1
[]
[obj]
type = ParsedScalarReporter
name = value
reporter_names = 'measure_data_real/objective_value measure_data_imag/objective_value'
reporter_symbols = 'a b'
expression = 'a+b'
execute_on = ADJOINT_TIMESTEP_END
execution_order_group = 1
[]
[]
[VectorPostprocessors]
[gradient_real]
type = ElementOptimizationDiffusionCoefFunctionInnerProduct
variable = T_real_adj
forward_variable = T_real
function = kappa_func
execute_on = ADJOINT_TIMESTEP_END
[]
[gradient_imag]
type = ElementOptimizationDiffusionCoefFunctionInnerProduct
variable = T_imag_adj
forward_variable = T_imag
function = kappa_func
execute_on = ADJOINT_TIMESTEP_END
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
nl_rel_tol = 1e-12
nl_abs_tol = 1e-10
l_tol = 1e-10
automatic_scaling = false
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
line_search = l2
verbose = true
[]
[Outputs]
console = true
execute_on = FINAL
[]
(modules/optimization/test/tests/optimizationreporter/constant_heat_source/forward_nonLinear.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[Variables]
[T]
initial_condition = 100
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = T
diffusivity = thermal_conductivity
[]
[heat_source]
type = BodyForce
function = volumetric_heat_func
variable = T
[]
[]
[BCs]
[left]
type = NeumannBC
variable = T
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = T
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = T
boundary = bottom
value = 200
[]
[top]
type = DirichletBC
variable = T
boundary = top
value = 100
[]
[]
[Functions]
[volumetric_heat_func]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params/q'
[]
[]
[Materials]
[steel]
type = ParsedMaterial
f_name = 'thermal_conductivity'
function = '.01*T'
args = 'T'
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[Reporters]
[measure_data]
type = OptimizationData
objective_name = objective_value
variable = T
[]
[params]
type = ConstantReporter
real_vector_names = 'q'
real_vector_values = '0' # Dummy value
[]
[]
[Outputs]
console = false
file_base = 'forward_nl'
[]
(modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/forward_and_adjoint.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 20
xmax = 1
ymax = 2
bias_x = 1.1
bias_y = 1.1
[]
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
[]
[Variables]
[temperature]
[]
[temperature_adjoint]
solver_sys = adjoint
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = thermal_conductivity
[]
[]
[BCs]
[left]
type = FunctionNeumannBC
variable = temperature
boundary = left
function = left_function
[]
[right]
type = FunctionNeumannBC
variable = temperature
boundary = right
function = right_function
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 200
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 100
[]
[]
[Functions]
[left_function]
type = ParsedOptimizationFunction
expression = 'a + b*y'
param_symbol_names = 'a b'
param_vector_name = 'params/left'
[]
[right_function]
type = ParsedOptimizationFunction
expression = 'a'
param_symbol_names = 'a'
param_vector_name = 'params/right'
[]
[]
[Materials]
[steel]
type = GenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Preconditioning]
[nl0]
type = SMP
nl_sys = 'nl0'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[adjoint]
type = SMP
nl_sys = 'adjoint'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
line_search = none
nl_rel_tol = 1e-12
l_tol = 1e-12
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = temperature_adjoint
x_coord_name = measure_data/measurement_xcoord
y_coord_name = measure_data/measurement_ycoord
z_coord_name = measure_data/measurement_zcoord
value_name = measure_data/misfit_values
weight_name = measure_data/weight
[]
[]
[VectorPostprocessors]
[grad_bc_left]
type = SideOptimizationNeumannFunctionInnerProduct
variable = temperature_adjoint
function = left_function
boundary = left
execute_on = ADJOINT_TIMESTEP_END
[]
[grad_bc_right]
type = SideOptimizationNeumannFunctionInnerProduct
variable = temperature_adjoint
function = right_function
boundary = right
execute_on = ADJOINT_TIMESTEP_END
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
variable = temperature
measurement_file = 'measurementData.csv'
file_xcoord = 'coordx'
file_ycoord ='y'
file_zcoord = 'z'
file_value = 'weightedMeasurement'
file_variable_weights = 'weight'
variable_weight_names = 'weight'
[]
[params]
type = ConstantReporter
real_vector_names = 'left right'
real_vector_values = '0 0; 0' # Dummy
[]
[vector_sqsum]
type = ParsedVectorRealReductionReporter
name = sqsum
reporter_name= 'measure_data/misfit_values'
initial_value = 0
expression = 'reduction_value+indexed_value*indexed_value'
outputs=none
[]
[obj_sum]
type = ParsedScalarReporter
name = value
reporter_names = 'vector_sqsum/sqsum'
reporter_symbols = 'a'
expression = '0.5*a'
[]
[]
[Outputs]
console = false
exodus = true
[]
(modules/optimization/test/tests/functions/nearest_reporter_coord/nearest_reporter_point.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 4
ny = 4
nz = 4
[]
[]
[AuxVariables]
[val]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[val_aux]
type = FunctionAux
variable = val
function = 'xyzt'
execute_on = 'initial timestep_end'
[]
[]
[Functions]
active = 'xyzt'
[xx]
type = NearestReporterCoordinatesFunction
x_coord_name = 'values1D/coordx'
value_name = 'values1D/value'
[]
[xy]
type = NearestReporterCoordinatesFunction
x_coord_name = 'values2D/coordx'
y_coord_name = 'values2D/coordy'
value_name = 'values2D/value'
[]
[xyz]
type = NearestReporterCoordinatesFunction
x_coord_name = 'values3D/coordx'
y_coord_name = 'values3D/coordy'
z_coord_name = 'values3D/coordz'
value_name = 'values3D/value'
[]
[xyzt]
type = NearestReporterCoordinatesFunction
x_coord_name = 'values4D/coordx'
y_coord_name = 'values4D/coordy'
z_coord_name = 'values4D/coordz'
time_name = 'values4D/time'
value_name = 'values4D/value'
[]
[errorv]
type = NearestReporterCoordinatesFunction
x_coord_name = 'values4D/coordx'
value_name = 'values1D/val'
[]
[errorx]
type = NearestReporterCoordinatesFunction
x_coord_name = 'values1D/coordx'
y_coord_name = 'values4D/coordx'
value_name = 'values4D/value'
[]
[errory]
type = NearestReporterCoordinatesFunction
x_coord_name = 'values4D/coordx'
y_coord_name = 'values1D/coordx'
value_name = 'values4D/value'
[]
[errorz]
type = NearestReporterCoordinatesFunction
variable = val
x_coord_name = 'values4D/coordx'
z_coord_name = 'values1D/coordx'
value_name = 'values4D/value'
[]
[errort]
type = NearestReporterCoordinatesFunction
x_coord_name = 'values4D/coordx'
time_name = 'values1D/coordx'
value_name = 'values4D/value'
[]
[]
[Reporters]
[values1D]
type = ConstantReporter
real_vector_names = 'coordx value'
real_vector_values = '0.25 0.75;
0.00 1.00'
[]
[values2D]
type = ConstantReporter
real_vector_names = 'coordx coordy value'
real_vector_values = '0.25 0.75 0.25 0.75;
0.25 0.25 0.75 0.75;
0.00 1.00 2.00 3.00'
[]
[values3D]
type = ConstantReporter
real_vector_names = 'coordx coordy coordz value'
real_vector_values = '0.25 0.75 0.25 0.75 0.25 0.75 0.25 0.75;
0.25 0.25 0.75 0.75 0.25 0.25 0.75 0.75;
0.25 0.25 0.25 0.25 0.75 0.75 0.75 0.75;
0.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00'
[]
[values4D]
type = ConstantReporter
real_vector_names = 'coordx coordy coordz time value'
real_vector_values = '0.25 0.75 0.25 0.75 0.25 0.75 0.25 0.75
0.25 0.75 0.25 0.75 0.25 0.75 0.25 0.75
0.25 0.75 0.25 0.75 0.25 0.75 0.25 0.75;
0.25 0.25 0.75 0.75 0.25 0.25 0.75 0.75
0.25 0.25 0.75 0.75 0.25 0.25 0.75 0.75
0.25 0.25 0.75 0.75 0.25 0.25 0.75 0.75;
0.25 0.25 0.25 0.25 0.75 0.75 0.75 0.75
0.25 0.25 0.25 0.25 0.75 0.75 0.75 0.75
0.25 0.25 0.25 0.25 0.75 0.75 0.75 0.75;
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.50 0.50 0.50 0.50 0.50 0.50 0.50 0.50
1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00;
0.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00
8.00 9.00 10.0 11.0 12.0 13.0 14.0 15.0
16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0'
[]
[]
[Problem]
solve = false
kernel_coverage_check = false
skip_nl_system_check = true
[]
[Executioner]
type = Transient
dt = 0.1
end_time = 1
[]
[Outputs]
exodus = true
[]
(test/tests/outputs/json/specific_reporter/specific_reporter.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Reporters/reporter]
type = ConstantReporter
real_names = 'value1 value2 value3'
real_values = '1 2 3'
[]
[Outputs]
[specific]
type = JSON
reporters = 'reporter/value1 reporter/value3'
[]
json = true
[]
(modules/optimization/examples/materialTransient/forward.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
xmax = 1
ymax = 1
nx = 10
ny = 10
[]
[]
[Variables/u]
initial_condition = 0
[]
[Kernels]
[dt]
type = TimeDerivative
variable = u
[]
[diff]
type = MatDiffusion
variable = u
diffusivity = D
[]
[src]
type = BodyForce
variable = u
value = 1
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = u
boundary = 'right top'
value = 0
[]
[]
[Materials]
[diffc]
type = GenericFunctionMaterial
prop_names = 'D'
prop_values = 'diffc_fun'
output_properties = 'D'
outputs = 'exodus'
[]
[]
[Functions]
[diffc_fun]
type = NearestReporterCoordinatesFunction
value_name = 'diffc_rep/D_vals'
x_coord_name = 'diffc_rep/D_x_coord'
y_coord_name = 'diffc_rep/D_y_coord'
[]
[]
[Reporters]
[diffc_rep]
type = ConstantReporter
real_vector_names = 'D_x_coord D_y_coord D_vals'
real_vector_values = '0.25 0.75 0.25 0.75;
0.25 0.25 0.75 0.75;
1 0.2 0.2 0.05' # Reference solution
outputs = none
[]
[data]
type = OptimizationData
variable = u
measurement_points = '0.25 0.25 0 0.25 0.75 0 0.75 0.25 0 0.75 0.75 0
0.25 0.25 0 0.25 0.75 0 0.75 0.25 0 0.75 0.75 0
0.25 0.25 0 0.25 0.75 0 0.75 0.25 0 0.75 0.75 0
0.25 0.25 0 0.25 0.75 0 0.75 0.25 0 0.75 0.75 0
0.25 0.25 0 0.25 0.75 0 0.75 0.25 0 0.75 0.75 0
0.25 0.25 0 0.25 0.75 0 0.75 0.25 0 0.75 0.75 0
0.25 0.25 0 0.25 0.75 0 0.75 0.25 0 0.75 0.75 0
0.25 0.25 0 0.25 0.75 0 0.75 0.25 0 0.75 0.75 0
0.25 0.25 0 0.25 0.75 0 0.75 0.25 0 0.75 0.75 0
0.25 0.25 0 0.25 0.75 0 0.75 0.25 0 0.75 0.75 0'
measurement_times = '0.1 0.1 0.1 0.1
0.2 0.2 0.2 0.2
0.3 0.3 0.3 0.3
0.4 0.4 0.4 0.4
0.5 0.5 0.5 0.5
0.6 0.6 0.6 0.6
0.7 0.7 0.7 0.7
0.8 0.8 0.8 0.8
0.9 0.9 0.9 0.9
1.0 1.0 1.0 1.0'
measurement_values = '0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0'
objective_name = objective_value
outputs = none
[]
[]
[Postprocessors]
[D1]
type = PointValue
variable = D
point = '0.25 0.25 0'
[]
[D2]
type = PointValue
variable = D
point = '0.75 0.25 0'
[]
[D3]
type = PointValue
variable = D
point = '0.25 0.75 0'
[]
[D4]
type = PointValue
variable = D
point = '0.75 0.75 0'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
nl_rel_tol = 1e-8
nl_abs_tol = 1e-12
dt = 0.1
num_steps = 10
[]
[Outputs]
csv = true
exodus = true
[]
(modules/optimization/test/tests/optimizationreporter/mesh_source/forward.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[]
[Variables/u]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[src]
type = BodyForce
variable = u
function = src_func
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = u
boundary = 'bottom left'
value = 0
[]
[]
[Functions]
[src_func]
type = ParameterMeshFunction
exodus_mesh = parameter_mesh_in.e
parameter_name = src_rep/vals
[]
[]
[Reporters]
[src_rep]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0'
[]
[measure_data]
type = OptimizationData
objective_name = objective_value
variable = u
outputs = none
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[AuxVariables]
[source]
[]
[]
[AuxKernels]
[source_aux]
type = FunctionAux
variable = source
function = src_func
[]
[]
[Outputs]
exodus = true
console = false
execute_on = timestep_end
[]
(test/tests/markers/reporter_point_marker/point_marker_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
elem_type = QUAD4
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Reporters]
[coords]
type=ConstantReporter
real_vector_names = 'x y z'
real_vector_values = '.31 .41 .51 .31 .41 .51 .31 .41 .51 .8;
.31 .31 .31 .41 .41 .41 .51 .51 .51 .8;
0 0 0 0 0 0 0 0 0 1'
outputs=none
[]
[bad_coords]
type=ConstantReporter
real_vector_names = 'x y z'
real_vector_values = '.31 .41 .51;
.31 .31 .31 .41 .41 .41 .51 .51;
0 0 0 0 0 0 0 0 0 1'
outputs=none
[]
[]
[Adaptivity]
[Markers]
active = 'box'
[box]
type = ReporterPointMarker
x_coord_name = coords/x
y_coord_name = coords/y
z_coord_name = coords/z
inside = refine
empty = do_nothing
[]
[bad_coord]
type = ReporterPointMarker
x_coord_name = bad_coords/x
y_coord_name = bad_coords/y
z_coord_name = bad_coords/z
inside = refine
empty = do_nothing
[]
[]
[]
[Outputs]
exodus=true
[]
(modules/optimization/examples/diffusion_reaction_XYDelaunay/forward_and_adjoint.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
dim = 2
nx = 25
ny = 25
xmin = 0
xmax = 1
ymin = 0
ymax = 1
[]
[]
[Variables/u]
[]
[Reporters]
[params]
type = ConstantReporter
real_vector_names = 'reaction_rate'
real_vector_values = '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0' # Dummy
outputs = nones
[]
[data]
type = OptimizationData
variable = u
objective_name = objective_value
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
outputs = none
[]
[]
[Functions]
[rxn_func]
type = ParameterMeshFunction
exodus_mesh = parameter_mesh_out.e
parameter_name = params/reaction_rate
[]
[]
[Materials]
[ad_dc_prop]
type = ADParsedMaterial
expression = '1 + u'
coupled_variables = 'u'
property_name = dc_prop
[]
[ad_rxn_prop]
type = ADGenericFunctionMaterial
prop_values = 'rxn_func'
prop_names = rxn_prop
[]
#ADMatReaction includes a negative sign in residual evaluation, so we need to
#reverse this with a negative reaction rate. However, we wanted the parameter
#to remain positive, which is why there is one object to evaluate function
#and another to flip it's sign for the kernel
[ad_neg_rxn_prop]
type = ADParsedMaterial
expression = '-rxn_prop'
material_property_names = 'rxn_prop'
property_name = 'neg_rxn_prop'
[]
[]
[Kernels]
[udot]
type = ADTimeDerivative
variable = u
[]
[diff]
type = ADMatDiffusion
variable = u
diffusivity = dc_prop
[]
[reaction]
type = ADMatReaction
variable = u
reaction_rate = neg_rxn_prop
[]
[src]
type = ADBodyForce
variable = u
value = 1
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = u
boundary = 'left bottom'
value = 0
[]
[]
[Executioner]
type = TransientAndAdjoint
forward_system = nl0
adjoint_system = adjoint
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
dt = 0.1
end_time = 1
nl_rel_tol = 1e-12
nl_abs_tol = 1e-12
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
skip_nl_system_check = true
[]
[Variables]
[u_adjoint]
initial_condition = 0
solver_sys = adjoint
outputs = none
[]
[]
[DiracKernels]
[misfit]
type = ReporterTimePointSource
variable = u_adjoint
value_name = data/misfit_values
x_coord_name = data/measurement_xcoord
y_coord_name = data/measurement_ycoord
z_coord_name = data/measurement_zcoord
time_name = data/measurement_time
[]
[]
[VectorPostprocessors]
[adjoint]
type = ElementOptimizationReactionFunctionInnerProduct
variable = u_adjoint
forward_variable = u
function = rxn_func
execute_on = ADJOINT_TIMESTEP_END
outputs = none
[]
[]
[AuxVariables]
[reaction_rate]
[]
[]
[AuxKernels]
[reaction_rate_aux]
type = FunctionAux
variable = reaction_rate
function = rxn_func
execute_on = TIMESTEP_END
[]
[]
[Postprocessors]
[u1]
type = PointValue
variable = u
point = '0.25 0.25 0'
[]
[u2]
type = PointValue
variable = u
point = '0.75 0.75 0'
[]
[u3]
type = PointValue
variable = u
point = '1 1 0'
[]
[]
[Outputs]
exodus = true
console = false
csv = true
[]
(test/tests/outputs/reporters/reporter.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables/u]
[]
[Problem]
solve = false
kernel_coverage_check = false
[]
[Reporters]
[constant]
type = ConstantReporter
integer_vector_names = 'int_vec'
integer_vector_values = '1 2 3 4'
real_vector_names = 'vec_1 vec_2'
real_vector_values = '5.0 50.0 500.0 5000.0; 6.6 66.6 666.6 6666.6'
string_vector_names = 'str_vec'
string_vector_values = 'seven eight nine ten'
integer_names = int
integer_values = 11
real_names = num
real_values = 12.1
string_names = str
string_values = thirteen
[]
[test]
type = TestDeclareReporter
[]
[]
[Postprocessors]
[numdofs]
type = NumDOFs
[]
[]
[Executioner]
type = Transient
num_steps = 3
[]
[Outputs]
csv = true
[]
(modules/stochastic_tools/test/tests/samplers/mcmc/main_des.i)
[StochasticTools]
[]
[Distributions]
[left]
type = Normal
mean = 0.0
standard_deviation = 1.0
[]
[right]
type = Normal
mean = 0.0
standard_deviation = 1.0
[]
[]
[Likelihood]
[gaussian]
type = Gaussian
noise = 'noise_specified/noise_specified'
file_name = 'exp_0_05.csv'
log_likelihood = true
[]
[]
[Samplers]
[sample]
type = AffineInvariantDES
prior_distributions = 'left right'
num_parallel_proposals = 5
file_name = 'confg.csv'
execute_on = PRE_MULTIAPP_SETUP
seed = 2547
initial_values = '0.1 0.1'
previous_state = 'mcmc_reporter/inputs'
previous_state_var = 'mcmc_reporter/variance'
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = sample
[]
[]
[Transfers]
[reporter_transfer]
type = SamplerReporterTransfer
from_reporter = 'average/value'
stochastic_reporter = 'constant'
from_multi_app = sub
sampler = sample
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
sampler = sample
param_names = 'left_bc right_bc mesh1'
[]
[]
[Reporters]
[constant]
type = StochasticReporter
[]
[noise_specified]
type = ConstantReporter
real_names = 'noise_specified'
real_values = '0.05'
[]
[mcmc_reporter]
type = AffineInvariantDifferentialDecision
output_value = constant/reporter_transfer:average:value
sampler = sample
likelihoods = 'gaussian'
[]
[]
[Executioner]
type = Transient
num_steps = 5
[]
[Outputs]
file_base = 'des_5prop'
[out]
type = JSON
execute_system_information_on = NONE
[]
[]
(modules/stochastic_tools/test/tests/samplers/mcmc/main_imh.i)
[StochasticTools]
[]
[Distributions]
[left]
type = Normal
mean = 0.0
standard_deviation = 1.0
[]
[right]
type = Normal
mean = 0.0
standard_deviation = 1.0
[]
[]
[Likelihood]
[gaussian]
type = Gaussian
noise = 'noise_specified/noise_specified'
file_name = 'exp_0_05.csv'
log_likelihood = true
[]
[]
[Samplers]
[sample]
type = IndependentGaussianMH
prior_distributions = 'left right'
# previous_state = 'mcmc_reporter/inputs'
num_parallel_proposals = 5
file_name = 'confg.csv'
execute_on = PRE_MULTIAPP_SETUP
seed = 2547
std_prop = '0.05 0.05'
initial_values = '0.1 0.1'
seed_inputs = 'mcmc_reporter/seed_input'
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = sample
[]
[]
[Transfers]
[reporter_transfer]
type = SamplerReporterTransfer
from_reporter = 'average/value'
stochastic_reporter = 'constant'
from_multi_app = sub
sampler = sample
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
sampler = sample
param_names = 'left_bc right_bc mesh1'
[]
[]
[Reporters]
[constant]
type = StochasticReporter
[]
[noise_specified]
type = ConstantReporter
real_names = 'noise_specified'
real_values = '0.05'
[]
[mcmc_reporter]
type = IndependentMHDecision
output_value = constant/reporter_transfer:average:value
sampler = sample
likelihoods = 'gaussian'
[]
[]
[Executioner]
type = Transient
num_steps = 5
[]
[Outputs]
file_base = 'imh_5prop'
[out]
type = JSON
execute_system_information_on = NONE
[]
[]
(modules/optimization/test/tests/optimizationreporter/point_loads/forward_and_adjoint.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmax = 1
ymax = 1.4
[]
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
[]
[Variables]
[temperature]
[]
[temperature_adjoint]
solver_sys = adjoint
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = thermal_conductivity
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = temperature
x_coord_name = 'point_source/x'
y_coord_name = 'point_source/y'
z_coord_name = 'point_source/z'
value_name = 'point_source/value'
[]
[misfit]
type = ReporterPointSource
variable = temperature_adjoint
x_coord_name = measure_data/measurement_xcoord
y_coord_name = measure_data/measurement_ycoord
z_coord_name = measure_data/measurement_zcoord
value_name = measure_data/misfit_values
[]
[]
[BCs]
[left]
type = DirichletBC
variable = temperature
boundary = left
value = 300
[]
[right]
type = DirichletBC
variable = temperature
boundary = right
value = 300
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 300
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 300
[]
[]
[Materials]
[steel]
type = GenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Preconditioning]
[nl0]
type = SMP
nl_sys = 'nl0'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[adjoint]
type = SMP
nl_sys = 'adjoint'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
nl_rel_tol = 1e-12
l_tol = 1e-12
[]
[VectorPostprocessors]
[gradient]
type = PointValueSampler
points = '0.2 0.2 0
0.7 0.56 0
0.4 1 0'
variable = temperature_adjoint
sort_by = id
execute_on = ADJOINT_TIMESTEP_END
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
objective_name = objective_value
variable = temperature
[]
[point_source]
type = ConstantReporter
real_vector_names = 'x y z value'
real_vector_values = '0.2 0.7 0.4;
0.2 0.56 1;
0 0 0;
-1000 120 500'
[]
[]
[Outputs]
console = false
[]
(modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/adjoint.i)
[Mesh]
[]
[Variables]
[adjoint_T]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = adjoint_T
diffusivity = thermal_conductivity
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjoint_T
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
weight_name = misfit/weight
[]
[]
[Reporters]
[misfit]
type = OptimizationData
variable_weight_names = 'weight'
[]
[params_left]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '0 0' # Dummy
[]
[params_right]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '0' # Dummy
[]
[]
[BCs]
[left]
type = NeumannBC
variable = adjoint_T
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = adjoint_T
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = adjoint_T
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = adjoint_T
boundary = top
value = 0
[]
[]
[Materials]
[steel]
type = GenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
line_search = none
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[Functions]
[left_function]
type = ParsedOptimizationFunction
expression = 'a + b*y'
param_symbol_names = 'a b'
param_vector_name = 'params_left/vals'
[]
[right_function]
type = ParsedOptimizationFunction
expression = 'a'
param_symbol_names = 'a'
param_vector_name = 'params_right/vals'
[]
[]
[VectorPostprocessors]
[grad_bc_left]
type = SideOptimizationNeumannFunctionInnerProduct
variable = adjoint_T
function = left_function
boundary = left
[]
[grad_bc_right]
type = SideOptimizationNeumannFunctionInnerProduct
variable = adjoint_T
function = right_function
boundary = right
[]
[]
[Outputs]
console = false
exodus = false
file_base = 'adjoint'
[]
(test/tests/outputs/json/one_file_per_timestep/json.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
num_steps = 3
[]
[Reporters]
[test]
type = ConstantReporter
integer_names = 'year'
integer_values = '1980'
execute_on = INITIAL
[]
[]
[Outputs]
[out]
type = JSON
one_file_per_timestep = true
[]
[]
(modules/optimization/test/tests/optimizationreporter/function_misfit/forward_and_adjoint_side.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 15
ny = 15
xmin = 0
ymin = 0
xmax = 1
ymax = 1.4
[]
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = FALSE
[]
[Variables]
[temperature]
[]
[temperature_adjoint]
solver_sys = adjoint
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = thermal_conductivity
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = temperature
x_coord_name = 'point_source/x'
y_coord_name = 'point_source/y'
z_coord_name = 'point_source/z'
value_name = 'point_source/value'
[]
[]
[BCs]
[left]
type = DirichletBC
variable = temperature
boundary = left
value = 300
[]
[right]
type = DirichletBC
variable = temperature
boundary = right
value = 300
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 300
[]
# apply gradient material as a side force since the objective integral is only
# over this side
[top]
type = MatNeumannBC
boundary = top
boundary_material = obj_misfit_gradient
variable = temperature_adjoint
value = 1
[]
[]
[Materials]
[steel]
type = GenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
# Create two materials.
# 1. Material which the integral of is our objective
# 2. dM/du material which is used for our adjoint problem
[beam]
type = MisfitReporterOffsetFunctionMaterial
x_coord_name = measure_data/measurement_xcoord
y_coord_name = measure_data/measurement_ycoord
z_coord_name = measure_data/measurement_zcoord
measurement_value_name = measure_data/measurement_values
forward_variable = temperature
property_name = obj_misfit
function = gauss
[]
[]
[Functions]
[gauss]
type = ParsedFunction
expression = 'exp(-2.0 *(x^2 + y^2 + z^2)/(beam_radii^2))'
symbol_names = 'beam_radii'
symbol_values = 0.1
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
nl_rel_tol = 1e-12
nl_abs_tol = 1e-10
l_tol = 1e-12
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[VectorPostprocessors]
[gradient]
type = PointValueSampler
points = '0.2 1.1 0
0.7 1.1 0
0.4 1.1 0'
variable = temperature_adjoint
sort_by = id
execute_on = ADJOINT_TIMESTEP_END
[]
[]
[Postprocessors]
[objective]
type = SideIntegralMaterialProperty
boundary = top
property = obj_misfit
execute_on = 'TIMESTEP_END'
[]
[largest_adjoint]
type = NodalExtremeValue
variable = temperature_adjoint
execute_on = ADJOINT_TIMESTEP_END
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
variable = temperature
[]
[point_source]
type = ConstantReporter
real_vector_names = 'x y z value'
real_vector_values = '0.2 0.7 0.4;
1.1 1.1 1.1;
0 0 0;
-1000 120 500'
[]
[]
[Outputs]
console = false
[]
(test/tests/reporters/accumulated_reporter/accumulate_reporter.i)
[Mesh/mesh]
type = GeneratedMeshGenerator
dim = 1
[]
[Problem]
kernel_coverage_check = false
solve = false
[]
[Functions/fun]
type = ParsedFunction
expression = 't * x'
[]
[Postprocessors/pp]
type = FunctionValuePostprocessor
function = fun
point = '1 0 0'
execute_on = 'initial timestep_end'
[]
[VectorPostprocessors/vpp]
type = LineFunctionSampler
functions = fun
start_point = '0 0 0'
end_point = '1 0 0'
num_points = 6
sort_by = x
execute_on = 'initial timestep_end'
[]
[Reporters]
[rep]
type = ConstantReporter
dof_id_type_names = 'dofid'
dof_id_type_values = '1'
integer_names = 'int'
integer_values = '1'
string_names = 'str'
string_values = 'two'
integer_vector_names = 'int_vec'
integer_vector_values = '3 4'
string_vector_names = 'str_vec'
string_vector_values = 'five six seven eight'
dof_id_type_vector_names = 'dofid_vec'
dof_id_type_vector_values = '1 2 3'
outputs = none
[]
[accumulate]
type = AccumulateReporter
reporters = 'pp/value vpp/fun rep/int rep/str rep/int_vec rep/str_vec rep/dofid rep/dofid_vec'
[]
[]
[Executioner]
type = Transient
num_steps = 5
# This is just testing that AccumulateReporter doesn't accumulate picard iterations
fixed_point_max_its = 3
custom_pp = pp
direct_pp_value = true
disable_fixed_point_residual_norm_check = true
accept_on_max_fixed_point_iteration = true
[]
[Outputs]
[out]
type = JSON
[]
[]
(modules/combined/test/tests/optimization/invOpt_mechanics/forward.i)
[Mesh]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[Kernels]
[TensorMechanics]
use_displaced_mesh = false
displacements = 'disp_x disp_y'
[]
[]
[BCs]
[left_ux]
type = DirichletBC
variable = disp_x
boundary = left
value = 0
[]
[left_uy]
type = DirichletBC
variable = disp_y
boundary = left
value = 0
[]
[right_fy]
type = FunctionNeumannBC
variable = disp_y
boundary = right
function = right_fy_func
[]
[]
[Functions]
[right_fy_func]
type = ParsedOptimizationFunction
expression = 'val'
param_symbol_names = 'val'
param_vector_name = 'params/right_fy_value'
[]
[]
[Materials]
[elasticity]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 10e3
poissons_ratio = 0.3
[]
[strain]
type = ComputeSmallStrain
displacements = 'disp_x disp_y'
[]
[stress]
type = ComputeLinearElasticStress
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-6
nl_rel_tol = 1e-8
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[VectorPostprocessors]
[point_sample]
type = PointValueSampler
variable = 'disp_y'
points = '5.0 1.0 0'
sort_by = x
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
objective_name = objective_value
variable = disp_y
[]
[params]
type = ConstantReporter
real_vector_names = 'right_fy_value'
real_vector_values = '0' # Dummy value
[]
[]
[Outputs]
csv = false
console = false
exodus = false
file_base = 'forward'
[]
(modules/porous_flow/test/tests/dirackernels/pls02reporter.i)
# fully-saturated situation with a poly-line sink with use_mobility=true
# The poly-line consists of 2 points, and has a length
# of 0.5. Each point is weighted with a weight of 0.1
# The PorousFlowPolyLineSink has
# p_or_t_vals = 0 1E7
# fluxes = 0 1
# so that for 0<=porepressure<=1E7
# base flux = porepressure * 1E-6 * mobility (measured in kg.m^-1.s^-1),
# and when multiplied by the poly-line length, and
# the weighting of each point, the mass flux is
# flux = porepressure * 0.5*E-8 * mobility (kg.s^-1).
#
# The fluid and matrix properties are:
# porosity = 0.1
# element volume = 8 m^3
# density = dens0 * exp(P / bulk), with bulk = 2E7
# initial porepressure P0 = 1E7
# viscosity = 0.2
# So, fluid mass = 0.8 * density (kg)
#
# The equation to solve is
# d(Mass)/dt = - porepressure * 0.5*E-8 * density / viscosity
#
# PorousFlow discretises time to conserve mass, so to march
# forward in time, we must solve
# Mass(dt) = Mass(0) - P * 0.5E-8 * density / viscosity * dt
# or
# 0.8 * dens0 * exp(P/bulk) = 0.8 * dens0 * exp(P0/bulk) - P * 0.5E-8 * density / viscosity * dt
# For the numbers written above this gives
# P(t=1) = 6.36947 MPa
# which is given precisely by MOOSE
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = -1
zmax = 1
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[pp]
initial_condition = 1E7
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pp
[]
[]
[UserObjects]
[pls_total_outflow_mass]
type = PorousFlowSumQuantity
[]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
m = 0.5
alpha = 1e-7
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 2e7
viscosity = 0.2
density0 = 1000
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
[]
[ppss]
type = PorousFlow1PhaseP
porepressure = pp
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
[]
[simple_fluid]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1E-12 0 0 0 1E-12 0 0 0 1E-12'
[]
[relperm]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[]
[]
[DiracKernels]
[pls]
# This defines a sink that has strength
# f = L(P) * relperm * L_seg
# where
# L(P) is a piecewise-linear function of porepressure
# that is zero at pp=0 and 1 at pp=1E7
# relperm is the relative permeability of the fluid
# L_seg is the line-segment length associated with
# the Dirac points defined in the file pls02.bh
type = PorousFlowPolyLineSink
# Because the Variable for this Sink is pp, and pp is associated
# with the fluid-mass conservation equation, this sink is extracting
# fluid mass (and not heat energy or something else)
variable = pp
# The following specfies that the total fluid mass coming out of
# the porespace via this sink in this timestep should be recorded
# in the pls_total_outflow_mass UserObject
SumQuantityUO = pls_total_outflow_mass
# The following file defines the polyline geometry
# which is just two points in this particular example
weight_reporter='pls02file/w'
x_coord_reporter='pls02file/x'
y_coord_reporter='pls02file/y'
z_coord_reporter='pls02file/z'
# Now define the piecewise-linear function, L
# First, we want L to be a function of porepressure (and not
# temperature or something else). The following means that
# p_or_t_vals should be intepreted by MOOSE as the zeroth-phase
# porepressure
function_of = pressure
fluid_phase = 0
# Second, define the piecewise-linear function, L
# The following means
# flux=0 when pp=0 (and also pp<0)
# flux=1 when pp=1E7 (and also pp>1E7)
# flux=linearly intepolated between pp=0 and pp=1E7
# When flux>0 this means a sink, while flux<0 means a source
p_or_t_vals = '0 1E7'
fluxes = '0 1'
# Finally, in this case we want to always multiply
# L by the fluid mobility (of the zeroth phase) and
# use that in the sink strength instead of the bare L
# computed above
use_mobility = true
[]
[]
[Reporters]
[pls02file]
# contains contents from pls02.bh
type=ConstantReporter
real_vector_names = 'w x y z'
real_vector_values = '0.10 0.10;
0.00 0.00;
0.00 0.00;
-0.25 0.25'
[]
[]
[Postprocessors]
[pls_report]
type = PorousFlowPlotQuantity
uo = pls_total_outflow_mass
[]
[fluid_mass0]
type = PorousFlowFluidMass
execute_on = timestep_begin
[]
[fluid_mass1]
type = PorousFlowFluidMass
execute_on = timestep_end
[]
[zmass_error]
type = FunctionValuePostprocessor
function = mass_bal_fcn
execute_on = timestep_end
indirect_dependencies = 'fluid_mass1 fluid_mass0 pls_report'
[]
[p0]
type = PointValue
variable = pp
point = '0 0 0'
execute_on = timestep_end
[]
[]
[Functions]
[mass_bal_fcn]
type = ParsedFunction
expression = abs((a-c+d)/2/(a+c))
symbol_names = 'a c d'
symbol_values = 'fluid_mass1 fluid_mass0 pls_report'
[]
[]
[Preconditioning]
[usual]
type = SMP
full = true
petsc_options = '-snes_converged_reason'
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it -ksp_max_it'
petsc_options_value = 'bcgs bjacobi 1E-10 1E-10 10000 30'
[]
[]
[Executioner]
type = Transient
end_time = 1
dt = 1
solve_type = NEWTON
[]
[Outputs]
exodus = false
csv = true
execute_on = timestep_end
[]
(test/tests/transfers/multiapp_reporter_transfer/sub0.i)
[Mesh/generate]
type = GeneratedMeshGenerator
dim = 1
[]
[Problem]
kernel_coverage_check = false
solve = false
[]
[Postprocessors]
[to_sub_pp]
type = Receiver
[]
[from_sub_pp]
type = Receiver
default = 3.1415926
[]
[]
[VectorPostprocessors]
[to_sub_vpp]
type = ConstantVectorPostprocessor
vector_names = 'a b'
value = '10 10 10 ; 20 20 20'
[]
[from_sub_vpp]
type = ConstantVectorPostprocessor
vector_names = 'a b'
value = '30 30 30; 40 40 40'
[]
[]
[Reporters]
[to_sub_rep]
type = ConstantReporter
integer_names = int
integer_values = 0
string_names = str
string_values = 'foo'
[]
[from_sub_rep]
type = ConstantReporter
integer_names = int
integer_values = 10
string_names = str
string_values = 'twenty'
[]
[]
[Executioner]
type = Transient
num_steps = 0
[]
[Outputs]
[out]
type = JSON
vectorpostprocessors_as_reporters = true
postprocessors_as_reporters = true
[]
execute_on = timestep_end
[]
(modules/optimization/test/tests/optimizationreporter/mesh_source/adjoint.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[]
[Variables/adjoint_u]
[]
[Kernels]
[heat_conduction]
type = Diffusion
variable = adjoint_u
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjoint_u
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = adjoint_u
boundary = 'bottom left'
value = 0
[]
[]
[Reporters]
[misfit]
type = OptimizationData
[]
[src_rep]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Functions]
[src_func]
type = ParameterMeshFunction
exodus_mesh = parameter_mesh_in.e
parameter_name = src_rep/vals
[]
[]
[VectorPostprocessors]
[gradient_vpp]
type = ElementOptimizationSourceFunctionInnerProduct
variable = adjoint_u
function = src_func
[]
[]
[Outputs]
console = false
[]
(modules/optimization/test/tests/vectorpostprocessors/element_reaction_inner_product/element_reaction_inner_product.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[]
[AuxVariables]
[u]
[]
[v]
initial_condition = 1
[]
[dp1]
[]
[dp2]
[]
[]
p1 = 3.14
p2 = 2.72
[Reporters]
[params]
type = ConstantReporter
real_vector_names = 'p'
real_vector_values = '${p1} ${p2}'
[]
[]
[Functions]
[p_fun]
type = ParsedOptimizationFunction
expression = 'p_1*x + p_2*p_2'
param_symbol_names = 'p_1 p_2'
param_vector_name = params/p
[]
[u_fun]
type = ParsedFunction
expression = 'x'
[]
[dp1_fun]
type = ParsedFunction
expression = 'x'
symbol_names = 'p_1 p_2'
symbol_values = '${p1} ${p2}'
[]
[dp2_fun]
type = ParsedFunction
expression = '2*p_2'
symbol_names = 'p_1 p_2'
symbol_values = '${p1} ${p2}'
[]
[]
[ICs]
[u_ic]
type = FunctionIC
variable = u
function = u_fun
[]
[dp1_ic]
type = FunctionIC
variable = dp1
function = dp1_fun
[]
[dp2_ic]
type = FunctionIC
variable = dp2
function = dp2_fun
[]
[]
[VectorPostprocessors]
[inner_product]
type = ElementOptimizationReactionFunctionInnerProduct
forward_variable = u
variable = v
function = p_fun
execute_on = initial
[]
[]
[Postprocessors]
[udp1v]
type = VectorPostprocessorComponent
vectorpostprocessor = inner_product
vector_name = inner_product
index = 0
[]
[udp2v]
type = VectorPostprocessorComponent
vectorpostprocessor = inner_product
vector_name = inner_product
index = 1
[]
[udp1v_exact]
type = VariableInnerProduct
variable = u
second_variable = dp1
[]
[udp2v_exact]
type = VariableInnerProduct
variable = u
second_variable = dp2
[]
[compare]
type = ParsedPostprocessor
expression = 'abs(udp1v + udp1v_exact) + abs(udp2v + udp2v_exact)'
pp_names = 'udp1v udp2v udp1v_exact udp2v_exact'
[]
[]
[UserObjects]
[terminate]
type = Terminator
expression = 'compare > 1e-8'
error_level = ERROR
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
(modules/stochastic_tools/test/tests/reporters/statistics/constant_sub.i)
[StochasticTools]
[]
val = 1
[Reporters/const]
type = ConstantReporter
real_names = 'num'
real_values = '${val}'
integer_names = 'int'
integer_values = '${val}'
real_vector_names = 'vec'
real_vector_values = '${val} ${val} ${val} ${val} ${val} ${val} ${val}'
[]
(modules/optimization/test/tests/vectorpostprocessors/element_source_inner_product/element_source_inner_product.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 4
ny = 4
nz = 4
[]
[]
[AuxVariables]
[u]
initial_condition = 1
[]
[]
[AuxKernels]
[u_val]
type = ParsedAux
variable = u
use_xyzt = true
function = 't'
[]
[]
[Functions]
[xyzt]
type = NearestReporterCoordinatesFunction
x_coord_name = 'values4D/coordx'
y_coord_name = 'values4D/coordy'
z_coord_name = 'values4D/coordz'
time_name = 'values4D/time'
value_name = 'values4D/value'
[]
[]
[Reporters]
[values4D]
type = ConstantReporter
real_vector_names = 'coordx coordy coordz time value'
real_vector_values = '0.25 0.75 0.25 0.75 0.25 0.75 0.25 0.75
0.25 0.75 0.25 0.75 0.25 0.75 0.25 0.75
0.25 0.75 0.25 0.75 0.25 0.75 0.25 0.75;
0.25 0.25 0.75 0.75 0.25 0.25 0.75 0.75
0.25 0.25 0.75 0.75 0.25 0.25 0.75 0.75
0.25 0.25 0.75 0.75 0.25 0.25 0.75 0.75;
0.25 0.25 0.25 0.25 0.75 0.75 0.75 0.75
0.25 0.25 0.25 0.25 0.75 0.75 0.75 0.75
0.25 0.25 0.25 0.25 0.75 0.75 0.75 0.75;
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.50 0.50 0.50 0.50 0.50 0.50 0.50 0.50
1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00;
0.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00
8.00 9.00 10.0 11.0 12.0 13.0 14.0 15.0
16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0'
outputs = none
[]
[]
[VectorPostprocessors]
[inner_product]
type = ElementOptimizationSourceFunctionInnerProduct
variable = u
function = xyzt
execute_on = 'initial timestep_end'
[]
[]
[Problem]
solve = false
kernel_coverage_check = false
skip_nl_system_check = true
[]
[Executioner]
type = Transient
dt = 0.1
end_time = 1
[]
[Outputs]
csv = true
execute_on = final
[]
(modules/optimization/test/tests/reporters/multiExperiment/forward.i)
omega = 1
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Functions]
[obj_func]
type = ParsedOptimizationFunction
expression = 'pow(x_val + 2 * y_val - ${omega}-5, 2) + pow(2 * x_val + y_val - ${omega}, 2)'
param_symbol_names = 'x_val y_val'
param_vector_name = vals/vals
[]
[df_dx]
type = ParsedOptimizationFunction
expression = '2 * (x_val + 2 * y_val - ${omega}-5) + 4 * (2 * x_val + y_val - ${omega})'
param_symbol_names = 'x_val y_val'
param_vector_name = vals/vals
[]
[df_dy]
type = ParsedOptimizationFunction
expression = '4 * (x_val + 2 * y_val - ${omega}-5) + 2 * (2 * x_val + y_val - ${omega})'
param_symbol_names = 'x_val y_val'
param_vector_name = vals/vals
[]
[]
[Postprocessors]
[obj_pp]
type = FunctionValuePostprocessor
function = obj_func
execute_on = 'INITIAL TIMESTEP_END'
[]
[df_dx]
type = FunctionValuePostprocessor
function = df_dx
[]
[df_dy]
type = FunctionValuePostprocessor
function = df_dy
[]
[omega]
type = ConstantPostprocessor
value = ${omega}
[]
[]
[VectorPostprocessors]
[grad_f]
type = VectorOfPostprocessors
postprocessors = 'df_dx df_dy'
[]
[]
[Reporters]
[vals]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '0 0'
[]
[]
[Outputs]
console = false
[]
(test/tests/dirackernels/reporter_point_source/2d_vpp.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[]
uniform_refine = 4
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[]
[DiracKernels]
inactive = 'reporter_point_source_err reporter_point_source_dup_err'
[vpp_point_source]
type = ReporterPointSource
variable = u
value_name = 'csv_reader/u'
x_coord_name = 'csv_reader/x'
y_coord_name = 'csv_reader/y'
z_coord_name = 'csv_reader/z'
[]
[reporter_point_source]
type = ReporterPointSource
variable = u
value_name = 'reporterData/u'
x_coord_name = 'reporterData/x'
y_coord_name = 'reporterData/y'
z_coord_name = 'reporterData/z'
weight_name = 'reporterData/weight'
[]
[reporter_point_source_err]
type = ReporterPointSource
variable = u
value_name = 'reporterData_err/u2'
x_coord_name = 'reporterData_err/x2'
y_coord_name = 'reporterData_err/y2'
z_coord_name = 'reporterData_err/z2'
[]
[reporter_point_source_dup_err]
type = ReporterPointSource
variable = u
value_name = 'reporterData_dup/u'
x_coord_name = 'reporterData_dup/x'
y_coord_name = 'reporterData_dup/y'
z_coord_name = 'reporterData_dup/z'
weight_name = 'reporterData_dup/weight'
combine_duplicates=false
[]
[reporter_point_source_dup]
type = ReporterPointSource
variable = u
value_name = 'reporterData_dup/u'
x_coord_name = 'reporterData_dup/x'
y_coord_name = 'reporterData_dup/y'
z_coord_name = 'reporterData_dup/z'
weight_name = 'reporterData_dup/weight'
combine_duplicates=true
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = 3
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = 1
value = 1
[]
[]
[VectorPostprocessors]
[csv_reader]
type = CSVReader
csv_file = point_value_file.csv
[]
[]
[Reporters]
[reporterData]
type = ConstantReporter
real_vector_names = 'x y z u weight'
real_vector_values = '0.2 0.2 0.0; 0.3 0.8 0.0; 0 0 0; 1 -.5 0; 1 1 1'
[]
[reporterData_err]
type = ConstantReporter
real_vector_names = 'x2 y2 z2 u2'
real_vector_values = '0.2 0.2; 0.3 0.8 0.0; 0 0 0; 1 -.5 0'
[]
[reporterData_dup]
type = ConstantReporter
real_vector_names = 'x y z u weight'
real_vector_values = '0.2 0.2 0.2 0.0; 0.3 0.3 0.8 0.0; 0 0 0 0; 2 1 -.5 0;0.25 0.5 1 1'
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/multiapp_reporter_transfer/dist_vector/main.i)
[Mesh]
[generate]
type = GeneratedMeshGenerator
nx = 4
dim = 1
[]
[]
[Problem]
kernel_coverage_check = false
solve = false
[]
[Reporters]
[to_sub_rep]
type = ConstantReporter
real_vector_vector_names = 'sent_vec'
real_vector_vector_values = '1.; 2. 1003.;-5.0 -10 1000;3.3'
real_vector_names = 'sent_real'
real_vector_values = "1. 2. 3. 4."
execute_on = INITIAL
outputs = out
[]
[from_sub_rep]
type = ConstantReporter
real_vector_vector_names = 'rec_vec_vec'
real_vector_vector_values = '10000000.'
real_vector_names = 'rec_vec'
real_vector_values = "0."
execute_on = INITIAL
outputs = out
[]
[]
[Positions]
[elem]
type = ElementCentroidPositions
auto_sort = true
outputs = none
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = 'sub.i'
positions_objects = elem
execute_on = TIMESTEP_END
[]
[]
[Transfers]
active = 'to_sub from_sub'
[to_sub]
type = MultiAppReporterTransfer
to_multi_app = sub
from_reporters = 'to_sub_rep/sent_vec to_sub_rep/sent_real'
to_reporters = 'from_main_rep/rec_vec from_main_rep/rec_real'
distribute_reporter_vector = true
[]
[from_sub]
type = MultiAppReporterTransfer
from_multi_app = sub
from_reporters = 'from_main_rep/rec_vec from_main_rep/rec_real'
to_reporters = 'from_sub_rep/rec_vec_vec from_sub_rep/rec_vec'
distribute_reporter_vector = true
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
[out]
type = JSON
execute_system_information_on = NONE
execute_on = TIMESTEP_END
[]
[]
(modules/optimization/test/tests/optimizationreporter/reporter_offset/reporter_offset_mat.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 100
ny = 100
xmax = 1
ymax = 1
[]
[]
[Problem]
solve = false
[]
[Materials]
[multiple_sources]
type = ReporterOffsetFunctionMaterial
property_name = 'multiple_funcs'
x_coord_name = 'constant/x'
y_coord_name = 'constant/y'
z_coord_name = 'constant/z'
function = gauss
outputs = exodus
output_properties = multiple_funcs
[]
[ad_multiple_sources]
type = ADReporterOffsetFunctionMaterial
property_name = 'ad_multiple_funcs'
x_coord_name = 'constant/x'
y_coord_name = 'constant/y'
z_coord_name = 'constant/z'
function = circle
outputs = exodus
output_properties = ad_multiple_funcs
[]
[]
[Reporters]
[constant]
type = ConstantReporter
real_vector_names = 'x y z'
real_vector_values = '0 0.25 0.5 0.45; 0 0.75 0.5 0.45; 0.0 0.0 0.0 0.0'
execute_on = 'INITIAL'
[]
[]
[Functions]
[gauss]
type = ParsedFunction
expression = 'exp(-2.0 *(x^2 + y^2 + z^2)/(beam_radii^2))'
symbol_names = 'beam_radii'
symbol_values = '0.1'
[]
[circle]
type = ParsedFunction
expression = 'if(x^2 +y^2 +z^2< beam_radii^2,1,0)'
symbol_names = 'beam_radii'
symbol_values = '0.1'
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/combined/test/tests/optimization/invOpt_bc_convective/adjoint.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 20
xmax = 1
ymax = 2
[]
[]
[AuxVariables]
[temperature_forward]
[]
[T2]
[]
[]
[AuxKernels]
[TT]
type = ParsedAux
args = 'temperature temperature_forward'
variable = T2
function = 'temperature*(100-temperature_forward)'
[]
[]
[Variables]
[temperature]
[]
[]
[Kernels]
[heat_conduction]
type = ADHeatConduction
variable = temperature
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = temperature
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Reporters]
[misfit]
type = OptimizationData
[]
[params]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '0' # Dummy value
[]
[]
[BCs]
[left]
type = ConvectiveFluxFunction
variable = temperature
boundary = 'left'
T_infinity = 0.0
coefficient = function1
[]
[right]
type = NeumannBC
variable = temperature
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 0
[]
[]
[Materials]
[steel]
type = ADGenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-6
nl_rel_tol = 1e-8
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Functions]
[function1]
type = ParsedOptimizationFunction
expression = 'a'
param_symbol_names = 'a'
param_vector_name = 'params/vals'
[]
[]
[VectorPostprocessors]
[adjoint_pt]
type = SideOptimizationNeumannFunctionInnerProduct
variable = T2
function = function1
boundary = left
[]
[]
[Outputs]
console = false
exodus = false
file_base = 'adjoint'
[]
(test/tests/transfers/multiapp_reporter_transfer/dist_vector/main_rec.i)
[Mesh]
[generate]
type = GeneratedMeshGenerator
nx = 4
dim = 1
[]
[]
[Problem]
kernel_coverage_check = false
solve = false
[]
[Reporters]
[from_sub_rep]
type = ConstantReporter
real_vector_vector_names = 'rec_vec_vec'
real_vector_vector_values = '10000000.'
real_vector_names = 'rec_vec'
real_vector_values = "0."
execute_on = INITIAL
outputs = out
[]
[]
[Positions]
[elem]
type = ElementCentroidPositions
auto_sort = true
outputs = none
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = 'sub.i'
positions_objects = elem
execute_on = TIMESTEP_END
cli_args = 'Reporters/from_main_rep/real_vector_values="0 1";Reporters/from_main_rep/real_values=0
Reporters/from_main_rep/real_vector_values="-10";Reporters/from_main_rep/real_values=-5
Reporters/from_main_rep/real_vector_values="100 -100 -200";Reporters/from_main_rep/real_values=3.33
Reporters/from_main_rep/real_vector_values="5.55 5.55 5.55 5.55";Reporters/from_main_rep/real_values=7'
[]
[]
[Transfers]
[from_sub]
type = MultiAppReporterTransfer
from_multi_app = sub
from_reporters = 'from_main_rep/rec_vec from_main_rep/rec_real'
to_reporters = 'from_sub_rep/rec_vec_vec from_sub_rep/rec_vec'
distribute_reporter_vector = true
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
file_base = N_to_1
[out]
type = JSON
execute_system_information_on = NONE
execute_on = TIMESTEP_END
[]
[]
(modules/optimization/test/tests/optimizationreporter/constant_heat_source/adjoint_nonLinear.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[Variables]
[adjoint_T]
[]
[]
[AuxVariables]
[T]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = adjoint_T
diffusivity = thermal_conductivity
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjoint_T
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Reporters]
[misfit]
type = OptimizationData
[]
[params]
type = ConstantReporter
real_vector_names = 'q'
real_vector_values = '0' # Dummy value
[]
[]
[BCs]
[left]
type = NeumannBC
variable = adjoint_T
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = adjoint_T
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = adjoint_T
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = adjoint_T
boundary = top
value = 0
[]
[]
[Materials]
[steel]
type = ParsedMaterial
f_name = 'thermal_conductivity'
function = '.01*T'
args = 'T'
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[Functions]
[volumetric_heat_func]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params/q'
[]
[]
[VectorPostprocessors]
[gradient_vpp]
type = ElementOptimizationSourceFunctionInnerProduct
variable = adjoint_T
function = volumetric_heat_func
[]
[]
[Outputs]
console = false
file_base = 'adjoint_nl'
[]
(test/tests/markers/reporter_point_marker/reporter_marker_adapt_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
num_steps = 6
dt = 0.1
[]
[Reporters]
[coords]
type=ConstantReporter
real_vector_names = 'y z'
real_vector_values = '.51 .91; 0 0'
outputs=none
[]
[]
[Functions]
[xfcn]
type = ParsedFunction
expression = t+0.01 #offset so marker is not on element edge
[]
[]
[Postprocessors]
[xfcn_pp]
type = FunctionValuePostprocessor
function = xfcn
execute_on = timestep_end
outputs = none
[]
[x_pp]
type = Receiver
default = .91
outputs = none
[]
[n_elements]
type = NumElements
execute_on = 'timestep_end'
[]
[]
[VectorPostprocessors]
[xfcn_vpp]
type = VectorOfPostprocessors
postprocessors = 'xfcn_pp x_pp'
outputs = none
[]
[]
[Adaptivity]
marker = x_moving
max_h_level = 2
[Markers]
[x_moving]
type = ReporterPointMarker
x_coord_name = xfcn_vpp/xfcn_vpp
y_coord_name = coords/y
z_coord_name = coords/z
inside = REFINE
empty = COARSEN
[]
[]
[]
[Outputs]
csv = true
[]
(modules/optimization/examples/materialTransient/forward_and_adjoint.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
xmax = 1
ymax = 1
nx = 10
ny = 10
[]
[]
[Variables/u]
initial_condition = 0
[]
[Kernels]
[dt]
type = TimeDerivative
variable = u
[]
[diff]
type = MatDiffusion
variable = u
diffusivity = D
[]
[src]
type = BodyForce
variable = u
value = 1
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = u
boundary = 'right top'
value = 0
[]
[]
[Materials]
[diffc]
type = GenericFunctionMaterial
prop_names = 'D'
prop_values = 'diffc_fun'
output_properties = 'D'
outputs = 'exodus'
[]
[]
[Functions]
[diffc_fun]
type = NearestReporterCoordinatesFunction
value_name = 'diffc_rep/D_vals'
x_coord_name = 'diffc_rep/D_x_coord'
y_coord_name = 'diffc_rep/D_y_coord'
[]
[]
[Reporters]
[diffc_rep]
type = ConstantReporter
real_vector_names = 'D_x_coord D_y_coord D_vals'
real_vector_values = '0.25 0.75 0.25 0.75;
0.25 0.25 0.75 0.75;
1 0.2 0.2 0.05' # Reference solution
outputs = none
[]
[data]
type = OptimizationData
objective_name = objective_value
variable = u
outputs = none
[]
[]
[Postprocessors]
[D1]
type = PointValue
variable = D
point = '0.25 0.25 0'
[]
[D2]
type = PointValue
variable = D
point = '0.75 0.25 0'
[]
[D3]
type = PointValue
variable = D
point = '0.25 0.75 0'
[]
[D4]
type = PointValue
variable = D
point = '0.75 0.75 0'
[]
[]
[Executioner]
type = TransientAndAdjoint
forward_system = nl0
adjoint_system = adjoint
nl_rel_tol = 1e-8
nl_abs_tol = 1e-12
l_tol = 1e-12
dt = 0.1
num_steps = 10
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
[]
[Variables]
[u_adjoint]
initial_condition = 0
solver_sys = adjoint
outputs = none
[]
[]
[DiracKernels]
[misfit]
type = ReporterTimePointSource
variable = u_adjoint
value_name = data/misfit_values
x_coord_name = data/measurement_xcoord
y_coord_name = data/measurement_ycoord
z_coord_name = data/measurement_zcoord
time_name = data/measurement_time
[]
[]
[VectorPostprocessors]
[adjoint]
type = ElementOptimizationDiffusionCoefFunctionInnerProduct
variable = u_adjoint
forward_variable = u
function = diffc_fun
execute_on = ADJOINT_TIMESTEP_END
outputs = none
[]
[]
[Outputs]
# The default exodus object executes only during the forward system solve,
# so the adjoint variable in the resulting file will show only 0.
# Unfortunately, there is no way to output the adjoint variable with Exodus.
exodus = true
console = false
[]
(modules/combined/test/tests/optimization/invOpt_nonlinear/homogeneous_forward.i)
[Executioner]
type = Steady
solve_type = NEWTON
line_search = none
#nl_forced_its = 1
nl_abs_tol = 1e-12
nl_rel_tol = 1e-12
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Mesh]
[]
[Variables]
[T]
[]
[]
[AuxVariables]
[forwardT]
[]
[_dDdTgradT]
order = CONSTANT
family = MONOMIAL_VEC
[]
[]
[Kernels]
[heat_conduction]
type = ADHeatConduction
thermal_conductivity = 'linearized_conductivity'
variable = T
[]
[heat_source]
type = ADMatHeatSource
material_property = 'volumetric_heat'
variable = T
[]
[advection]
type = ConservativeAdvection
velocity = _dDdTgradT
variable = T
upwinding_type = full #Full upwinding gives somewhat better results
[]
[]
[AuxKernels]
[_dDdTgradT]
type = ADFunctorElementalGradientAux
functor = forwardT
variable = _dDdTgradT
factor_matprop = '_dDdT'
[]
[]
[Materials]
[LinearizedConductivity]
type = ADParsedMaterial
f_name = 'linearized_conductivity'
function = '10+500*forwardT'
args = 'forwardT'
[]
[_dDdT]
type = ADParsedMaterial
f_name = '_dDdT' # "_" represents negation
function = '-500'
args = 'forwardT'
[]
[volumetric_heat]
type = ADGenericFunctionMaterial
prop_names = 'volumetric_heat'
prop_values = 'volumetric_heat_func'
[]
[]
[Functions]
[volumetric_heat_func]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params/heat_source'
[]
[]
[BCs]
[left]
type = NeumannBC
variable = T
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = T
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = T
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = T
boundary = top
value = 0
[]
[]
[Reporters]
[measurement_locations]
type = OptimizationData
variable = T
[]
[params]
type = ConstantReporter
real_vector_names = 'heat_source'
real_vector_values = '0' # Dummy
[]
[]
[Outputs]
console = false
[]
(modules/optimization/test/tests/optimizationreporter/constant_heat_source/forward.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[Variables]
[temperature]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = thermal_conductivity
[]
[heat_source]
type = BodyForce
function = volumetric_heat_func
variable = temperature
[]
[]
[BCs]
[left]
type = NeumannBC
variable = temperature
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = temperature
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 200
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 100
[]
[]
[Functions]
[volumetric_heat_func]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params/q'
[]
[]
[Materials]
[steel]
type = GenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[Reporters]
[measure_data]
type = OptimizationData
objective_name = objective_value
variable = temperature
[]
[params]
type = ConstantReporter
real_vector_names = 'q'
real_vector_values = '0' # Dummy value
[]
[]
[Outputs]
console = false
file_base = 'forward'
[]
(modules/optimization/test/tests/optimizationreporter/material/forward.i)
[Mesh]
[]
[Variables]
[temperature]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = thermal_conductivity
[]
[heat_source]
type = BodyForce
value = 1000
variable = temperature
[]
[]
[BCs]
[left]
type = NeumannBC
variable = temperature
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = temperature
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 200
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 100
[]
[]
[Functions]
[thermo_conduct]
type = ParsedOptimizationFunction
expression = 'alpha'
param_symbol_names = 'alpha'
param_vector_name = 'params/p1'
[]
[]
[Materials]
[steel]
type = GenericFunctionMaterial
prop_names = 'thermal_conductivity'
prop_values = 'thermo_conduct'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[Reporters]
[measure_data]
type = OptimizationData
objective_name = objective_value
variable = temperature
[]
[params]
type = ConstantReporter
real_vector_names = 'p1'
real_vector_values = '0' # Dummy value
[]
[]
[Outputs]
console = false
file_base = 'forward'
[]
(modules/optimization/test/tests/optimizationreporter/bimaterial/model.i)
# Steady state Heat conduction in a 2D domain with two diffusivities
# The domain is -4 <= x <= 4 and -4 <= y <= 4
# The top-half of the domain (y > 0) has high diffusivity
# The bottom-half of the domain (y < 0) has low diffusivity
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 16
ny = 16
xmin = -4
xmax = 4
ymin = -4
ymax = 4
[]
[]
[Variables]
[temperature]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = diffusivity
[]
[heat_source]
type = BodyForce
value = 100
variable = temperature
[]
[]
[AuxVariables]
[grad_Tx]
order = CONSTANT
family = MONOMIAL
[]
[grad_Ty]
order = CONSTANT
family = MONOMIAL
[]
[grad_Tz]
order = CONSTANT
family = MONOMIAL
[]
[]
[BCs]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 0
[]
[]
[Functions]
[diffusivity_function]
type = NearestReporterCoordinatesFunction
x_coord_name = data/coordx
y_coord_name = data/coordy
value_name = data/diffusivity
[]
[]
[Materials]
[mat]
type = GenericFunctionMaterial
prop_names = diffusivity
prop_values = diffusivity_function
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
variable = temperature
objective_name = objective_value
[]
[data]
type = ConstantReporter
real_vector_names = 'coordx coordy diffusivity'
real_vector_values = '0 0; -2 2; 5 10'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_forced_its = 1
line_search = none
nl_abs_tol = 1e-8
[]
[Outputs]
file_base = 'forward'
console = false
[]
(modules/optimization/examples/materialFrequency/wave1D/model_grad.i)
id = 1
frequencyHz = 1.0
omega = '${fparse 2*3.14159265359*frequencyHz}'
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
skip_nl_system_check = true
[]
[Preconditioning]
[nl0]
type = SMP
nl_sys = 'nl0'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
full = true
[]
[adjoint]
type = SMP
nl_sys = 'adjoint'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
full = true
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
nl_forced_its = 1
line_search = none
nl_abs_tol = 1e-8
[]
[Outputs]
csv = false
console = false
json = false
[]
[Mesh]
type = GeneratedMesh
dim = 1
nx = 200
xmax = 2
[]
[Variables]
[ur]
[]
[ui]
[]
[uradj]
initial_condition = 0
solver_sys = adjoint
[]
[uiadj]
initial_condition = 0
solver_sys = adjoint
[]
[]
[Kernels]
[stiff]
type = MatDiffusion
variable = ur
diffusivity = G
[]
[mass]
type = Reaction
variable = ur
rate = '${fparse -1.0*omega*omega}'
[]
[stiffV]
type = MatDiffusion
variable = ui
diffusivity = G
[]
[massV]
type = Reaction
variable = ui
rate = '${fparse -1.0*omega*omega}'
[]
[]
[BCs]
[leftU]
type = CoupledVarNeumannBC
boundary = left
variable = ur
coef = 2.0
v = ui
[]
[leftV]
type = CoupledVarNeumannBC
boundary = left
variable = ui
coef = -2.0
v = ur
[]
[right]
type = NeumannBC
variable = ur
boundary = right
value = 1
[]
[]
[Materials]
[G]
type = GenericFunctionMaterial
prop_names = G
prop_values = G_function
[]
[]
[Functions]
[G_function]
type = NearestReporterCoordinatesFunction
x_coord_name = parameters/coordx
value_name = parameters/G
[]
[]
[Reporters]
[parameters]
type = ConstantReporter
real_vector_names = 'coordx G'
# 'True value when used to generate synthetic data'
# real_vector_values = '5.0 15.0; 4.0 4.0'
real_vector_values = '1.0; 4.0'
[]
[]
[DiracKernels]
[misfit_ur]
type = ReporterPointSource
variable = uradj
x_coord_name = measure_data_ur/measurement_xcoord
y_coord_name = measure_data_ur/measurement_ycoord
z_coord_name = measure_data_ur/measurement_zcoord
value_name = measure_data_ur/misfit_values
[]
[misfit_ui]
type = ReporterPointSource
variable = uiadj
x_coord_name = measure_data_ui/measurement_xcoord
y_coord_name = measure_data_ui/measurement_ycoord
z_coord_name = measure_data_ui/measurement_zcoord
value_name = measure_data_ui/misfit_values
[]
[]
[VectorPostprocessors]
[gradient_from_real]
type = ElementOptimizationDiffusionCoefFunctionInnerProduct
variable = uradj
forward_variable = ur
function = G_function
execute_on = ADJOINT_TIMESTEP_END
# Just to confirm this happens BEFORE the gradient calcutions
execution_order_group = -1
[]
[gradient_from_imag]
type = ElementOptimizationDiffusionCoefFunctionInnerProduct
variable = uiadj
forward_variable = ui
function = G_function
execute_on = ADJOINT_TIMESTEP_END
# Just to confirm this happens BEFORE the gradient calcutions
execution_order_group = -1
[]
[]
[Reporters]
[measure_data_ur]
type = OptimizationData
objective_name = obj_val
variable = 'ur'
file_value = 'value'
measurement_file = 'measurement/frequency_ur_${id}.csv'
[]
[measure_data_ui]
type = OptimizationData
objective_name = obj_val
variable = 'ui'
file_value = 'value'
measurement_file = 'measurement/frequency_ui_${id}.csv'
[]
[gradient]
type = ParsedVectorReporter
name = gradient
reporter_names = 'gradient_from_real/inner_product gradient_from_imag/inner_product'
reporter_symbols = 'a b'
expression = 'a+b'
execute_on = ADJOINT_TIMESTEP_END
execution_order_group = 0
[]
[objective]
type = ParsedScalarReporter
name = objective
reporter_names = 'measure_data_ur/obj_val measure_data_ui/obj_val'
reporter_symbols = 'a b'
expression = 'a+b'
execute_on = ADJOINT_TIMESTEP_END
# Just to confirm this happens after the gradient calcutions
execution_order_group = 1
[]
[]
(modules/optimization/test/tests/optimizationreporter/bimaterial/model_and_adjoint.i)
# Steady state Heat conduction in a 2D domain with two diffusivities
# The domain is -4 <= x <= 4 and -4 <= y <= 4
# The top-half of the domain (y > 0) has high diffusivity
# The bottom-half of the domain (y < 0) has low diffusivity
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 16
ny = 16
xmin = -4
xmax = 4
ymin = -4
ymax = 4
[]
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
[]
[Variables]
[temperature]
[]
[temperature_adjoint]
solver_sys = adjoint
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = diffusivity
[]
[heat_source]
type = BodyForce
value = 100
variable = temperature
[]
[]
[BCs]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 0
[]
[]
[Functions]
[diffusivity_function]
type = NearestReporterCoordinatesFunction
x_coord_name = data/coordx
y_coord_name = data/coordy
value_name = data/diffusivity
[]
[]
[Materials]
[mat]
type = GenericFunctionMaterial
prop_names = diffusivity
prop_values = diffusivity_function
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = temperature_adjoint
x_coord_name = measure_data/measurement_xcoord
y_coord_name = measure_data/measurement_ycoord
z_coord_name = measure_data/measurement_zcoord
value_name = measure_data/misfit_values
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
objective_name = objective_value
variable = temperature
[]
[data]
type = ConstantReporter
real_vector_names = 'coordx coordy diffusivity'
real_vector_values = '0 0; -2 2; 5 10'
[]
[]
[VectorPostprocessors]
[gradvec]
type = ElementOptimizationDiffusionCoefFunctionInnerProduct
variable = temperature_adjoint
forward_variable = temperature
function = diffusivity_function
execute_on = ADJOINT_TIMESTEP_END
[]
[]
[Preconditioning]
[nl0]
type = SMP
nl_sys = 'nl0'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[adjoint]
type = SMP
nl_sys = 'adjoint'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
nl_forced_its = 1
line_search = none
nl_abs_tol = 1e-8
[]
[Outputs]
console = false
[]
(modules/stochastic_tools/examples/libtorch_drl_control/libtorch_drl_control_trainer.i)
[StochasticTools]
[]
[Samplers]
[dummy]
type = CartesianProduct
linear_space_items = '0 0.01 1'
[]
[]
[MultiApps]
[runner]
type = SamplerFullSolveMultiApp
sampler = dummy
input_files = 'libtorch_drl_control_sub.i'
[]
[]
[Transfers]
[nn_transfer]
type = LibtorchNeuralNetControlTransfer
to_multi_app = runner
trainer_name = nn_trainer
control_name = src_control
[]
[r_transfer]
type = MultiAppReporterTransfer
from_multi_app = runner
to_reporters = 'results/center_temp results/env_temp results/reward results/top_flux results/log_prob_top_flux'
from_reporters = 'T_reporter/center_temp_tend:value T_reporter/env_temp:value T_reporter/reward:value T_reporter/top_flux:value T_reporter/log_prob_top_flux:value'
[]
[]
[Trainers]
[nn_trainer]
type = LibtorchDRLControlTrainer
response = 'results/center_temp results/env_temp'
control = 'results/top_flux'
log_probability = 'results/log_prob_top_flux'
reward = 'results/reward'
num_epochs = 1000
update_frequency = 10
decay_factor = 0.0
loss_print_frequency = 10
critic_learning_rate = 0.0001
num_critic_neurons_per_layer = '64 27'
control_learning_rate = 0.0005
num_control_neurons_per_layer = '16 6'
# keep consistent with LibtorchNeuralNetControl
input_timesteps = 2
response_scaling_factors = '0.03 0.03'
response_shift_factors = '290 290'
action_standard_deviations = '0.02'
standardize_advantage = true
read_from_file = false
[]
[]
[Reporters]
[results]
type = ConstantReporter
real_vector_names = 'center_temp env_temp reward top_flux log_prob_top_flux'
real_vector_values = '0; 0; 0; 0; 0'
outputs = csv
execute_on = timestep_begin
[]
[reward]
type = DRLRewardReporter
drl_trainer_name = nn_trainer
[]
[]
[Executioner]
type = Transient
num_steps = 440
[]
[Outputs]
file_base = output/train_out
csv = true
time_step_interval = 10
[]
(modules/stochastic_tools/test/tests/transfers/libtorch_nn_transfer/libtorch_drl_control_trainer.i)
[StochasticTools]
[]
[Samplers]
[dummy]
type = CartesianProduct
linear_space_items = '0 0.01 1'
[]
[]
[MultiApps]
[runner]
type = SamplerFullSolveMultiApp
sampler = dummy
input_files = 'libtorch_drl_control_sub.i'
[]
[]
[Transfers]
[nn_transfer]
type = LibtorchNeuralNetControlTransfer
to_multi_app = runner
trainer_name = nn_trainer
control_name = src_control
[]
[r_transfer]
type = MultiAppReporterTransfer
from_multi_app = runner
to_reporters = 'results/center_temp results/env_temp results/reward results/left_flux results/log_prob_left_flux'
from_reporters = 'T_reporter/center_temp_tend:value T_reporter/env_temp:value T_reporter/reward:value T_reporter/left_flux:value T_reporter/log_prob_left_flux:value'
[]
[]
[Trainers]
[nn_trainer]
type = LibtorchDRLControlTrainer
response = 'results/center_temp results/env_temp'
control = 'results/left_flux'
log_probability = 'results/log_prob_left_flux'
reward = 'results/reward'
num_epochs = 10
update_frequency = 2
decay_factor = 0.0
loss_print_frequency = 3
critic_learning_rate = 0.0005
num_critic_neurons_per_layer = '4 2'
control_learning_rate = 0.0005
num_control_neurons_per_layer = '4 2'
# keep consistent with LibtorchNeuralNetControl
input_timesteps = 2
response_scaling_factors = '0.03 0.03'
response_shift_factors = '270 270'
action_standard_deviations = '0.1'
read_from_file = false
[]
[]
[Reporters]
[results]
type = ConstantReporter
real_vector_names = 'center_temp env_temp reward left_flux log_prob_left_flux'
real_vector_values = '0; 0; 0; 0; 0'
outputs = 'csv_out'
execute_on = timestep_begin
[]
[nn_parameters]
type = DRLControlNeuralNetParameters
trainer_name = nn_trainer
outputs = json_out
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
file_base = train_out
[json_out]
type = JSON
execute_on = TIMESTEP_BEGIN
execute_system_information_on = NONE
[]
[]
(modules/optimization/test/tests/outputs/exodus_optimization_steady/adjoint_iteration_output.i)
[Mesh]
[]
[Variables]
[adjointVar]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = adjointVar
diffusivity = thermal_conductivity
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjointVar
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Reporters]
[misfit]
type = OptimizationData
[]
[params]
type = ConstantReporter
real_vector_names = 'p1'
real_vector_values = '0' # Dummy value
[]
[]
[AuxVariables]
[temperature_forward]
[]
[]
[BCs]
[left]
type = NeumannBC
variable = adjointVar
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = adjointVar
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = adjointVar
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = adjointVar
boundary = top
value = 0
[]
[]
[Functions]
[thermo_conduct]
type = ParsedOptimizationFunction
expression = 'alpha'
param_symbol_names = 'alpha'
param_vector_name = 'params/p1'
[]
[]
[Materials]
[thermalProp]
type = GenericFunctionMaterial
prop_names = 'thermal_conductivity'
prop_values = 'thermo_conduct'
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[VectorPostprocessors]
[adjoint_grad]
type = ElementOptimizationDiffusionCoefFunctionInnerProduct
variable = adjointVar
forward_variable = temperature_forward
function = thermo_conduct
[]
[]
[Outputs]
console = false
file_base = 'adjoint'
[exodus]
type = ExodusOptimizationSteady
execute_on = 'TIMESTEP_END'
[]
[]
(test/tests/outputs/hide_via_reporters_block/reporter.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Problem]
solve = false
kernel_coverage_check = false
[]
[Reporters]
[day]
type = ConstantReporter
integer_names = day
integer_values = 24
[]
[month]
type = ConstantReporter
integer_names = month
integer_values = 6
outputs = none
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
[out]
type = JSON
[]
[]
(test/tests/transfers/multiapp_reporter_transfer/dist_vector/sub.i)
[Mesh/generate]
type = GeneratedMeshGenerator
dim = 1
[]
[Problem]
kernel_coverage_check = false
solve = false
[]
[Reporters]
[from_main_rep]
type = ConstantReporter
real_vector_names = 'rec_vec'
real_vector_values = '0.'
real_names = 'rec_real'
real_values = '-1.'
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
[out]
type = JSON
execute_system_information_on = NONE
execute_on = TIMESTEP_END
[]
[]
(modules/optimization/test/tests/functions/parameter_mesh/parameter_mesh_transient.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[]
[Functions]
[parameter_mesh]
type = ParameterMeshFunction
exodus_mesh = create_mesh_out.e
parameter_name = param_vec/params
time_name = param_vec/times
[]
[]
[Reporters]
[param_vec]
type = ConstantReporter
real_vector_names = 'times params'
real_vector_values = '0 2 5;
0 0 0.0000 0 0 0 0 0 0
0 0 0.1250 0 0 0 0 0 0
0 0 0.3125 0 0 0 0 0 0'
[]
[]
[AuxVariables]
[parameter]
family = MONOMIAL
order = CONSTANT
[]
[grad_parameter]
family = MONOMIAL_VEC
order = CONSTANT
[]
[parameter_gradient]
components = 27
[]
[]
[AuxKernels]
[parameter_aux]
type = FunctionAux
function = parameter_mesh
variable = parameter
execute_on = 'initial timestep_end'
[]
[grad_parameter_aux]
type = FunctorElementalGradientAux
functor = parameter_mesh
variable = grad_parameter
execute_on = 'initial timestep_end'
[]
[parameter_gradient_aux]
type = OptimizationFunctionAuxTest
function = parameter_mesh
variable = parameter_gradient
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
exodus = true
[]
[Executioner]
type = Transient
num_steps = 5
dt = 1
[]
[Problem]
solve = false
[]
(modules/stochastic_tools/test/tests/reporters/basic/statistics_reporter_ci.i)
[StochasticTools]
[]
[Reporters]
[const]
type = ConstantReporter
real_vector_names = 'const'
real_vector_values = '2 4 6 8 10'
[]
[stats]
type = StatisticsReporter
reporters = 'const/const'
compute = 'min max sum mean stddev norm2 ratio stderr median'
ci_method = percentile
[]
[]
[Outputs/out]
type = JSON
execute_on = FINAL
[]
(modules/stochastic_tools/test/tests/reporters/morris/sub.i)
q0 = 0
q1 = 0.5
q2 = 3
q3 = 9
q4 = 99
q5 = 99
x0 = 0
x1 = 0
x2 = 0
x3 = 0
x4 = 0
x5 = 0
y0 = ${fparse (abs(4 * x0 - 2) + q0) / (1 + q0)}
y1 = ${fparse (abs(4 * x1 - 2) + q1) / (1 + q1)}
y2 = ${fparse (abs(4 * x2 - 2) + q2) / (1 + q2)}
y3 = ${fparse (abs(4 * x3 - 2) + q3) / (1 + q3)}
y4 = ${fparse (abs(4 * x4 - 2) + q4) / (1 + q4)}
y5 = ${fparse (abs(4 * x5 - 2) + q5) / (1 + q5)}
y = ${fparse y0 * y1 * y2 * y3 * y4 * y5}
ya0 = ${fparse abs(4 * x0 - 2)}
ya1 = ${fparse abs(4 * x1 - 2)}
ya2 = ${fparse abs(4 * x2 - 2)}
ya3 = ${fparse abs(4 * x3 - 2)}
ya = ${fparse ya0 * ya1 * ya2 * ya3}
[StochasticTools]
[]
[Reporters/const]
type = ConstantReporter
real_names = 'gf gfa'
real_values = '${y} ${ya}'
real_vector_names = 'gf_vec'
real_vector_values = '${y} ${ya}'
[]
(modules/stochastic_tools/test/tests/likelihoods/gaussian_derived/main.i)
[StochasticTools]
[]
[Distributions]
[mu1]
type = Normal
mean = 0.0
standard_deviation = 0.5
[]
[]
[Samplers]
[sample]
type = MonteCarlo
distributions = 'mu1 mu1'
num_rows = 3
seed = 2547
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = sample
[]
[]
[Transfers]
[param]
type = SamplerParameterTransfer
to_multi_app = sub
sampler = sample
parameters = 'BCs/left/value BCs/right/value'
# to_control = 'stochastic'
[]
[reporter_transfer]
type = SamplerReporterTransfer
from_reporter = 'average/value'
stochastic_reporter = 'constant'
from_multi_app = sub
sampler = sample
[]
[]
[Reporters]
[constant]
type = StochasticReporter
[]
[noise_specified]
type = ConstantReporter
real_names = 'noise_specified'
real_values = '0.2'
[]
[likelihoodtest]
type = TestLikelihood
likelihoods = 'gaussian'
model_pred = constant/reporter_transfer:average:value
sampler = sample
[]
[]
[Likelihood]
[gaussian]
type = Gaussian
noise = 'noise_specified/noise_specified'
file_name = 'exp1.csv'
log_likelihood=true
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
file_base ='loglikelihood_scalar'
[out]
type = JSON
execute_system_information_on = NONE
[]
[]
(modules/combined/test/tests/optimization/invOpt_mechanics/adjoint.i)
[Mesh]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[Kernels]
[TensorMechanics]
use_displaced_mesh = false
displacements ='disp_x disp_y'
[]
[]
#-----adjoint problem information------------------
[DiracKernels]
[pt]
type = ReporterPointSource
variable = disp_y
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Reporters]
[misfit]
type=OptimizationData
[]
[params]
type = ConstantReporter
real_vector_names = 'right_fy_value'
real_vector_values = '0' # Dummy value
[]
[]
[Functions]
[right_fy_func]
type = ParsedOptimizationFunction
expression = 'val'
param_symbol_names = 'val'
param_vector_name = 'params/right_fy_value'
[]
[]
[VectorPostprocessors]
[adjoint_pt]
type = SideOptimizationNeumannFunctionInnerProduct
variable = disp_y
function = right_fy_func
boundary = right
[]
[]
#---------------------------------------------------
[BCs]
[left_ux]
type = DirichletBC
variable = disp_x
boundary = left
value = 0
[]
[left_uy]
type = DirichletBC
variable = disp_y
boundary = left
value = 0
[]
[right_fy]
type = NeumannBC
variable = disp_y
boundary = right
value = 0 #2000
[]
[]
[Materials]
[elasticity]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 10e3
poissons_ratio = 0.3
[]
[strain]
type = ComputeSmallStrain
displacements = 'disp_x disp_y'
[]
[stress]
type = ComputeLinearElasticStress
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-6
nl_rel_tol = 1e-8
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
csv = false
console = false
exodus = false
file_base = 'adjoint'
[]
(modules/optimization/test/tests/optimizationreporter/constant_heat_source/adjoint.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[Variables]
[adjoint_T]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = adjoint_T
diffusivity = thermal_conductivity
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjoint_T
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Reporters]
[misfit]
type = OptimizationData
[]
[params]
type = ConstantReporter
real_vector_names = 'q'
real_vector_values = '0' # Dummy value
[]
[]
[BCs]
[left]
type = NeumannBC
variable = adjoint_T
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = adjoint_T
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = adjoint_T
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = adjoint_T
boundary = top
value = 0
[]
[]
[Materials]
[steel]
type = GenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[Functions]
[volumetric_heat_func]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params/q'
[]
[]
[VectorPostprocessors]
[gradient_vpp]
type = ElementOptimizationSourceFunctionInnerProduct
variable = adjoint_T
function = volumetric_heat_func
[]
[]
[Outputs]
console = false
file_base = 'adjoint'
[]
(modules/optimization/test/tests/reporters/vector_math/vectorMath.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Reporters]
[dataFromVofV]
type=VectorOfVectorTestReporter
name = v_of_v
vector_of_vectors = '101 201; 102 202; 103 203'
outputs=none
[]
[vecvec_sum]
type = ParsedVectorVectorRealReductionReporter
name = sum
reporter_name= 'dataFromVofV/v_of_v'
initial_value = 0
expression = 'reduction_value+indexed_value'
[]
[vecvec_sqsum]
type = ParsedVectorVectorRealReductionReporter
name = sqsum
reporter_name= 'dataFromVofV/v_of_v'
initial_value = 0
expression = 'reduction_value+indexed_value*indexed_value'
[]
[vecvec_multiply]
type = ParsedVectorVectorRealReductionReporter
name = multiply
reporter_name= 'dataFromVofV/v_of_v'
initial_value = 1
expression = 'reduction_value*indexed_value'
[]
[vecvec_max]
type = ParsedVectorVectorRealReductionReporter
name = max
reporter_name= 'dataFromVofV/v_of_v'
initial_value = -100000
expression = 'max(reduction_value,indexed_value)'
[]
[vecs]
type = ConstantReporter
real_vector_names = 'vec_a vec_b vec_c vec_d'
real_vector_values = '1 2 3; 10 20 30; 100 10 1; 1 2 3 4'
real_names = 'a b c'
real_values='1 10 100'
outputs=none
[]
[vectorOperation]
type = ParsedVectorReporter
name = inner
reporter_names = 'vecs/vec_a vecs/vec_b vecs/vec_c'
reporter_symbols = 'a b c'
constant_names = 'constant1 constant2'
constant_expressions = '10 20'
expression = '(a+b)*c+constant1+constant2'
[]
[scalarOperation]
type = ParsedScalarReporter
name = inner
reporter_names = 'vecs/a vecs/b vecs/c'
reporter_symbols = 'a b c'
constant_names = 'constant1 constant2'
constant_expressions = '10 20'
expression = '(a+b)*c+constant1+constant2'
[]
[vec_d]
type = ConstantReporter
real_vector_names = 'vec_d'
real_vector_values = '1 2 3 4'
outputs=none
[]
[vector_sum]
type = ParsedVectorRealReductionReporter
name = sum
reporter_name= vec_d/vec_d
initial_value = 0
expression = 'reduction_value+indexed_value'
[]
[vector_sqsum]
type = ParsedVectorRealReductionReporter
name = sqsum
reporter_name= vec_d/vec_d
initial_value = 0
expression = 'reduction_value+indexed_value*indexed_value'
[]
[vector_multiply]
type = ParsedVectorRealReductionReporter
name = multiply
reporter_name= vec_d/vec_d
initial_value = 1
expression = 'reduction_value*indexed_value'
[]
[vector_max]
type = ParsedVectorRealReductionReporter
name = max
reporter_name= vec_d/vec_d
initial_value = -100000
expression = 'max(reduction_value,indexed_value)'
[]
[]
[Outputs]
csv=true
[]
(test/tests/transfers/multiapp_reporter_transfer/clone_type.i)
[Mesh/generate]
type = GeneratedMeshGenerator
dim = 1
[]
[Problem]
kernel_coverage_check = false
solve = false
[]
[Reporters]
[receiver]
type = ConstantReporter
[]
[]
[MultiApps]
[multi_reporter]
type = TransientMultiApp
input_files = 'sub0.i sub0.i sub0.i sub0.i'
positions = '0 0 0
0 0 0
0 0 0
0 0 0'
cli_args = 'Postprocessors/from_sub_pp/default=3.1415926;Reporters/from_sub_rep/integer_values=10;Reporters/from_sub_rep/string_values=ten;Outputs/active=""
Postprocessors/from_sub_pp/default=1.5707963;Reporters/from_sub_rep/integer_values=11;Reporters/from_sub_rep/string_values=twenty;Outputs/active=""
Postprocessors/from_sub_pp/default=1.0471975;Reporters/from_sub_rep/integer_values=12;Reporters/from_sub_rep/string_values=thirty;Outputs/active=""
Postprocessors/from_sub_pp/default=0.7853981;Reporters/from_sub_rep/integer_values=13;Reporters/from_sub_rep/string_values=forty;Outputs/active=""'
max_procs_per_app = 1
[]
[]
[Transfers]
[multi_rep]
type = MultiAppCloneReporterTransfer
from_reporters = 'from_sub_pp/value from_sub_rep/int from_sub_rep/str'
to_reporter = receiver
from_multi_app = multi_reporter
reporter_type = 'real integer string'
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
[out]
type = JSON
vectorpostprocessors_as_reporters = true
[]
execute_on = timestep_end
[]
(modules/optimization/test/tests/optimizationreporter/nonlinear_material/forward_and_adjoint.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
[]
[Variables]
[forwardT]
[]
[adjointT]
solver_sys = adjoint
[]
[]
[Kernels]
[heat_conduction]
type = ADMatDiffusion
variable = forwardT
diffusivity = 'conductivity'
[]
[heat_source]
type = ADBodyForce
function = volumetric_heat_func
variable = forwardT
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjointT
x_coord_name = measurement_locations/measurement_xcoord
y_coord_name = measurement_locations/measurement_ycoord
z_coord_name = measurement_locations/measurement_zcoord
value_name = measurement_locations/misfit_values
[]
[]
[Materials]
[NonlinearConductivity]
type = ADParsedMaterial
property_name = conductivity
expression = '10+500*forwardT'
coupled_variables = 'forwardT'
[]
[]
[Functions]
[volumetric_heat_func]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params/heat_source'
[]
[]
[BCs]
[left]
type = NeumannBC
variable = forwardT
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = forwardT
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = forwardT
boundary = bottom
value = 2
[]
[top]
type = DirichletBC
variable = forwardT
boundary = top
value = 1
[]
[]
[Reporters]
[measurement_locations]
type = OptimizationData
objective_name = objective_value
variable = forwardT
[]
[params]
type = ConstantReporter
real_vector_names = 'heat_source'
real_vector_values = '0' # Dummy
[]
[]
[VectorPostprocessors]
[gradient_vpp]
type = ElementOptimizationSourceFunctionInnerProduct
function = volumetric_heat_func
variable = adjointT
execute_on = ADJOINT_TIMESTEP_END
[]
[]
[Preconditioning]
[nl0]
type = SMP
nl_sys = 'nl0'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[adjoint]
type = SMP
nl_sys = 'adjoint'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
line_search = none
nl_abs_tol = 1e-12
nl_rel_tol = 1e-12
l_tol = 1e-12
[]
[Outputs]
console = false
[]
(modules/optimization/test/tests/executioners/constrained/shape_optimization/forward.i)
# This test is documented as an example for ConstrainedShapeOptimization. This
# test should not be changed without updating the documentation.
inner_radius = 6
outer_radius = 10
volume_constraint = 200
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[mesh]
type = ConcentricCircleMeshGenerator
has_outer_square = no
num_sectors = 16
radii = '${inner_radius} ${outer_radius}'
rings = '16 16'
preserve_volumes = false
[]
[inner_radius]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
new_boundary = inner
primary_block = 2
paired_block = 1
[]
[delete]
type = BlockDeletionGenerator
input = inner_radius
block = 1
[]
[gather_all]
type = BoundingBoxNodeSetGenerator
input = delete
bottom_left = '-100 -100 -100'
top_right = '100 100 100'
new_boundary = total
[]
[combine]
type = SideSetsFromBoundingBoxGenerator
input = gather_all
bottom_left = '-100 -100 -100'
top_right = '100 100 100'
boundaries_old = 'inner outer'
boundary_new = moving
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[T]
[]
[]
[AuxVariables]
[dist_between]
[AuxKernel]
type = NearestNodeDistanceAux
variable = dist_between
paired_boundary = moving
boundary = total
block = 2
use_displaced_mesh = false
execute_on = "INITIAL"
[]
[]
[]
[Kernels]
[disp_x]
type = MatDiffusion
variable = disp_x
use_displaced_mesh = false
diffusivity = diff_coef
[]
[disp_y]
type = MatDiffusion
variable = disp_y
use_displaced_mesh = false
diffusivity = diff_coef
[]
# run physics of interest on deformed mesh
[Diffusion]
type = FunctionDiffusion
variable = T
use_displaced_mesh = true
[]
[Source]
type = BodyForce
variable = T
value = 1
use_displaced_mesh = true
[]
[]
[Materials]
# perserve elements near the boundary
[diff_coef]
type = ParsedMaterial
coupled_variables = 'dist_between'
expression = '1/(dist_between+0.5)'
property_name = 'diff_coef'
[]
[h]
type = ADGenericFunctionMaterial
prop_names = h
prop_values = h
[]
# convection type boundary condition
[convection_bc]
type = ADParsedMaterial
coupled_variables = "T"
expression = "h*(100-T)"
material_property_names = "h"
property_name = convection
[]
[]
[Functions]
[r1_x]
type = ParsedOptimizationFunction
expression = 'r1 * cos((atan(y/x)))'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[r1_y]
type = ParsedOptimizationFunction
expression = 'r1 * sin((atan(y/x)))'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[r0_x]
type = ParsedOptimizationFunction
expression = 'r0 * cos((atan(y/x)))'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[r0_y]
type = ParsedOptimizationFunction
expression = 'r0 * sin((atan(y/x)))'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[h]
type = ParsedOptimizationFunction
# r0+${inner_radius} is the true current inner radius
expression = '10 /(pi * (r0+${inner_radius})^3)'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[eq_grad_r0]
type = ParsedOptimizationFunction
expression = '-2 * pi * (r0 + ${inner_radius})'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[eq_grad_r1]
type = ParsedOptimizationFunction
# r1+${outer_radius} is the true current outer radius
expression = '2 * pi * (r1+${outer_radius})'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[]
[BCs]
[diffuse_r1_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 'outer'
function = r1_x
preset = false
[]
[diffuse_r1_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 'outer'
function = r1_y
preset = false
[]
[diffuse_r0_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 'inner'
function = r0_x
preset = false
[]
[diffuse_r0_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 'inner'
function = r0_y
preset = false
[]
# run physics on deformed mesh
[convection]
type = ADMatNeumannBC
variable = T
boundary = inner
boundary_material = convection
use_displaced_mesh = true
value = 1
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Reporters]
[params]
type = ConstantReporter
real_vector_names = 'radii'
real_vector_values = '0 0'
dof_id_type_vector_names = 'num_params'
dof_id_type_vector_values = '2'
[]
[]
[Postprocessors]
[current_volume]
type = VolumePostprocessor
use_displaced_mesh = true
[]
# objective function
[objective]
type = NodalExtremeValue
variable = T
[]
[eq_constraint]
type = ParsedPostprocessor
pp_names = current_volume
expression = 'current_volume - ${volume_constraint}'
[]
[func_r0]
type = FunctionValuePostprocessor
function = eq_grad_r0
[]
[func_r1]
type = FunctionValuePostprocessor
function = eq_grad_r1
[]
[]
[VectorPostprocessors]
# convert "Real" postprocessors to vectors
[vol_constraint]
type = VectorOfPostprocessors
postprocessors = 'eq_constraint'
force_postaux = true
[]
[eq_grad]
type = VectorOfPostprocessors
postprocessors = 'func_r0 func_r1'
force_postaux = true
[]
[]
[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-8
nl_abs_tol = 1e-8
[]
[Outputs]
console = false
[]
(modules/stochastic_tools/test/tests/samplers/mcmc/main_base.i)
[StochasticTools]
[]
[Distributions]
[left]
type = Normal
mean = 0.0
standard_deviation = 1.0
[]
[right]
type = Normal
mean = 0.0
standard_deviation = 1.0
[]
[]
[Likelihood]
[gaussian]
type = Gaussian
noise = 'noise_specified/noise_specified'
file_name = 'exp_0_05.csv'
log_likelihood = true
[]
[]
[Samplers]
[sample]
type = PMCMCBase
prior_distributions = 'left right'
num_parallel_proposals = 2
initial_values = '0.1 0.1'
file_name = 'confg.csv'
execute_on = PRE_MULTIAPP_SETUP
seed = 2547
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = sample
[]
[]
[Transfers]
[reporter_transfer]
type = SamplerReporterTransfer
from_reporter = 'average/value'
stochastic_reporter = 'constant'
from_multi_app = sub
sampler = sample
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
sampler = sample
param_names = 'left_bc right_bc mesh1'
[]
[]
[Reporters]
[constant]
type = StochasticReporter
[]
[noise_specified]
type = ConstantReporter
real_names = 'noise_specified'
real_values = '0.05'
[]
[mcmc_reporter]
type = PMCMCDecision
output_value = constant/reporter_transfer:average:value
sampler = sample
likelihoods = 'gaussian'
[]
[]
[Executioner]
type = Transient
num_steps = 5
[]
[Outputs]
file_base = 'mcmc_base'
[out]
type = JSON
execute_system_information_on = NONE
[]
[]
(modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/forward.i)
[Mesh]
[]
[Variables]
[temperature]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = thermal_conductivity
[]
[]
[BCs]
[left]
type = FunctionNeumannBC
variable = temperature
boundary = left
function = left_function
[]
[right]
type = FunctionNeumannBC
variable = temperature
boundary = right
function = right_function
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 200
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 100
[]
[]
[Functions]
[left_function]
type = ParsedOptimizationFunction
expression = 'a + b*y'
param_symbol_names = 'a b'
param_vector_name = 'params_left/vals'
[]
[right_function]
type = ParsedOptimizationFunction
expression = 'a'
param_symbol_names = 'a'
param_vector_name = 'params_right/vals'
[]
[]
[Materials]
[steel]
type = GenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
line_search = none
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[VectorPostprocessors]
[vertical_1]
type = LineValueSampler
variable = 'temperature'
start_point = '0.2 0.0 0'
end_point = '0.2 2.0 0'
num_points = 21
sort_by = y
[]
[vertical_2]
type = LineValueSampler
variable = 'temperature'
start_point = '0.8 0.0 0'
end_point = '0.8 2.0 0'
num_points = 21
sort_by = y
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
variable = temperature
objective_name = objective_value
variable_weight_names = weightForTemperature
[]
[params_left]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '0 0' # Dummy
[]
[params_right]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '0' # Dummy
[]
[]
[Outputs]
console = false
exodus = false
file_base = 'forward'
[]
(modules/optimization/examples/materialFrequency/wave1D/sampler.i)
[Problem]
kernel_coverage_check = false
solve = false
[]
[Executioner]
type = Steady
[]
[Mesh]
[generate]
type = GeneratedMeshGenerator
dim = 1
[]
[]
[MultiApps]
[model_grad]
type = FullSolveMultiApp
input_files = model_grad.i
min_procs_per_app = 1
#this creates 4 subapps
positions = '0 0 0
0 0 0
0 0 0
0 0 0'
cli_args = 'id=1;frequencyHz=1.0
id=2;frequencyHz=2.0
id=3;frequencyHz=3.0
id=4;frequencyHz=4.0'
[]
[]
[Reporters]
[from_sub_rep]
type = ConstantReporter
real_vector_vector_names = 'rec_vec_vec'
real_vector_vector_values = '0'
real_vector_names = 'rec_vec'
real_vector_values = "0."
outputs = out
[]
[parameters]
type = ConstantReporter
real_vector_names = 'G'
real_vector_values = '4'
[]
[objective]
type = ParsedVectorRealReductionReporter
name = objective
reporter_name = from_sub_rep/rec_vec
initial_value = 0
expression = 'reduction_value+indexed_value'
[]
[gradient]
type = ParsedVectorVectorRealReductionReporter
name = gradient
reporter_name = "from_sub_rep/rec_vec_vec"
initial_value = 0
expression = 'reduction_value+indexed_value'
[]
[]
[Transfers]
[setPrameters]
type = MultiAppReporterTransfer
to_multi_app = model_grad
from_reporters = 'parameters/G'
to_reporters = 'parameters/G'
execute_on = 'TIMESTEP_BEGIN'
[]
[ObjectivesGradients]
type = MultiAppReporterTransfer
from_multi_app = model_grad
from_reporters = 'gradient/gradient objective/objective'
to_reporters = 'from_sub_rep/rec_vec_vec from_sub_rep/rec_vec'
distribute_reporter_vector = true
[]
[]
[Outputs]
csv = false
json = false
console = false
[]
(modules/optimization/test/tests/optimizationreporter/general_opt/point_loads_gen_opt/forward_and_adjoint.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmax = 1
ymax = 1.4
[]
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
[]
[Variables]
[temperature]
[]
[temperature_adjoint]
solver_sys = adjoint
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = thermal_conductivity
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = temperature
x_coord_name = 'point_source/x'
y_coord_name = 'point_source/y'
z_coord_name = 'point_source/z'
value_name = 'point_source/value'
[]
[misfit]
type = ReporterPointSource
variable = temperature_adjoint
x_coord_name = measure_data/measurement_xcoord
y_coord_name = measure_data/measurement_ycoord
z_coord_name = measure_data/measurement_zcoord
value_name = measure_data/misfit_values
[]
[]
[BCs]
[left]
type = DirichletBC
variable = temperature
boundary = left
value = 300
[]
[right]
type = DirichletBC
variable = temperature
boundary = right
value = 300
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 300
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 300
[]
[]
[Materials]
[steel]
type = GenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
nl_rel_tol = 1e-12
l_tol = 1e-12
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[VectorPostprocessors]
[gradient]
type = PointValueSampler
points = '0.2 0.2 0
0.7 0.56 0
0.4 1 0'
variable = temperature_adjoint
sort_by = id
execute_on = ADJOINT_TIMESTEP_END
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
variable = temperature
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'
objective_name = misfit_norm
[]
[point_source]
type = ConstantReporter
real_vector_names = 'x y z value'
real_vector_values = '0.2 0.7 0.4;
0.2 0.56 1;
0 0 0;
-1000 120 500'
[]
[]
[Outputs]
console = false
[]
(modules/stochastic_tools/test/tests/reporters/bootstrap_statistics/percentile/sub.i)
[StochasticTools]
[]
[Reporters/const]
type = ConstantReporter
real_vector_names = 'num_vec'
real_vector_values = '1 1 1 1 1'
[]
(modules/optimization/test/tests/outputs/exodus_optimization_steady/forward_and_adjoint_iteration_output.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmax = 1
ymax = 1.4
[]
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
[]
[Variables]
[temperature]
[]
[temperature_adjoint]
solver_sys = adjoint
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = thermal_conductivity
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = temperature
x_coord_name = 'point_source/x'
y_coord_name = 'point_source/y'
z_coord_name = 'point_source/z'
value_name = 'point_source/value'
[]
[misfit]
type = ReporterPointSource
variable = temperature_adjoint
x_coord_name = measure_data/measurement_xcoord
y_coord_name = measure_data/measurement_ycoord
z_coord_name = measure_data/measurement_zcoord
value_name = measure_data/misfit_values
[]
[]
[BCs]
[left]
type = DirichletBC
variable = temperature
boundary = left
value = 300
[]
[right]
type = DirichletBC
variable = temperature
boundary = right
value = 300
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 300
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 300
[]
[]
[Materials]
[steel]
type = GenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Preconditioning]
[nl0]
type = SMP
nl_sys = 'nl0'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[adjoint]
type = SMP
nl_sys = 'adjoint'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
nl_rel_tol = 1e-12
l_tol = 1e-12
[]
[VectorPostprocessors]
[gradient]
type = PointValueSampler
points = '0.2 0.2 0
0.7 0.56 0
0.4 1 0'
variable = temperature_adjoint
sort_by = id
execute_on = ADJOINT_TIMESTEP_END
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
objective_name = objective_value
variable = temperature
outputs = none
[]
[point_source]
type = ConstantReporter
real_vector_names = 'x y z value'
real_vector_values = '0.2 0.7 0.4;
0.2 0.56 1;
0 0 0;
-1000 120 500'
[]
[]
[Outputs]
console = false
[exodus]
type = ExodusOptimizationSteady
execute_on = 'TIMESTEP_END'
[]
[]
(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/outputs/perf_graph_json/perf_graph_json.i)
[Mesh/gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 1
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
# To make sure this doesn't show up in output
[Reporters/constant]
type = ConstantReporter
real_names = value
real_values = 1
[]
[Outputs]
perf_graph_json = true
json = true
[]
(modules/optimization/test/tests/reporters/multiExperiment/sampler_subapp.i)
[Problem]
kernel_coverage_check = false
solve = false
[]
[Executioner]
type = Steady
[]
[Mesh]
[generate]
type = GeneratedMeshGenerator
dim = 1
[]
[]
[MultiApps]
[model_grad]
type = FullSolveMultiApp
input_files = forward.i
min_procs_per_app = 1
positions = '0 0 0
0 0 0
0 0 0'
cli_args = 'omega=2.0
omega=3.0
omega=5.0'
[]
[]
[Reporters]
[from_sub_rep]
type = ConstantReporter
real_vector_vector_names = 'rec_vec_vec'
real_vector_vector_values = '0'
real_vector_names = 'rec_vec'
real_vector_values = "0."
outputs = out
[]
[parameters]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '0 4'
[]
[obj_sum]
type = ParsedVectorRealReductionReporter
name = value
reporter_name = from_sub_rep/rec_vec
initial_value = 0
expression = 'reduction_value+indexed_value'
[]
[grad_sum]
type = ParsedVectorVectorRealReductionReporter
name = row_sum
reporter_name = "from_sub_rep/rec_vec_vec"
initial_value = 0
expression = 'reduction_value+indexed_value'
[]
[]
[Transfers]
[setPrameters]
type = MultiAppReporterTransfer
to_multi_app = model_grad
from_reporters = 'parameters/vals'
to_reporters = 'vals/vals'
execute_on = 'TIMESTEP_BEGIN'
[]
[ObjectivesGradients]
type = MultiAppReporterTransfer
from_multi_app = model_grad
from_reporters = 'grad_f/grad_f obj_pp/value'
to_reporters = 'from_sub_rep/rec_vec_vec from_sub_rep/rec_vec'
distribute_reporter_vector = true
[]
[]
[Outputs]
csv = false
json = false
console = false
[]
(modules/stochastic_tools/test/tests/transfers/sampler_reporter/sub.i)
# This is changed by main.i for testing purposes
real_val = 0.0
vector_val0 = ${fparse real_val * 10}
vector_val1= ${fparse vector_val0 * 10}
vector_val2= ${fparse vector_val0 * 100}
vector_val3= ${fparse vector_val0 * 1000}
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[time]
type = TimeDerivative
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = ${real_val}
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Transient
num_steps = 5
dt = 0.01
dtmin = 0.01
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
error_on_dtmin = false
[]
[Postprocessors]
[pp]
type = PointValue
point = '0 0 0'
variable = u
[]
[]
[VectorPostprocessors]
[vpp]
type = ConstantVectorPostprocessor
vector_names = 'vec'
value = '${vector_val0} ${vector_val1} ${vector_val2} ${vector_val3}'
[]
[]
[Reporters]
[constant]
type = ConstantReporter
integer_names = 'int'
integer_values = 0
string_names = 'str'
string_values = 'this_value'
[]
[mesh]
type = MeshInfo
items = sidesets
[]
[]
# This is used in main_batch.i
[Controls]
[stm]
type = SamplerReceiver
[]
[]
(modules/optimization/examples/materialTransient/gradient.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
xmax = 1
ymax = 1
nx = 10
ny = 10
[]
[]
[Variables/u_adjoint]
initial_condition = 0
[]
[Kernels]
[dt]
type = TimeDerivative
variable = u_adjoint
[]
[diff]
type = MatDiffusion
variable = u_adjoint
diffusivity = D
[]
[]
[DiracKernels]
[misfit]
type = ReporterTimePointSource
variable = u_adjoint
value_name = data/misfit_values
x_coord_name = data/measurement_xcoord
y_coord_name = data/measurement_ycoord
z_coord_name = data/measurement_zcoord
time_name = data/measurement_time
reverse_time_end = 1
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = u_adjoint
boundary = 'right top'
value = 0
[]
[]
[Materials]
[diffc]
type = GenericFunctionMaterial
prop_names = 'D'
prop_values = 'diffc_fun'
[]
[]
[Functions]
[diffc_fun]
type = NearestReporterCoordinatesFunction
value_name = 'diffc_rep/D_vals'
x_coord_name = 'diffc_rep/D_x_coord'
y_coord_name = 'diffc_rep/D_y_coord'
[]
[]
[Reporters]
[diffc_rep]
type = ConstantReporter
real_vector_names = 'D_x_coord D_y_coord D_vals'
real_vector_values = '0.25 0.75 0.25 0.75;
0.25 0.25 0.75 0.75;
0.1 10 10 0.1' # Reference solution
outputs = none
[]
[data]
type = OptimizationData
[]
[]
[AuxVariables/u]
[]
[UserObjects]
[load_u]
type = AdjointSolutionUserObject
mesh = forward_out.e
system_variables = 'u'
reverse_time_end = 1
execute_on = 'timestep_begin'
[]
[]
[AuxKernels]
[u_aux]
type = SolutionAux
variable = u
solution = load_u
direct = true
execute_on = 'timestep_begin'
[]
[]
[VectorPostprocessors]
[adjoint]
type = ElementOptimizationDiffusionCoefFunctionInnerProduct
variable = u_adjoint
forward_variable = u
function = diffc_fun
reverse_time_end = 1
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
nl_rel_tol = 1e-8
nl_abs_tol = 1e-12
dt = 0.1
num_steps = 10
[]
(modules/optimization/examples/simpleTransient/forward_mesh.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = -1
xmax = 1
ymin = -1
ymax = 1
[]
[]
[Variables]
[u]
[]
[]
[ICs]
[initial]
type = FunctionIC
variable = u
function = exact
[]
[]
[Kernels]
[dt]
type = TimeDerivative
variable = u
[]
[diff]
type = Diffusion
variable = u
[]
[src]
type = BodyForce
variable = u
function = source
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = u
boundary = 'left right top bottom'
value = 0
[]
[]
[Functions]
[exact]
type = ParsedFunction
value = '2*exp(-2.0*(x - sin(2*pi*t))^2)*exp(-2.0*(y - cos(2*pi*t))^2)*cos((1/2)*x*pi)*cos((1/2)*y*pi)/pi'
[]
[source]
type = ParameterMeshFunction
exodus_mesh = source_mesh_in.e
time_name = src_values/time
parameter_name = src_values/values
[]
[]
[Executioner]
type = Transient
num_steps = 100
end_time = 1
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Reporters]
[measured_data]
type = OptimizationData
measurement_file = mms_data.csv
file_xcoord = x
file_ycoord = y
file_zcoord = z
file_time = t
file_value = u
variable = u
objective_name = objective_value
execute_on = timestep_end
outputs = csv
[]
[src_values]
type = ConstantReporter
real_vector_names = 'time values'
real_vector_values = '0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0;
0' # dummy
[]
[]
[AuxVariables/source]
[]
[AuxKernels]
[source_aux]
type = FunctionAux
variable = source
function = source
[]
[]
[Outputs]
console = false
exodus = true
[]
(modules/stochastic_tools/test/tests/reporters/basic/statistics_reporter_error.i)
[StochasticTools]
[]
[Reporters]
[const]
type = ConstantReporter
string_vector_names = 'const'
string_vector_values = 'a b c d'
[]
[stats]
type = StatisticsReporter
reporters = 'const/const'
compute = 'min max sum mean stddev norm2 ratio stderr'
[]
[]
[Outputs/out]
type = JSON
execute_on = FINAL
[]
(modules/optimization/examples/diffusion_reaction/forward_and_adjoint.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
dim = 2
nx = 16
ny = 16
xmin = 0
xmax = 1
ymin = 0
ymax = 1
[]
[]
[Variables/u]
[]
[Reporters]
[params]
type = ConstantReporter
real_vector_names = 'reaction_rate'
real_vector_values = '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0' # Dummy
outputs = none
[]
[data]
type = OptimizationData
variable = u
objective_name = objective_value
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
outputs = none
[]
[]
[Functions]
[rxn_func]
type = ParameterMeshFunction
exodus_mesh = parameter_mesh_out.e
parameter_name = params/reaction_rate
[]
[]
[Materials]
[ad_dc_prop]
type = ADParsedMaterial
expression = '1 + u'
coupled_variables = 'u'
property_name = dc_prop
[]
[ad_rxn_prop]
type = ADGenericFunctionMaterial
prop_values = 'rxn_func'
prop_names = rxn_prop
[]
#ADMatReaction includes a negative sign in residual evaluation, so we need to
#reverse this with a negative reaction rate. However, we wanted the parameter
#to remain positive, which is why there is one object to evaluate function
#and another to flip it's sign for the kernel
[ad_neg_rxn_prop]
type = ADParsedMaterial
expression = '-rxn_prop'
material_property_names = 'rxn_prop'
property_name = 'neg_rxn_prop'
[]
[]
[Kernels]
[udot]
type = ADTimeDerivative
variable = u
[]
[diff]
type = ADMatDiffusion
variable = u
diffusivity = dc_prop
[]
[reaction]
type = ADMatReaction
variable = u
reaction_rate = neg_rxn_prop
[]
[src]
type = ADBodyForce
variable = u
value = 1
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = u
boundary = 'left bottom'
value = 0
[]
[]
[Preconditioning]
[nl0]
type = SMP
nl_sys = 'nl0'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[adjoint]
type = SMP
nl_sys = 'adjoint'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[]
[Executioner]
type = TransientAndAdjoint
forward_system = nl0
adjoint_system = adjoint
dt = 0.1
end_time = 1
nl_rel_tol = 1e-12
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
skip_nl_system_check = true
[]
[Variables]
[u_adjoint]
initial_condition = 0
solver_sys = adjoint
outputs = none
[]
[]
[DiracKernels]
[misfit]
type = ReporterTimePointSource
variable = u_adjoint
value_name = data/misfit_values
x_coord_name = data/measurement_xcoord
y_coord_name = data/measurement_ycoord
z_coord_name = data/measurement_zcoord
time_name = data/measurement_time
[]
[]
[VectorPostprocessors]
[adjoint]
type = ElementOptimizationReactionFunctionInnerProduct
variable = u_adjoint
forward_variable = u
function = rxn_func
execute_on = ADJOINT_TIMESTEP_END
outputs = none
[]
[]
[AuxVariables]
[reaction_rate]
[]
[]
[AuxKernels]
[reaction_rate_aux]
type = FunctionAux
variable = reaction_rate
function = rxn_func
execute_on = TIMESTEP_END
[]
[]
[Postprocessors]
[u1]
type = PointValue
variable = u
point = '0.25 0.25 0'
[]
[u2]
type = PointValue
variable = u
point = '0.75 0.75 0'
[]
[u3]
type = PointValue
variable = u
point = '1 1 0'
[]
[]
[Outputs]
exodus = true
console = false
csv = true
[]
(modules/optimization/test/tests/optimizationreporter/mesh_source/forward_and_adjoint.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
[]
[Variables]
[u]
[]
[u_adjoint]
solver_sys = adjoint
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[src]
type = BodyForce
variable = u
function = src_func
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = u
boundary = 'bottom left'
value = 0
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = u_adjoint
x_coord_name = measure_data/measurement_xcoord
y_coord_name = measure_data/measurement_ycoord
z_coord_name = measure_data/measurement_zcoord
value_name = measure_data/misfit_values
[]
[]
[Functions]
[src_func]
type = ParameterMeshFunction
exodus_mesh = parameter_mesh_in.e
parameter_name = src_rep/vals
[]
[]
[Reporters]
[src_rep]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0'
[]
[measure_data]
type = OptimizationData
variable = u
objective_name = objective_value
outputs = none
[]
[]
[VectorPostprocessors]
[gradient_vpp]
type = ElementOptimizationSourceFunctionInnerProduct
variable = u_adjoint
function = src_func
execute_on = ADJOINT_TIMESTEP_END
[]
[]
[Preconditioning]
[nl0]
type = SMP
nl_sys = 'nl0'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[adjoint]
type = SMP
nl_sys = 'adjoint'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
nl_rel_tol = 1e-12
l_tol = 1e-12
[]
[AuxVariables]
[source]
[]
[]
[AuxKernels]
[source_aux]
type = FunctionAux
variable = source
function = src_func
[]
[]
[Outputs]
exodus = true
console = true
execute_on = timestep_end
[]
(test/tests/outputs/perf_graph_json_file/perf_graph_json_file.i)
[Mesh/gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 1
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
# To make sure this doesn't show up in output
[Reporters/constant]
type = ConstantReporter
real_names = value
real_values = 1
[]
[Outputs]
perf_graph_json_file = pg.json
json = true
[]
(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
[]
(modules/combined/test/tests/optimization/invOpt_nonlinear/adjoint.i)
[Executioner]
type = Steady
solve_type = NEWTON
line_search = none
nl_abs_tol = 1e-12
nl_rel_tol = 1e-12
nl_max_its = 100
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Mesh]
[]
[Variables]
[adjointT]
[]
[]
[AuxVariables]
[forwardT]
[]
[dDdTgradT]
order = CONSTANT
family = MONOMIAL_VEC
[]
[]
[Kernels]
[heat_conduction]
type = ADHeatConduction
thermal_conductivity = 'linearized_conductivity'
variable = adjointT
[]
[advection]
type = LevelSetAdvection
velocity = dDdTgradT
variable = adjointT
[]
[]
[AuxKernels]
[dDdTgradT]
type = ADFunctorElementalGradientAux
functor = forwardT
variable = dDdTgradT
factor_matprop = 'dDdT'
[]
[]
[Materials]
[LinearizedConductivity]
type = ADParsedMaterial
f_name = 'linearized_conductivity'
function = '10+500*forwardT'
args = 'forwardT'
[]
[dDdT]
type = ADParsedMaterial
f_name = 'dDdT'
function = '500'
args = 'forwardT'
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjointT
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Reporters]
[misfit]
type = OptimizationData
[]
[params]
type = ConstantReporter
real_vector_names = 'heat_source'
real_vector_values = '0' # Dummy
[]
[]
[BCs]
[left]
type = NeumannBC
variable = adjointT
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = adjointT
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = adjointT
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = adjointT
boundary = top
value = 0
[]
[]
[VectorPostprocessors]
[gradient_vpp]
type = ElementOptimizationSourceFunctionInnerProduct
function = volumetric_heat_func
variable = adjointT
[]
[]
[Functions]
[volumetric_heat_func]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params/heat_source'
[]
[]
[Outputs]
console = false
[]
(modules/optimization/test/tests/functions/parsed_function/parsed_function.i)
[Optimization]
[]
[Reporters]
[params]
type = ConstantReporter
real_vector_names = 'vals'
# Random numbers (0,1)
real_vector_values = '0.2045493861327407 0.1683865411251007 0.5071506764525194 0.7257355264179883'
[]
[]
[Functions]
[parsed_opt]
type = ParsedOptimizationFunction
expression = 'x*v1 + y*v2*v2 + z*v3*v3*v3 + t*v4*v4*v4*v4'
param_symbol_names = 'v1 v2 v3 v4'
param_vector_name = 'params/vals'
[]
[]
[VectorPostprocessors]
[test]
type = OptimizationFunctionTest
functions = parsed_opt
# Random numbers (0,1)
points = '0.1004222428676613 0.21941135757659 0.9310663354302137'
times = '0.3313593793207535'
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
execute_on = timestep_end
[]
(modules/stochastic_tools/test/tests/actions/parameter_study_action/sub.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[average]
type = AverageNodalVariableValue
variable = u
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
# This is for testing distributions
p0 = 0
p1 = 0
p2 = 0
p3 = 0
p4 = 0
p5 = 0
p6 = 0
[Reporters]
[const]
type = ConstantReporter
real_names = 'p0 p1 p2 p3 p4 p5 p6'
real_values = '${p0} ${p1} ${p2} ${p3} ${p4} ${p5} ${p6}'
[]
[]
(modules/combined/test/tests/optimization/invOpt_elasticity_modular/grad.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 11
ny = 11
xmin = -4
xmax = 4
ymin = -4
ymax = 4
[]
displacements = 'adj_disp_x adj_disp_y'
[]
[Variables]
# adjoint
[adj_disp_x]
[]
[adj_disp_y]
[]
[]
[AuxVariables]
[dummy]
[]
[T]
[]
# displacement variables to be transferred from the forward app
# we use them to compute stress and stress derivative wrt E
[disp_x]
[]
[disp_y]
[]
[]
[DiracKernels]
[misfit_is_adjoint_force]
type = ReporterPointSource
variable = adj_disp_x
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Physics]
[SolidMechanics]
[QuasiStatic]
displacements = 'adj_disp_x adj_disp_y'
[adjoint]
strain = SMALL
new_system = true
formulation = TOTAL
incremental = true
volumetric_locking_correction = false
displacements = 'adj_disp_x adj_disp_y'
# add base name to distinguish between forward and adjoint
# the total lagrangian formulation does not add base_name correctly without setting both, which should be improved
base_name = 'adjoint'
strain_base_name = 'adjoint'
[]
[]
[]
[]
[NEML2]
input = 'elasticity.i'
verbose = true
device = 'cpu'
[forward]
model = 'forward_elasticity_model'
moose_input_types = 'MATERIAL'
moose_inputs = 'forward_strain'
neml2_inputs = 'forces/E'
moose_parameter_types = 'MATERIAL'
moose_parameters = 'E_material'
neml2_parameters = 'E'
moose_output_types = 'MATERIAL'
moose_outputs = 'forward_stress'
neml2_outputs = 'state/S'
moose_parameter_derivative_types = 'MATERIAL'
moose_parameter_derivatives = 'forward_dstress_dE'
neml2_parameter_derivatives = 'state/S E'
[]
[adjoint]
model = 'adjoint_elasticity_model'
moose_input_types = 'MATERIAL'
moose_inputs = 'adjoint_strain'
neml2_inputs = 'forces/E'
moose_parameter_types = 'MATERIAL'
moose_parameters = 'E_material'
neml2_parameters = 'E'
moose_output_types = 'MATERIAL'
moose_outputs = 'adjoint_stress'
neml2_outputs = 'state/S'
moose_derivative_types = 'MATERIAL'
moose_derivatives = 'adjoint_jacobian'
neml2_derivatives = 'state/S forces/E'
[]
[]
[BCs]
[bottom_ux]
type = DirichletBC
variable = adj_disp_x
boundary = bottom
value = 0.0
[]
[bottom_uy]
type = DirichletBC
variable = adj_disp_y
boundary = bottom
value = 0.0
[]
[]
[Materials]
[E_material]
type = GenericFunctionMaterial
prop_names = 'E_material'
prop_values = 'E'
[]
# forward
[forward_strain]
type = ComputeLagrangianStrain
displacements = 'disp_x disp_y'
base_name = 'forward'
[]
[convert_forward_strain]
type = RankTwoTensorToSymmetricRankTwoTensor
from = 'forward_mechanical_strain'
to = 'forward_strain'
[]
# adjoint
[convert_adjoint_strain]
type = RankTwoTensorToSymmetricRankTwoTensor
from = 'adjoint_mechanical_strain'
to = 'adjoint_strain'
[]
[adjoint_stress]
type = ComputeLagrangianObjectiveCustomSymmetricStress
custom_small_stress = 'adjoint_stress'
custom_small_jacobian = 'adjoint_jacobian'
base_name = 'adjoint'
[]
[]
[Functions]
[E]
type = NearestReporterCoordinatesFunction
x_coord_name = parametrization/coordx
y_coord_name = parametrization/coordy
value_name = parametrization/youngs_modulus
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
variable = 'adj_disp_x'
[]
[misfit]
type = OptimizationData
[]
[parametrization]
type = ConstantReporter
real_vector_names = 'coordx coordy youngs_modulus'
real_vector_values = '0 0 0; ${fparse 8/3} 0 ${fparse -8/3}; 5 5 5'
[]
[]
[VectorPostprocessors]
[grad_youngs_modulus]
type = AdjointStrainSymmetricStressGradInnerProduct
stress_derivative_name = 'forward_dstress_dE'
adjoint_strain_name = 'adjoint_mechanical_strain'
variable = dummy
function = E
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
# we do not compute them together as this is overwritting DiracKernel's residual calculation, which should be improved
residual_and_jacobian_together = false
nl_rel_tol = 1e-10
nl_abs_tol = 1e-14
[]
[Outputs]
file_base = 'adjoint'
console = false
[]
(modules/stochastic_tools/test/tests/samplers/mcmc/main_ss.i)
[StochasticTools]
[]
[Distributions]
[left]
type = Normal
mean = 0.0
standard_deviation = 1.0
[]
[right]
type = Normal
mean = 0.0
standard_deviation = 1.0
[]
[]
[Likelihood]
[gaussian]
type = Gaussian
noise = 'noise_specified/noise_specified'
file_name = 'exp_0_05.csv'
log_likelihood = true
[]
[]
[Samplers]
[sample]
type = AffineInvariantStretchSampler
prior_distributions = 'left right'
num_parallel_proposals = 5
file_name = 'confg.csv'
execute_on = PRE_MULTIAPP_SETUP
seed = 2547
initial_values = '0.1 0.1'
previous_state = 'mcmc_reporter/inputs'
previous_state_var = 'mcmc_reporter/variance'
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = sample
[]
[]
[Transfers]
[reporter_transfer]
type = SamplerReporterTransfer
from_reporter = 'average/value'
stochastic_reporter = 'constant'
from_multi_app = sub
sampler = sample
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
sampler = sample
param_names = 'left_bc right_bc mesh1'
[]
[]
[Reporters]
[constant]
type = StochasticReporter
[]
[noise_specified]
type = ConstantReporter
real_names = 'noise_specified'
real_values = '0.05'
[]
[mcmc_reporter]
type = AffineInvariantStretchDecision
output_value = constant/reporter_transfer:average:value
sampler = sample
likelihoods = 'gaussian'
[]
[]
[Executioner]
type = Transient
num_steps = 5
[]
[Outputs]
file_base = 'ss_5prop'
[out]
type = JSON
execute_system_information_on = NONE
[]
[]
(modules/stochastic_tools/test/tests/reporters/basic/statistics_reporter.i)
[StochasticTools]
[]
[Reporters]
[const]
type = ConstantReporter
real_vector_names = 'real'
real_vector_values = '2 4 6 8 10'
integer_vector_names = 'int'
integer_vector_values = '100 200 300 400 500'
[]
[stats]
type = StatisticsReporter
reporters = 'const/real const/int'
compute = 'min max sum mean stddev norm2 ratio stderr'
[]
[]
[Outputs/out]
type = JSON
execute_on = FINAL
[]
(modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/homogeneous_forward.i)
[Mesh]
[]
[Variables]
[temperature]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = thermal_conductivity
[]
[]
[BCs]
[left]
type = FunctionNeumannBC
variable = temperature
boundary = left
function = left_function
[]
[right]
type = FunctionNeumannBC
variable = temperature
boundary = right
function = right_function
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 0
[]
[]
[Functions]
[left_function]
type = ParsedOptimizationFunction
expression = 'a + b*y'
param_symbol_names = 'a b'
param_vector_name = 'params_left/vals'
[]
[right_function]
type = ParsedOptimizationFunction
expression = 'a'
param_symbol_names = 'a'
param_vector_name = 'params_right/vals'
[]
[]
[Materials]
[steel]
type = GenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Executioner]
type = Steady
line_search = none
solve_type = NEWTON
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[VectorPostprocessors]
[vertical_1]
type = LineValueSampler
variable = 'temperature'
start_point = '0.2 0.0 0'
end_point = '0.2 2.0 0'
num_points = 21
sort_by = y
[]
[vertical_2]
type = LineValueSampler
variable = 'temperature'
start_point = '0.8 0.0 0'
end_point = '0.8 2.0 0'
num_points = 21
sort_by = y
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
variable_weight_names = weightForTemperature
variable = temperature
[]
[params_left]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '0 0' # Dummy
[]
[params_right]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '0' # Dummy
[]
[]
[Outputs]
console = false
exodus = false
file_base = 'homogenous'
[]