<div dir="ltr">Hi:<div><br></div><div>I have been trying MatNest. I have two questions. </div><div><br></div><div>1. I have to call MatAssemblyBegin/End for both sub-matrices and for the MatNest object. From my experiment, if I miss any of those, I will get an error message </div><div>[0]PETSC ERROR: Object is in wrong state</div>[0]PETSC ERROR: Not for unassembled matrix<br><div><br></div><div>I am a bit confused because in the example <a href="https://www.mcs.anl.gov/petsc/petsc-current/src/snes/tutorials/ex70.c.html">https://www.mcs.anl.gov/petsc/petsc-current/src/snes/tutorials/ex70.c.html</a> The MatAssemblyBegin/End are only called for submatrices. I assume that example works correctly.</div><div><br></div><div>On the other hand, in the actual implementation, <a href="https://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/nest/matnest.c.html#MatAssemblyBegin_Nest">https://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/nest/matnest.c.html#MatAssemblyBegin_Nest</a>, I can see that the MatAssemblyBegin/End are already called for each sub-matrix. It seems that one should only call one MatAssemblyBegin/End for the big nest matrix. Unfortunately, I tried that and got an error message shown above. I must have misunderstood something.</div><div><br></div><div>2. From previous threads, Jed has strongly suggested using standard Vec instead of VecNest, unless there are strong reasons. In my case, since MatNest is already used as the underlying matrix object, the local element assembly will generate residual vectors for separate physics. So it is rather natural to put the right-hand side residual vector as a nest vector. Of course, a consequence is that I have to put every vector object in the nested format, since my experiments suggest VecNest cannot be used with standard Vec. My question is this. How mature is the VecNest implementation? Is it a good design to put every vector in the nest format?</div><div><br></div><div>Thanks,</div><div><br></div><div>Alex</div><div><br></div><div><br></div><div><br></div><div><br></div></div>