Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard _ad_u_dot calculation #13171

Closed
lindsayad opened this issue Apr 3, 2019 · 1 comment
Closed

Guard _ad_u_dot calculation #13171

lindsayad opened this issue Apr 3, 2019 · 1 comment
Labels
C: Framework P: normal A defect affecting operation with a low possibility of significantly affects. T: defect An anomaly, which is anything that deviates from expectations.

Comments

@lindsayad
Copy link
Member

lindsayad commented Apr 3, 2019

Bug Description

Calculation of _ad_u_dot is not guarded by a _need_ad_u_dot flag

Steps to Reproduce

  • run a transient simulation
  • Call something like adSln or adCoupledValue--anything to register that a variable needs calculation--on an auxiliary variable

This generates the following stack trace:

0: 0   libmesh_dbg.0.dylib                 0x000000010c94549e libMesh::print_trace(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) + 2366
1: 1   libmoose_test-dbg.0.dylib           0x000000010753d958 MooseArray<double>::operator[](unsigned int) + 1736
2: 2   libmoose-dbg.0.dylib                0x00000001090b2f71 MooseVariableFE<double>::computeAD(unsigned int, unsigned int, bool, MooseArray<std::__1::vector<double, std::__1::allocator<double> > > const&, MooseArray<std::__1::vector<libMesh::VectorValue<double>, std::__1::allocator<libMesh::VectorValue<double> > > > const&, MooseArray<std::__1::vector<libMesh::TensorValue<double>, std::__1::allocator<libMesh::TensorValue<double> > > > const*&, MooseArray<std::__1::vector<libMesh::VectorValue<MetaPhysicL::DualNumber<double, MetaPhysicL::NumberArray<50ul, double> > >, std::__1::allocator<libMesh::VectorValue<MetaPhysicL::DualNumber<double, MetaPhysicL::NumberArray<50ul, double> > > > > > const&) + 2785
3: 3   libmoose-dbg.0.dylib                0x00000001090b0f0a MooseVariableFE<double>::computeValuesHelper(libMesh::QBase*&, MooseArray<std::__1::vector<double, std::__1::allocator<double> > > const&, MooseArray<std::__1::vector<libMesh::VectorValue<double>, std::__1::allocator<libMesh::VectorValue<double> > > > const&, MooseArray<std::__1::vector<libMesh::TensorValue<double>, std::__1::allocator<libMesh::TensorValue<double> > > > const*&, MooseArray<std::__1::vector<double, std::__1::allocator<double> > > const*&, MooseArray<std::__1::vector<libMesh::VectorValue<MetaPhysicL::DualNumber<double, MetaPhysicL::NumberArray<50ul, double> > >, std::__1::allocator<libMesh::VectorValue<MetaPhysicL::DualNumber<double, MetaPhysicL::NumberArray<50ul, double> > > > > > const&) + 16122
4: 4   libmoose-dbg.0.dylib                0x00000001090b553d MooseVariableFE<double>::computeElemValues() + 77
5: 5   libmoose-dbg.0.dylib                0x00000001093a06f3 AuxiliarySystem::reinitElem(libMesh::Elem const*, unsigned int) + 787
6: 6   libmoose-dbg.0.dylib                0x00000001089c8d42 FEProblemBase::reinitElem(libMesh::Elem const*, unsigned int) + 130
7: 7   libmoose-dbg.0.dylib                0x00000001092f8a87 ComputeJacobianThread::onElement(libMesh::Elem const*) + 103
8: 8   libmoose-dbg.0.dylib                0x0000000108179263 ThreadedElementLoopBase<libMesh::StoredRange<libMesh::MeshBase::const_element_iterator, libMesh::Elem const*> >::operator()(libMesh::StoredRange<libMesh::MeshBase::const_element_iterator, libMesh::Elem const*> const&, bool) + 707
9: 9   libmoose-dbg.0.dylib                0x00000001093f02aa void libMesh::Threads::parallel_reduce<libMesh::StoredRange<libMesh::MeshBase::const_element_iterator, libMesh::Elem const*>, ComputeJacobianThread>(libMesh::StoredRange<libMesh::MeshBase::const_element_iterator, libMesh::Elem const*> const&, ComputeJacobianThread&) + 138
10: 10  libmoose-dbg.0.dylib                0x00000001093ed506 NonlinearSystemBase::computeJacobianInternal(std::__1::set<unsigned int, std::__1::less<unsigned int>, std::__1::allocator<unsigned int> > const&) + 1702
11: 11  libmoose-dbg.0.dylib                0x00000001093f5bff NonlinearSystemBase::computeJacobianTags(std::__1::set<unsigned int, std::__1::less<unsigned int>, std::__1::allocator<unsigned int> > const&) + 95
12: 12  libmoose-dbg.0.dylib                0x0000000108a19e1e FEProblemBase::computeJacobianTags(std::__1::set<unsigned int, std::__1::less<unsigned int>, std::__1::allocator<unsigned int> > const&) + 3550
13: 13  libmoose-dbg.0.dylib                0x0000000108a18f75 FEProblemBase::computeJacobianInternal(libMesh::NumericVector<double> const&, libMesh::SparseMatrix<double>&, std::__1::set<unsigned int, std::__1::less<unsigned int>, std::__1::allocator<unsigned int> > const&) + 277
14: 14  libmoose-dbg.0.dylib                0x0000000108a18e54 FEProblemBase::computeJacobian(libMesh::NumericVector<double> const&, libMesh::SparseMatrix<double>&) + 1460
15: 15  libmoose-dbg.0.dylib                0x0000000108a18486 FEProblemBase::computeJacobianSys(libMesh::NonlinearImplicitSystem&, libMesh::NumericVector<double> const&, libMesh::SparseMatrix<double>&) + 70
16: 16  libmoose-dbg.0.dylib                0x00000001093b1877 Moose::compute_jacobian(libMesh::NumericVector<double> const&, libMesh::SparseMatrix<double>&, libMesh::NonlinearImplicitSystem&) + 327
17: 17  libmesh_dbg.0.dylib                 0x000000010e007d4f libmesh_petsc_snes_jacobian + 5647
18: 18  libpetsc.3.10.dylib                 0x00000001117f88ad SNESComputeJacobian + 925
19: 19  libpetsc.3.10.dylib                 0x000000011182daee SNESSolve_NEWTONLS + 1438
20: 20  libpetsc.3.10.dylib                 0x00000001117fd96d SNESSolve + 1821
21: 21  libmesh_dbg.0.dylib                 0x000000010e004711 libMesh::PetscNonlinearSolver<double>::solve(libMesh::SparseMatrix<double>&, libMesh::NumericVector<double>&, libMesh::NumericVector<double>&, double, unsigned int) + 4017
22: 22  libmesh_dbg.0.dylib                 0x000000010e11e44e libMesh::NonlinearImplicitSystem::solve() + 1310
23: 23  libmoose-dbg.0.dylib                0x00000001096cb24d TimeIntegrator::solve() + 45
24: 24  libmoose-dbg.0.dylib                0x00000001093b38c4 NonlinearSystem::solve() + 1476
25: 25  libmoose-dbg.0.dylib                0x0000000108a115f5 FEProblemBase::solve() + 165
26: 26  libmoose-dbg.0.dylib                0x00000001083ee6d4 FEProblemSolve::solve() + 36
27: 27  libmoose-dbg.0.dylib                0x00000001083f85c9 PicardSolve::solveStep(double, double&, double, double&, bool, std::__1::set<unsigned int, std::__1::less<unsigned int>, std::__1::allocator<unsigned int> > const&) + 1913
28: 28  libmoose-dbg.0.dylib                0x00000001083f62e1 PicardSolve::solve() + 5185
29: 29  libmoose-dbg.0.dylib                0x000000010913f2d4 TimeStepper::step() + 52
30: 30  libmoose-dbg.0.dylib                0x0000000108405d4c Transient::takeStep(double) + 284
31: 31  libmoose-dbg.0.dylib                0x00000001084054a1 Transient::execute() + 145
32: 32  libmoose-dbg.0.dylib                0x0000000109b9fa8b MooseApp::executeExecutioner() + 235
33: 33  libmoose-dbg.0.dylib                0x0000000109ba100f MooseApp::run() + 335
34: 34  moose_test-dbg                      0x000000010751c9c6 main + 294

Impact

Continue to improve generality of AD system in being able to work with auxiliary variables (although we continue to not propagate derivatives through them)

@lindsayad lindsayad added the T: defect An anomaly, which is anything that deviates from expectations. label Apr 3, 2019
@permcody permcody added C: Framework P: normal A defect affecting operation with a low possibility of significantly affects. labels Apr 3, 2019
@dschwen
Copy link
Member

dschwen commented Apr 3, 2019

Ha, I ran into this very error about an hour ago!

aeslaughter pushed a commit to aeslaughter/moose that referenced this issue Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Framework P: normal A defect affecting operation with a low possibility of significantly affects. T: defect An anomaly, which is anything that deviates from expectations.
Projects
None yet
Development

No branches or pull requests

3 participants