<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 4/5/14 1:41 AM, TAY wee-beng wrote:<br>
</div>
<blockquote cite="mid:533F430F.10600@gmail.com" type="cite">Hi,
<br>
<br>
Supposed, I use DM to construct my grid. I would like to know if
DM can be used to update the ghost values easily?
<br>
<br>
If I can use staggered grid, does it mean I have to create 3 DM
grids (x,y,z)?
<br>
</blockquote>
Yes this is how I do it currently. But this is not optimal, because
you have to scatter to ghost points four times (vx, vy, vz, p
separately). Just do it this way to start with, because by far it's
the simplest implementation.<br>
<br>
Alternatively you can create 2 distributed vectors, the one that
contains non-overlapping partitioning of the grid points (to setup
SNES, KSP, PC), and another overlapping one that contains all ghost
points you need to compute your residual/Jacobian. Depending on the
problem you solve this can be either star or box stencil (for each
solution component).<br>
<br>
Then setup scatter context.<br>
<a class="moz-txt-link-freetext" href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecScatterCreate.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecScatterCreate.html</a><br>
<br>
You can reuse the same context for both accessing off-processor
values and residual assembly, just need to change scatter mode
SCATTER_FORWARD / SCATTER_REVERSE and insert mode ADD_VALUES /
INSERT_VALUES<br>
<a class="moz-txt-link-freetext" href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecScatterBegin.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecScatterBegin.html</a><br>
<br>
Anton<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<blockquote cite="mid:533F430F.10600@gmail.com" type="cite">
<br>
Also, how can I solve the momentum eqn involving u,v,w using KSP?
<br>
<br>
What examples can I follow for the above requirements?
<br>
<br>
Thank you.
<br>
<br>
</blockquote>
<br>
</body>
</html>