forked from idaholab/moose
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force inversion with nonlinear diffusion problem, where the conductiv…
…ity is a function of temperature. Gradient computation is checked with FD gradient and passes, and the tests include both limited memory BFGS as well as reduced Newton's method with matrix-free Hessian. closes idaholab#25
- Loading branch information
Showing
12 changed files
with
1,221 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
143 changes: 143 additions & 0 deletions
143
...les/optimization/test/tests/auxkernels/matl_scaled_gradient_vector/gradientVector.imurthy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
[Mesh] | ||
type = GeneratedMesh | ||
dim = 2 | ||
nx = 10 | ||
ny = 10 | ||
xmin = 0 | ||
xmax = 3.141 | ||
ymin = 0 | ||
ymax = 3.141 | ||
[] | ||
|
||
|
||
|
||
[Variables] | ||
[u] | ||
[] | ||
[v] | ||
[] | ||
[] | ||
|
||
[ICs] | ||
[./u_ic] | ||
type = FunctionIC | ||
variable = 'u' | ||
function = parsed_function | ||
[../] | ||
[./v_ic] | ||
type = FunctionIC | ||
variable = 'v' | ||
function = 'x' | ||
[../] | ||
[] | ||
|
||
[Functions] | ||
[./parsed_function] | ||
type = ParsedFunction | ||
value = 'sin(x)-cos(y/2)' | ||
[../] | ||
[./parsed_grad_function] | ||
type = ParsedVectorFunction | ||
value_x = 'cos(x)' | ||
value_y = 'sin(y/2)/2' | ||
[../] | ||
[./parsed_gradx_function] | ||
type = ParsedFunction | ||
value = 'cos(x)' | ||
[../] | ||
[] | ||
|
||
[AuxVariables] | ||
[./funcGrad_u] | ||
order = CONSTANT | ||
family = MONOMIAL_VEC | ||
[../] | ||
[./auxGrad_u] | ||
order = CONSTANT | ||
family = MONOMIAL_VEC | ||
[../] | ||
[./auxGrad_v] | ||
order = CONSTANT | ||
family = MONOMIAL_VEC | ||
[../] | ||
[./funcGrad_u_x] | ||
order = CONSTANT | ||
family = MONOMIAL | ||
[../] | ||
[./auxGrad_u_x] | ||
order = CONSTANT | ||
family = MONOMIAL | ||
[../] | ||
[./auxGrad_v_x] | ||
order = CONSTANT | ||
family = MONOMIAL | ||
[../] | ||
[] | ||
|
||
[AuxKernels] | ||
[vec] | ||
type = VectorFunctionAux | ||
variable = funcGrad_u | ||
function = parsed_grad_function | ||
[../] | ||
[grad_u] | ||
type = MaterialScaledGradientVector | ||
gradient_variable = u | ||
variable = auxGrad_u | ||
[] | ||
[grad_v] | ||
type = MaterialScaledGradientVector | ||
gradient_variable = v | ||
variable = auxGrad_v | ||
material_scaling = 'trig_material' | ||
[] | ||
[funcGrad_u_x] | ||
type = VectorVariableComponentAux | ||
variable = funcGrad_u_x | ||
vector_variable = funcGrad_u | ||
component = 'x' | ||
[] | ||
[auxGrad_u_x] | ||
type = VectorVariableComponentAux | ||
variable = auxGrad_u_x | ||
vector_variable = auxGrad_u | ||
component = 'x' | ||
[] | ||
[auxGrad_v_x] | ||
type = VectorVariableComponentAux | ||
variable = auxGrad_v_x | ||
vector_variable = auxGrad_v | ||
component = 'x' | ||
[] | ||
[] | ||
|
||
[Materials] | ||
[steel] | ||
type = GenericFunctionMaterial | ||
prop_names = 'trig_material' | ||
prop_values = 'parsed_gradx_function' | ||
[] | ||
[] | ||
|
||
[VectorPostprocessors] | ||
[results] | ||
type = LineValueSampler | ||
start_point = '0 1 0' | ||
end_point = '3.141 1 0' | ||
variable = 'funcGrad_u_x auxGrad_u_x auxGrad_v_x' | ||
num_points = 20 | ||
sort_by = x | ||
[] | ||
[] | ||
|
||
[Problem] | ||
solve = false | ||
[] | ||
[Executioner] | ||
type = Steady | ||
[] | ||
|
||
[Outputs] | ||
# console = true | ||
csv = true | ||
[] |
135 changes: 135 additions & 0 deletions
135
...imization/test/tests/optimizationreporter/objective_gradient_minimize/nonlinear/adjoint.i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
[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 = MaterialScaledGradientVector | ||
gradient_variable = forwardT | ||
variable = dDdTgradT | ||
material_scaling = 'dDdT' | ||
[] | ||
[] | ||
[Materials] | ||
[LinearizedConductivity] | ||
type = ADParsedMaterial | ||
f_name = 'linearized_conductivity' | ||
function = '10+500*forwardT' | ||
args = 'forwardT' | ||
[] | ||
[dDdT] | ||
type = ParsedMaterial | ||
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 | ||
[] | ||
[] | ||
|
||
|
||
[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 = VectorOfPostprocessors | ||
postprocessors = 'heatSourceGradient' | ||
[] | ||
[] | ||
[Postprocessors] | ||
[heatSourceGradient] | ||
type = VariableFunctionElementIntegral | ||
function = volumetric_heat_func_deriv | ||
variable = adjointT | ||
[] | ||
[] | ||
[Functions] | ||
[volumetric_heat_func_deriv] | ||
type = ParsedFunction | ||
value = dq | ||
vars = 'dq' | ||
vals = 1 | ||
[] | ||
[] | ||
|
||
|
||
[Outputs] | ||
console = false | ||
[] |
Oops, something went wrong.