Skip to content
Permalink
Browse files

Merge pull request #12743 from fdkong/ad_dg

An attempt to implement AD for DG Kernels
  • Loading branch information...
aeslaughter committed Feb 22, 2019
2 parents 8819d4e + 682fab9 commit 7462455d8287417b2f4a71b89f6b3bbc2a636df1
Showing with 1,493 additions and 1,199 deletions.
  1. +0 −12 framework/doc/content/source/actions/AddADBCAction.md
  2. +0 −12 framework/doc/content/source/actions/AddADKernelAction.md
  3. +0 −12 framework/doc/content/source/actions/AddADMaterialAction.md
  4. +5 −5 framework/doc/content/source/bcs/ADFunctionDirichletBC.md
  5. +4 −4 framework/doc/content/source/bcs/ADLagrangeVecFunctionDirichletBC.md
  6. +9 −0 framework/doc/content/source/dgkernels/ADDGDiffusion.md
  7. +3 −3 framework/doc/content/source/kernels/ADDiffusion.md
  8. +4 −4 framework/doc/content/source/kernels/ADTimeDerivative.md
  9. +3 −3 framework/doc/content/source/kernels/ADVectorDiffusion.md
  10. +0 −17 framework/doc/content/syntax/ADBCs/index.md
  11. +0 −67 framework/doc/content/syntax/ADKernels/index.md
  12. +0 −19 framework/doc/content/syntax/ADMaterials/index.md
  13. +0 −28 framework/include/actions/AddADBCAction.h
  14. +0 −28 framework/include/actions/AddADKernelAction.h
  15. +0 −28 framework/include/actions/AddADMaterialAction.h
  16. +0 −54 framework/include/actions/MooseADObjectAction.h
  17. +34 −13 framework/include/base/Registry.h
  18. +48 −0 framework/include/dgkernels/ADDGDiffusion.h
  19. +75 −0 framework/include/dgkernels/ADDGKernel.h
  20. +6 −152 framework/include/dgkernels/DGKernel.h
  21. +198 −0 framework/include/dgkernels/DGKernelBase.h
  22. +3 −3 framework/include/loops/ComputeJacobianThread.h
  23. +3 −3 framework/include/loops/ComputeResidualThread.h
  24. +2 −2 framework/include/materials/MaterialProperty.h
  25. +24 −0 framework/include/materials/TwoMaterialPropertyInterface.h
  26. +3 −3 framework/include/systems/NonlinearSystemBase.h
  27. +0 −37 framework/src/actions/AddADBCAction.C
  28. +0 −37 framework/src/actions/AddADKernelAction.C
  29. +0 −37 framework/src/actions/AddADMaterialAction.C
  30. +8 −1 framework/src/actions/AddBCAction.C
  31. +8 −1 framework/src/actions/AddDGKernelAction.C
  32. +10 −1 framework/src/actions/AddKernelAction.C
  33. +8 −1 framework/src/actions/AddMaterialAction.C
  34. +0 −82 framework/src/actions/MooseADObjectAction.C
  35. +3 −1 framework/src/actions/MooseObjectAction.C
  36. +69 −82 framework/src/base/Moose.C
  37. +35 −0 framework/src/base/Registry.C
  38. +2 −4 framework/src/bcs/ADIntegratedBC.C
  39. +2 −2 framework/src/bcs/ADNodalBC.C
  40. +76 −0 framework/src/dgkernels/ADDGDiffusion.C
  41. +202 −0 framework/src/dgkernels/ADDGKernel.C
  42. +2 −211 framework/src/dgkernels/DGKernel.C
  43. +246 −0 framework/src/dgkernels/DGKernelBase.C
  44. +2 −2 framework/src/kernels/ADKernel.C
  45. +1 −1 framework/src/loops/ComputeJacobianThread.C
  46. +1 −1 framework/src/loops/ComputeResidualThread.C
  47. +0 −1 framework/src/materials/ADMaterial.C
  48. +11 −6 framework/src/materials/MaterialPropertyInterface.C
  49. +0 −16 framework/src/parser/Parser.C
  50. +1 −2 framework/src/systems/NonlinearSystemBase.C
  51. +2 −1 framework/src/variables/MooseVariableFE.C
  52. +1 −1 modules/combined/test/tests/elastic_patch/ad_elastic_patch_plane_strain.i
  53. +1 −1 modules/combined/test/tests/elastic_patch/ad_elastic_patch_rspherical.i
  54. +1 −1 modules/combined/test/tests/elastic_patch/ad_elastic_patch_rz.i
  55. +1 −1 modules/combined/test/tests/elastic_patch/ad_elastic_patch_rz_nonlinear.i
  56. +8 −8 modules/combined/test/tests/evolving_mass_density/tests
  57. +4 −4 modules/heat_conduction/doc/content/source/kernels/ADHeatConduction.md
  58. +3 −3 modules/heat_conduction/doc/content/source/kernels/ADHeatConductionTimeDerivative.md
  59. +3 −3 modules/heat_conduction/doc/content/source/kernels/ADMatHeatSource.md
  60. +2 −2 modules/heat_conduction/test/tests/ad_heat_conduction/test.i
  61. +1 −1 modules/heat_conduction/test/tests/heat_source_bar/ad_heat_source_bar.i
  62. +1 −1 modules/heat_conduction/test/tests/verify_against_analytical/ad_1D_transient.i
  63. +1 −1 modules/heat_conduction/test/tests/verify_against_analytical/ad_2d_steady_state_final_prob.i
  64. +3 −3 modules/misc/doc/content/source/kernels/ADMatDiffusion.md
  65. +3 −3 modules/misc/doc/content/source/kernels/ADThermoDiffusion.md
  66. +1 −1 modules/misc/test/tests/kernels/diffusion/ad_1D_transient.i
  67. +1 −1 modules/misc/test/tests/kernels/diffusion/ad_2d_steady_state_final_prob.i
  68. +2 −2 modules/misc/test/tests/kernels/thermo_diffusion/ad_thermo_diffusion.i
  69. +0 −1 modules/phase_field/test/tests/phase_field_kernels/ACInterfaceStress_jacobian.i
  70. +70 −0 modules/phase_field/test/tests/phase_field_kernels/ACInterfaceStress_jacobian.i
  71. +4 −4 modules/tensor_mechanics/doc/content/source/kernels/ADStressDivergenceRSphericalTensors.md
  72. +4 −4 modules/tensor_mechanics/doc/content/source/kernels/ADStressDivergenceRZTensors.md
  73. +4 −4 modules/tensor_mechanics/doc/content/source/kernels/ADStressDivergenceTensors.md
  74. +4 −4 modules/tensor_mechanics/doc/content/source/materials/ADComputeAxisymmetricRZFiniteStrain.md
  75. +4 −4 modules/tensor_mechanics/doc/content/source/materials/ADComputeAxisymmetricRZIncrementalStrain.md
  76. +4 −4 modules/tensor_mechanics/doc/content/source/materials/ADComputeAxisymmetricRZSmallStrain.md
  77. +4 −4 modules/tensor_mechanics/doc/content/source/materials/ADComputeFiniteStrain.md
  78. +4 −4 modules/tensor_mechanics/doc/content/source/materials/ADComputeFiniteStrainElasticStress.md
  79. +4 −4 modules/tensor_mechanics/doc/content/source/materials/ADComputeGreenLagrangeStrain.md
  80. +4 −4 modules/tensor_mechanics/doc/content/source/materials/ADComputeIncrementalSmallStrain.md
  81. +4 −4 modules/tensor_mechanics/doc/content/source/materials/ADComputeLinearElasticStress.md
  82. +4 −4 modules/tensor_mechanics/doc/content/source/materials/ADComputeMultipleInelasticStress.md
  83. +4 −4 modules/tensor_mechanics/doc/content/source/materials/ADComputeRSphericalFiniteStrain.md
  84. +4 −4 modules/tensor_mechanics/doc/content/source/materials/ADComputeRSphericalIncrementalStrain.md
  85. +4 −4 modules/tensor_mechanics/doc/content/source/materials/ADComputeRSphericalSmallStrain.md
  86. +4 −4 modules/tensor_mechanics/doc/content/source/materials/ADComputeSmallStrain.md
  87. +4 −4 modules/tensor_mechanics/doc/content/source/materials/ADPowerLawCreepStressUpdate.md
  88. +2 −2 modules/tensor_mechanics/examples/hyper_elastic_test.i
  89. +2 −2 modules/tensor_mechanics/test/tests/ad_elastic/finite_elastic.i
  90. +2 −2 modules/tensor_mechanics/test/tests/ad_elastic/green-lagrange.i
  91. +2 −2 modules/tensor_mechanics/test/tests/ad_elastic/incremental_small_elastic.i
  92. +2 −2 modules/tensor_mechanics/test/tests/ad_elastic/rspherical_finite_elastic.i
  93. +2 −2 modules/tensor_mechanics/test/tests/ad_elastic/rspherical_incremental_small_elastic.i
  94. +2 −2 modules/tensor_mechanics/test/tests/ad_elastic/rspherical_small_elastic.i
  95. +2 −2 modules/tensor_mechanics/test/tests/ad_elastic/rz_finite_elastic.i
  96. +2 −2 modules/tensor_mechanics/test/tests/ad_elastic/rz_incremental_small_elastic.i
  97. +2 −2 modules/tensor_mechanics/test/tests/ad_elastic/rz_small_elastic.i
  98. +1 −4 modules/tensor_mechanics/test/tests/ad_plastic/power_law_creep.i
  99. +8 −8 modules/tensor_mechanics/test/tests/ad_plastic/tests
  100. +2 −2 modules/tensor_mechanics/test/tests/ad_simple_linear/linear-ad-reverse-dependency.i
  101. +2 −2 modules/tensor_mechanics/test/tests/ad_simple_linear/linear-ad.i
  102. +1 −1 modules/tensor_mechanics/test/tests/ad_simple_linear/linear-mixed-reverse.i
  103. +1 −1 modules/tensor_mechanics/test/tests/ad_simple_linear/linear-mixed.i
  104. +2 −2 test/tests/bcs/ad_bcs/ad_bc.i
  105. +2 −2 test/tests/bcs/ad_bcs/vector_ad_bc.i
  106. +120 −0 test/tests/dgkernels/ad_dg_diffusion/2d_diffusion_ad_dg_test.i
  107. BIN test/tests/dgkernels/ad_dg_diffusion/gold/2d_diffusion_ad_dg_test_out.e
  108. BIN test/tests/dgkernels/ad_dg_diffusion/gold/2d_diffusion_ad_dg_test_out.e-s003
  109. +10 −0 test/tests/dgkernels/ad_dg_diffusion/tests
  110. +1 −1 test/tests/kernels/ad_coupled_convection/ad_coupled_convection.i
  111. +0 −3 test/tests/kernels/ad_coupled_value/ad_aux_coupled_value.i
  112. +0 −3 test/tests/kernels/ad_coupled_value/ad_coupled_value.i
  113. +1 −1 test/tests/kernels/ad_simple_diffusion/ad_simple_diffusion.i
  114. +0 −3 test/tests/kernels/ad_transient_diffusion/ad_transient_diffusion.i
  115. +0 −3 test/tests/kernels/ad_value/ad_value.i
  116. +1 −4 test/tests/kernels/ad_vector_couple/ad_grad_vector_couple.i
  117. +1 −4 test/tests/kernels/ad_vector_couple/ad_vector_couple.i
  118. +1 −4 test/tests/kernels/ad_vector_couple/ad_vector_couple_default.i
  119. +1 −1 test/tests/kernels/ad_vector_couple/tests
  120. +0 −3 test/tests/kernels/jxw_grad_test_dep_on_displacements/jxw-cylindrical.i
  121. +0 −3 test/tests/kernels/jxw_grad_test_dep_on_displacements/jxw-spherical.i
  122. +0 −3 test/tests/kernels/jxw_grad_test_dep_on_displacements/not-handling-jxw.i
  123. +1 −1 test/tests/kernels/kernel_precompute/adkernel_precompute_test.i
  124. +2 −5 test/tests/kernels/vector_fe/ad_lagrange_vec.i
  125. +2 −2 test/tests/materials/ad_material/ad_material.i
  126. +1 −4 test/tests/materials/ad_material/ad_stateful_material.i
  127. BIN test/tests/materials/ad_material/gold/default_ad_material_out.e
  128. +23 −3 test/tests/materials/ad_material/tests
  129. +1 −1 test/tests/tag/tag_ad_kernels.i

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -1,6 +1,6 @@
# ADFunctionDirichletBC

