A variable can exist on a block with no active Kernels for that variable
Bug Description
A nonlinear variable can exist on a block with no active kernel applied to that variable on a the block. I think the existing kernel coverage only checks if a variable has at least one kernel associated with it on at least one block, even if the variable is defined on more than one block.
Steps to Reproduce
Take a mesh containing two blocks. Add a nonlinear variable that is not block restricted. Add a Kernel that is block restricted to one of the blocks. This behavior led to zero diagonal pivots using superlu and other non-physical behavior using mumps on complicated case I was analyzing. I should be able to reproduce this on a simple moose only problem.
Impact
It was a bit annoying tracking this down because the errors I was obtaining didn't point directly to this being the issue.
If you share a MWE I suspect I can fix this pretty easily.
simple_diffusion.txt This file runs fine with the setup I talked about (a variable defined on multiple blocks but the kernels are block restricted). However, this uses
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
which I don't use in my analyses for other reasons. If I switch the solver options to:
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = ' lu superlu_dist'
I get the zero pivot error I saw on my problem:
At column 0, pivotL() encounters zero diagonal at line 722 in file /opt/civet/build_0/conda_builds/conda_envs/next-bd5f61a914/conda-bld/moose-petsc_1607706904825/work/arch-conda-c-opt/externalpackages/git.superlu_dist/SRC/symbfact.c
And with mumps instead of superlu_dist it fails to converge:
Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0
PC failed due to FACTOR_NUMERIC_ZEROPIVOT
Nonlinear solve did not converge due to DIVERGED_LINE_SEARCH iterations 0
Solve Did NOT Converge!
Aborting as solve did not converge
However, if I block restrict the u variable to the bottom_square only, both superlu_dist and mumps converge fine.
Hello
I am also facing the same issue. Is there a way to resolve this?
Best Avtar
Hello
I am also facing the same issue. Is there a way to resolve this?
Best Avtar
This comes about when having a variable specified to apply to all blocks when the only kernel applying to that variable is block restricted. In creating this issue I'm hoping for an improved error message to be able to prevent this in the future. If the variable has a kernel operating on it on every block in the mesh you shouldn't hit this issue. Therefore, if you define a variable on all blocks make sure a kernel applies to said variable on all blocks. If the kernels are only on a subset of the blocks for the variable, just make sure you block restrict the variable to be only on the blocks for which its kernels operate.
For reference sake I also had the same issue. Block restricting fixed it. Thanks!
Hello, could you please explain how to do block restriction, I am sorry but I am facing the same problem and don't understand the solution. Thanks