[Nek5000-users] Domain boundary visualization in VisIt

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Thu Feb 4 15:10:09 CST 2010


Yes - I do something similar to check my boundary conditions!
btw: postnek has a feature to display BC (but I prefer VisIt for other reasons).

Cheers,
Stefan 



On Feb 4, 2010, at 10:02 PM, nek5000-users at lists.mcs.anl.gov wrote:

> Hi all,
> 
> hoping not to have found a solution to a non-existing problem, I'd like to post
> my idea about how to visualize domain boundaries based on their type in VisIt.
> That'll come in handy when I want to generate a picture to describe with
> colors/gray levels what boundary conditions were used in the simulation.
> 
> First, I add the following lines to the .usr file:
> "
>      real bcscal(lx1,ly1,lz1,lelt) !Scalar for boundary condition visualization
>      integer e, f
> 
>      ntot   = nx1*ny1*nz1*nelv
>      call rzero(t(1,1,1,1,2),ntot)
>      call rzero(bcscal,ntot)
> 
> c-----Set scalar values for different boundaries
>      nface = 2*ndim
>      do e=1,nelv
>      do f=1,nface
>         if (cbc(f,e,1).eq.'P  ') then
>            call facev(bcscal,e,f,1.0,lx1,ly1,lz1)
>         endif
>         if (cbc(f,e,1).eq.'O  ') then
>            call facev(bcscal,e,f,2.0,lx1,ly1,lz1)
>         endif
>         if (cbc(f,e,1).eq.'W  ') then
>            call facev(bcscal,e,f,3.0,lx1,ly1,lz1)
>         endif
>         if (cbc(f,e,1).eq.'v  ') then
>            call facev(bcscal,e,f,4.0,lx1,ly1,lz1)
>         endif
>      enddo
>      enddo
> 
>      call copy(t(1,1,1,1,2),bcscal,ntot)
> "
> This will assign different values (1 for periodic, 2 for outflow, ...) to faces
> on boundaries of certain types.
> "
>      ifpsco(1) = .true.
>      ifreguo = .false.
>      call prepost(.true.,'bcs')
> "
> This will turn on output of scalar 1 (t(1,1,1,1,2)) and write it out on a GLL
> mesh with filename prefix 'bcs'.
> 
> In VisIt, I then define equations (Controls->Expressions...) that create new
> scalar
> variables (wall, periodic, ...), for example for walls:
> Variable name: walls
> "
> if(eq(s1,3), walls=1, walls=0)
> "
> I then use a "Contour" plot for each variable.
> 
> I'd be glad to hear some feedback,
> Markus
> _______________________________________________
> Nek5000-users mailing list
> Nek5000-users at lists.mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users




More information about the Nek5000-users mailing list