!syntax description /ADBCs/ADFunctionDirichletBC<RESIDUAL>
!syntax description /BCs/ADFunctionDirichletBC<RESIDUAL>

## Description

@@ -32,10 +32,10 @@ Note that `ADFunctionDirichletBC` computes its Jacobian using automatic differen

## Example Input Syntax

!listing test/tests/bcs/ad_bcs/ad_bc.i block=ADBCs
!listing test/tests/bcs/ad_bcs/ad_bc.i block=BCs

!syntax parameters /ADBCs/ADFunctionDirichletBC<RESIDUAL>
!syntax parameters /BCs/ADFunctionDirichletBC<RESIDUAL>

!syntax inputs /ADBCs/ADFunctionDirichletBC<RESIDUAL>
!syntax inputs /BCs/ADFunctionDirichletBC<RESIDUAL>

!syntax children /ADBCs/ADFunctionDirichletBC<RESIDUAL>
!syntax children /BCs/ADFunctionDirichletBC<RESIDUAL>
@@ -1,6 +1,6 @@
# ADLagrangeVecFunctionDirichletBC

!syntax description /ADBCs/ADLagrangeVecFunctionDirichletBC<RESIDUAL>
!syntax description /BCs/ADLagrangeVecFunctionDirichletBC<RESIDUAL>

