<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jan 15, 2018 at 8:28 PM, 서승진 (기계항공및원자력공학부) <span dir="ltr"><<a href="mailto:mistloin@unist.ac.kr" target="_blank">mistloin@unist.ac.kr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div id="gmail-m_7279604020525382251divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0px;margin-bottom:0px">sorry, I mean that</p>
<p style="margin-top:0px;margin-bottom:0px"><span><strong>My geometry is a rectangle</strong>.</span></p>
<p style="margin-top:0px;margin-bottom:0px">That means, geometry is just rectangle box shape with four boundary.</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">My question is that, how can I set the four boundary condition individually in example 12 of SNES?</p></div></div></blockquote><div><br></div><div>You put a different marker on each side. The easiest way to do it is to give the</div><div><br></div><div>  -dm_plex_separate_marker</div><div><br></div><div>option. This is done in SNES ex69.</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:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div id="gmail-m_7279604020525382251divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0px;margin-bottom:0px">(I think that the boundary condition should be added in right side of the weak form, where load vector f and test function term is included. However, in example of petsc, boundary condition is applied as general
 form.)</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">Seungjin Seo<br>
</p>
</div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_7279604020525382251divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><span class="gmail-"><b>보낸 사람:</b> Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>><br>
</span><b>보낸 날짜:</b> 2018년 1월 15일 월요일 오후 11:06:18<br>
<b>받는 사람:</b> 서승진 (기계항공및원자력공학부)<br>
<b>참조:</b> Smith, Barry F.; <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a><div><div class="gmail-h5"><br>
<b>제목:</b> Re: [petsc-users] I have a question for PETSc example</div></div></font>
<div> </div>
</div><div><div class="gmail-h5">
<div class="gmail-m_7279604020525382251BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="gmail-m_7279604020525382251PlainText"><br>
   The term "rectangular mesh" usually refers to a "structured grid mesh" so it is not clear if you truly need an unstructured grid. Take a look at src/snes/examples/tutorials/<wbr>ex19.c
<br>
<br>
  Barry<br>
<br>
<br>
> On Jan 15, 2018, at 1:03 AM, 서승진 (기계항공및원자력공학부) <<a href="mailto:mistloin@unist.ac.kr" target="_blank">mistloin@unist.ac.kr</a>> wrote:<br>
> <br>
> Dear PETSc-user<br>
> <br>
> I am Seungjin Seo, researcher of Korean Advanced Institute of Science and Technology, South Korea.<br>
> <br>
> I am tring to understand the ex12.c in SNES examples, and I have a problem...<br>
> Could you give me some advise? Is there any good description or materials for PetscFE and DMPlex?<br>
>  <br>
> I will make a code with unstructured grid with PetscFE and SNES. My geometry is a rectangle mesh (the size is not fixed so I think this is unstructured grid).<br>
> The equation is  <br>
> I will set boundry conditions as follow;<br>
>   1. (Top-side boundary) Neumann boundary<br>
>   2. (Bottom-side boundary) Neumann boundary<br>
>   3. (Left-side boundary) Dirichlet boundary<br>
>   4. (Right-side boundary) Dirichlet boundary<br>
> <br>
> In example ex12.c in SNES, load vector f is defiend as f_0, and neumann boundary condition is defined as f_bd_0. f_1 means the test function gradient term. The example set general type of neumann boundary condition on f_bd_0, but I want to set each boundary
 condition individually. Could you give me some advise?<br>
> <br>
> Thansk for reading my email.<br>
> <br>
> Best regard,<br>
> Seungjin Seo<br>
> <br>
> <br>
> <br>
> 보낸 사람: Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>><br>
> 보낸 날짜: 2017년 12월 21일 목요일 오후 3:46:42<br>
> 받는 사람: 서승진 (기계항공및원자력공학부)<br>
> 참조: <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a><br>
> 제목: Re: [petsc-users] I have a question for PETSc example<br>
>  <br>
> <br>
>   In deed you can, yes many PETSc examples only feature a single field for simplicity, but multiple fields are fine. You simple provide your FormFunction and FormJacobian to handle both degrees of freedom per cell/node at the same time. You use SNES or TS
 depending on if your problem is time dependent and then use -pc_type lu to start. Once you have the physics correct come back and ask us about optimizing the linear solver with preconditioners; but until you have the physics correct it is absurd to waste time
 worrying about making the linear solver efficient. What you want to do, many people do and is not a big deal.<br>
> <br>
>    Barry<br>
> <br>
> <br>
> > On Dec 21, 2017, at 12:27 AM, 서승진 (기계항공및원자력공학부) <<a href="mailto:mistloin@unist.ac.kr" target="_blank">mistloin@unist.ac.kr</a>> wrote:<br>
> > <br>
> > Dear PETSc-user<br>
> >  <br>
> >  <br>
> > I am Seungjin Seo, researcher of Korean Advanced Institute of Science and Technology, South Korea.<br>
> >  <br>
> > <br>
> > <br>
> > I am trying to solve thermal and fluid equations within a porous structure.<br>
> > The thermal equation includes a non-linear term of pressure and the fluid equation has a boundary condition using temperature gradient.<br>
> > Is there any way I can solve these two equations at the same time, instead of solving temperature first with previous pressure distribution and then pressure and update temperature?<br>
> > Many examples solve only one PDF instead of coupling several physics.<br>
> > Please recommend me which solver is appropriate for my case?<br>
> > <br>
> > Best regards,<br>
> > Seungjin Seo<br>
<br>
</div>
</span></font></div>
</div></div></div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>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><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div>
</div></div>