-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inversion test using piecewiseMultiLinearFromReporter or piecewiseMul…
…tiConstantFromReporter to describe body force
- Loading branch information
1 parent
3d8651f
commit 07101e8
Showing
15 changed files
with
895 additions
and
518 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
[Mesh] | ||
[gmg] | ||
type = GeneratedMeshGenerator | ||
dim = 2 | ||
nx = 20 | ||
ny = 25 | ||
xmin = -1 | ||
xmax = 1 | ||
ymin = -1 | ||
ymax = 1.5 | ||
[] | ||
[] | ||
|
||
[Problem] | ||
extra_tag_vectors = 'ref' | ||
[] | ||
|
||
[AuxVariables] | ||
[residual_src] | ||
[] | ||
[] | ||
|
||
[AuxKernels] | ||
[residual_src] | ||
type = TagVectorAux | ||
vector_tag = 'ref' | ||
v = 'u' | ||
variable = 'residual_src' | ||
[] | ||
[] | ||
|
||
|
||
[Variables] | ||
[u] | ||
[] | ||
[] | ||
|
||
[Kernels] | ||
[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 = syntheticNodal.csv | ||
file_xcoord = x | ||
file_ycoord = y | ||
file_zcoord = z | ||
file_value = u | ||
[] | ||
[gridData] | ||
type = GriddedDataReporter | ||
data_file = 'gridded_source_params_const.txt' | ||
outputs = none | ||
[] | ||
[] | ||
|
||
[DiracKernels] | ||
[misfit] | ||
type = VectorPointSource | ||
variable = u | ||
value = measured_data/misfit_values | ||
coord_x = measured_data/measurement_xcoord | ||
coord_y = measured_data/measurement_ycoord | ||
coord_z = measured_data/measurement_zcoord | ||
extra_vector_tags = 'ref' | ||
[] | ||
[] | ||
|
||
[Functions] | ||
[source] | ||
type = PiecewiseMulticonstantFromReporter | ||
direction = 'right right' | ||
values_name = 'gridData/parameter' | ||
grid_name = 'gridData/grid' | ||
axes_name = 'gridData/axes' | ||
step_name = 'gridData/step' | ||
dim_name = 'gridData/dim' | ||
[] | ||
[] | ||
|
||
[VectorPostprocessors] | ||
[adjoint] | ||
type = ElementOptimizationSourceFunctionInnerProduct | ||
variable = u | ||
function = source | ||
[] | ||
[] | ||
|
||
[Executioner] | ||
type = Steady | ||
solve_type = NEWTON | ||
line_search=none | ||
petsc_options_iname = '-pc_type' | ||
petsc_options_value = 'lu' | ||
[] | ||
|
||
[Outputs] | ||
console = false | ||
[] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
[Mesh] | ||
[gmg] | ||
type = GeneratedMeshGenerator | ||
dim = 2 | ||
nx = 20 | ||
ny = 25 | ||
xmin = -1 | ||
xmax = 1 | ||
ymin = -1 | ||
ymax = 1.5 | ||
[] | ||
[] | ||
|
||
[Problem] | ||
extra_tag_vectors = 'ref' | ||
[] | ||
|
||
[AuxVariables] | ||
[residual_src] | ||
[] | ||
[] | ||
|
||
[AuxKernels] | ||
[residual_src] | ||
type = TagVectorAux | ||
vector_tag = 'ref' | ||
v = 'u' | ||
variable = 'residual_src' | ||
[] | ||
[] | ||
|
||
[Variables] | ||
[u] | ||
[] | ||
[] | ||
|
||
[Kernels] | ||
[diff] | ||
type = Diffusion | ||
variable = u | ||
[] | ||
[src] | ||
type = BodyForce | ||
variable = u | ||
function = source | ||
extra_vector_tags = 'ref' | ||
[] | ||
[] | ||
|
||
[BCs] | ||
[dirichlet] | ||
type = DirichletBC | ||
variable = u | ||
boundary = 'left right top bottom' | ||
value = 0 | ||
[] | ||
[] | ||
|
||
[Functions] | ||
[source] | ||
type = PiecewiseMulticonstantFromReporter | ||
direction = 'right right' | ||
values_name = 'gridData/parameter' | ||
grid_name = 'gridData/grid' | ||
axes_name = 'gridData/axes' | ||
step_name = 'gridData/step' | ||
dim_name = 'gridData/dim' | ||
[] | ||
[] | ||
|
||
[Executioner] | ||
type = Steady | ||
solve_type = NEWTON | ||
line_search=none | ||
petsc_options_iname = '-pc_type' | ||
petsc_options_value = 'lu' | ||
[] | ||
|
||
[Reporters] | ||
[measured_data] | ||
type = OptimizationData | ||
measurement_file = syntheticNodal.csv | ||
file_xcoord = x | ||
file_ycoord = y | ||
file_zcoord = z | ||
file_value = u | ||
variable = u | ||
execute_on = timestep_end | ||
outputs=none | ||
[] | ||
[gridData] | ||
type = GriddedDataReporter | ||
data_file = 'gridded_source_params_const.txt' | ||
outputs = none | ||
[] | ||
[] | ||
|
||
[VectorPostprocessors] | ||
[line1] | ||
type = LineValueSampler | ||
start_point = '0.5 -0.9 0' | ||
end_point = '0.5 1.4 0' | ||
num_points = 5 | ||
sort_by = id | ||
variable = u | ||
[] | ||
[line2] | ||
type = LineValueSampler | ||
start_point = '-0.5 -0.9 0' | ||
end_point = '-0.5 1.4 0' | ||
num_points = 5 | ||
sort_by = id | ||
variable = u | ||
[] | ||
[] | ||
|
||
[Outputs] | ||
# exodus = true | ||
csv = true | ||
console = false | ||
[] |
6 changes: 6 additions & 0 deletions
6
examples/simpleSteadyGriddedData/gold/main_const_out_forward0_line1_0001.csv
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,6 @@ | ||
id,u,x,y,z | ||
0,0.95658362042007,0.5,-0.9,0 | ||
0.575,2.64660281359,0.5,-0.325,0 | ||
1.15,-2.2110578584852,0.5,0.25,0 | ||
1.725,-1.8473258313108,0.5,0.825,0 | ||
2.3,0.22880461118954,0.5,1.4,0 |
6 changes: 6 additions & 0 deletions
6
examples/simpleSteadyGriddedData/gold/main_const_out_forward0_line2_0001.csv
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,6 @@ | ||
id,u,x,y,z | ||
0,-1.1018382492446,-0.5,-0.9,0 | ||
0.575,-3.0657575989378,-0.5,-0.325,0 | ||
1.15,2.5360977137657,-0.5,0.25,0 | ||
1.725,2.0016608223546,-0.5,0.825,0 | ||
2.3,-0.341436174908,-0.5,1.4,0 |
11 changes: 0 additions & 11 deletions
11
examples/simpleSteadyGriddedData/gold/main_out_OptimizationReporter_0001.csv
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
examples/simpleSteadyGriddedData/gold/main_out_forward0_line1_0001.csv
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,6 @@ | ||
id,u,x,y,z | ||
0,1.1407467839022,0.5,-0.9,0 | ||
0.575,3.1192716676809,0.5,-0.325,0 | ||
1.15,-2.6175760590462,0.5,0.25,0 | ||
1.725,-2.3228716525221,0.5,0.825,0 | ||
2.3,0.93284289946732,0.5,1.4,0 |
6 changes: 6 additions & 0 deletions
6
examples/simpleSteadyGriddedData/gold/main_out_forward0_line2_0001.csv
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,6 @@ | ||
id,u,x,y,z | ||
0,-1.1407523117604,-0.5,-0.9,0 | ||
0.575,-3.1192698998733,-0.5,-0.325,0 | ||
1.15,2.6175760032011,-0.5,0.25,0 | ||
1.725,2.3228698004762,-0.5,0.825,0 | ||
2.3,-0.9328373862911,-0.5,1.4,0 |
19 changes: 8 additions & 11 deletions
19
examples/simpleSteadyGriddedData/gridded_source_params.txt
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 |
---|---|---|
@@ -1,15 +1,12 @@ | ||
# This is from source_params.csv | ||
AXIS X | ||
-0.8 0 0.8 | ||
-1.0 -0.35 0.35 1.0 | ||
AXIS Y | ||
-0.8 0 1.3 | ||
-1.0 -0.5 0 0.5 1.0 1.5 | ||
DATA | ||
-1 | ||
9 | ||
-3 | ||
7 | ||
-5 | ||
5 | ||
-7 | ||
3 | ||
-9 | ||
0 0 0 0 | ||
0 0 0 0 | ||
0 0 0 0 | ||
0 0 0 0 | ||
0 0 0 0 | ||
0 0 0 0 |
Oops, something went wrong.