<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 7 Mar 2016, at 13:50, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="gmail_extra">
<div class="gmail_quote">On Mon, Mar 7, 2016 at 6:58 AM, Lukasz Kaczmarczyk <span dir="ltr" class="">
<<a href="mailto:Lukasz.Kaczmarczyk@glasgow.ac.uk" target="_blank" class="">Lukasz.Kaczmarczyk@glasgow.ac.uk</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br class="">
<br class="">
I run multi-grid solver, with adaptivity, works well, however It is some space for improving efficiency. I using hierarchical approximation basis, for which<br class="">
construction of interpolation operators is simple, it is simple injection.<br class="">
<br class="">
After each refinement level (increase of order of approximation on some element) I rebuild multigrid pre-conditioner with additional level. It is a way to add dynamically new levels without need of rebuilding whole MG pre-conditioner.<br class="">
</blockquote>
<div class=""><br class="">
</div>
<div class="">That does not currently exist, however it would not be hard to add, since the MG structure jsut consists of</div>
<div class="">arrays of pointers.</div>
<div class=""> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Looking at execution profile I noticed that 50%-60% of time is spent on MatPtAP function during PCSetUP stage.<br class="">
</blockquote>
<div class=""><br class="">
</div>
<div class="">Which means you are using a Galerkin projection to define the coarse operator. Do you have a direct way of defining</div>
<div class="">this operator (rediscretization)?</div>
</div>
</div>
</div>
</div>
</blockquote>
<br class="">
</div>
<div>Matt,</div>
<div><br class="">
</div>
<div><br class="">
</div>
<div>Thanks for swift response. You are right, I using Galerkin projection.</div>
<div><br class="">
</div>
<div>Yes, I have a way to get directly coarse operator, it is some sub matrix of whole matrix. I taking advantage here form hierarchical approximation. </div>
<div><br class="">
</div>
<div>I could reimplement PCSetUp_MG to set the MG structure directly, but this probably not good approach, since my implementation which will work with current petsc version could be incompatible which  future changes in native MG data structures. The alternative
 option is to hack MatPtAP itself, and until petsc MG will use this, whatever changes you will make in MG in the future my code will work.</div>
<div><br class="">
</div>
<div>PS.</div>
<div>Current, not efficient enough implementation is here,</div>
<div><a href="http://userweb.eng.gla.ac.uk/lukasz.kaczmarczyk/MoFem/html/_p_c_m_g_set_up_via_approx_orders_8cpp_source.html" class="">http://userweb.eng.gla.ac.uk/lukasz.kaczmarczyk/MoFem/html/_p_c_m_g_set_up_via_approx_orders_8cpp_source.html</a></div>
<div class=""><br class="">
</div>
Kind regards,
<div class="">Lukasz<br class="">
<div class="">
<div class=""><br class="">
</div>
</div>
</div>
</body>
</html>