Skip to content

Bug when calling EquationSystems::reinit with NodeElem and discontinuous variables #1661

@dknez

Description

@dknez
  1. Make or read in a mesh, and add a NodeElem to it. Make an EquationSystems object, es, based on the mesh.

  2. Add a system to es that only has discontinuous basis functions, e.g. CONSTANT MONOMIALs, or FIRST L2_LAGRANGEs.

  3. Do es.init(); followed by es.reinit(); On the call to reinit, I get the stack trace below. I gather the issue is that reinit fails because the NodeElem has no variables on it associated with the system added in point 2 (though it may have variables in other systems in es).

Assertion `var < this->n_vars(s)' failed.
var = 0
this->n_vars(s) = 0


Stack frames: 17
0: libMesh::print_trace(std::ostream&)
1: libMesh::MacroFunctions::report_error(char const*, int, char const*, char const*)
2: libMesh::DofObject::n_comp(unsigned int, unsigned int) const
3: libMesh::DofMap::_dof_indices(libMesh::Elem const&, int, std::__debug::vector<unsigned int, std::allocator<unsigned int> >&, unsigned int, libMesh::Node const* const*, unsigned int, unsigned long&) const
4: libMesh::DofMap::dof_indices(libMesh::Elem const*, std::__debug::vector<unsigned int, std::allocator<unsigned int> >&) const
5: libMesh::FEMContext::pre_fe_reinit(libMesh::System const&, libMesh::Elem const*)
6: libMesh::GenericProjector<libMesh::OldSolutionValue<double, &(void libMesh::FEMContext::point_value<double>(unsigned int, libMesh::Point const&, double&, double) const)>, libMesh::OldSolutionValue<libMesh::VectorValue<double>, &(void libMesh::FEMContext::point_gradient<libMesh::VectorValue<double> >(unsigned int, libMesh::Point const&, double&, double) const)>, double, libMesh::VectorSetAction<double> >::operator()(libMesh::StoredRange<libMesh::MeshBase::const_element_iterator, libMesh::Elem const*> const&) const
7: void libMesh::Threads::parallel_for<libMesh::StoredRange<libMesh::MeshBase::const_element_iterator, libMesh::Elem const*>, libMesh::GenericProjector<libMesh::OldSolutionValue<double, &(void libMesh::FEMContext::point_value<double>(unsigned int, libMesh::Point const&, double&, double) const)>, libMesh::OldSolutionValue<libMesh::VectorValue<double>, &(void libMesh::FEMContext::point_gradient<libMesh::VectorValue<double> >(unsigned int, libMesh::Point const&, double&, double) const)>, double, libMesh::VectorSetAction<double> > >(libMesh::StoredRange<libMesh::MeshBase::const_element_iterator, libMesh::Elem const*> const&, libMesh::GenericProjector<libMesh::OldSolutionValue<double, &(void libMesh::FEMContext::point_value<double>(unsigned int, libMesh::Point const&, double&, double) const)>, libMesh::OldSolutionValue<libMesh::VectorValue<double>, &(void libMesh::FEMContext::point_gradient<libMesh::VectorValue<double> >(unsigned int, libMesh::Point const&, double&, double) const)>, double, libMesh::VectorSetAction<double> > const&)
8: libMesh::System::project_vector(libMesh::NumericVector<double> const&, libMesh::NumericVector<double>&, int) const
9: libMesh::System::project_vector(libMesh::NumericVector<double>&, int) const
10: libMesh::System::restrict_vectors()
11: libMesh::System::prolong_vectors()
12: libMesh::EquationSystems::reinit_solutions()
13: libMesh::EquationSystems::reinit()
14: ./example-dbg() [0x491074]
15: __libc_start_main
16: ./example-dbg() [0x48fe09]
[0] /home/dknez/software/libmesh_install/dbg_real/libmesh/include/libmesh/dof_object.h, line 784, compiled Apr 19 2018 at 13:22:05

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions