<div dir="ltr">Thank you, Paul,<div>Only I think to account for all nondiagonal components I have to add conditions to the inner loop like:</div><div><br></div><div><p style="color:rgb(0,0,0);font-size:13.3333330154419px;margin-right:0px;margin-left:0px;font-family:Courier"> do e=1,nelv</p><p style="color:rgb(0,0,0);font-size:13.3333330154419px;margin-right:0px;margin-left:0px;font-family:Courier"> do j=1,nij</p><p style="color:rgb(0,0,0);font-size:13.3333330154419px;margin-right:0px;margin-left:0px;font-family:Courier"> do i=1,nxyz</p><p style="color:rgb(0,0,0);font-size:13.3333330154419px;margin-right:0px;margin-left:0px;font-family:Courier"> sij2(i,e)=sij2(i,e)+sij(i,j,e)**2</p><div><div style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:16px"> if (if3d .and. j.ge.4) sij2(i,e)=sij2(i,e)+sij(i,j,e)**2</div><div style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:16px"> if ( .not. if3d .and. j.eq.3 ) sij2(i,e)=sij2(i,e)+sij(i,j,e)**2</div></div><div><span style="color:rgb(0,0,0);font-family:Courier;font-size:13.3333330154419px"> enddo</span><br></div><p style="color:rgb(0,0,0);font-size:13.3333330154419px;margin-right:0px;margin-left:0px;font-family:Courier"> enddo</p><p style="color:rgb(0,0,0);font-size:13.3333330154419px;margin-right:0px;margin-left:0px;font-family:Courier"> enddo</p></div><div><br></div><div>Best regards, Ilias</div><div><br></div><div><br></div><div><div style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:16px"><br></div></div><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 9, 2015 at 5:03 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-family:Tahoma;color:rgb(0,0,0);font-size:10pt">
<div><br>
</div>
Hi Ilias,
<div><br>
</div>
<div><br>
</div>
<div>How about:</div>
<div><br>
</div>
<div>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
subroutine dissipation(sij2)</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier;min-height:16px">
<br>
</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
include 'SIZE'</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
include 'TOTAL'</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier;min-height:16px">
<br>
</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
real sij2(lx1*ly1*lz1,lelt)</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier;min-height:16px">
<br>
</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
common /scrns/ sij (lx1*ly1*lz1,6,lelv)</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier;min-height:16px">
<br>
</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
parameter (lr=lx1*ly1*lz1)</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
common /scruz/ ur(lr),us(lr),ut(lr)</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
$ , vr(lr),vs(lr),vt(lr)</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
$ , wr(lr),ws(lr),wt(lr)</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier;min-height:16px">
<br>
</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
integer e</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier;min-height:16px">
<br>
</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
nij = 3+3*(ndim-2)</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier;min-height:16px">
<br>
</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
call comp_sij(sij,nij,vx,vy,vz,ur,us,ut,vr,vs,vt,wr,ws,wt)</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier;min-height:16px">
<br>
</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
nxyz = nx1*ny1*nz1</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
n = nx1*ny1*nz1*nelv</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier;min-height:16px">
<br>
</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
call rzero(sij2,n)</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier;min-height:16px">
<br>
</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
do e=1,nelv</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
do j=1,nij</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
do i=1,nxyz</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
sij2(i,e)=sij2(i,e)+sij(i,j,e)**2</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
enddo</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
enddo</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
enddo</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier;min-height:16px">
<br>
</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
return</p>
<p style="margin-right:0px;margin-left:0px;line-height:normal;font-family:Courier">
end</p>
<div><br>
</div>
<div>?</div>
<div><br>
</div>
<div>This should function correctly.</div>
<div><br>
</div>
<div>Best, Paul</div>
<div><br>
</div>
<div><br>
</div>
<div style="font-family:'Times New Roman';color:rgb(0,0,0);font-size:16px">
<hr>
<div style="direction:ltr"><font face="Tahoma" size="2" color="#000000"><b>From:</b> <a href="mailto:nek5000-users-bounces@lists.mcs.anl.gov" target="_blank">nek5000-users-bounces@lists.mcs.anl.gov</a> [<a href="mailto:nek5000-users-bounces@lists.mcs.anl.gov" target="_blank">nek5000-users-bounces@lists.mcs.anl.gov</a>] on behalf of <a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.gov</a> [<a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.gov</a>]<br>
<b>Sent:</b> Sunday, November 08, 2015 4:37 PM<br>
<b>To:</b> <a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.gov</a><br>
<b>Subject:</b> [Nek5000-users] dissipation<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">Dear neks,
<div>I am trying to user comp_sij to compute dissipation in every point of the domain.</div>
<div>The data storage is organised according to </div>
<div>
<div> real sij(lx1*ly1*lz1,nij,lelv)</div>
</div>
<div>so the index of a component of tensor</div>
<div>precedes number of element, and </div>
<div>the is no continuous block of lx1*ly1*lz1,lelv points for an element of tensor.<br>
</div>
<div>And so, the global functions like col3 of glsc can not be applied.</div>
<div>At least I don't understand how.</div>
<div><br>
</div>
<div>To bypass this, I copied comp_sij to my usr file and changed the order of</div>
<div>last indices in sij</div>
<div>
<div> real sij(lx1*ly1*lz1,lelv,nij)</div>
</div>
<div>
<div><br>
</div>
<div><br>
</div>
<div>After that I use the followng code to compute viscous dissipation</div>
<div><br>
</div>
<div> nij = 3</div>
<div> if (if3d) nij=6</div>
<div><br>
</div>
<div> call il_comp_sij(sij,nij,vx,vy,vz,ur,us,ut,vr,vs,vt,wr,ws,wt)</div>
<div><br>
</div>
<div> call rzero(il_dissip,lv)</div>
<div><br>
</div>
<div> do j=1,nij</div>
<div> call col3(sij2,sij(1,1,1,1,j),sij(1,1,1,1,j),nxyz)</div>
<div> il_dissip=il_dissip+sij2</div>
<div> if (if3d .and. j.ge.4) then</div>
<div> il_dissip=il_dissip+sij2</div>
<div> end if</div>
<div> if ( .not. if3d .and. j.eq.3 ) then</div>
<div> il_dissip=il_dissip+sij2</div>
<div> end if</div>
<div> il_dissip=2*param(2)*il_dissip</div>
<div> enddo</div>
<div><br>
</div>
</div>
<div>Is is a fair way to compute dissipation?</div>
<div><br>
</div>
<div>Thanks, Ilias</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>_______________________________________________<br>
Nek5000-users mailing list<br>
<a href="mailto:Nek5000-users@lists.mcs.anl.gov">Nek5000-users@lists.mcs.anl.gov</a><br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users" rel="noreferrer" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users</a><br>
<br></blockquote></div><br></div></div>