## Description

@@ -30,8 +30,8 @@ or more sidesets corresponding to the boundary subset $\partial \Omega_D$.

Note that this BC computes its Jacobian using automatic differentiation

!syntax parameters /ADBCs/ADLagrangeVecFunctionDirichletBC<RESIDUAL>
!syntax parameters /BCs/ADLagrangeVecFunctionDirichletBC<RESIDUAL>

!syntax inputs /ADBCs/ADLagrangeVecFunctionDirichletBC<RESIDUAL>
!syntax inputs /BCs/ADLagrangeVecFunctionDirichletBC<RESIDUAL>

!syntax children /ADBCs/ADLagrangeVecFunctionDirichletBC<RESIDUAL>
!syntax children /BCs/ADLagrangeVecFunctionDirichletBC<RESIDUAL>
@@ -0,0 +1,9 @@
# ADDGDiffusion

Use DG to compute a diffusion term, and AD is adopted for Jacobian calculation.

!syntax parameters /DGKernels/ADDGDiffusion<RESIDUAL>

!syntax inputs /DGKernels/ADDGDiffusion<RESIDUAL>

!syntax children /DGKernels/ADDGDiffusion<RESIDUAL>
@@ -18,8 +18,8 @@ element solution of the weak formulation.
The Jacobian in `ADDiffusion` is computed using forward automatic
differentiation.

