Re: [deal.II] Regarding changing the Dimensions of and input data size of Wave Eqaution(step-23)

2023-11-02 Thread Jai
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.

On Thursday, 2 November 2023 at 14:42:36 UTC+5:30 Jai wrote:

> 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.
>
>
> On Thursday, 2 November 2023 at 13:16:39 UTC+5:30 simrn...@gmail.com 
> wrote:
>
>> 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, 
>>
>>
>>
>>
>> On Thu, 2 Nov 2023, 10:46 Jai,  wrote:
>>
>>> 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 
>>>   void WaveEquation::solve_u()
>>>{
>>> SolverControlsolver_control(1000, 1e-8 * 
>>> system_rhs.l2_norm());
>>>SolverCG> 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.
>>>
>>> -- 
>>> 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
>>>  
>>> 
>>> .
>>>
>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/ac4f30de-fea4-4e5a-aafc-0d131cd19712n%40googlegroups.com.


[deal.II] Re: Utilities::MPI::broadcas doesn't work

2023-11-02 Thread Bruno Turcksin
Hello,

broadcast returns the updated value. tt is unchanged. See the documentation 
here 


Best,

Bruno

On Thursday, November 2, 2023 at 10:26:46 AM UTC-4 ztdep...@gmail.com wrote:

> I tried to sent a double vector with size of 5 to all other cpus. 
> but it seems no values have been broadcase out.
> only the root has values in tt vector. all other cpus only have zero 
> values in tt. 
>  Could you please help me out.
>
> vector tt(5);
>  if(Utilities::MPI::this_mpi_process(mpi_communicator)==0) {
>   for(int i=0;i   Utilities::MPI::broadcast(mpi_communicator,tt);
>  
>   
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/9a921ab4-680c-4eec-a93a-983209eb39d5n%40googlegroups.com.


[deal.II] Utilities::MPI::broadcas doesn't work

2023-11-02 Thread ztdep...@gmail.com
I tried to sent a double vector with size of 5 to all other cpus. 
but it seems no values have been broadcase out.
only the root has values in tt vector. all other cpus only have zero values 
in tt. 
 Could you please help me out.

vector tt(5);
 if(Utilities::MPI::this_mpi_process(mpi_communicator)==0) {
  for(int i=0;ihttp://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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/9a9327ff-62de-45fc-9fdd-9821521a60ben%40googlegroups.com.


Re: [deal.II] how to use const std::function< T(const T &, const T &)> & combiner

2023-11-02 Thread Daniel Arndt
It's simply a function that takes two arguments of the same type by
reference and returns a new value of that type.
For a sum reduction using doubles, you could pass in in a lambda, for
example:

[](const double& a, const double& b) {return a+b;}

Best,
Daniel

On Thu, Nov 2, 2023 at 9:03 AM ztdep...@gmail.com 
wrote:

> I want to use the mpi::all_reduce to add some values from every processes.
> but i don't know how to set the "const std::function< T(const T &, const T
> &)> &   combiner".
> Could you please give me some help about it?
>
>  Utilities::MPI::all_reduce ( const T &   local_value,
> const MPI_Comm &   comm,
> const std::function< T(const T &, const T &)> &   combiner
> )
>
> const std::function< T(const T &, const T &)> &   combiner
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/801ac1c2-cc05-490d-8683-e55613e655fen%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CAOYDWb%2BK6D652ZxuMR85i3KPrEvN2tmK0GTheNr-KhtCTJ1egg%40mail.gmail.com.


[deal.II] how to use const std::function< T(const T &, const T &)> & combiner

2023-11-02 Thread ztdep...@gmail.com
I want to use the mpi::all_reduce to add some values from every processes. 
but i don't know how to set the "const std::function< T(const T &, const T 
&)> &   combiner". 
Could you please give me some help about it?

 Utilities::MPI::all_reduce ( const T &   local_value,
const MPI_Comm &   comm,
const std::function< T(const T &, const T &)> &   combiner 
) 

const std::function< T(const T &, const T &)> &   combiner 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/801ac1c2-cc05-490d-8683-e55613e655fen%40googlegroups.com.


Re: [deal.II] Regarding changing the Dimensions of and input data size of Wave Eqaution(step-23)

2023-11-02 Thread Jai
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.


On Thursday, 2 November 2023 at 13:16:39 UTC+5:30 simrn...@gmail.com wrote:

> 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, 
>
>
>
>
> On Thu, 2 Nov 2023, 10:46 Jai,  wrote:
>
>> 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 
>>   void WaveEquation::solve_u()
>>{
>> SolverControlsolver_control(1000, 1e-8 * 
>> system_rhs.l2_norm());
>>SolverCG> 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.
>>
>> -- 
>> 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
>>  
>> 
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/fb762d73-b4e7-4970-8723-e3bdcb578611n%40googlegroups.com.


Re: [deal.II] Regarding changing the Dimensions of and input data size of Wave Eqaution(step-23)

2023-11-02 Thread Jai
1) 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.

On Thursday, 2 November 2023 at 13:16:39 UTC+5:30 simrn...@gmail.com wrote:

> 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, 
>
>
>
>
> On Thu, 2 Nov 2023, 10:46 Jai,  wrote:
>
>> 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 
>>   void WaveEquation::solve_u()
>>{
>> SolverControlsolver_control(1000, 1e-8 * 
>> system_rhs.l2_norm());
>>SolverCG> 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.
>>
>> -- 
>> 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
>>  
>> 
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/af3e46a2-5692-42e7-af40-12add982ba66n%40googlegroups.com.


Re: [deal.II] Regarding changing the Dimensions of and input data size of Wave Eqaution(step-23)

2023-11-02 Thread Simranjeet Singh
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,




On Thu, 2 Nov 2023, 10:46 Jai,  wrote:

> 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 
>   void WaveEquation::solve_u()
>{
> SolverControlsolver_control(1000, 1e-8 *
> system_rhs.l2_norm());
>SolverCG> 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.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/7d54e428-1fb3-4bb9-a5d8-bd9284ad53b7n%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CAH2bA6Z7KF9hs3YjQqhD8m0uNE7tR5zyUWUTfEZZywz3H3bN_Q%40mail.gmail.com.