Code Monkey home page Code Monkey logo

nekexamples's Introduction

NekTests

Nek unittests

The NekTests.py module contains the Nek5000 verification tests, implemented using the Python standard-library unittest framework. NekTests requires Python 2.7 or higher.

Module Contents

The module contains a separate class for each test problem. The classes are:

  • Axi
  • Benard_Ray9
  • Benard_RayDD
  • Benard_RayDN
  • Benard_RayNN
  • Blasius
  • ConjHt
  • CylRestart_Ca
  • CylRestart_Cb
  • CylRestart_Pa
  • CylRestart_Pb
  • Eddy_EddyUv
  • Eddy_PsiOmega
  • ExtCyl
  • Fs2_St1
  • Fs2_St2
  • Fs2_StdWv
  • FsHydro
  • Hemi
  • Kovasznay
  • KovStState
  • LowMachTest
  • Mhd_Gpf
  • Mhd_GpfB
  • Mhd_GpfM
  • Os7000
  • Peris
  • Pipe_Helix
  • Pipe_Stenosis
  • Rayleigh_Ray1
  • Rayleigh_Ray2
  • Shear4_Shear4
  • Shear4_Thin
  • Solid
  • Strat_P0001
  • Strat_P1000
  • Taylor
  • ThreeDBox
  • TurbChannel
  • VarVis
  • Vortex
  • Vortex2

Each class also contains four methods for different formulations and parallelization modes:

  • test_PnPn_Serial
  • test_PnPn_Parallel
  • test_PnPn2_Serial
  • test_PnPn2_Parallel

Running Tests

The tests may be run using the Python standard-library 'unittest' module, which requires no additional dependencies. The tests may also be run with any third-party testing tool compatible with unittest, such as nose, py.test, TwistedTrial, and others.

Setting Up Your Environment

Before running the tests, these environment variables should be defined:

  • SOURCE_ROOT: Points to the top-level Nek5000 repository. (default: none)
  • CC: The C compiler you wish to use. (default: gcc)
  • F77: The Fortran 77 compiler you wish to use. (default gfortran)
  • IFMPI=[true|false]: If true, run tests with MPI. (default: false)

These environment variables may optionally be defined:

  • EXAMPLES_ROOT: Points to an alternate Nek5000 examples directory. For example, $HOME/NekExamples. (default: this directory)
  • TOOLS_ROOT: Points to an alternate directory for Nek5000 tools. (default: $SOURCE_ROOT/tools)
  • SCRIPTS_ROOT: Points to an alternate directory Nek5000 scripts directory.
  • TOOLS_BIN: If defined, compile tools in this directory. (default: $SOURCE_ROOT/bin)
  • LOG_ROOT: If defined, move completed logs into this directory. If not defined, leave logs in the example folders. (default: undefined)
  • VERBOSE_TESTS=[true|false]: If true, display standard output from compiler and Nek5000 to terminal window. Standard output will always be recorded in logfiles, whether VERBOSE_TESTS is true or false. (default: true)
  • PARALLEL_PROCS: The number of processes to use when running with MPI. (default: 4)

Running NekTests with unittest

To run all the tests, first cd into this directory and then run: $ python -m 'unittest' NekTests

If you wish to run tests for just one example problem (for example, "TurbChannel"), run: $ python -m 'unittest' NekTests.TurbChannel

If you wish to run tests for just one example problem and one formulation/parallelization (for example, test_PnPn_Serial), run: $ python -m 'unittest' NekTests.TurbChannel.test_PnPn_Serial

nekexamples's People

Contributors

ronrahaman avatar klheisey avatar fischer1 avatar stgeke avatar ypeet avatar maxhutch avatar aobabko avatar oana-marin-codes avatar nicooff avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.