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:
bang...@colostate.edu
www:
http://www.math.colostate.edu/~bangerth/