<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">
</span>I used<br>
<br>
        CALL PCFieldSplitSetIS(PRECON,PETSC_NULL_CHARACTER,ISU,IERR)<br>
        ...<br>
<span class=""><br></span></blockquote><div><br></div><div>Here are two suggestions to play with:<br></div><div><br></div><div>[1] When using the same object for the operator and preconditioner, <br>you will need to fieldsplit factorization type = schur. <br>This require two-splits (U,p). <br>Thus, your basic field split configuration will look like<br><br>-coupledsolve_pc_type fieldsplit<br>-coupledsolve_pc_fieldsplit_0_fields 0,1,2 <br>-coupledsolve_pc_fieldsplit_1_fields 3<br>-coupledsolve_pc_fieldsplit_type SCHUR<br><br></div><div>Petsc has some support to generate approximate pressure schur complements for you, but these will not be as good as the ones specifically constructed for you particular discretization.<br></div><div><br></div><div>If you want to perform solves on you scalar sub-problems (e.g. you have a nice AMG implementation for each scalar block), you will need to split UU block again (nested fieldsplit)<br></div><div><br></div><div>[2] If you assembled a different operator for your preconditioner in which the B_pp slot contained a pressure schur complement approximation, you could use the simpler and likley more robust option (assuming you know of a decent schur complement approximation for you discretisation and physical problem)<br><br>-coupledsolve_pc_type fieldsplit<br>-coupledsolve_pc_fieldsplit_type MULTIPLICATIVE<br><br>which include you U-p coupling, or just<br><br>-coupledsolve_pc_fieldsplit_type ADDITIVE<br></div><div><br>which would define the following preconditioner<br></div><div>inv(B) = diag( inv(B_uu,) , inv(B_vv) , inv(B_ww) , inv(B_pp) ) <br></div><div><br></div><div>Option 2 would be better as your operator doesn't have an u_i-u_j, i != j coupling and you could use efficient AMG implementations for each scalar terms associated with u-u, v-v, w-w coupled terms without having to split again.<br></div><div><br></div><div>Also, fieldsplit will not be aware of the fact that the Auu, Avv, Aww blocks are all identical - thus it cannot do anything "smart" in order to save memory. Accordingly, the KSP defined for each u,v,w split will be a unique KSP object. If your A_ii are all identical and you want to save memory, you could use MatNest but as Matt will always yell out, "MatNest is ONLY a memory optimization and should be ONLY be used once all solver exploration/testing is performed". <br></div><div><br></div><div> <span class=""></span><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
- A_pp is defined as the matrix resulting from the discretization of the<br>
pressure equation that considers only the pressure related terms.<br></blockquote><div><br></div><div>Hmm okay, i assumed for incompressible NS the pressure equation <br></div><div>that the pressure equation would be just \div(u) = 0.<br><br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Note that the matrix is not stored as this, since I use field<br>
interlacing.<br></blockquote><div><br></div><div>yeah sure<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class=""><div class="h5">><br>
><br>
> Cheers,<br>
><br>
>   Dave<br>
><br>
><br>
>         Each field corresponds to one of the variables (u,v,w,p).<br>
>         Considering<br>
>         the corresponding blocks A_.., the non-interlaced matrix would<br>
>         read as<br>
><br>
>         [A_uu   0     0   A_up]<br>
>         [0    A_vv    0   A_vp]<br>
>         [0      0   A_ww  A_up]<br>
>         [A_pu A_pv  A_pw  A_pp]<br>
><br>
>         where furthermore A_uu = A_vv = A_ww. This might be considered<br>
>         to<br>
</div></div></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">>         further improve the efficiency of the solve.<br>
><br>
>         You find attached the solver output for an analytical test<br>
>         case with 2e6<br>
>         cells each having 4 degrees of freedom. I used the<br>
>         command-line options:<br>
><br>
>         -log_summary<br>
>         -coupledsolve_ksp_view<br>
>         -coupledsolve_ksp_monitor<br>
>         -coupledsolve_ksp_gmres_restart 100<br>
>         -coupledsolve_pc_factor_levels 1<br>
>         -coupledsolve_ksp_gmres_modifiedgramschmidt<br>
><br>
>         Regards,<br>
>         Fabian Gabel<br>
><br>
><br>
><br>
<br>
<br>
</div></div></blockquote></div><br></div></div>