<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<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">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%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><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</font>
<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>
</body>
</html>