Re: [deal.II] Assemble system slowing down the program

2023-01-09 Thread Wasim Niyaz Munshi ce21d400
Thank you for pointing that out. After passing my solution vector as reference the assembly time has reduced from 2 seconds to 0.2 seconds. Thanks and regards Wasim Niyaz Research scholar CE Dept. IITM On Sun, 8 Jan, 2023, 7:31 pm Jean-Paul Pelteret, wrote: > Hi Wasim, > > It looks like

Re: [deal.II] Assemble system slowing down the program

2023-01-08 Thread Jean-Paul Pelteret
Hi Wasim, It looks like you're passing your solution vector by copy for each cell that you're assembling on. You probably want to pass it by reference. Best, Jean-Paul Sent from my mobile device. Please excuse my brevity and any typos. On Sun, 08 Jan 2023, 14:38 Wasim Niyaz Munshi ce21d400, <

Re: [deal.II] Assemble system slowing down the program

2023-01-08 Thread Wasim Niyaz Munshi ce21d400
Thank you Prof. Munch. I am now passing FEValues object as a parameter to the H_plus function. My assemble time has decreased from (4-5 seconds) to around 2 seconds, but it is still nowhere close to the time required if there is no call to h_plus function(say eg. step-3 tutorial problem). I

Re: [deal.II] Assemble system slowing down the program

2023-01-08 Thread Wasim Niyaz Munshi ce21d400
Do I need to make this change in both declaration and definition? Also, do I need a* const *because then* fe_values.reinit(cell) *will be discarded? Thanks Wasim On Sun, Jan 8, 2023 at 3:44 PM Peter Munch wrote: > Change: > > > float H_plus(Vector solution_elastic, const auto cell,const >

Re: [deal.II] Assemble system slowing down the program

2023-01-08 Thread Peter Munch
Change: > float H_plus(Vector solution_elastic, const auto cell,const unsigned int q_point, * FEValues<2> fe_values_damage*); to: > float H_plus(Vector solution_elastic, const auto cell,const unsigned int q_point, * const FEValues<2> & fe_values_damage*); Peter On

Re: [deal.II] Assemble system slowing down the program

2023-01-08 Thread Wasim Niyaz Munshi ce21d400
Thank you, Prof. Munch. I tried to pass the FEValues object as a parameter to the H_plus function as follows: I changed the function declaration from: float H_plus(Vector solution_elastic, const auto cell,const unsigned int q_point); to this: float H_plus(Vector solution_elastic, const auto

Re: [deal.II] Assemble system slowing down the program

2023-01-08 Thread Peter Munch
You are creating a new instance of FEValues at each quadrature point. This is a very expensive operation, since there all the shape functions are evaluated. Try to reuse that by passing it to the function as a parameter. Hope that helps! Peter On Sunday, 8 January 2023 at 09:58:41 UTC+1

Re: [deal.II] Assemble system slowing down the program

2023-01-08 Thread Wasim Niyaz Munshi ce21d400
Following is my H_plus function: float PhaseField::H_plus(Vector solution_elastic , const auto cell,const unsigned int q_point) { QGauss<2> quadrature_formula_damage(fe_damage.degree + 1); FEValues<2> fe_values_damage(fe_damage, quadrature_formula_damage,

Re: [deal.II] Assemble system slowing down the program

2023-01-07 Thread blais...@gmail.com
There might be many things that can be done to improve the speed of this function. You can ask yourselve the following question as guidance: - Does the function allocate memory? - Could it be inlined? - Are you calling the function inside the DOF loops or inside the quadrature loop? Then I

Re: [deal.II] Assemble system slowing down the program

2023-01-07 Thread Wolfgang Bangerth
On 1/6/23 22:01, Wasim Niyaz Munshi ce21d400 wrote: H_plus is being called in Assemble_damage and not assemble_elastic. It uses elastic solution, cell and gauss point to evaluate strain at a gauss point. Then some quantity is evaluated based on the strain. Similarly I have another function

Re: [deal.II] Assemble system slowing down the program

2023-01-06 Thread Wasim Niyaz Munshi ce21d400
Sorry for the confusion. I think I made a mistake while writing the first email. H_plus is being called in Assemble_damage and not assemble_elastic. It uses elastic solution, cell and gauss point to evaluate strain at a gauss point. Then some quantity is evaluated based on the strain. Similarly

Re: [deal.II] Assemble system slowing down the program

2023-01-06 Thread Wasim Niyaz Munshi ce21d400
I use it to evaluate strain at Gauss points. Then, i evaluate some quantity which is a function of this strain. Wasim Niyaz Research scholar CE Dept. IITM On Sat, 7 Jan, 2023, 3:09 am Wolfgang Bangerth, wrote: > On 1/6/23 13:53, Wasim Niyaz Munshi ce21d400 wrote: > > I am using 65536 elements.

Re: [deal.II] Assemble system slowing down the program

2023-01-06 Thread Wolfgang Bangerth
On 1/6/23 13:53, Wasim Niyaz Munshi ce21d400 wrote: I am using 65536 elements. For step-8 the assembly takes very less time (around 0.15second) while for my assemble_elastic, it takes around 5 seconds. The only difference between my assemble_elastic function and the assemble function of step-8

[deal.II] Assemble system slowing down the program

2023-01-06 Thread Wasim Niyaz Munshi ce21d400
Hello everyone. I am trying to solve elasticity and laplace equations one after the other. The elasticity solution feeds as input to the laplace equation (stiffness matrix of laplace equation depends on elasticity solution) and vice versa. I am using 65536 elements. For step-8 the assembly takes