-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26486 from maxnezdyur/refac_opt_data
Refactor OptimizationData
- Loading branch information
Showing
23 changed files
with
958 additions
and
6 deletions.
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
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
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
124 changes: 124 additions & 0 deletions
124
...es/optimization/test/tests/optimizationreporter/general_opt/point_loads_gen_opt/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,124 @@ | ||
[Mesh] | ||
type = GeneratedMesh | ||
dim = 2 | ||
nx = 10 | ||
ny = 10 | ||
xmax = 1 | ||
ymax = 1.4 | ||
[] | ||
|
||
[Variables] | ||
[adjoint] | ||
[] | ||
[] | ||
|
||
[Problem] | ||
extra_tag_vectors = 'ref' | ||
[] | ||
[AuxVariables] | ||
[residual_src] | ||
[] | ||
[] | ||
[AuxKernels] | ||
[residual_src] | ||
type = TagVectorAux | ||
vector_tag = 'ref' | ||
v = 'adjoint' | ||
variable = 'residual_src' | ||
[] | ||
[] | ||
|
||
[Variables] | ||
[adjoint] | ||
[] | ||
[] | ||
|
||
[Kernels] | ||
[heat_conduction] | ||
type = MatDiffusion | ||
variable = adjoint | ||
diffusivity = thermal_conductivity | ||
[] | ||
[] | ||
|
||
#-----every adjoint problem should have these two | ||
[DiracKernels] | ||
[pt] | ||
type = ReporterPointSource | ||
variable = adjoint | ||
x_coord_name = misfit/measurement_xcoord | ||
y_coord_name = misfit/measurement_ycoord | ||
z_coord_name = misfit/measurement_zcoord | ||
value_name = misfit/misfit_values | ||
extra_vector_tags = 'ref' | ||
[] | ||
[] | ||
|
||
[Reporters] | ||
[misfit] | ||
type = OptimizationData | ||
measurement_points = ${measurement_points} | ||
measurement_values = ${measurement_values} | ||
[] | ||
[] | ||
|
||
[BCs] | ||
[left] | ||
type = DirichletBC | ||
variable = adjoint | ||
boundary = left | ||
value = 0 | ||
[] | ||
[right] | ||
type = DirichletBC | ||
variable = adjoint | ||
boundary = right | ||
value = 0 | ||
[] | ||
[bottom] | ||
type = DirichletBC | ||
variable = adjoint | ||
boundary = bottom | ||
value = 0 | ||
[] | ||
[top] | ||
type = DirichletBC | ||
variable = adjoint | ||
boundary = top | ||
value = 0 | ||
[] | ||
[] | ||
|
||
[Materials] | ||
[steel] | ||
type = GenericConstantMaterial | ||
prop_names = thermal_conductivity | ||
prop_values = 5 | ||
[] | ||
[] | ||
|
||
[Executioner] | ||
type = Steady | ||
solve_type = NEWTON | ||
nl_abs_tol = 1e-6 | ||
nl_rel_tol = 1e-8 | ||
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 = adjoint | ||
sort_by = id | ||
[] | ||
[] | ||
|
||
[Outputs] | ||
console = false | ||
exodus = false | ||
file_base = 'adjoint' | ||
[] |
113 changes: 113 additions & 0 deletions
113
...es/optimization/test/tests/optimizationreporter/general_opt/point_loads_gen_opt/forward.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,113 @@ | ||
[Mesh] | ||
[gmg] | ||
type = GeneratedMeshGenerator | ||
dim = 2 | ||
nx = 10 | ||
ny = 10 | ||
xmax = 1 | ||
ymax = 1.4 | ||
[] | ||
[] | ||
|
||
[Variables] | ||
[temperature] | ||
[] | ||
[] | ||
|
||
[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 | ||
[] | ||
[top] | ||
type = DirichletBC | ||
variable = temperature | ||
boundary = top | ||
value = 300 | ||
[] | ||
[] | ||
|
||
[Materials] | ||
[steel] | ||
type = GenericConstantMaterial | ||
prop_names = thermal_conductivity | ||
prop_values = 5 | ||
[] | ||
[] | ||
|
||
[Executioner] | ||
type = Steady | ||
solve_type = NEWTON | ||
nl_abs_tol = 1e-6 | ||
nl_rel_tol = 1e-8 | ||
petsc_options_iname = '-pc_type' | ||
petsc_options_value = 'lu' | ||
[] | ||
|
||
[VectorPostprocessors] | ||
[point_source] | ||
type = ConstantVectorPostprocessor | ||
vector_names = 'x y z value' | ||
value = '0.2 0.7 0.4; | ||
0.2 0.56 1; | ||
0 0 0; | ||
-1000 120 500' | ||
execute_on = LINEAR | ||
[] | ||
[vertical] | ||
type = LineValueSampler | ||
variable = 'temperature' | ||
start_point = '0.5 0 0' | ||
end_point = '0.5 1.4 0' | ||
num_points = 21 | ||
sort_by = y | ||
[] | ||
[] | ||
|
||
[Reporters] | ||
[measure_data] | ||
type = OptimizationData | ||
variable = temperature | ||
objective_name = misfit_norm | ||
measurement_points = ${measurement_points} | ||
measurement_values = ${measurement_values} | ||
[] | ||
[] | ||
|
||
[Outputs] | ||
console = false | ||
file_base = 'forward' | ||
[] |
Oops, something went wrong.