Open TheGreatCid opened 2 months ago
@lindsayad @hugary1995 @dschwen
One of the reinit
methods must have not been called (at the correct time).
@dschwen and I found that using _u_old(_var.nodalValueOld())
instead of _u_old(_var.slnOld())
returns the correct value.
So there is certainly something odd going on here.
@lindsayad Should I open a PR using _u_old(_var.nodalValueOld())
? and just ignore the issue with _u_old(_var.slnOld())
for now?
You should probably do that since nodalValueOld()
is probably the best named API to use for a nodal BC. In which case you can either ref this issue and leave it open or mark this as closed and we can open a new one for the framework issue
Bug Description
In the process of merging the
DirectDirichletBC
type, the calculation of the residual in the base class was changed fromto
where
_u_old= _var.slnOld()
and_u_dot_old = _var.uDotOld()
These should be equivalent, and indeed the tests did not catch any changes in these cases. However I found that there a sort of compounding error in the solution at the boundaries as number of time steps increases. This error eventually leads to the incorrect enforcement of the boundary condition. This error is not present in the original method of indexing of the solution vector.
I found that in the
DirectDirichletBCBase
class,_u_old[_qp]
!=_sys.solutionOld()(dofnum)
. This behavior is puzzling and fixing this should fix the class.Steps to Reproduce
Running this file will show the issue. The BC at the bottom of the plate will be incorrectly enforced.
Impact
This gives incorrect values and should be fixed ASAP.
[Optional] Diagnostics
No response