<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 27, 2013 at 7:09 PM, Amneet Bhalla <span dir="ltr"><<a href="mailto:mail2amneet@gmail.com" target="_blank">mail2amneet@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>static const int NO_COMPS = ...;</div>
<div>Vec array_x[NO_COMPS] = {.....};</div><div>Vec x;</div><div>VecCreateNest(PETSC_COMM_WORLD, NO_COMPS, PETSC_NULL, array_x, &x);</div><div><br></div><div>for(int n = 0; n < NO_COMPS; ++n)</div><div>{</div><div>
Vec sub_x;</div><div><span style="white-space:pre-wrap"> </span>IS iset;</div><div><span style="white-space:pre-wrap"> </span>ISCreateGeneral(PETSC_COMM_WORLD, 1, &n, PETSC_COPY_VALUES, &iset); </div></blockquote>
<div><br></div><div style>The IS is supposed to address those entries in the Vec, not the blocking implied by the arguments to VecCreateNest. (Vec base does not have a concept of such "blocks".) Did you look at the examples I pointed you to?</div>
<div style><br></div><div style>We discussed this already and since you are dedicated to not defining a global space, you'll have to use VecNestGetSubVec().</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><br></div><div><span style="white-space:pre-wrap"> </span>VecGetSubVector(x, iset, &sub_x); </div><div> //<b>ERROR: Index set not found in nested Vec!</b></div></blockquote></div><br><br></div></div>