On 8/30/22 13:56, Lucas Myers wrote:
To enforce these boundary conditions, I initialize constraints with:
```
constraints.clear();
dealii::DoFTools::make_hanging_node_constraints(dof_handler, constraints);
dealii::VectorTools::
interpolate_boundary_values(dof_handler,
0,
dealii::Functions::ZeroFunction<dim>(1),
constraints);
constraints.close();
```
I use the `distribute_local_to_global` in the assembly function, and then once
I've solved the linear system (directly, with UMFPACK), I use
`constraints.distribute`. Not sure what else I need to do to enforce those
boundary conditions.
I'm attaching the code (<300 lines including white space) in case that is
helpful. Any help is appreciated!
Rather than trying to debug this myself, let me ask some questions:
* Right after the call you show above, are the necessary constraints in your
'constraint' object?
* Right before you call 'distribute_local_to_blobal()' are the necessary
constraints still in the 'constraints' object?
* Right before you call 'distribute()' after you solve the linear system, are
the necessary constraints still in the 'constraints' object?
* Right after you call 'distribute()', are the entries in the solution vector
that correspond to boundary nodes correct?
If the answer to any of the questions above is 'no', then you've got a spot to
further debug. (All of this might be easiest to check on a very coarse mesh,
say a 2x2 mesh.) Right now, all you see is that the *end result* is wrong.
You've got to narrow things down to a smaller part of the code, and the
questions above should help you with it!
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: [email protected]
www: 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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/9943ac10-bb84-b55c-f66a-aec9f87b069f%40colostate.edu.