Skip to content

Getting Started

Jacob Fields edited this page May 28, 2020 · 7 revisions

Assumptions of Knowledge

OOPS is really intended for beginners in scientific computing, but everyone comes in with a slightly different level of experience. Therefore, it's worthwhile to take a moment to mention what the OOPS documentation does and doesn't assume someone knows about C++ and numerical methods.

C++ and Object-Oriented Programming:

  • Must Know:
    • Pointers and References
    • Classes
    • Inheritance/Polymorphism
    • Input and output with the Standard Template Library
  • Helpful to Know:
    • Template classes
    • Basic data structures in the Standard Template Library (especially std::map, std::set, std::vector, and std::array)
    • Smart pointers in the Standard Template Library

Numerical Methods:

  • Must Know:
    • What a differential equation is and what it means
    • How to reduce the order of ODEs and PDEs into a system of lower order ODEs and PDEs
    • Finite-difference methods for boundary-value problems
  • Helpful to Know:
    • How to solve simple differential equations analytically (ODEs and PDEs)
    • Integration methods for initial-value problems
    • Some numerical analysis

Setup

OOPS was designed to be as simple to install as possible. Nevertheless, there are a few system requirements:

  • CMake 3.0 or later
  • A modern C++11-compliant compiler
  • Python 3.0 or later with standard libraries Some optional features may have additional system requirements:
  • SDF output requires the RNPL library. This package is very old and notoriously difficult to install on modern computers, but it has been successfully compiled on modern versions of Ubuntu (native and via the Windows Subsystem for Linux, albeit with some issues) and RHEL.
  • The plotData.py script requires the Matplotlib and NumPy packages.

Because OOPS has so few external dependencies, it should theoretically be able to run on Windows, Linux, or MacOS, although some features (like SDF output) are not guaranteed to be compatible. Instructions are provided for a generic command line installation via Make, though the use of CMake should make it possible to generate build files for other systems, too.

Compiling

Because of CMake, compilation is relatively straightforward. On a Bash terminal using Unix Makefiles, it might look something like the following:

cd <OOPS directory>
mkdir build
ccmake ../

From here, you simply follow the instructions in the CMake terminal, then run make when you're done. The default options should be sufficient for getting started.

Structure of OOPS

Every OOPS program must have the following components:

  • A Domain object, which defines the space for your problem.
  • One or more Grid objects, which subdivide a Domain into discrete points for numerical calculation.
  • A Solver object, such as RK4, which will numerically solve any system of differential equations fed into it.
  • An ODE object, which provides the righthand side for a system of ODEs (such as PDEs discretized with finite-difference methods), boundary conditions, and initial conditions.
  • An Interpolator object, which tells ODE how to transfer data between neighboring Grid objects.

More complex codes will almost certainly use custom Parameters objects and their corresponding ParamParser objects, but these are not strictly required.

Clone this wiki locally