Closed tophmatthews closed 4 years ago
I'm looking at this right now. Notes of what I found so far:
TM_all0
which acts on disp_x
ke
off diagonal Jacobian block for the temp
variable is emptytemp
or setting SMP full = false
makes the error go awaystrain = SMALL
and ComputeLinearElasticStress
make the error go awaytemperature = temp
into the TM action block makes the error go awayLooks like an off diagonal jacobian is computed "unexpectedly". I.e. during setup MOOSE does not know the variables are coupled, but it computes the odj anyways...
This is not a bug in the TensorMechanics action. If I unfold the action using the extremely useful DumpProblem
object (#8876)... @permcody, I get
Which fails with the same error
The issue seems coupling a variable that has kernels only on the displaced mesh to a variable that has kernels only on the undisplaced mesh.
Minimal example without tensor mechanics:
[GlobalParams]
displacements = 'u'
[]
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[./u]
[../]
[./v]
[../]
[]
[Kernels]
[./u]
type = Diffusion
use_displaced_mesh = true
variable = u
[../]
[./v]
type = Diffusion
use_displaced_mesh = false
variable = v
[../]
[]
[BCs]
[./no_x]
type = DirichletBC
variable = u
boundary = left
value = 1.0e-3
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
[]
This came up again. Should this really be a restriction? ping @dschwen @permcody
Yeah, bummer, this issue just got forgotten. Let me 🏓 @andrsd, who should know all about the allocation of the Jacobian blocks. Maybe he has some fresh ideas.
So, you guys have a PDE where volumetric terms are on displaced mesh and its BCs are on undisplaced? Or is this just a simplification of something more complex?
BTW: just by looking at the input file, this should work. I suspect where the problem might be...
@andrsd, I don't exactly remember, but I thought this required coupling the u and v (where u is in the displaced and v is on the undisplaced mesh), and then adding a non zero BC (no idea if the BC is on the displaced or undisplaced mesh though).
The minimal example that breaks has variable v
on non-displaced mesh. It is not coupled anywhere as far as I see.
I suspect the real problem is that a kernel is on a displaced mesh - those would be q-point values - plus there is a nodal BC - those would be nodal values - on a non-displaced mesh. And we do not flip the right flag to compute one of those... It is just my working theory for now...
D'oh, you're right, there is no coupling. I guess you just need variables on both meshes.
Cool, looks like you guys are tracking it down? I just don't want this to get lost again :)
So, here is the problem (mostly for me so that I do not forget):
Assembly
like so:
jacobianBlock(vi, vj).resize(ivar.dofIndices().size(), jvar.dofIndices().size());
Now, u
is on displaced mesh and v
is not. So in the non-displaced instance for variable v
, we resize the block to (2, 0).
Kernel::computeOffDiagJacobian
for v
variable we get:
_test.size() == 2
_phi.size() == 2
And then we go into the previously sized block that has incorrect dimensions.
Looks like this is close, I'll be glad to see this resolved after all this time!
I guess my last comment was confusing for some...this isn't closed, but sounds close since @andrsd has an idea on what the problem is
@andrsd @dschwen Okay, it looks like this was solved by something else! Maybe the simplified input file given here should be implemented as a test to ensure it doesn't get broken in the future?
Looks like this has be solved by something else
UGGG!!!! This problem still exists. Here is another condensed input file that reproduces the error. As far as I can tell, no line can be removed without clearing the error. This is causing problems with some large BISON runs I'm trying to run through debug and is hindering development. Any ideas @dschwen @andrsd ?
This latest input has to be run with combined-dbg
Any new thoughts on this issue ? I've been trying to run some test cases with the peridynamics module and running into the same error in devel mode
ping @dschwen @andrsd ???
I ran the input with the latest moose/libmes combined-dbg and it errors out with
Solve failed and timestep already at or below dtmin, cannot continue!
but not with the assertion you mentioned.
Argh, never mind, the one in your comment from May 31st still triggers the bug.
Ok, some preliminary observation:
TaggingInterface::prepareMatrixTag
sets up the _local_ke
matrix size. For the temp
/diff
coupling case only this sets up the matrix as 9x0 a few times. The vast majority of calls sets it up to the correct 9x9 size. Scaling with mesh size indicates that only the size in the IntegratedBC
is screwed up (the kernels get the correct _local_ke
). It is always the matrix dimension corresponding to the diff
variable that is messed up.
This can be traced further up to Assembly::prepareJacobianBlock
, where dofIndices().size()
for that variable occasionally is 0.
The problem also seems to vanish when only using first order elements (just setting order 1 on temp
or diff
alone does not make the problem go away).
@dschwen @andrsd This popped up again and is slowing development...any way we can get this through?! What can I do to help?
I'm on travel this week
Whew...I think this was fixed along the way...
Really? It's not referenced. I hope we have a test case, or if not adding one now would be great!
There are three different inputs that should prove it in this issue
Nope! Still a problem!!!!! I closed this prematurely somehow.
I keep coming around to this when I have to use dbg on thermo-mechanical problems. Once I get pulled away to something else and I stop pushing this, I forget, @dschwen forgets, @andrsd forgets, everyone else forgets, and it gets consistently lost.
This was so close at some point with @andrsd identifying the problem, but this never being solved.
I'll open a PR with a test that clearly fails so this hopefully gets more visibility, and this damn thing gets closed finally!
Gonna rename this to "Topher's bug" - Seems like it's the bane of your existence.
Glad someone could sense my frustration... :)
Description of the enhancement or error report
When running a tensor mechanics problem with debug, the following assertion fails:
Output
``` Time Step 0, time = 0 dt = 0 Time Step 1, time = 1 dt = 1 0 Nonlinear |R| = 1.414214e-03 Assertion `i*j < _val.size()' failed. i*j = 0 _val.size() = 0 sh: line 1: 56583 Trace/BPT trap: 5 gdb -p 56581 -batch -ex bt -ex detach 2> /dev/null > temp_print_trace.njF0L8 Stack frames: 32 0: 0 libmesh_dbg.0.dylib 0x000000010e4d93af libMesh::print_trace(std::__1::basic_ostreamIt seems to happen when the DenseMatrix is formulated for the off-diagonal jacobian, and only when there is a non-zero BC condition preset. It also requires an additional variable beyond just the displacement variables, and for
strain = FINITE
Rationale for the enhancement or information for reproducing the error
The following input file can be used to reproduce the error with
tensor-mechanics-dbg
.Input File
``` [GlobalParams] displacements = 'disp_x disp_y' [] [Mesh] type = GeneratedMesh dim = 2 [] [Variables] [./temp] [../] [] [Modules] [./TensorMechanics] [./Master] [./all] add_variables = true strain = FINITE [../] [../] [../] [] [Kernels] [./dt] type = TimeDerivative variable = temp [../] [] [BCs] [./no_x] type = DirichletBC variable = disp_x boundary = left value = 1.0e-3 [../] [] [Materials] [./stress] type = ComputeFiniteStrainElasticStress [../] [./elasticity_tensor] type = ComputeIsotropicElasticityTensor youngs_modulus = 1e11 poissons_ratio = 0.3 [../] [] [Preconditioning] [./SMP] type = SMP full = true [../] [] [Executioner] type = Transient [] ```Identified impact
This will allow more complicated input files to be debugged.