<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>How to VecScatter from global to local vector, and then, VecGather back ?</div><div><br></div><div>This is a very simple use case: I need to split a global vector in local (possibly overlapping) pieces, then I need to modify each local piece (x2), and finally I need to assemble (+=) back local parts into a global vector.<br></div><div>Read the doc and went through examples... But still can't make this work: can I get some help on this ?<br></div><div><br></div><div>Note: running petsc-3.7.6 on debian with gcc-6.3<br></div><div><br></div><div>Thanks,<br></div><div><br></div><div>Franck<br></div><div><br></div><div>~> head -n 12 vecScatterGather.cpp<br>// How to VecScatter from global to local vector, and then, VecGather back ?<br>//<br>// global vector: 3x1 2 overlapping local vector: 2x1 global vector: 3x1<br>//<br>// x2<br>// |1 -> |2<br>// |1 scatter |1 |2 gather |2<br>// |1 -> -> |4<br>// |1 |1 -> |2 |2<br>// |1 |2<br>//<br>// ~> g++ -o vecScatterGather.exe vecScatterGather.cpp -lpetsc -lm; mpirun -n 2 vecScatterGather.exe<br><br><br></div></div></body></html>