[Nek5000-users] Finding the maximum

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Fri Oct 29 15:04:44 CDT 2010


Hi Shriram,

You can do this in userchk as follows:


       n = nx1*ny1*nz1*nelv
       vmax = -9e20
       do i=1,n
          x=xm1(i,1,1,1)
          y=ym1(i,1,1,1)
          z=zm1(i,1,1,1)
          if (x0.le.x.and.x.le.x1 .and.
      $       y0.le.y.and.y.le.y1 .and.
      $       z0.le.z.and.z.le.z1 )
      $       vmax=max(vmax,eddyv(i,1,1,1))
       enddo
       vmax = glmax(vmax,1)

where x0,x1,...,z1 are discrimators of your choice
and eddyv, say, is the array in question.

Paul



On Fri, 29 Oct 2010, nek5000-users at lists.mcs.anl.gov wrote:

> Hi,
>
> For a computation with eddy viscosity, I would like to find the maximum eddy
> viscosity within a particular region of my domain and also the location of
> the max/min value.
> Is there a routine in nek to give limits on x,y,z and then find max of a
> particular variable ? glmax() finds the maximum in the entire domain . . .
>
> Regards
> Shriram
>



More information about the Nek5000-users mailing list