- expressionThe user defined function.
C++ Type:FunctionExpression
Unit:(no unit assumed)
Controllable:No
Description:The user defined function.
- param_symbol_namesNames of parameters in 'expression' being optimized.
C++ Type:std::vector<std::string>
Unit:(no unit assumed)
Controllable:No
Description:Names of parameters in 'expression' being optimized.
- param_vector_nameReporter or VectorPostprocessor vector containing parameter values.
C++ Type:ReporterName
Unit:(no unit assumed)
Controllable:No
Description:Reporter or VectorPostprocessor vector containing parameter values.
ParsedOptimizationFunction
Function used for optimization that uses a parsed expression with parameter dependence.
Overview
This function is similar to ParsedFunction except it has some dedicated routines relevant to optimization, particularly the ability to differentiate the function with respect to parameters. The "expression" parameter indicates the function expression. Users may specify x
, y
, z
, and t
for space-time dependence. They may also define variables with constant values in the expression by specifying "constant_symbol_names" and "constant_symbol_values" pairs. Finally, parameter variables can be specified which correspond to the definitions in "param_symbol_names". The values of these parameter variables are evaluated from the inputted vector in "param_vector_name". The vector specified in "param_vector_name" can either be a vector-postprocessor vector or a vector reporter value. An error will occur if the length of this vector does not match the number of values specified in "param_symbol_names".
Example Input File Syntax
Here is an example where the parsed function represents the following expression:
[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'
[]
[]
(modules/optimization/test/tests/functions/parsed_function/parsed_function.i)params/vals
is the name of a vector reporter value, define as:
[Reporters]
[params]
type = ConstantReporter
real_vector_names = 'vals'
# Random numbers (0,1)
real_vector_values = '0.2045493861327407 0.1683865411251007 0.5071506764525194 0.7257355264179883'
[]
[]
(modules/optimization/test/tests/functions/parsed_function/parsed_function.i)Input Parameters
- constant_symbol_namesVariables (excluding t,x,y,z) that are bound to the values provided by the corresponding items in the symbol_values vector.
C++ Type:std::vector<std::string>
Unit:(no unit assumed)
Controllable:No
Description:Variables (excluding t,x,y,z) that are bound to the values provided by the corresponding items in the symbol_values vector.
- constant_symbol_valuesConstant numeric values for vars.
C++ Type:std::vector<double>
Unit:(no unit assumed)
Controllable:No
Description:Constant numeric values for vars.
Optional Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Unit:(no unit assumed)
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
Unit:(no unit assumed)
Controllable:No
Description:Set the enabled status of the MooseObject.
Advanced Parameters
Input Files
- (modules/optimization/test/tests/misc/scaling_test/scaling_test.i)
- (modules/optimization/test/tests/outputs/exodus_optimization_steady/adjoint_iteration_output.i)
- (modules/combined/test/tests/optimization/invOpt_mechanics/forward.i)
- (modules/combined/test/tests/optimization/invOpt_nonlinear/adjoint.i)
- (modules/combined/test/tests/optimization/invOpt_bc_convective/adjoint.i)
- (modules/optimization/test/tests/optimizationreporter/constant_heat_source/adjoint_nonLinear.i)
- (modules/optimization/test/tests/optimizationreporter/constant_heat_source/forward.i)
- (modules/combined/test/tests/optimization/invOpt_bc_convective/forward.i)
- (modules/combined/test/tests/optimization/invOpt_mechanics/adjoint.i)
- (modules/optimization/test/tests/optimizationreporter/nonlinear_material/forward_and_adjoint.i)
- (modules/optimization/test/tests/optimizationreporter/general_opt/function_optimization/forward.i)
- (modules/optimization/test/tests/optimizationreporter/material/adjoint.i)
- (modules/optimization/test/tests/optimizationreporter/constant_heat_source/forward_nonLinear.i)
- (modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/adjoint.i)
- (modules/optimization/test/tests/reporters/multiExperiment/forward.i)
- (modules/optimization/test/tests/vectorpostprocessors/element_reaction_inner_product/element_reaction_inner_product.i)
- (modules/optimization/test/tests/executioners/constrained/shape_optimization/forward.i)
- (modules/optimization/test/tests/outputs/exodus_optimization_steady/forward.i)
- (modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/forward.i)
- (modules/optimization/test/tests/optimizationreporter/constant_heat_source/adjoint.i)
- (modules/optimization/test/tests/functions/parsed_function/parsed_function.i)
- (modules/combined/test/tests/optimization/invOpt_mechanics/forward_and_adjoint.i)
- (modules/combined/test/tests/optimization/invOpt_nonlinear/homogeneous_forward.i)
- (modules/combined/test/tests/optimization/invOpt_nonlinear/forward.i)
- (modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/homogeneous_forward.i)
- (modules/optimization/test/tests/executioners/constrained/inequality/forward_and_adjoint.i)
- (modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/forward_and_adjoint.i)
- (modules/optimization/test/tests/optimizationreporter/material/forward.i)
expression
C++ Type:FunctionExpression
Unit:(no unit assumed)
Controllable:No
Description:The user defined function.
constant_symbol_names
C++ Type:std::vector<std::string>
Unit:(no unit assumed)
Controllable:No
Description:Variables (excluding t,x,y,z) that are bound to the values provided by the corresponding items in the symbol_values vector.
constant_symbol_values
C++ Type:std::vector<double>
Unit:(no unit assumed)
Controllable:No
Description:Constant numeric values for vars.
param_symbol_names
C++ Type:std::vector<std::string>
Unit:(no unit assumed)
Controllable:No
Description:Names of parameters in 'expression' being optimized.
param_vector_name
C++ Type:ReporterName
Unit:(no unit assumed)
Controllable:No
Description:Reporter or VectorPostprocessor vector containing parameter values.
param_vector_name
C++ Type:ReporterName
Unit:(no unit assumed)
Controllable:No
Description:Reporter or VectorPostprocessor vector containing parameter values.
param_symbol_names
C++ Type:std::vector<std::string>
Unit:(no unit assumed)
Controllable:No
Description:Names of parameters in 'expression' being optimized.
(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/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/optimization/test/tests/misc/scaling_test/scaling_test.i)
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
[]
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 4
ny = 2
nz = 1
xmin = 9.4615
xmax = 92.0115
ymin = 3.175
ymax = 22.225
zmin = 0.489
zmax = 0.755
[]
[]
[Variables]
[T]
scaling = 10
[]
[lam_T]
solver_sys = adjoint
scaling = 1e3
[]
[]
[Kernels]
[heat_conduction]
type = ADMatDiffusion
variable = T
diffusivity = thermal_conductivity
[]
[heat_source]
type = ADBodyForce
function = src_fuel_function
variable = T
[]
[]
[BCs]
[dir_BC_front]
type = NeumannBC
variable = T
boundary = front
value = 2
[]
[dir_BC_back]
type = DirichletBC
variable = T
boundary = back
value = 300
[]
[]
[Materials]
# fuel properties
[fuel_thermal]
type = ADGenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 17.6e3
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu mumps'
line_search = 'none'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-30
nl_max_its = 10
l_max_its = 10
[]
##---------Forward Optimization stuff------------------#
[Reporters]
[measure_data]
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; 5 5 5; 1 1 1'
[]
[params_fuel]
type = ConstantReporter
real_vector_names = 'source'
real_vector_values = '5e7' # Dummy
[]
[]
[Functions]
[src_fuel_function]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params_fuel/source'
[]
[]
##---------Adjoint Optimization stuff------------------#
[DiracKernels]
[adjointLoad_T]
type = ReporterPointSource
variable = lam_T
x_coord_name = measure_data/x
y_coord_name = measure_data/y
z_coord_name = measure_data/z
value_name = measure_data/u
[]
[]
##--------- Outputs ------------------#
[Debug]
show_var_residual_norms = true
[]
(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'
[]
[]
(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/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/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'
[]
(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'
[]
(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/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_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/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
[]
[]
[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
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
console = false
[]
(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/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'
[]
(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/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'
[]
(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
[]
(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/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/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'
[]
[]
(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/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/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/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
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
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_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
[]
[]
(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/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/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'
[]
(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
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
line_search = none
nl_rel_tol = 1e-12
l_tol = 1e-12
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[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'
[]
[]
(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
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
line_search = none
nl_rel_tol = 1e-12
l_tol = 1e-12
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[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/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'
[]