<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 1, 2016 at 9:58 AM, Max Rietmann <span dir="ltr"><<a href="mailto:max.rietmann@gmail.com" target="_blank">max.rietmann@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
Dear all,<br>
<br>
We are building out a new finite-element code for wave propagation
and I am currently implementing the boundary conditions. My first
pass will simply have dirichlet boundaries, but eventually we will
have more sophisticated options available.<br></div></blockquote><div><br></div><div>Is this going to be a purely explicit code?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF">
I am creating an exodus mesh in Trelis/Cubit, in which I can create
one (or more) "side sets", which are properly read by the exodus
reader. From reading the petsc source (plexexodusii.c), it seems
that these basically create a list of faces, which belong to the
side set.<br></div></blockquote><div><br></div><div>Yes.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF">
A call to DMPlexGetLabelValue(dm,"Face Set",face_id,&value),
allows me to see if "face_id" is on the boundary by checking value
(>=1 for boundary, or -1 for not in set). Additional side sets
get ids = {2,3,etc}. This allows us to have multiple types of
boundary (absorbing, reflecting, etc).<br></div></blockquote><div><br></div><div>Yes. Note that you can also extract them all at once into a sorted array.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF">
However, I am unsure how to determine if an element has a particular
face_id in order to determine if one face of the element is on a
boundary (and which value it has {-1,1,2,3, etc}).<br></div></blockquote><div><br></div><div>Here you can see me doing the thing you are asking for:</div><div><br></div><div> <a href="https://bitbucket.org/petsc/petsc/src/2d7a10a4145949cccd1c2cb7dc0d518dc12666a9/src/dm/impls/plex/plexsubmesh.c?at=master&fileviewer=file-view-default#plexsubmesh.c-106">https://bitbucket.org/petsc/petsc/src/2d7a10a4145949cccd1c2cb7dc0d518dc12666a9/src/dm/impls/plex/plexsubmesh.c?at=master&fileviewer=file-view-default#plexsubmesh.c-106</a></div><div><br></div><div>The code is slightly overkill for what you want since it also works for vertices. You could call</div><div><br></div><div> DMPlexGetSupport()</div><div><br></div><div>on the face rather than</div><div><br></div><div> DMPlexGetTransitiveClosure()</div><div><br></div><div>and the code would be simpler.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF">
The routine is listed here:<br>
<br>
PetscErrorCode DMPlexGetLabelValue(DM dm, const char name[],
PetscInt point, PetscInt *value)<br>
<br>
How do I determine the "point" of a face, if I'm iterating through
my elements.<br>
<br>
thanks!<span class=""><font color="#888888"><br>
<br>
Max Rietmann <br>
</font></span><br>
PS I've also seen the DMPlexAddBoundary method, but I wasn't sure
how to use it in our setting.<br>
</div>
</blockquote></div><br>This is used to hook into the DMPlexSetBoundaryValues() interface so that BC values are properly loaded into</div><div class="gmail_extra">local vectors before assembly operations.</div><div class="gmail_extra"><br></div><div class="gmail_extra"> Thanks,</div><div class="gmail_extra"><br></div><div class="gmail_extra"> Matt<br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>