Dear All,

I just got some concerns about the efficiency after reading the example misc.ex5. It may be due to my misunderstanding of the libmesh or the DG scheme. Would you guys please help me clear it. 

In this example, the Laplace equation is solved using DG with interior penalty method. So the main job is to compute the mass matrix from the element volume integration and surface jump integration. It is done element by element with the help of element iterator. I know all of the elements organized as a quad-forest and only the active items need to be looped. 

so does this mean when we need to reach to the next active element, const_element_iterator++ need to go through the quad-forest and pass several non-active parent elements then get to the correct element pointer to the next active element? If the answer is true. Is it too expensive to find an element in a solver?

The other thing is the metrics computing such as Jacobian, xi_x xi_y eta_x eta_y and face normal etc. Do those metrics computed several times using FE::FEMap? If the mesh is fixed in space, we only need to compute them once and store them somewhere. 

Same thing happens when computing quadrature points in physical domain and value of shape function/ its derivation at those points in computational domain. I think those are computed in 
----------------------
fe->reinit(elem)
----------------------
Those values do not change during the calculation and should be computed only once.  I think they are in the deepest loop and will eat a lot of cpu time.

Last one, to compute the flux jump at flux points on the common surface of two cells with different h levels. The coordinates and normals of the flux quadrature points on the both side of  element are computed several times if we use a residual based scheme. It does not change at each refinement level. Is there any efficient way to handle those kind of situation: flux jump calculation at a surface with hanging node? 

Or those are just for demo only. Those efficiency problem get even worse for a scheme need residual jacobian at each time step. Do we need to use FEMap explicitly and store the metrics for each element/face? So we don't need to compute them more than once.

Thanks a lot for your time. 



Sincerely Yours,

Lei Shi
----------