SCTL: Scientific Computing Template Library
SCTL is a header-only C++ library providing various functionalities for scientific computing. This documentation outlines these functionalities and provides a guide to getting started.
Requirements
The only requirement to use SCTL is a working C++11 compliant compiler with OpenMP 4.0 support. It has been tested with GCC-9 and newer.
Getting Started
Note
SCTL requires a C++11 compliant compiler with OpenMP 4.0 support.
To get started, download the latest version of SCTL from the SCTL GitHub.
git clone https://github.com/dmalhotra/SCTL.git
Since SCTL is a header-only library, it does not require compilation or installation. Simply include the sctl.hpp
header file in your C++ project and start using the provided classes and functions.
#include <sctl.hpp>
Ensure the compiler can locate the header file by providing the path to SCTL_ROOT/include
using the flag -I ${SCTL_ROOT}/include
.
Optional Dependencies
The following libraries can be optionally used when available. If not available, SCTL uses its own implementation which may be slower.
BLAS: Enable by defining
SCTL_HAVE_BLAS
.LAPACK: Enable by defining
SCTL_HAVE_LAPACK
.libmvec: Enable by defining
SCTL_HAVE_LIBMVEC
.Intel SVML: Enable by defining
SCTL_HAVE_SVML
.MPI: Enable by defining
SCTL_HAVE_MPI
(see Comm).FFTW: Enable double precision by defining
SCTL_HAVE_FFTW
, single precision by definingSCTL_HAVE_FFTWF
, or long double precision by definingSCTL_HAVE_FFTWL
(see FFT).PVFMM: Enable by defining
SCTL_HAVE_PVFMM
(requires MPI, see ParticleFMM).
To enable support for any of these libraries, define the corresponding flag during compilation. For example, to enable MPI support, use -DSCTL_HAVE_MPI
.
Optional Compiler Flags
The following compiler flags can be used to enable or disable specific features in SCTL:
-DSCTL_MEMDEBUG
: Enable memory debugging (iterator.hpp, static-array.hpp).-DSCTL_GLOBAL_MEM_BUFF=<size in MB>
: Use a global memory buffer for allocations.-DSCTL_PROFILE=<level>
: Enable profiling.-DSCTL_VERBOSE
: Enable verbose profiling output.-DSCTL_SIG_HANDLER
: Enable stack trace.-DSCTL_QUAD_T
: Enable support for quad-precision type.
Features and Capabilities
The following list outlines the primary features and capabilities provided by the library, along with references to detailed tutorials and documentation for each component:
Basic Data Structures: Fundamental classes for storing and manipulating data.
Vector: Dynamically allocated linear array.
Matrix, Permutation: Dynamically allocated 2D array for matrix operations.
Tensor: Statically allocated multi-dimensional array.
Numerical Solvers and Algorithms: Methods for solving equations, performing interpolations, numerical integration, and partitioning data.
SDC (Spectral Deferred Correction): High-order solver for ordinary differential equations.
GMRES solver, Krylov preconditioner: Distributed memory GMRES solver.
LagrangeInterp: Polynomial interpolation and differentiation.
ChebQuadRule, LegQuadRule: Clenshaw-Curtis and Gauss-Legendre quadrature rules.
InterpQuadRule: Generating special quadrature rules.
Tree, PtTree, Morton: Morton order based N-dimensional parallel tree structure.
Spectral Methods: Methods for spectral representations and transformations.
FFT: Wrapper for FFTW to perform fast Fourier transforms.
SphericalHarmonics: Computing spherical harmonics.
Boundary Integral Methods: Techniques for solving partial differential equations using boundary integral representations.
BoundaryIntegralOp: Generic class for instantiating layer-potential operators.
Kernel functions: Contains a variety of kernel functions for integral equations.
ParticleFMM: Integration with PVFMM for particle N-body calculations.
High Performance Computing (HPC): Tools for parallel and distributed computing.
Comm: Wrapper for MPI to facilitate parallel computing.
Vec: SIMD vectorization class for optimized computations.
OpenMP utilities: Parallel algorithms such as merge-sort and scan using OpenMP.
Profile: Tools for profiling and performance analysis.
Utilities: Miscellaneous utilities for data handling, debugging, and visualization.
VTUData: Writes unstructured VTK files for data visualization.
QuadReal, basic math functions: Quad-precision type and essential mathematical functions.
Iterator, ConstIterator, StaticArray: Iterator and static array utilities.
MemoryManager: Aligned memory allocation and deallocation.
Stacktrace utility: Prints stack traces for debugging.
Legacy (Unmaintained): Older functionalities that are no longer actively maintained.
Boundary quadrature: Boundary integrals on quad-patches using hedgehog quadrature.
ChebBasis: Tensor product Chebyshev basis for general-dimension computations.
Acknowledgments
This project originated at the University of Texas at Austin, received support from New York university between 2017 and 2020, and is now supported by the Flatiron Institute.