[Nek5000-users] Volume of an element
nek5000-users at lists.mcs.anl.gov
nek5000-users at lists.mcs.anl.gov
Tue Feb 27 04:45:30 CST 2018
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.
nxyz = nx1*ny1*nz1
n = nx1*ny1*nz1*nelv
vol = vlsum(bm1(1,1,1,1),nxyz)
a=glmax(vol,1)
b=glmin(vol,1)
do e=1,n
volume = vlsum(bm1(e,1,1,1),nxyz)
open (unit=10,file="hcoeff.dat")
write (10,7020) a,b,volume
7020 format(7f20.14)
enddo
Regards
Sijo GEORGE
De: "nek5000-users" <nek5000-users at lists.mcs.anl.gov>
À: "nek5000-users" <nek5000-users at lists.mcs.anl.gov>
Envoyé: Lundi 26 Février 2018 21:46:02
Objet: Re: [Nek5000-users] Volume of an element
Dear Sijo,
We typically refer to elements as the structures that have (N+1)^3
points. (Here, N+1 = lx1.)
They are enumerated in nek5000 by the element number, e:
integer e
nxyz = nx1*ny1*nz1
do e=1,nelt
volume = volel(e)
volume = vlsum(bm1(1,1,1,e),nxyz)
enddo
would both yield the same value for the volume of element e.
It appears to me that you are after something different, however.
It seems like you want to associate a volume with each grid point.
If that is the case, then the entries of the diagonal mass matrix, bm1,
are indeed the quantities that you want.
Each entry of bm1(i,1,1,1) for i=1 to n:=nxyz*nelt, corresponds to the
integral of the underlying basis function.
That is, if we think about a function phi_i(x) such that
u(x) = sum_i=1^n u(i,1,1,1)*phi_i(x)
then
bm1(i,1,1,1) = \int phi_i(x) dx
where the integral (\int) is taken over the entire computational domain.
[ Note that we really don't have such a global phi_i(x) ... I use it simply
for illustration, here.]
hth
Paul
From: Nek5000-users <nek5000-users-bounces at lists.mcs.anl.gov> on behalf of nek5000-users at lists.mcs.anl.gov <nek5000-users at lists.mcs.anl.gov>
Sent: Monday, February 26, 2018 11:59:19 AM
To: nek5000-users
Subject: [Nek5000-users] Volume of an element
Hi Neks,
How to calculate volume of an element in a 3D mesh? If i write
n = nx1*ny1*nz1*nelv
do i=1,n
v(i) = volume(1,1,1,i)
enddo
Can i store the volume of each element into a varibale called v?
What happens if i use bm1(1,1,1,i)? Instead of volume(1,1,1,i)
Thanks
Sijo
_______________________________________________
Nek5000-users mailing list
Nek5000-users at lists.mcs.anl.gov
https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20180227/85113a4c/attachment.html>
More information about the Nek5000-users
mailing list