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

Elastodynamics #91

Open
wants to merge 109 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
7d6670f
Enable explicit specification of forward and adjoint strains
mguddati Dec 8, 2023
7b6ccb1
Adding a test for automatic ajoint based inversion for elastostatic
mguddati Dec 8, 2023
968e164
2-parameter thermomechanical inversion example
mguddati Dec 8, 2023
ae690b7
Updating stable moose submodule refs #000
Dec 8, 2023
910e2eb
Code for adding two vector postprocessors. Is useful, e.g. to add
mguddati Dec 8, 2023
3095a1d
Updating stable moose submodule refs #000
Dec 8, 2023
7d2010f
Elastostatic inversion for incompressible media
mguddati Dec 8, 2023
45a2d86
Implementation of correlation objective
mguddati Dec 9, 2023
9242bba
Getting rid of registerAll deprication warning
mguddati Dec 9, 2023
070a760
Updating stable moose submodule refs #000
Dec 9, 2023
34d9632
Facilitating standard L2 objective through general optimization reporter
mguddati Dec 11, 2023
06e4f33
Multi-experiment inversion facilitated by combining (a) inverse
mguddati Dec 11, 2023
ac0855b
Multi-experiment inversion facilitated by combining (a) inverse
mguddati Dec 11, 2023
4d038f8
Fixing a bug in the sign of objective function
mguddati Dec 12, 2023
fbc134e
Intermediate version towards a convergent inversion of 1D wave propag…
mguddati Dec 12, 2023
ba75f9a
Single frequency, single parameter Helmholtz inversion now works.
mguddati Dec 13, 2023
b71075a
Updating stable moose submodule refs #000
Dec 12, 2023
8489a14
Updating stable moose submodule refs #000
Dec 12, 2023
07c9f06
Updating stable moose submodule refs #000
Dec 13, 2023
10092c1
Changed to higher frequency of 1.0 Hz, leading to poorer performance
mguddati Dec 13, 2023
a7fcf66
Simultaneous inversion by matching multiple frequency data (high freq…
mguddati Dec 13, 2023
af89b3d
Preliminary input for 3D wave propagation simulation - this is the
mguddati Dec 16, 2023
7fc4a67
Preliminary input for 3D wave propagation simulation - this is the
mguddati Dec 16, 2023
f466127
Preliminary input for 3D wave propagation simulation - this is the
mguddati Dec 16, 2023
bc176ea
Example 2D simulation in frequency domain
mguddati Dec 19, 2023
ad9f922
3D wave model changes to be examined
mguddati Dec 19, 2023
0681875
Updating stable moose submodule refs #000
Dec 14, 2023
c7a7943
Updating stable moose submodule refs #000
Dec 14, 2023
1cee4aa
Updating stable moose submodule refs #000
Dec 14, 2023
fceafa0
Updating stable moose submodule refs #000
Dec 18, 2023
ae29d5e
Updating stable moose submodule refs #000
Dec 18, 2023
190ef70
Updating stable moose submodule refs #000
Dec 18, 2023
8dc7c30
Updating stable moose submodule refs #000
Dec 19, 2023
3a88edf
Updating stable moose submodule refs #000
Dec 19, 2023
bb46436
Updating stable moose submodule refs #000
Dec 20, 2023
413445a
Updating stable moose submodule refs #000
Dec 20, 2023
eaffb3c
Facilitating parametrized input of modulus to set stage for inversion
mguddati Dec 19, 2023
e399c5c
Preliminary shot at getting the adjoint and gradient
mguddati Dec 21, 2023
2e55a00
Updating stable moose submodule refs #000
Dec 22, 2023
70f9916
Updating stable moose submodule refs #000
Dec 22, 2023
a8fd98c
Updating stable moose submodule refs #000
Dec 22, 2023
5540aaf
Updating stable moose submodule refs #000
Dec 22, 2023
5257fa3
Intermediate version for gradient check. Currently has a factor of
mguddati Dec 21, 2023
854a26e
Gradient check passes for compressilbe elastic material
mguddati Dec 22, 2023
7551ffd
Intermediate effort on incompressible elasticity
mguddati Dec 23, 2023
05c6096
Updating stable moose submodule refs #000
Dec 23, 2023
63b6da2
General cleanup
mguddati Dec 29, 2023
d9d9d54
General cleanup
mguddati Dec 29, 2023
96eb071
Updating stable moose submodule refs #000
Dec 29, 2023
68c009a
Viscoelasticity fix
mguddati Dec 29, 2023
efa5080
General cleanup
mguddati Dec 29, 2023
69d6f00
Using higher order discretization with coarser mesh
mguddati Dec 29, 2023
073167c
Multi-frequency inversion for 4 frequencies and 3 parameters
mguddati Jan 1, 2024
03244d5
Facilitating the plot of objective function to examine the optimization
mguddati Jan 1, 2024
a469830
Adding imaginary data which makes the inversion so much better
mguddati Jan 2, 2024
00d1179
Updating stable moose submodule refs #000
Jan 2, 2024
8128d30
Updating stable moose submodule refs #000
Jan 3, 2024
ceff300
Updating stable moose submodule refs #000
Jan 3, 2024
4f9ab88
Some cleanup including fixing the measurements of real and imaginary
mguddati Jan 2, 2024
d42a873
Using mesh based parametrization with multiple frequencies. Prelimina…
mguddati Jan 3, 2024
b668067
Some reorganization of mesh-based inversion including outputting
mguddati Jan 4, 2024
96bff00
Implementation of multiresolution imaging
mguddati Jan 4, 2024
4ffeb74
Updating stable moose submodule refs #000
Jan 4, 2024
ecdf9de
Updating stable moose submodule refs #000
Jan 4, 2024
3583ece
Adding inhomogeneous multiresolution imaging example (bell shaped G)
mguddati Jan 4, 2024
0810827
Adding inhomogeneous multiresolution imaging example (bell shaped G)
mguddati Jan 4, 2024
9752217
Fixing warning on HPC due to initialization order
Jan 4, 2024
3330d27
Cleanup - separating synthetic, sampling and inversion.
Jan 5, 2024
70426b1
general cleanup
Jan 6, 2024
d13fc58
Getting ready to make 2D input in a clean way
Jan 6, 2024
220b87e
3D forward model - preliminary version
Jan 6, 2024
88a3364
3D grad check passes!
Jan 6, 2024
d9e3d23
Made the 3D example closer to SWE usecase but with a line measurement
Jan 7, 2024
8c2f6fd
Branching from elastodynamics and making it closer to shear wave elas…
mguddati Jan 8, 2024
77accb3
Adding visualization fix for paraview for quadratic elements by
mguddati Jan 8, 2024
ca2d212
Cleanup and streamlining for SWE - only synthetic apparently works
mguddati Jan 8, 2024
b90306a
Removing plot_obj that was carried over from 2D
mguddati Jan 8, 2024
946883f
Further clean up and streamlining. Grad check and inversion scripts
mguddati Jan 8, 2024
a33338d
Parallel issue fixed. For some reason the grad check is not as precise
mguddati Jan 10, 2024
20d1b14
Updating stable moose submodule refs #000
Jan 5, 2024
ec849bf
Fixup deprecated RTM label
cticenhour Jan 5, 2024
ae178fc
Remove stp_filename from RTM template. No longer required.
cticenhour Jan 5, 2024
d88d283
Updating stable moose submodule refs #000
Jan 6, 2024
980e8de
Updating stable moose submodule refs #000
Jan 6, 2024
cf5fb7d
Updating stable moose submodule refs #000
Jan 8, 2024
459e0d5
Updating stable moose submodule refs #000
Jan 9, 2024
540cd8e
Updating stable moose submodule refs #000
Jan 10, 2024
548e4e8
Gradient check passes (mesh cannot be too coarse)
mguddati Jan 10, 2024
14d56b6
Facilitating changing element types in 3D for accuracy purposes
mguddati Jan 11, 2024
4cea48b
general clean up including streamlining parallel runs for multiple
mguddati Jan 11, 2024
db029e8
Adding synthetic data with a 20x20x20 HEX27 mesh and updating to 8 fr…
mguddati Jan 11, 2024
e3c918e
Preliminary version of multiresolution imaging script with parallel runs
mguddati Jan 12, 2024
ee12078
Reverting to compressible elasticity to avoid unnecessary complexities
mguddati Jan 12, 2024
a910822
Many canges coming together to address many issues
mguddati Jan 17, 2024
b6e3c3f
Adding Multiresolution imaging that has heterogeneous computing needs
mguddati Jan 17, 2024
4259266
Adding Multiresolution imaging that has heterogeneous computing needs
mguddati Jan 17, 2024
c024487
Changing to multipush acquisition
mguddati Jan 18, 2024
8c12c6e
(hopefully) final streamlining of the process including readme descri…
mguddati Jan 18, 2024
6e3feee
Adding log parametrization and some other refinements in the scripts
mguddati Jan 30, 2024
257b9ed
Clearing up various things and removing potential blind spots that
mguddati Feb 4, 2024
79afbef
Changing the main file for isopod to make it consistent with
mguddati Feb 4, 2024
c093369
Got parallel run to work for the first time. It looks like we need to
mguddati Feb 7, 2024
5343d7d
Changing the domain to rectangular prism to check sensitivities
mguddati Feb 15, 2024
fd97ddf
Fixing synthetic data generation sampler to batch-reset.
mguddati Feb 23, 2024
48555b3
Increase the number of processors to accelerate the run while still
mguddati Feb 24, 2024
030e3c0
Moving back to Shear Wave Elastography - testing the code for
mguddati Feb 24, 2024
8519b8e
BIOMECHANICAL IMAGING APPLICATION:
mguddati Feb 28, 2024
b4c21fd
Moving GeneralParameterOptimization (temporary contruct) from MOOSE t…
mguddati May 2, 2024
afc0e57
Implementation and testing of L2 regularizer on the parameter mesh
mguddati Sep 20, 2024
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ POROUS_FLOW := no
RDG := no
RICHARDS := no
SOLID_MECHANICS := no
STOCHASTIC_TOOLS := no
STOCHASTIC_TOOLS := yes
TENSOR_MECHANICS := yes
XFEM := no
OPTIMIZATION := yes
Expand Down
2 changes: 1 addition & 1 deletion doc/content/sqa/isopod_rtm.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!template load file=app_rtm.md.template app=Isopod category=isopod stp_filename=isopod_stp.md
!template load file=app_rtm.md.template app=Isopod category=isopod
2 changes: 1 addition & 1 deletion doc/sqa_reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Documents:
software_requirements_specification: sqa/isopod_srs.md
software_design_description: sqa/isopod_sdd.md
software_test_plan: sqa/isopod_stp.md
requirements_traceablity_matrix: sqa/isopod_rtm.md
requirements_traceability_matrix: sqa/isopod_rtm.md
verification_validation_report: sqa/isopod_vvr.md
failure_analysis_report: sqa/isopod_vvr.md
log_safety_software_determination: WARNING
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
grad_lambda,grad_mu,lambda,measurement_time,measurement_values,measurement_xcoord,measurement_ycoord,measurement_zcoord,misfit_values,mu,simulation_values
-4.3796599397474e-08,-8.1077586556456e-07,4.9999703676621,0,4.46462,-1,-1,0,-2.2288267853554e-07,1.0000005195792,4.4646197771173
-6.2509348307711e-09,-1.7312856628588e-07,4.0001368580929,0,6.447155,-1,0,0,-1.9949611118619e-07,1.9999990912205,6.4471548005039
-8.9816855038081e-10,-1.0424117832137e-08,3.0000053638196,0,8.434803,-1,1,0,-9.7586703162733e-08,3.0000073381577,8.4348029024133
0,0,0,0,4.176264,0,-1,0,-1.4786177882087e-07,0,4.1762638521382
0,0,0,0,6.172984,0,0,0,-2.477726290806e-08,0,6.1729839752227
0,0,0,0,8.200859,0,1,0,4.4258881182202e-07,0,8.2008594425888
0,0,0,0,4.049477,1,-1,0,-8.2262971545788e-08,0,4.049476917737
0,0,0,0,6.052499,1,0,0,3.4381697400221e-07,0,6.052499343817
0,0,0,0,8.079385,1,1,0,-8.3668947326032e-09,0,8.0793849916331
4 changes: 4 additions & 0 deletions examples/bimaterialElastic/grad.i
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,15 @@
[grad_lambda]
type = ElementOptimizationLameLambdaInnerProduct
variable = dummy
adjoint_strain_name = mechanical_strain
forward_strain_name = forward_mechanical_strain
function = lambda
[]
[grad_mu]
type = ElementOptimizationLameMuInnerProduct
variable = dummy
adjoint_strain_name = mechanical_strain
forward_strain_name = forward_mechanical_strain
function = mu
[]
[]
Expand Down
96 changes: 96 additions & 0 deletions examples/bimaterialElastic/main_auto.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
[Optimization]
[]

[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'lambda mu'
num_values = '3 3'
#initial_condition = '5 4 3 ; 1 2 1'
initial_condition = '5.0 5.0 5.0; 1.0 1.0 1.0'
lower_bounds = '0.1; 0.1'
upper_bounds = '10.0; 10.0'
measurement_points = '-1.0 -1.0 0.0
-1.0 0.0 0.0
-1.0 1.0 0.0
0.0 -1.0 0.0
0.0 0.0 0.0
0.0 1.0 0.0
1.0 -1.0 0.0
1.0 0.0 0.0
1.0 1.0 0.0'
measurement_values = '4.464620e+00 6.447155e+00 8.434803e+00
4.176264e+00 6.172984e+00 8.200859e+00
4.049477e+00 6.052499e+00 8.079385e+00'
[]

[Executioner]
type = Optimize
tao_solver = taobqnls #taobncg #taoblmvm
petsc_options_iname = '-tao_gatol -tao_ls_type -tao_max_it'
petsc_options_value = '1e-6 unit 500'

#THESE OPTIONS ARE FOR TESTING THE ADJOINT GRADIENT
#petsc_options_iname='-tao_max_it -tao_fd_test -tao_test_gradient -tao_fd_gradient -tao_fd_delta -tao_gatol'
#petsc_options_value='1 true true false 1e-8 0.1'
#petsc_options = '-tao_test_gradient_view'
verbose = true
[]

[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = model_grad.i
execute_on = FORWARD
[]
[]

[Transfers]
[set_model_grad]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/lambda
OptimizationReporter/mu'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
parametrization/lambda
parametrization/mu'
[]
[get_simulation_values]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[get_grad_lambda]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'grad_lambda/inner_product'
to_reporters = 'OptimizationReporter/grad_lambda'
[]
[get_grad_mu]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'grad_mu/inner_product'
to_reporters = 'OptimizationReporter/grad_mu'
[]
[]

[Reporters]
[optInfo]
type = OptimizationInfo
items = 'current_iterate function_value gnorm'
[]
[]

[Outputs]
console = false
csv = true
[]
197 changes: 197 additions & 0 deletions examples/bimaterialElastic/model_grad.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
[]

[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 11
ny = 11
xmin = -4
xmax = 4
ymin = -4
ymax = 4
[]
[]

[Variables]
[ux]
[]
[uy]
[]
[ux_adjoint]
nl_sys = adjoint
[]
[uy_adjoint]
nl_sys = adjoint
[]
[]

[AuxVariables]
[dummy]
[]
[]

[Kernels]
[div_sigma_x]
type = StressDivergenceTensors
variable = ux
displacements = 'ux uy'
component = 0
volumetric_locking_correction = false
[]
[div_sigma_y]
type = StressDivergenceTensors
variable = uy
displacements = 'ux uy'
component = 1
volumetric_locking_correction = false
[]
[]

[BCs]
[bottom_ux]
type = DirichletBC
variable = ux
boundary = bottom
value = 0.0
[]
[bottom_uy]
type = DirichletBC
variable = uy
boundary = bottom
value = 0.0
[]
[top_fx]
type = NeumannBC
variable = ux
boundary = top
value = 1.0
[]
[top_fy]
type = NeumannBC
variable = uy
boundary = top
value = 1.0
[]
[]

[Materials]
[stress]
type = ComputeLinearElasticStress
[]
[strain]
type = ComputeSmallStrain
displacements = 'ux uy'
[]
[adjoint_strain]
type = ComputeSmallStrain
displacements = 'ux_adjoint uy_adjoint'
base_name = 'adjoint'
[]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
args = dummy
youngs_modulus = E_material
poissons_ratio = nu_material
[]
[E_material]
type = GenericFunctionMaterial
prop_names = 'E_material'
prop_values = E
[]
[nu_material]
type = GenericFunctionMaterial
prop_names = 'nu_material'
prop_values = nu
[]
[]

[Functions]
[E]
type = ParsedFunction
expression = mu*(3*lambda+2*mu)/(lambda+mu)
symbol_names = 'lambda mu'
symbol_values = 'lambda mu'
[]
[nu]
type = ParsedFunction
expression = lambda/2/(lambda+mu)
symbol_names = 'lambda mu'
symbol_values = 'lambda mu'
[]
[lambda]
type = NearestReporterCoordinatesFunction
x_coord_name = parametrization/coordx
y_coord_name = parametrization/coordy
value_name = parametrization/lambda
[]
[mu]
type = NearestReporterCoordinatesFunction
x_coord_name = parametrization/coordx
y_coord_name = parametrization/coordy
value_name = parametrization/mu
[]
[]

[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
petsc_options_iname='-pc_type'
petsc_options_value='lu'
nl_forced_its = 1
line_search = none
nl_abs_tol = 1e-8
[]

[Outputs]
console = false
csv = false
[]

[DiracKernels]
[misfit_is_adjoint_force]
type = ReporterPointSource
variable = ux_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
[]
[]

[Reporters]
[measure_data]
type = OptimizationData
variable = ux
[]
[parametrization]
type = ConstantReporter
real_vector_names = 'coordx coordy lambda mu'
real_vector_values = '0 1 2; 0 1 2; 5 4 3; 1 2 3'
[]
[]

[VectorPostprocessors]
[grad_lambda]
type = ElementOptimizationLameLambdaInnerProduct
forward_strain_name = 'mechanical_strain'
adjoint_strain_name = 'adjoint_mechanical_strain'
#adjoint_strain_name = 'adjoint_total_strain'
variable = dummy
function = lambda
execute_on = 'ADJOINT_TIMESTEP_END'
[]
[grad_mu]
type = ElementOptimizationLameMuInnerProduct
forward_strain_name = 'mechanical_strain'
adjoint_strain_name = 'adjoint_mechanical_strain'
#adjoint_strain_name = 'adjoint_total_strain'
variable = dummy
function = mu
execute_on = 'ADJOINT_TIMESTEP_END'
[]
[]
14 changes: 14 additions & 0 deletions examples/bimaterialElastic/tests
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,18 @@
# steady solve
recover = false
[]
issues = '#9999' #modify this
design = 'OptimizationReporter.md'
[opt_auto]
requirement = "The system shall be able to invert for elastic moduli using automatic adjoint."
type = CSVDiff
abs_zero = 1E-3
rel_err = 1e-3
input = main_auto.i
csvdiff = main_auto_out_OptimizationReporter_0001.csv
max_threads = 1
method = opt
# steady solve
recover = false
[]
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
grad_mu,measurement_time,measurement_values,measurement_xcoord,measurement_ycoord,measurement_zcoord,misfit_values,mu,simulation_values
-3.9109922919115e-08,0,4.1613567552542,-1,-1,0,-0.00084769473057467,1.0016574936417,4.1605090605236
-2.8552016042187e-09,0,5.9488957653438,-1,0,0,-0.00049305346803674,1.9964074643121,5.9484027118758
1.7175434588979e-10,0,7.675869730064,-1,1,0,-0.0012184465245957,3.0592449960713,7.6746512835394
0,0,3.7517712455797,0,-1,0,-2.7832529675642e-05,0,3.75174341305
0,0,5.548762655743,0,0,0,0.0014059181715211,0,5.5501685739145
0,0,7.3172699473444,0,1,0,5.9206744674967e-05,0,7.3173291540891
0,0,3.5372009228108,1,-1,0,0.0010745903451448,0,3.5382755131559
0,0,5.3435565114703,1,0,0,-0.00029167404059738,0,5.3432648374297
0,0,7.156727075585,1,1,0,0.00075948676127702,0,7.1574865623463
Loading