Wave front not propagating through mesh modification on step 23, is Affine constraints wiping out my solution?

43 views
Skip to first unread message

Matthew Rich

unread,
Jul 30, 2022, 5:45:34 PM7/30/22
to deal.II User Group
Hi

I am trying a different time integration approach using the generalized alpha method rather then reposing with a velocity variable. I am also switching to the BC handled by affine constraints.  

I am not sure why the wave wont move through the mesh. I just see the BC at the edge which quickly fades out in the tutorial. 

Any hints or nudges would be appreciated code attached. 

Matt
step23alt.cc

Wolfgang Bangerth

unread,
Jul 30, 2022, 10:47:15 PM7/30/22
to dea...@googlegroups.com
Matthew -- I think you're asking too much of us as well of yourself. In
essence, your question reads
I started with code X which I know works. Then I made substantial changes
A, B, and C and the code is no longer working. Any help?
That's too many things at once one would have to check. Go back to the
original code and make one change at a time, then test. Make another check and
test. Go on like this. If you work along this strategy, you know which change
broke the functionality, and you can focus on these changes in trying to
figure out where the bug is.

If, in addition, you use version control (via git or subversion or any other
tool), you should commit every working version and you can always go back to
that. You can also clearly identify what changes you have made and list the
concrete lines where the newly introduced bug must be.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Matthew Rich

unread,
Jul 30, 2022, 11:16:13 PM7/30/22
to dea...@googlegroups.com
Fair point and thanks for the reply. 

However, I am not sure how to slowly morph the Step 23 tutorial into what I want to do. The different time integration approach is like swapping an engine from a car. You have to commit and hope the car starts at the end. My car will not turn over. I was hoping there was an obvious error in what I am doing since the solution being just zero is pretty stark. 

I will keep on looking at this. 



--
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 a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/KD341CckGvc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/b72eabc6-9e6e-227f-1b50-e228d411e268%40colostate.edu.

Wolfgang Bangerth

unread,
Jul 31, 2022, 5:44:15 PM7/31/22
to dea...@googlegroups.com
On 7/30/22 21:15, Matthew Rich wrote:
>
> However, I am not sure how to slowly morph the Step 23 tutorial into what I
> want to do. The different time integration approach is like swapping an engine
> from a car.

But you also switched the boundary conditions.


> You have to commit and hope the car starts at the end. My car will
> not turn over. I was hoping there was an obvious error in what I am doing
> since the solution being just zero is pretty stark.

Sorry, you'll have to debug this yourself I'm afraid :-( We don't have the
resources to do this for all of our users.

Matthew Rich

unread,
Jul 31, 2022, 8:22:42 PM7/31/22
to dea...@googlegroups.com
OK, 

One question regarding the statement about switching boundary conditions... How so? 

BoundaryValuesU is unchanged from the tutorial and directly integrating eliminates the need for a BC on velocity so I should still be aligned with the tutorial and the system described earlier in the tutorial. Maybe this is my problem that my assumption is incorrect? 

Anyways thanks for the correspondence. 

Matt

--
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 a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/KD341CckGvc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.

Wolfgang Bangerth

unread,
Aug 1, 2022, 5:55:13 PM8/1/22
to dea...@googlegroups.com
On 7/31/22 18:22, Matthew Rich wrote:
>
> One question regarding the statement about switching boundary conditions...
> How so?
>
> BoundaryValuesU is unchanged from the tutorial and directly integrating eliminates the need for a BC on velocity so I should still be aligned with the tutorial and the system described earlier in the tutorial. Maybe this is my problem that my assumption is incorrect?

I haven't looked at the code so I can't really comment on this.

But let me give you a philosophical framework: When you observe a bug in your
code, there is the tension between "I believe that I implemented the code
correctly" and "I observe that the output is not correct". These statements
are incompatible with each other. One or the other must be wrong. So stating
"I should still be aligned with the tutorial and the system described earlier
in the tutorial" is not a helpful approach. You made some changes in parts A,
B, C of the code and the result is no wrong. It's not productive to rule out
any of these as the source based on belief that they "must be correct" or
"should be correct". You can only rule them out if you actively test their
correctness.

Matthew Rich

unread,
Aug 3, 2022, 12:47:42 PM8/3/22
to dea...@googlegroups.com
Just to close this out in case others run into the same problem. The culprit was me declaring a local vector variable system_rhs in WaveEquation<dim>::run().  A careless mistake, which had the net effect of having my RHS just be zero since the global version of the variable, used in the solve function, is never touched or updated with anything.  After that was addressed, I was able to tweak some typos and now the solution matches the tutorial and the case is closed. 

I would like to ask about adding this approach to the tutorial of step 23 maybe at the bottom. For newcomers, it is not obvious how to deal with the 2nd order time derivative directly and there may be instances where my approach is better suited. It is also a much shorter program.

Matt

 

On Sat, 30 Jul 2022 at 22:47, Wolfgang Bangerth <bang...@colostate.edu> wrote:
--
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 a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/KD341CckGvc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.

Wolfgang Bangerth

unread,
Aug 3, 2022, 12:50:27 PM8/3/22
to dea...@googlegroups.com
On 8/3/22 10:47, Matthew Rich wrote:
>
> I would like to ask about adding this approach to the tutorial of step 23
> maybe at the bottom. For newcomers, it is not obvious how to deal with the 2nd
> order time derivative directly and there may be instances where my approach is
> better suited. It is also a much shorter program.

Yes, absolutely -- a section in the "Possibilities for extensions" would be
fantastic!

Alternatively, we could also put the corresponding program into the code
gallery if you would prefer that, with a note in step-23.

Best
Wolfgang
Reply all
Reply to author
Forward
0 new messages