Nekcem Downloads
The following sections describe the process for downloading and building the NEKCEM package. It is assumed the user is comfortable with using Subversion, as well as with compiling Fortran and C programs.
NEKCEM is available for download via the Subversion repository:
svn co https://svn.mcs.anl.gov/repos/NEKCEM
The NEKCEM package contains the source code, scripts, examples, libraries used, and documentation.
-
src: source code
-
bin: a collection of scripts for building and running NEKCEM
-
makenek: builds the nekcem package. Run from an 'example' directory via ../../bin/makenek. To clean ../../bin/cleanall; See makenek --help for options
-
nek: runs the nekcem package with 'reasonable' defaults for the platform. See nek --help for options
-
arch-settings: contains architecture-specific settings for building NEKCEM. Used by makenek
-
paraview: used for visualization
-
-
examples: sample problems including SIZEu, *.rea, *.map, *.usr (some special cases have additional files)
-
2dboxpp: SIZEu, 2dboxpp.rea, 2dboxpp.map, 2dboxpp.usr
-
-
libs: BLAS and LAPACK can be placed here if not already installed on your system
-
tool: source codes for other utilities, mainly for meshing (detail below)
-
doc: documentation
Source codes for other utilities are available under NEKCEM/trunk/tool/. This utilities collection contains the following:
-
prex: meshing tool for hexahedral mesh
-
To build prex: cd NEKCEM/trunk/tool/ and compile by
makeprex makefile.pfg (pgi compiler)
or
makeprex makefile.gft (gfortran compiler)
-
To build prex: cd NEKCEM/trunk/tool/ and compile by
-
n2to2: duplicate/extension of 2d mesh to 2d mesh
-
To build n2to2: cd NEKCEM/trunk/tool/ and compile by
maken2to2 pgf77 (pgi compiler)
maken2to2 gfortran (gnu compiler) -
n2to3: extension of 2d mesh to 3d mesh
-
To build n2to3: cd NEKCEM/trunk/tool/ and compile by
maken2to3 pgf77 (pgi compiler)
maken2to3 gfortran (gnu compiler) -
genmap: generation of mapping file
-
To build genmap: cd NEKCEM/trunk/tool/ and compile by
makegenmap pgf77 (pgi compiler)
makegenmap gfortran (gnu compiler)
Building and using NEKCEM consist of creating an appropriate mesh and building the package for that mesh
Keep built-in examples as they are and create your own directory "sample" under NEKCEM/trunk/example. Copy *.usr, *.rea, *.map, and SIZEu file from one of the examples (CAUTION: your run is 2d example for 2d run; 3d example for 3d run) and then work on those tiles by assigning another name. That way, you always have the original examples file to use. Invoke the prex GUI tool to generate a mesh under the sample sample directory or where you want the generated files to be stored:
cd examples/sample/
../../tool/prex
-
Example: how to generate meshes for simple box meshes
-
Example: how to generate meshes for cylindrical meshes
-
Example: how to generate meshes for nanorods.
To compile the package, run the makenek script from the directory of the example just created:
cd NEKCEM/trunk/examples/2dboxpp
../../bin/makenek 2dboxpp
See makenek -h for compile options. The most useful option is probably -d, which builds in debug mode (debug symbols and no optimization).
A few files will get moved around during the compile process:
-
The 2dboxpp.usr file will get copied into the ../../src directory as subuser.F.
-
The SIZEu file will get copied into the ../../src directory as SIZE. Whenever you change the data in SIZE file, you need to do cleanall and re-compile
To run on the current example, use the nek script
cd NEKCEM/trunk/examples/2dboxpp
../../bin/nek 2dboxpp
See nek -h for options. You'll probably want to use -n for controlling the number of nodes, and -t for the walltime.
A few files will get generated during the execution:
-
Run statement will be printed on your screen with information for timestep, grid points, order, time, dt, errors of (Hx, Hy, Hz) and (Ex, Ey, Ez), CPU time, CPUtime/proc/grid/timestep
-
Field files will be generated in a format em-p000000-t00000.vtk under vtk directory (also created). Outputs can be viewed in paraview
Some built-in examples are included
-
2dboxpp: traveling wave with periodic boundaries
-
3dboxppp: traveling wave with periodic boundaries
-
cylwave: cylindrical waveguides PEC in x-y and periodic in z
-
recwave: rectangular waveguides PEC in x-y and periodic in z
-
2d-air-glass: light transmission periodic in y and PML in x
-
2dnanoslab: light transmission periodic in y and PML in x
-
2dnanoslits: light transmission periodic in y and PML in x
-
tube: wakefield and wakepotential calculations for a tube mesh
Paraview can be used to view the results for each processor and every n timesteps you specify in your rea file. The vtk directory contains the files needed by paraview. For more information, see the ParaView website.
An available tutoral site for Paraview (temporary) is here: QuickStart
Collaborators
Misun Min
Paul Fischer