Skip to content

Commit

Permalink
add a test that showing the jacobian assembly bug reported in idahola…
Browse files Browse the repository at this point in the history
  • Loading branch information
YaqiWang committed Jan 11, 2023
1 parent 76355eb commit a1b6d81
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 1 deletion.
75 changes: 75 additions & 0 deletions test/tests/kernels/array_kernels/array_custom_coupling_test.i
@@ -0,0 +1,75 @@
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 4
ny = 4
dim = 2
[]
[]


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

[Kernels]
[diff]
type = ArrayDiffusion
variable = u
diffusion_coefficient = dc
[]
[reaction]
type = ArrayReaction
variable = u
reaction_coefficient = rc
[]
[]

[BCs]
[left]
type = ArrayVacuumBC
variable = u
boundary = 1
[]

[right]
type = ArrayPenaltyDirichletBC
variable = u
boundary = 2
value = '1 2'
penalty = 4
[]
[]

[Materials]
[dc]
type = GenericConstantArray
prop_name = dc
prop_value = '1 1'
[]
[rc]
type = GenericConstant2DArray
prop_name = rc
prop_value = '1 0; -0.1 1'
[]
[]

[Preconditioning]
[smp]
type = SMP
off_diag_row = 'u_0 u_1'
off_diag_column = 'u_0 u_1'
[]
[]

[Executioner]
type = Steady
[]

[Outputs]
exodus = true
[]
14 changes: 13 additions & 1 deletion test/tests/kernels/array_kernels/tests
@@ -1,5 +1,5 @@
[Tests]
issues = '#6881 #14057'
issues = '#6881 #14057 #23123'
design = '/variables/ArrayMooseVariable.md'
[test]
type = 'Exodiff'
Expand Down Expand Up @@ -62,4 +62,16 @@
exodiff = 'array_body_force_out.e'
requirement = 'The system shall provide array body-force kernels on an array variable.'
[]

[test_array_custom_coupling]
type = 'RunApp'
input = 'array_custom_coupling_test.i'
cli_args = '-ksp_view_pmat'
max_parallel = 1
# This test is to match the values of the assembled Jacobian at row 49.
# Before fixing the bug reportted in #23123 the row is:
# row 49: (37, -0.331771) (39, -0.142708) (47, 0.003125) (49, 1.04792)
expect_out = 'row 49\: \(37\, -0.3315\d+\) \(39\, -0.14236\d+\) \(47\, 0.0034722\d+\) \(49\, 1.0486\d+\)'
requirement = 'The system shall assemble the Jacobian properly with array variables'
[]
[]

0 comments on commit a1b6d81

Please sign in to comment.