Time loop in step-26

59 views
Skip to first unread message

Kaushik Das

unread,
Dec 7, 2020, 9:20:16 AM12/7/20
to deal.II User Group
Hi all,
I have a question about the time loop in step-26. 
We are incrementing timestep_number at the beginning of the loop and it is initialized to 0 in the constructor. Should not then the if statement for pre_refinement will be only true just once when timestep_number = 1? 
Should not we decrement  timestep_number inside the if part of the loop?
Thank you,
Kaushik 

while (time <= 0.5)
{
time += time_step;
++timestep_number;
...

if ((timestep_number == 1) &&
(pre_refinement_step < n_adaptive_pre_refinement_steps))
{
...
}
else if ((timestep_number > 0) && (timestep_number % 5 == 0))
{
...
}
old_solution = solution;
}

Wolfgang Bangerth

unread,
Dec 7, 2020, 12:09:46 PM12/7/20
to dea...@googlegroups.com

Kaushik,
I think what you are saying is that when we go back to the
start_time_iteration label, we should reset time=0 and timestep_number=0. Is
that correct?

I think you discovered a bug in the program. I see that this seems to have
been right in 8.4.0:
https://dealii.org/8.4.0/doxygen/deal.II/step_26.html#codeHeatEquationruncode
but broken in 8.5.0:
https://dealii.org/8.5.0/doxygen/deal.II/step_26.html#codeHeatEquationruncode

So the bug must have been introduced between March 2016 and April 2017. It
would be interesting to figure out which pull request caused this, and then to
write a patch. Would you like to work on this?

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

Wolfgang Bangerth

unread,
Dec 7, 2020, 12:21:04 PM12/7/20
to dea...@googlegroups.com

> So the bug must have been introduced between March 2016 and April 2017. It
> would be interesting to figure out which pull request caused this,

It was #4083: https://github.com/dealii/dealii/pull/4083

I think if you add the two lines back, that would work. Do you want to write
such a patch, or would you like to leave that to us?

Best
W.

Kaushik Das

unread,
Dec 7, 2020, 1:57:49 PM12/7/20
to dea...@googlegroups.com
Thank you Prof. Bangerth. 
I would love to help. Do I have to create a fork on my git account and push through that? Or can I will create a new branch on deal.ii and push there? 
I was working on converting step-26 to use a distributed triangulation and parallel solvers following step-40, and it seems that it worked. But I have a few questions, that I will ask in a separate email.
Thank you again for your help.
-Kaushik 



--
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/IYeaNcpjlHk/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/dfd34a71-e981-87fb-1257-d7bbd695e6c7%40colostate.edu.

Wolfgang Bangerth

unread,
Dec 7, 2020, 2:57:55 PM12/7/20
to dea...@googlegroups.com
On 12/7/20 11:56 AM, Kaushik Das wrote:
> I would love to help. Do I have to create a fork on my git account and push
> through that? Or can I will create a new branch on deal.ii and push there?

There's a good description of the process here:
https://github.com/dealii/dealii/wiki/Contributing

I'm looking forward to the patch!
Best
Wolfgang

Kaushik Das

unread,
Dec 10, 2020, 4:10:00 PM12/10/20
to dea...@googlegroups.com
Hello Prof Bangerth:
Unfortunately, I now think it may be better for me not to create a pull request to fix this issue in example-26 just so I don't inadvertently create an IP related conflict with my employer. It's a low chance but still, I think it's better I don't do this. 
Thank you for the help in resolving this.
Kaushik 

--
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/IYeaNcpjlHk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.

Wolfgang Bangerth

unread,
Dec 10, 2020, 4:27:20 PM12/10/20
to dea...@googlegroups.com
On 12/10/20 2:08 PM, Kaushik Das wrote:
> Unfortunately, I now think it may be better for me not to create a pull
> request to fix this issue in example-26 just so I don't inadvertently create
> an IP related conflict with my employer. It's a low chance but still, I think
> it's better I don't do this.

OK, no worries. We understand these sorts of issues. I already opened an issue
here:
https://github.com/dealii/dealii/issues/11349
We'll get it done before the next release. Thanks for reporting the issue!
Reply all
Reply to author
Forward
0 new messages