<div class="gmail_extra">On Thu, Nov 8, 2012 at 10:31 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":1nj">This has been redone to remove Jed's objection (see new manual section). It now<br>
uses DM temp arrays,<br>
<br>
for(c = cStart; c < cEnd; ++c) {<br>
PetscInt numVals;<br>
PetscScalar *vals;<br>
<br>
DMComplexVecGetClosure(dm, section, vec, c, &numVals, &vals);<br>
/* Compute residual */<br>
DMComplexVecRestoreClosure(dm, section, vec, c, &numVals, &vals);<br>
DMComplexVecSetClosure(dm, section, resvec, c, vals, ADD_VALUES);<br>
<div class="im">}<br></div></div></blockquote><div><br></div><div>My other problem here is that VecGetArray() is potentially expensive (need to check coherence with other vectors, might not be contiguous for some Vec implementations).</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":1nj"><div class="im">
> 2. Add DMComplex-specific access routines so the user does not need to see<br>
> the PetscSection. Presumably this would be something like<br>
> DMComplexGetPointOffset(dm,c,&offset); // offset into owned part of global<br>
> vector?<br>
> DMComplexGetPointOffsetLocal(dm,c,&loffset); // offset into local vector<br>
<br>
</div>This is cumbersome because you must make another DM for every PetscSection<br>
you want to use.</div></blockquote><div><br></div><div>What other sections do users need? A trace space?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":1nj"> However, I am not completely against this now because<br>
DMComplexClone()<br>
is easy and accomplishes this.<br>
<div class="im"><br></div></div></blockquote><div>[...] </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":1nj"><div class="im">
<br>
</div>I hate cursors. I had the same experience with them no matter what<br>
they are called<br>
(iterators, etc.) You need so much information, that you end up with<br>
the whole object<br>
in this "external" thing. I think they never pay off.<br></div></blockquote><div><br></div><div>How do you intend to support many threads calling DMComplexVecGetClosure(), perhaps each with multiple buffers, without expensive instructions?</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":1nj"><div class="im"></div><div class="im">
<br>
</div>These are for multi-field splitting/</div></blockquote></div><br></div><div class="gmail_extra">Clearly, but why do they need to be in PetscSection? We already need DMs associated with fields.</div>