Regarding changing the Dimensions of and input data size of Wave Eqaution(step-23)

55 views
Skip to first unread message

Jai

unread,
Nov 2, 2023, 1:16:17 AM11/2/23
to deal.II User Group
Hello All,
1) In the tutorial of deal.ii , an example of wave equation in 2D is given in step-23. Does changing  ( WaveEquation<2> wave_equation_solver) to (WaveEquation<1 or 3> wave_equation_solver) change the dimension of wave equation and will it be working fine.
If not please specify how can we change 2D wave equation to 1D and 3D or if there are examples of 1D and 3D please let me know. 
2) How can we change the input data size of the wave equation.
 template <int dim>
  void WaveEquation<dim>::solve_u()
   {
    SolverControl            solver_control(1000, 1e-8 * system_rhs.l2_norm());
   SolverCG<Vector<double>> cg(solver_control);
  cg.solve(matrix_u, solution_u, system_rhs, PreconditionIdentity());
   std::cout << "   u-equation: " << solver_control.last_step()
             << " CG iterations." << std::endl;
  }
I tried changing 1000 to 10,000 and 100,000 But the time taken by the program is still the same.
Thanks.

Simranjeet Singh

unread,
Nov 2, 2023, 3:46:39 AM11/2/23
to dea...@googlegroups.com
Hi,
1) You can try to run it on your own, and see if it works :)
2) The value "1000" is probably the max number of iterations allowed (The second argument is tolerance)
So maybe the solution converges before that, so you don't notice any difference in execution times.
Also, from what I understand, you need to change the initial conditions, boundary conditions or domain size to alter the problem.
Regards, 




--
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 dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/7d54e428-1fb3-4bb9-a5d8-bd9284ad53b7n%40googlegroups.com.
Message has been deleted

Jai

unread,
Nov 2, 2023, 5:12:36 AM11/2/23
to deal.II User Group
Thanks Simrn for the reply,
) I tried running by with 1,2 and 3 Dimensions it run successfully . 
  The time taken to run by different dimensions are as follows:
    1D- 0.015625 seconds
    2D- 5.8 minutes
   3D- 29.22 hours.


Jai

unread,
Nov 3, 2023, 1:17:43 AM11/3/23
to deal.II User Group
I tried by changing boundary, initial conditions but the execuation time reamained same. If there is any method to vary the execution time by varying any data size in wave equation (step-23) please mention.
Thank You.

Wolfgang Bangerth

unread,
Nov 3, 2023, 11:16:30 AM11/3/23
to dea...@googlegroups.com

On 11/2/23 23:17, Jai wrote:
> I tried by changing boundary, initial conditions but the execuation time
> reamained same. If there is any method to vary the execution time by
> varying any data size in wave equation (step-23) please mention.

Jai:
You're probably starting with the wrong tutorial program. These sorts of
issues are all discussed in the early tutorial programs, say steps 1-6.
Generally, if you want to change how long it takes a program to run, you
will want to change the number of cells in the mesh -- that is, the
number of mesh refinement cycles.

Best
W.
Reply all
Reply to author
Forward
0 new messages