<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><br></div> Are you referring to the text?<div><br></div><div><div>. `DM_BOUNDARY_MIRROR` - the ghost value is the same as the value 1 grid point in; that is, the 0th grid point in the real mesh acts like a mirror to define</div><div> the ghost point value; not yet implemented for 3d</div><div><br></div><div><br></div><div> Looking at the code for DMSetUp_DA_3D() I see</div><div><br></div><div> PetscCheck(stencil_type != DMDA_STENCIL_BOX || (bx != DM_BOUNDARY_MIRROR && by != DM_BOUNDARY_MIRROR && bz != DM_BOUNDARY_MIRROR), PetscObjectComm((PetscObject)da), PETSC_ERR_SUP, "Mirror boundary and box stencil");</div><div><br></div><div>which seems (to me) to indicate the mirroring is not done for box stencils but should work for star stencils.</div><div><br></div><div>Are you using a star stencil or a box stencil?</div><div><br></div><div>I believe the code is not complete for box stencil because the code to determine the location of the "mirrored point" for extra "box points" is messy in 3d and no one wrote it. You can compare DMSetUp_DA_2D() and DMSetUp_DA_3D() to see what is missing and see if you can determine how to add it for 3d.</div><div><br></div><div> Barry</div><div><br></div><div><br><blockquote type="cite"><div>On Jan 4, 2024, at 1:08 PM, Gourav Kumbhojkar <gourav.kumbhojkar@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Hi,</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">I am trying to implement a No-flux boundary condition for a 3D domain. I previously modeled a no flux boundary in 2D domain using DMDACreate2D and “PETSC_BOUNDARY_MIRROR” which worked well.</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">However, the manual pages say that the Mirror Boundary is not supported for 3D.</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Could you please point me to the right resources to implement no flux boundary condition in 3D domains?</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Regards,</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Gourav K.</div></div></div></blockquote></div><br></div></body></html>