!syntax parameters /ADKernels/ADDiffusion<RESIDUAL>
!syntax parameters /Kernels/ADDiffusion<RESIDUAL>

!syntax inputs /ADKernels/ADDiffusion<RESIDUAL>
!syntax inputs /Kernels/ADDiffusion<RESIDUAL>

!syntax children /ADKernels/ADDiffusion<RESIDUAL>
!syntax children /Kernels/ADDiffusion<RESIDUAL>
@@ -25,10 +25,10 @@ Time derivative terms are ubiquitous in any transient simulation. The kernel
block for a transient diffusion problem that demonstrates the
`ADTimeDerivative` syntax is shown below:

!listing test/tests/kernels/ad_transient_diffusion/ad_transient_diffusion.i block=ADKernels
!listing test/tests/kernels/ad_transient_diffusion/ad_transient_diffusion.i block=Kernels

!syntax parameters /ADKernels/ADTimeDerivative<RESIDUAL>
!syntax parameters /Kernels/ADTimeDerivative<RESIDUAL>

!syntax inputs /ADKernels/ADTimeDerivative<RESIDUAL>
!syntax inputs /Kernels/ADTimeDerivative<RESIDUAL>

!syntax children /ADKernels/ADTimeDerivative<RESIDUAL>
!syntax children /Kernels/ADTimeDerivative<RESIDUAL>
@@ -6,8 +6,8 @@
except it is applied to vector finite element variables and the Jacobian is
computed automatically using automatic differentiation.

!syntax parameters /ADKernels/ADVectorDiffusion<RESIDUAL>
!syntax parameters /Kernels/ADVectorDiffusion<RESIDUAL>

!syntax inputs /ADKernels/ADVectorDiffusion<RESIDUAL>
!syntax inputs /Kernels/ADVectorDiffusion<RESIDUAL>

!syntax children /ADKernels/ADVectorDiffusion<RESIDUAL>
!syntax children /Kernels/ADVectorDiffusion<RESIDUAL>

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 7462455

Please sign in to comment.
You can’t perform that action at this time.