"constraints for degree of freedom ... should not be stored ... " after SolutionTransfer

41 views
Skip to first unread message

Simon

unread,
Jun 8, 2024, 9:51:47 AMJun 8
to deal.II User Group
Dear all,

I am doing a SolutionTransfer in the same fashion as described in the docu of SolutionTransfer class.
After calling
-triangulation.execute_coarsening_and_refinement();
I proceed with
-dofHandler.distribute_dofs(feSystem);
-constraints.clear();
-DoFTools::make_hanging_node_constraints(dofHandler, constraints);
where my feSystem has 2 blocks (3 copies of FE_Q<3(1) and 1 copy of FE_DGQ<3>(0))

The function
DoFTools::make_hanging_node_constraints(dofHandler, constraints)

throws

  dealii::types::global_dof_index dealii::AffineConstraints<number>::calculate_line_index(size_type) const [with number = double; dealii::types::global_dof_index = unsigned int; size_type = unsigned int]
The violated condition was:
    local_lines.is_element(line_n)
Additional information:
    The index set given to this constraints object indicates constraints
    for degree of freedom 167 should not be stored by this object, but a
    constraint is being added.

Before refinement, dofHandler stored 138 DoFs, after refinement 202. 

I could not reproduce the error on a minimal example.
However, it is not clear to me why
make_hanging_constraints() reports an error associated with dof index 167, 
if I cleared the constraints object before hand and can be certain that my DoFHandler has 202 DoFs. 
So the sequence of distributing DoFs, followed by clearing constraints and calling make hanging node constraints should work independently of how my program arrived at these lines of code. Is this not true?

Any general hints as for the problem source and narrowing down the problem?

Thanks,
Simon
 
 



Wolfgang Bangerth

unread,
Jun 9, 2024, 10:30:33 PMJun 9
to dea...@googlegroups.com
On 6/8/24 07:51, Simon wrote:
>
> Before refinement, dofHandler stored 138 DoFs, after refinement 202.
>
> I could not reproduce the error on a minimal example.
> However, it is not clear to me why
> make_hanging_constraints() reports an error associated with dof index 167,
> if I cleared the constraints object before hand and can be certain that my
> DoFHandler has 202 DoFs.
> So the sequence of distributing DoFs, followed by clearing constraints and
> calling make hanging node constraints should work independently of how my
> program arrived at these lines of code. Is this not true?
>
> Any general hints as for the problem source and narrowing down the problem?

Did you initialize the AffineConstraints object with index sets for the
locally owned and/or locally relevant DoFs? If so, you will have to
re-initialize it with the now larger/different number of DoFs you have after
mesh refinement.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/


Simon

unread,
Jun 10, 2024, 2:13:38 AMJun 10
to deal.II User Group
No, the program that produced the error is serial not parallel.

Best,
Simon

陈敏

unread,
Jun 10, 2024, 5:07:26 AMJun 10
to dea...@googlegroups.com
Hi Simon

you can write function of setup_system like other tutorial setp, after refine mesh, rerun function of setup_system().

Best
Chen

Simon <simon.w...@gmail.com> 于2024年6月10日周一 14:13写道:
--
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 dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/66d6a3fd-eb61-45ab-9ca1-509ed97bdc39n%40googlegroups.com.

Wolfgang Bangerth

unread,
Jun 10, 2024, 1:05:01 PMJun 10
to dea...@googlegroups.com

On 6/10/24 00:13, Simon wrote:
> No, the program that produced the error is serial not parallel.

I think then I'd need to see the whole program :-)

Best
W.

Simon

unread,
Jun 10, 2024, 1:25:50 PMJun 10
to deal.II User Group
I figured out the problem.

In my make_constraints() function, I re-initialized the AffineConstraints object indeed with
the locally releveant DoFs as you said (although this is not necessary in the serial version of my code).

Thanks for pointing out to this!

-Simon
Reply all
Reply to author
Forward
0 new messages