Hi Sarah,
> I've been working to modify the Step 26 tutorial to include a radiative
> boundary condition on one edge and am running into an issue combining this
> with adaptive mesh refinement. Although the boundary condition and adaptive
> refinement both seem to be working separately, I get large artifacts at the
> radiative boundary after each timestep where I refine the mesh.
Without actually debugging your code, I think you've collected a number of
symptoms already that should point you in the right direction:
> During my attempts to debug I've found several other strange symptoms:
>
> 1) This problem doesn't occur after I initially refine the mesh (presumably
> since I set it to a predefined initial temperature?)
>
> 2) The artifacts don't appear if I run the code without ever calling
> refine_mesh() (near-identical to the function by the same name in the tutorial
> code), but they /do/ appear if I call refine_mesh() but set the refine/coarsen
> fractions to 0 so no refinement actually occurs.
So the mismatch between expectation and reality here is that you assume that
when the fractions are set to zero, that the function should not actually do
anything -- but that it does something after all. Your job in debugging this
is to figure out that *something* is, and that shouldn't be too hard to do:
Because you assume that the function doesn't do anything, you could call it
and gradually remove lines of code from the function. You *know* that it does
something to your program, so when you remove a line and suddenly start
getting the right results, you have figured out what line caused the mismatch.
This may not be the line that has the bug, but since there is a piece of your
program that you don't understand what it does or why, having an understanding
what part of the function it is is a good start.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email:
bang...@colostate.edu
www:
http://www.math.colostate.edu/~bangerth/