Skip to content

project_solution fails with infinite elements #2092

@BalticPinguin

Description

@BalticPinguin

Dear all,
I have a bugreport and a related question about intended usage/performance:
In my program I have an input-function (i.e. I can compute its value at any point) and which needs to be projected into the FEM-space.
Currently, I am solving a FEM-system M*x=f where M is just the mass matrix and f is computed by integrating the input-quantity.

Now I wanted to change this, using the project_vector class, aiming at a speed-up.
The question-part now is: How does this function work? It looks quite complex, and seems to do something similar, but on an element-wise level.
Am I right? I see that this saves me from constructing the large matrix; but can anyone tell me something about the performance in terms of time? I am just curious...

Now to the bug: My mesh contains infinite elements,leading to the project_solution part to break with the traceout:

ERROR: Bad ElemType = INFPRISM12 for SECOND order approximation!
Stack frames: 18
0: libMesh::print_trace(std::ostream&)
1: libMesh::MacroFunctions::report_error(char const*, int, char const*, char const*)
2: /home/tm162/bin/libmesh/dev_libmesh/lib/libmesh_dbg.so.0(+0x1b2c7a0) [0x7ffff60c87a0]
3: libMesh::FE<3u, (libMesh::FEFamily)0>::n_dofs(libMesh::ElemType, libMesh::Order)
4: libMesh::FE<3u, (libMesh::FEFamily)0>::n_shape_functions(libMesh::ElemType, libMesh::Order)
5: libMesh::FE<3u, (libMesh::FEFamily)0>::map(libMesh::Elem const*, libMesh::Point const&)
6: libMesh::FE<3u, (libMesh::FEFamily)0>::inverse_map(libMesh::Elem const*, libMesh::Point const&, double, bool)
7: libMesh::FE<3u, (libMesh::FEFamily)0>::inverse_map(libMesh::Elem const*, std::__debug::vector<libMesh::Point, std::allocator<libMesh::Point> > const&, std::__debug::vector<libMesh::Point, std::allocator<libMesh::Point> >&, double, bool)
8: libMesh::FE<3u, (libMesh::FEFamily)0>::edge_reinit(libMesh::Elem const*, unsigned int, double, std::__debug::vector<libMesh::Point, std::allocator<libMesh::Point> > const*, std::__debug::vector<double, std::allocator<double> > const*)
9: libMesh::FEMContext::edge_fe_reinit()
10: libMesh::GenericProjector<libMesh::FEMFunctionWrapper<std::complex<double> >, libMesh::FEMFunctionWrapper<libMesh::VectorValue<std::complex<double> > >, std::complex<double>, libMesh::VectorSetAction<std::complex<double> > >::operator()(libMesh::StoredRange<libMesh::MeshBase::const_element_iterator, libMesh::Elem const*> const&) const
11: void libMesh::Threads::parallel_for<libMesh::StoredRange<libMesh::MeshBase::const_element_iterator, libMesh::Elem const*>, libMesh::GenericProjector<libMesh::FEMFunctionWrapper<std::complex<double> >, libMesh::FEMFunctionWrapper<libMesh::VectorValue<std::complex<double> > >, std::complex<double>, libMesh::VectorSetAction<std::complex<double> > > >(libMesh::StoredRange<libMesh::MeshBase::const_element_iterator, libMesh::Elem const*> const&, libMesh::GenericProjector<libMesh::FEMFunctionWrapper<std::complex<double> >, libMesh::FEMFunctionWrapper<libMesh::VectorValue<std::complex<double> > >, std::complex<double>, libMesh::VectorSetAction<std::complex<double> > > const&)
12: libMesh::System::project_vector(libMesh::NumericVector<std::complex<double> >&, libMesh::FEMFunctionBase<std::complex<double> >*, libMesh::FEMFunctionBase<libMesh::VectorValue<std::complex<double> > >*, int) const
13: libMesh::System::project_vector(libMesh::NumericVector<std::complex<double> >&, libMesh::FunctionBase<std::complex<double> >*, libMesh::FunctionBase<libMesh::VectorValue<std::complex<double> > >*, int) const
14: libMesh::System::project_solution(libMesh::FunctionBase<std::complex<double> >*, libMesh::FunctionBase<libMesh::VectorValue<std::complex<double> > >*) const
15: /scratch/tm162/bin/FreeWilly/FrWll-dbg(+0xc179a) [0x55555561579a]

I think, the issue here is around stack # 9: the FEMContext should look carefully, whether the fe_reinit or inf_reinit should be called.
Another way to look at it is that the _edge_fe is filled via FEAbstract::build(dim, fe_type), which is not sensitive to it.

I must admit that I am a bit stuck at this point, because I am not very familiar with the classes involved and I fear that it is not easy to generalize this part.
Probably someone can comment on this and give me some direction how to fix this?

Many thanks in advance,
Hubert

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions