Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auxvar parameter optimization #10

Draft
wants to merge 41 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1568d85
Merge commit '942eade19180e5a04b06fe45e0b251ca5167fec3' into main
Jan 24, 2022
5c40f9b
Merge commit '2503ad7809a4a3144b68090a91c9cb48576f7558' into main
Jan 25, 2022
e3d9149
Merge commit '3c651ebd4da8176335d1437d7e6911b17caa2c05' into main
Jan 25, 2022
56ed23f
Merge commit '9a377c7afa7d40beb3bdcf25ff8842ee70787433' into main
Jan 26, 2022
bc9f17f
Merge commit '3c6fcd3b65fb1c1c98309d6307120dfc1c208e16' into main
Jan 26, 2022
e863549
Merge commit '47c4456522b897f2c8b072297d295ea9590a6650' into main
Jan 27, 2022
9485953
Merge commit '27774a4f1b731d3ce8099ae51c343c3d9879feaa' into main
Jan 27, 2022
0644720
Merge commit '28910901b3986ce3697cc0c08b7b7e878df36309' into main
Jan 27, 2022
106eb7a
Merge commit '30c6d1a92ce2d410ea0ec31577f93bfb4368309d' into main
Jan 28, 2022
f196e73
Merge commit '1d001e550e83ee10773e73f5fbeeae125b1164c1' into main
Jan 30, 2022
365c219
Merge commit 'ae5457427a6def0e14235a28275db6fffa67afd4' into main
Feb 1, 2022
23d4bcb
Merge commit '11f985e9a53cc6d7da3c3a26a5d5a38e05fa9399' into main
Feb 3, 2022
5235053
Merge commit 'b9ff0bc3224e48b03c65264393fb1c5bd3464d1e' into main
Feb 3, 2022
3012317
Merge commit 'd445adc5f93bbe76e829e9fab25fce8fc51b4e90' into main
Feb 4, 2022
190acf1
Merge commit '0f7eafaec1456020a45b59991efe364bd236e78f' into main
Feb 4, 2022
91df636
Merge commit 'b0318b7c754f8f02090ec124f33389ccdcd13c97' into main
Feb 7, 2022
cb58718
Merge commit '3432a55da821b1f622e5fbde64e67c08f02b1116' into main
Feb 8, 2022
2274342
Merge commit '0ef1e96739516a4fc20f5c03bb6c8f83b6bcb38f' into main
Feb 9, 2022
f0374b4
Merge commit '0fd8042169e20865e2242e01fc954aa286d3b804' into main
Feb 10, 2022
61243a4
Merge commit '36e02563ff6fd2c7f4be7688e39ef66a240058fe' into main
Feb 10, 2022
ba1235b
Merge commit '00d677bbee0a25e5a601527931eac54d274235ee' into main
Feb 11, 2022
1019485
Merge commit 'e41a8d6c9152448b4c4f30485eaeb5d4b97df677' into main
Feb 16, 2022
570784c
Merge commit 'bd22f6b7324861fd32b26bd848ffd1abbff1f50e' into main
Feb 17, 2022
db7bd31
Merge commit '94dda8475618b8ff2820609b7ad056833d03eb64' into main
Feb 18, 2022
270b3e7
Merge commit 'eaf19383cde49bb5d5cc4f884caef5e355a72bad' into main
Feb 18, 2022
cb511e0
Merge commit 'da50364f025f11bacb5df7033a8674eb27f3f1b3' into main
Feb 18, 2022
ab75913
Merge commit '83479eac421c6d9c1890c5d811bba5a5e4ccdf23' into main
Feb 19, 2022
0ad4155
Merge commit '10689c5f7d6f46602da405de76d6637f88b80b86' into main
Feb 19, 2022
2a43951
Merge commit 'eb207037cd8337e1686f1624e995838422e93049' into main
Feb 21, 2022
32e7658
Merge commit 'd3ee5c58f5e202f428c6d74ec597f8690edbeae3' into main
Feb 23, 2022
d51e42d
Merge commit 'b197012f3d892dbc0c11cb9fce26ef673380c80e' into main
Feb 23, 2022
6c201df
Merge commit '5b513e4bb55ec676eaed86a61a3bf7467bb5bd03' into main
Feb 23, 2022
a8defe8
Merge commit '02b3dd9546dc8369cfa1fd13310d19504c20218d' into main
Feb 23, 2022
819ea47
Merge commit '98a2bf2df1eefa98b6acc8b870a9a67dd2e038ed' into main
Feb 24, 2022
3ef0388
Merge commit '5d6e49e3a6d4b553f3ca491f59a9215b02d0b113' into main
Feb 24, 2022
f1db4cc
Merge commit '142290ed73261e86a49e46db6a42b1e72b473ae8' into main
Feb 24, 2022
fb4ae47
Merge commit '3572be57a6ed83b192b3c1ffaf67e7d91552450a' into main
Feb 25, 2022
1f2bfcf
Merge commit '081563b3a04a213f1565f89cfb16e75ff07e116a' into main
Feb 26, 2022
62ab302
Add OptimizationReporterBase class and refactor
dewenyushu Feb 28, 2022
021466b
Add positions in multiapp and examples
dewenyushu Mar 1, 2022
0f1be34
Initial implementation of VariableOptimizationReporter
dewenyushu Mar 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add positions in multiapp and examples
dewenyushu committed Mar 1, 2022
commit 021466b1543df0cdcdcd47cb6c77f48cbce6b917
Binary file not shown.
57 changes: 57 additions & 0 deletions examples/thermal_flux_patch_load/interpolation_transfer/forward.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[Mesh]
[fmg]
type = FileMeshGenerator
file = ./../halfSphere.e
[]
[lowerd]
input = fmg
type = LowerDBlockFromSidesetGenerator
sidesets = 'flat'
new_block_id = 2
new_block_name = "bottom"
[]
[]

[Variables]
[u]
order = FIRST
family = LAGRANGE
[]
[]

[Kernels]
[diff]
type = Diffusion
variable = u
[]
[]

[AuxVariables]
[p_var_forward]
order = FIRST
family = LAGRANGE
block = 'bottom'
[]
[]

[BCs]
[./bottom]
type = DirichletBC
variable = u
boundary = 'flat'
value = 300
[../]
[]

[Executioner]
type = Steady
solve_type = 'PJFNK'
l_abs_tol = 1e-10
nl_rel_tol = 1e-8
nl_abs_tol = 1e-10
[]

[Outputs]
exodus = true
csv = true
[]
91 changes: 91 additions & 0 deletions examples/thermal_flux_patch_load/interpolation_transfer/master.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
[Mesh]
[fmg]
type = FileMeshGenerator
file = ./../halfSphere_coarse.e
[]
[lowerd]
input = fmg
type = LowerDBlockFromSidesetGenerator
sidesets = 'flat'
new_block_id = 2
new_block_name = "bottom"
[]
[]

[Variables]
[u]
order = FIRST
family = LAGRANGE
[]
[]

[Kernels]
[diff]
type = Diffusion
variable = u
[]
[]

[AuxVariables]
[p_var]
order = FIRST
family = LAGRANGE
block = 'bottom'
[]
[]

[AuxKernels]
[p_var_kernel]
type = FunctionAux
variable = p_var
function = aux_p_fun
[]
[]

[Functions]
[aux_p_fun]
type = ParsedFunction
value = 10*sin(pi*y)*sin(pi*z)
[]
[]

[BCs]
[./bottom]
type = DirichletBC
variable = u
boundary = 'flat'
value = 300
[../]
[]

[Executioner]
type = Steady
solve_type = 'PJFNK'
l_abs_tol = 1e-10
nl_rel_tol = 1e-8
nl_abs_tol = 1e-10
[]

[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = 'TIMESTEP_END'
[]
[]

[Transfers]
[to_forward_aux]
type = MultiAppInterpolationTransfer
# type = MultiAppNearestNodeTransfer
direction = to_multiapp
multi_app = forward
source_variable = p_var
variable = p_var_forward
[]
[]

[Outputs]
csv = true
exodus = true
[]
136 changes: 136 additions & 0 deletions examples/thermal_flux_patch_load/var_param/adjoint.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
[Mesh]
[fmg]
type = FileMeshGenerator
file = ./../halfSphere.e
[]
[]

[Variables]
[temperature]
[]
[]

[AuxVariables]
[saved_t]
order = FIRST
family = LAGRANGE
[]
[]

[Kernels]
[heat_conduction]
type = ADHeatConduction
variable = temperature
save_in = saved_t
[]
[]

#-----every adjoint problem should have these two
[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
[]
[]


[BCs]
[round]
type = ConvectiveFluxFunction
boundary = round
variable = temperature
coefficient = 0.05
T_infinity = 0.0
[]
[flat]
type = NeumannBC
variable = temperature
boundary = flat
value = 0
[]
[]

[Materials]
[steel]
type = ADGenericConstantMaterial
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 -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_forced_its = 1
[]

[Postprocessors]
[adjoint_0]
type = SideIntegralVariablePostprocessor
boundary = '100 101'
variable = temperature
[]
[adjoint_1]
type = SideIntegralVariablePostprocessor
boundary = '102 103'
variable = temperature
[]
[adjoint_2]
type = SideIntegralVariablePostprocessor
boundary = '104 105'
variable = temperature
[]
[adjoint_3]
type = SideIntegralVariablePostprocessor
boundary = '106 107'
variable = temperature
[]
[adjoint_4]
type = SideIntegralVariablePostprocessor
boundary = '108 109'
variable = temperature
[]
[]

[VectorPostprocessors]
[adjoint_bc]
type = VectorOfPostprocessors
postprocessors = 'adjoint_0 adjoint_1
adjoint_2 adjoint_3
adjoint_4'
[]
[]


[VectorPostprocessors]
[data_pt]
type = PointValueSampler
variable = temperature
points = '4 0 0
2 2 2
2 -2 2
2 -2 -2
2 2 -2'
sort_by = id
[]
[]

[Outputs]
console = true
exodus = true
csv = true
file_base = 'adjoint'
[]
Loading