<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 30, 2013 at 10:13 AM, <span dir="ltr"><<a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">
Hello<div>I want to identify boundary faces to set their boundary condition type. Following some of the examples, I created the following function. To find the location of the face, I need to know the coordinates (xf,yf) of the face center using which I can figure out where the face lies. Is this possible to find ?</div>
<div><br></div><div>Thanks</div><div>praveen</div></div></blockquote></div><br>Hello</div><div class="gmail_extra"><br></div><div class="gmail_extra">By looking at this</div><div class="gmail_extra"><br></div><div class="gmail_extra">
<a href="http://nek5000.mcs.anl.gov/index.php/Element_Definition">http://nek5000.mcs.anl.gov/index.php/Element_Definition</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">I made the following code. This is a 2d problem and in blue part below I am getting face midpoint coordinates. I am not sure I have got the numbering of the faces correct.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Thanks</div><div class="gmail_extra">praveen</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace">C=======================================================================</font></div>
<div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> subroutine usrdat2</font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"><br>
</font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> include 'SIZE'</font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> include 'TOTAL'</font></div>
<div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"><br></font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> parameter(XTOL=1e-10)</font></div>
<div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> character*3 cbv</font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> integer e, f</font></div>
<div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> real xmin, xmax, ymax, xf(4), yf(4)</font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"><br>
</font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> xmin = -5.0</font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> xmax = +10.0</font></div>
<div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> ymax = 3.0</font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"><br>
</font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace">c set boundary conditions</font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> do e = 1,nelv</font></div>
<div class="gmail_extra"><font class="" style="background-color:rgb(255,255,255)" color="#0000ff" face="'courier new', monospace"> xf(3) = 0.5*(xm1(1, 1, 1,e) + xm1(nx1,1, 1,e))</font></div><div class="gmail_extra">
<font class="" style="background-color:rgb(255,255,255)" color="#0000ff" face="'courier new', monospace"> xf(2) = 0.5*(xm1(nx1,1, 1,e) + xm1(nx1,ny1,1,e))</font></div><div class="gmail_extra"><font class="" style="background-color:rgb(255,255,255)" color="#0000ff" face="'courier new', monospace"> xf(4) = 0.5*(xm1(1, ny1,1,e) + xm1(nx1,ny1,1,e))</font></div>
<div class="gmail_extra"><font class="" style="background-color:rgb(255,255,255)" color="#0000ff" face="'courier new', monospace"> xf(1) = 0.5*(xm1(1, ny1,1,e) + xm1(1, 1, 1,e))</font></div><div class="gmail_extra">
<font class="" style="background-color:rgb(255,255,255)" color="#0000ff" face="'courier new', monospace"> yf(3) = 0.5*(ym1(1, 1, 1,e) + ym1(nx1,1, 1,e))</font></div><div class="gmail_extra"><font class="" style="background-color:rgb(255,255,255)" color="#0000ff" face="'courier new', monospace"> yf(2) = 0.5*(ym1(nx1,1, 1,e) + ym1(nx1,ny1,1,e))</font></div>
<div class="gmail_extra"><font class="" style="background-color:rgb(255,255,255)" color="#0000ff" face="'courier new', monospace"> yf(4) = 0.5*(ym1(1, ny1,1,e) + ym1(nx1,ny1,1,e))</font></div><div class="gmail_extra">
<font class="" style="background-color:rgb(255,255,255)" color="#0000ff" face="'courier new', monospace"> yf(1) = 0.5*(ym1(1, ny1,1,e) + ym1(1, 1, 1,e))</font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> do f = 1,2*ndim</font></div>
<div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> cbv = cbc(f,e,1)</font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> if (cbv.ne.'E ') then ! This is boundary edge</font></div>
<div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> if(abs(xf(f)-xmin).lt.XTOL)then</font><br></div><div class="gmail_extra">
<font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> cbc(f,e,1) = 'v ' ! inlet</font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> else if(abs(xf(f)-xmax).lt.XTOL)then</font></div>
<div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> cbc(f,e,1) = 'O ' ! outlet</font></div><div class="gmail_extra">
<font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> else if(abs(yf(f)-ymax).lt.XTOL)then</font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> cbc(f,e,1) = 'SYM' ! top wall</font></div>
<div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> else</font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> cbc(f,e,1) = 'W ' ! bottom wall</font></div>
<div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> endif</font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> endif</font></div>
<div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> enddo</font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> enddo</font></div>
<div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"><br></font></div><div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> return</font></div>
<div class="gmail_extra"><font class="" color="#ff0000" style="background-color:rgb(255,255,255)" face="'courier new', monospace"> end</font></div><div><br></div></div></div>