<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jan 22, 2015 at 12:08 PM, Luc Berger-Vergiat <span dir="ltr"><<a href="mailto:lb2653@columbia.edu" target="_blank">lb2653@columbia.edu</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">Hi all,<br>
I'm trying to test some functionalities in DMPlex, specifically I want to do a 2d fem simulation using a mesh generated by GMSH.<br>
At this point I am trying to understand how Dirichlet BC can be applied.<br>
<br>
Can you explain to me what arguments I have to pass to:<br>
DMPlexAddBoundary()?<br></blockquote><div><br></div><div><div> ierr = DMPlexAddBoundary(dm, PETSC_TRUE,"wall","marker",(void (*)())top_displacement,1,&id,user)</div></div><div><br></div><div>PETSC_TRUE means that these unknowns will be eliminated from the global system</div><div><br></div><div>"wall" is the name of the BC</div><div><br></div><div>"marker" is the name of the DMLabel that you want to use to identify the mesh points</div><div><br></div><div>1 is the number of label IDs that identify constrained mesh points</div><div><br></div><div>id is the label ID which identifies constrained mesh points</div><div><br></div><div>top_displacement is the function used to set boundary values</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">
I am attaching a little bit of c code and my mesh.geo and mesh.msh so that you understand the context.<br>
The BCs I want to apply are displacement of 0.2 in the y direction if y==1.0<br>
0.0 in the x direction if y==0.0</blockquote><div><br></div><div>I might do this:</div><div><br></div><div><div>void top_displacement(const PetscReal x[], PetscScalar *u, void *ctx)</div><div>{</div><div> *u = x[1] < PETSC_MACHINE_EPSILON ? 0.0 : 0.2;</div><div>}</div></div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</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"><span class=""><font color="#888888"><br>
-- <br>
Best,<br>
Luc<br>
<br>
</font></span></blockquote></div><br><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>