Dear Maxi,
It looks like you are using a scalar finite element (FE_Q<dim>), but you
set FEEvaluation to operate on a vectorial field, i.e.,
FEEvaluation<dim, degree, n_points_1d, dim, Number> phi(data);
Notice the 4th template parameter "dim", which should be one. I agree it
is unfortunate that we do not provide a better error message, so I
opened an issue for it, https://github.com/dealii/dealii/issues/9312
If you switch the parameter to 1, it should work. However, I want to
point out that you use a continuous element with
CellwiseInverseMassMatrix - this will not give you a valid matrix
inverse. You need to either use a diagonal mass matrix (see step-48) or
use the cellwise inverse as a preconditioner (when combined with
suitable scaling) and solve the mass matrix iteratively.
Best,
Martin
On 14.01.20 10:49, 'Maxi Miller' via deal.II User Group wrote:
I could narrow it down to the function
|
// same as above for has_partitioners_are_compatible == true
template<
typenameVectorType,
typenamestd::enable_if<has_partitioners_are_compatible<VectorType>::value,
VectorType>::type *=nullptr>
inlinevoid
check_vector_compatibility(
constVectorType& vec,
constinternal::MatrixFreeFunctions::DoFInfo&dof_info)
{
(void)vec;
(void)dof_info;
Assert(vec.partitioners_are_compatible(*dof_info.vector_partitioner),
ExcMessage(
"The parallel layout of the given vector is not "
"compatible with the parallel partitioning in MatrixFree. "
"Use MatrixFree::initialize_dof_vector to get a "
"compatible vector."));
}
|
located in vector_access_internal.h. Apparently I have a segfault in
the function
|
template<typenameNumber,typenameMemorySpaceType>
inlinebool
Vector<Number,MemorySpaceType>::partitioners_are_compatible(
constUtilities::MPI::Partitioner&part)const
{
returnpartitioner->is_compatible(part);
}
|
located in la_parallel_vector.templates.h, and thereby directly
stopping the program without triggering the assert()-function. The
direct gdb output for this function is
|
#3 0x00007ffff00c0c5c in
dealii::LinearAlgebra::distributed::Vector<double,
dealii::MemorySpace::Host>::partitioners_are_compatible (this=0x0,
part=...) at
~Downloads/git-files/dealii/include/deal.II/lac/la_parallel_vector.templates.h:2021
|
I am not sure what that means. Could it point to a nullpointer
somewhere (after this=0x0)? Though, when putting a breakpoint to the
first function and printing the involved variables there, I get
|
(gdb)printdof_info.vector_partitioner
$2 =std::shared_ptr<constdealii::Utilities::MPI::Partitioner>(usecount
3,weak count 0)={get()=0x7a60c0}
(gdb)printvec.partitioner
$3 =std::shared_ptr<constdealii::Utilities::MPI::Partitioner>(usecount
3,weak count 0)={get()=0x7a60c0}
|
i.e. no null ptr. Could the problem be there, or somewhere else?
Thanks!
Am Montag, 13. Januar 2020 21:41:54 UTC+1 schrieb Wolfgang Bangerth:
On 1/13/20 8:41 AM, 'Maxi Miller' via deal.II User Group wrote:
> Therefore, I assume that I have some bugs in my code, but am not
experienced
> enough in writing matrix-free code for being able to debug it
myself. What
> kind of approach could I do now, or is there simply a glaring
bug which I did
> not see yet?
I haven't even looked at the code yet, but for segfaults there is
a relatively
simple cure: Run your code in a debugger. A segmentation fault is
a problem
where some piece of code tries to access data at an address
(typically through
a pointer) that is not readable or writable. The general solution
to finding
out what the issue is is to run the code in a debugger -- the
debugger will
then stop at the place where the problem happens, and you can
inspect all of
the values of the pointers and variables that are live at that
location. Once
you see what variable is at fault, the problem is either already
obvious, or
you can start to think about how a pointer got the value it has
and why.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: [email protected] <javascript:>
www:
http://www.math.colostate.edu/~bangerth/
<http://www.math.colostate.edu/~bangerth/>
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google
Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/d55e53b2-a0c8-4cc0-ab84-7521f8b23d81%40googlegroups.com
<https://groups.google.com/d/msgid/dealii/d55e53b2-a0c8-4cc0-ab84-7521f8b23d81%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/2770efd0-cc96-332b-bd42-ceb76fa0d38b%40gmail.com.