<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Alfredo<div class=""><br class=""></div><div class="">Take a look at VecStrideGather and VecStrideScatter….maybe these are what you want?</div><div class=""><br class=""></div><div class=""><a href="https://petsc.org/release/docs/manualpages/Vec/VecStrideGather.html" class="">https://petsc.org/release/docs/manualpages/Vec/VecStrideGather.html</a></div><div class=""><br class=""></div><div class=""><a href="https://petsc.org/release/docs/manualpages/Vec/VecStrideScatter.html" class="">https://petsc.org/release/docs/manualpages/Vec/VecStrideScatter.html</a></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Randy M.</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 11, 2021, at 12:33 PM, Alfredo J Duarte Gomez <<a href="mailto:aduarteg@utexas.edu" class="">aduarteg@utexas.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Good morning,<div class=""><br class=""></div><div class="">I am currently handling a structured dmda object with more than one field.</div><div class=""><br class=""></div><div class="">In some intermediate operations, I have to create and handle vectors of a size that corresponds to the same dmda with one field only.</div><div class=""><br class=""></div><div class="">After that, it would be very useful to concatenate these vectors and then use them with matrices of the size of the original dmda (more than one field), I hope the vectors keep their i,j structure from the dmda.</div><div class=""><br class=""></div><div class="">I tried using VecConcatenate but it seems to be scrambling the vector without the i,j arrangement, and the only other way I can think of is using a for loop over every grid point which seems cumbersome.</div><div class=""><br class=""></div><div class="">Any suggestions for this problem?</div><div class=""><br class=""></div><div class="">-Alfredo</div><div class=""><div class=""><div class=""><br class=""></div>-- <br class=""><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><font face="arial, sans-serif" class="">Alfredo Duarte</font><div class=""><font face="arial, sans-serif" class="">Graduate Research Assistant</font></div><div class=""><font face="arial, sans-serif" class="">The University of Texas at Austin</font></div></div></div></div></div></div></div></div>
</div></blockquote></div><br class=""></div></body></html>