<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><style style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style><style style="display:none">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style></div><div>Sorry for an empty email before, it was a mistake. Here is my problem I was trying to make the blending coefficient(h) depending upon the volume of elements to have a mesh deoformation rigid near the walls (beasev = 1) and 0 at boundaries (beasev = 0). I had also seen a way to make blending coefficient from the papper that you had sent to me and it was there in an example called ocyl2.usr . But there is variable called delta which is an unknown scale to me and it depends up on the mesh. </div><div><br data-mce-bogus="1"></div><div>How ever, I have also seen another equation which deals with volumes of elements in mesh (you had mentioned in you papper also). I was successfully implemented that function on 2D cases by the code shown at the end. But when it becomes to 3D case, I realise that the volume of elements that i tried to capture is in a wrong way. So could you please help me to find the volume of element corresponding to all the grid points (I would like to have the element volume not the spectral elements volume for each grid points) for example if the spectral element order is 4. then it would have 25 small spectral elements in 1 big element right? What I would like to have what ever the grid point in that element I would like to have the element volume.<br></div><div><br data-mce-bogus="1"></div><div>that is if i tried like below,,<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>n = nx1*ny1*nz1*nelv<br data-mce-bogus="1"></div><div> do e=1,n<br> volume = bm1(e,1,1,1)<br> enddo<br data-mce-bogus="1"></div><div>it will throw spectral elements volume right?<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>and if i tried this,<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div> do e=1,nelt<br> vol(e) = volel(e)<br> enddo<br data-mce-bogus="1"></div><div>I will get element volume,<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>but i would like to create smoothing varibale for all grid points. That is i need h(n) not h(nelt) (n and nelt are the array sizes)<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Code which works for 2D<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div> v = volume(1,1,1,1)<br><br> a=glmax(v,1)<br> b=glmin(v,1)<br><br> <br> do i=1,nelv <br> denom = 1/a<br> h1(i) = ((1-(b/a))/(denom*v))<br> enddo<br> <br data-mce-bogus="1"></div><div>Regards<br></div><div><br data-mce-bogus="1"></div><div>Sijo<br data-mce-bogus="1"></div><div data-marker="__QUOTED_TEXT__"><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><br><hr id="zwchr"><div><b>De: </b>"nek5000-users" <nek5000-users@lists.mcs.anl.gov><br><b>À: </b>"nek5000-users" <nek5000-users@lists.mcs.anl.gov><br><b>Envoyé: </b>Mardi 27 Février 2018 13:28:54<br><b>Objet: </b>Re: [Nek5000-users] Volume of an element<br></div><br><div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Dear Sijo,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">The volume per grid point is given by the entries in bm1(i,j,k,e)</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">For each element e, there are points [i,j,k] with index ranges i=1,...,nx1</p>
<p style="margin-top:0;margin-bottom:0">j=1,...,ny1, k=1,...,nz1</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">You must reference elements by the 4th index (...,e).</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Fortunately, all the data is contiguous, so, if accessing _all_ points,</p>
<p style="margin-top:0;margin-bottom:0">you can use a loop like</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"> do i=1,n</p>
<p style="margin-top:0;margin-bottom:0"> volume_of_point_i = bm1(i,1,1,1)</p>
<p style="margin-top:0;margin-bottom:0"> enddo</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">You certainly do not need to do any summing if you only want the</p>
<p style="margin-top:0;margin-bottom:0">point wise volume.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Perhaps it'd be best if you indicate what exactly you are planning to</p>
<p style="margin-top:0;margin-bottom:0">do with the volume.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Finally, I see your use of glmax and glmin. How many processors</p>
<p style="margin-top:0;margin-bottom:0">are you using? If more than one, are you intending that they are</p>
<p style="margin-top:0;margin-bottom:0">all writing to the file hcoeff.dat?</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">hth,</p>
<p style="margin-top:0;margin-bottom:0">Paul</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
</div>
<hr style="display:inline-block;width:98%">
<div id="divRplyFwdMsg" dir="ltr"><span style="font-size: 11pt; color: #000000; font-family: Calibri,sans-serif;"><b>From:</b> Nek5000-users <nek5000-users-bounces@lists.mcs.anl.gov> on behalf of nek5000-users@lists.mcs.anl.gov <nek5000-users@lists.mcs.anl.gov><br>
<b>Sent:</b> Tuesday, February 27, 2018 4:45:30 AM<br>
<b>To:</b> nek5000-users<br>
<b>Subject:</b> Re: [Nek5000-users] Volume of an element</span>
<div> </div>
</div>
<div>
<div style="font-family:arial,helvetica,sans-serif; font-size:12pt; color:#000000">
<div>Thanks Paul for your Kind replay. You were right. I want to get the volume associated with each grid point. And I tried the code below, but at each time when I run I get different answers for volume so I think my ocde is not rubust. Could you please verify
my code below.<br>
</div>
<div> </div>
<div><br>
</div>
<div><br>
</div>
<div> nxyz = nx1*ny1*nz1<br>
n = nx1*ny1*nz1*nelv<br>
</div>
<div><br>
</div>
<div> vol = vlsum(bm1(1,1,1,1),nxyz)<br>
a=glmax(vol,1)<br>
b=glmin(vol,1)<br>
<br>
do e=1,n<br>
volume = vlsum(bm1(e,1,1,1),nxyz)<br>
open (unit=10,file="hcoeff.dat")<br>
write (10,7020) a,b,volume<br>
7020 format(7f20.14)<br>
enddo<br>
<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Regards<br>
</div>
<div><br>
</div>
<div>Sijo GEORGE<br>
</div>
<div><br>
</div>
<hr id="x_zwchr">
<div><b>De: </b>"nek5000-users" <nek5000-users@lists.mcs.anl.gov><br>
<b>À: </b>"nek5000-users" <nek5000-users@lists.mcs.anl.gov><br>
<b>Envoyé: </b>Lundi 26 Février 2018 21:46:02<br>
<b>Objet: </b>Re: [Nek5000-users] Volume of an element<br>
</div>
<div><br>
</div>
<div>
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Dear Sijo,</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">We typically refer to elements as the structures that have (N+1)^3</p>
<p style="margin-top:0; margin-bottom:0">points. (Here, N+1 = lx1.)</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">They are enumerated in nek5000 by the element number, e:</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"> integer e</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"> nxyz = nx1*ny1*nz1</p>
<p style="margin-top:0; margin-bottom:0"> do e=1,nelt</p>
<p style="margin-top:0; margin-bottom:0"> volume = volel(e)</p>
<p style="margin-top:0; margin-bottom:0"> volume = vlsum(bm1(1,1,1,e),nxyz)</p>
<p style="margin-top:0; margin-bottom:0"> enddo</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">would both yield the same value for the volume of element e.</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">It appears to me that you are after something different, however.</p>
<p style="margin-top:0; margin-bottom:0">It seems like you want to associate a volume with each grid point.</p>
<p style="margin-top:0; margin-bottom:0">If that is the case, then the entries of the diagonal mass matrix, bm1,</p>
<p style="margin-top:0; margin-bottom:0">are indeed the quantities that you want.</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Each entry of bm1(i,1,1,1) for i=1 to n:=nxyz*nelt, corresponds to the</p>
<p style="margin-top:0; margin-bottom:0">integral of the underlying basis function. </p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">That is, if we think about a function phi_i(x) such that</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"> u(x) = sum_i=1^n u(i,1,1,1)*phi_i(x)</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">then</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"> bm1(i,1,1,1) = \int phi_i(x) dx</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">where the integral (\int) is taken over the entire computational domain.</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">[ Note that we really don't have such a global phi_i(x) ... I use it simply</p>
<p style="margin-top:0; margin-bottom:0">for illustration, here.]</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">hth</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Paul</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
</div>
<hr style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><span style="font-size:11pt; color:#000000; font-family:Calibri,sans-serif"><b>From:</b> Nek5000-users <nek5000-users-bounces@lists.mcs.anl.gov> on behalf of nek5000-users@lists.mcs.anl.gov
<nek5000-users@lists.mcs.anl.gov><br>
<b>Sent:</b> Monday, February 26, 2018 11:59:19 AM<br>
<b>To:</b> nek5000-users<br>
<b>Subject:</b> [Nek5000-users] Volume of an element</span>
<div> </div>
</div>
<div>
<div style="font-family:arial,helvetica,sans-serif; font-size:12pt; color:#000000">
<div>Hi Neks,<br>
</div>
<div><br>
</div>
<div>How to calculate volume of an element in a 3D mesh? If i write<br>
</div>
<div><br>
</div>
<div>n = nx1*ny1*nz1*nelv<br>
</div>
<div>do i=1,n<br>
</div>
<div> v(i) = volume(1,1,1,i)<br>
</div>
<div>enddo<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Can i store the volume of each element into a varibale called v?<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>What happens if i use bm1(1,1,1,i)? Instead of volume(1,1,1,i)</div>
<div><br>
</div>
<div><br>
</div>
<div>Thanks<br>
</div>
<div>Sijo<br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
<br>
_______________________________________________<br>
Nek5000-users mailing list<br>
Nek5000-users@lists.mcs.anl.gov<br>
https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users<br>
</div>
</div>
</div>
<br>_______________________________________________<br>Nek5000-users mailing list<br>Nek5000-users@lists.mcs.anl.gov<br>https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users<br></div></div><br>_______________________________________________<br>Nek5000-users mailing list<br>Nek5000-users@lists.mcs.anl.gov<br>https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users<br></div></div></body></html>