writing values in the solution vector for constrained dofs

22 views
Skip to first unread message

Simon

unread,
Jun 23, 2021, 5:00:06 AM6/23/21
to deal.II User Group
Dear all,

I am dealing with adaptivity, so hanging nodes are present in my mesh which are handled by a constraints object like in the following:
AffineConstraints...constraints;
make_hanging_node_constraints...();
constraints.close();

My solution vector is filled via a local approach. Basically I loop over all active vertices, use cell->vertex_dof_index() to access the dofs living on them and write appropriate values in the global solution vector. So I don't use the before mentioned constraints object to make a local-global distribution or something similar as it is done in most tuturial programs.
After my loop is finished I call constraints.distribute().

So by looping over all active vertices I also visit the constrained hanging nodes and write some values for these dofs in the solution vector.

My question is if I can just skip the hanging nodes in my loop because the call "constraints.distribute()" will overwrite these values anyway?
This is at least my understanding of what constraints.distribute() does, i.e. computing constraind dof values from unconstrained ones. But I am not quite sure if problems can come up by modifyiing the constrained dofs beforehand.

Best
Simon

Bruno Turcksin

unread,
Jun 23, 2021, 5:28:40 PM6/23/21
to deal.II User Group
Simon,

Yes, you should be able to skip the constrained hanging nodes. Like you said the value will be overwritten when you call distribute(). Let us know if you get something unexpected but that should work.

Best,

Bruno

Simon Wiesheier

unread,
Jun 26, 2021, 4:27:23 PM6/26/21
to dea...@googlegroups.com
Hi Bruno,

everything worked as expected, so constraints.distribute() does what it should do :-)

Best
Simon

--
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/6288fd1c-fa80-4798-ac7b-49a904f1ab40n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages