Hi, Thank you for taking a look. You are correct in that if I comment out VectorTools::interpolate_boundary_values in line 320, the solution does not change. If I understand you correctly, you are saying that the function apply_boundary_values defined in line 553 and called in line 630 must take in the system_matrix and must modify system_matrix in the same way I do the solution vector? This also means that when I call apply_boundary_values, I must move the location of this call until say line 646 or after I define system_matrix but before I solve?
Thank you. On Tuesday, April 27, 2021 at 11:59:14 PM UTC-4 Wolfgang Bangerth wrote: > > Nikki, > apologies for not getting to this any earlier! > > > I've recently implemented a 1d standard wave equation and have been > messing > > around with different boundary conditions. For instance, I have run my > code > > with 1 dirichlet and 1 neumann, 2 neumann, and 1 absorbing condition and > 1 > > neumann (as in step-24). When I run step-23 from the examples, which > utilizes > > Dirichlet conditions, you can easily see the expected behavior of a > phase flip > > after interaction from the boundary, i.e. as the source approaches the > > boundary it looks like a cap and after the boundary interaction it looks > like > > a cup. However, in all 3 cases that I have tried, listed above, I am not > > observing the phase flip. No matter what boundary I change the left one > to > > (dirichlet, neumann, absorbing) it seems to be giving me the same > neumann > > behavior. Do you have any idea why this might be? > > I don't see any specific thing that looks wrong, but then it's an 800 line > code -- not easy to see anything without spending a couple of hours with > it. > > But here's where I would start: Look at the difference between Dirichlet > and > Neumann cases. If I see this right, setting up Dirichlet conditions > happens in > line 319 for boundary zero, which in line 162 you seem to think of as the > right boundary. So does the call to > VectorTools::interpolate_boundary_values > actually do anything? If you comment it out, does it change anything? > > I suspect no: You put the result into the 'boundary_value_map' variable, > but > that's a local variable whose lifetime ends at the end of the function, > and it > is never used after calling VectorTools::interpolate_boundary_values. So > that > looks like a bug -- or at least a pointless piece of code. > > Of course, you do the same again in line 573. There, you seem to set the > elements of the solution vector to the correct boundary values, but you do > not > touch the matrix. But you need to adjust the matrix before you solve with > it > if you want to apply the correct set of boundary values -- take a look at > step-3, step-4, step-26, for example. In particular the last one. > > > 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/518ad080-4b59-401c-9110-ebb4dd54dd57n%40googlegroups.com.
