|
numerics 0.1.0
|
Higher-order stencil and grid-sweep utilities. More...
#include "core/vector.hpp"#include "fields/field3d.hpp"#include "fields/grid2d.hpp"#include "fields/scalar_field_2d.hpp"#include <algorithm>#include <cmath>#include <vector>Go to the source code of this file.
Namespaces | |
| namespace | num |
Functions | |
| template<typename T > | |
| void | num::laplacian_stencil_2d (const BasicVector< T > &x, BasicVector< T > &y, int N) |
| template<typename T > | |
| void | num::laplacian_stencil_2d_periodic (const BasicVector< T > &x, BasicVector< T > &y, int N) |
| Periodic second-order 2D Laplacian stencil. | |
| template<typename T > | |
| void | num::laplacian_stencil_2d_4th (const BasicVector< T > &x, BasicVector< T > &y, int N) |
| Fourth-order 2D Laplacian cross stencil. | |
| real | num::sample_2d_periodic (const Vector &field, idx N, real h, real px, real py, real ox, real oy) |
| template<typename T , typename F > | |
| void | num::col_fiber_sweep (BasicVector< T > &data, int N, F &&f) |
| Apply a mutable 1D operation to each column fiber. | |
| template<typename T , typename F > | |
| void | num::row_fiber_sweep (BasicVector< T > &data, int N, F &&f) |
| Apply a mutable 1D operation to each row fiber. | |
| template<typename F > | |
| void | num::fill_grid (Vector &u, int N, double h, F &&f) |
| Fill grid values at \(x_i=(i+1)h,\ y_j=(j+1)h\). | |
| template<typename F > | |
| void | num::fill_grid (ScalarField2D &g, F &&f) |
| void | num::laplacian_stencil_2d_periodic (const ScalarField2D &x, ScalarField2D &y) |
| void | num::laplacian_stencil_2d_4th (const ScalarField2D &x, ScalarField2D &y) |
| real | num::sample_2d_periodic (const ScalarField2D &g, real px, real py, real ox=0.0, real oy=0.0) |
| void | num::neg_laplacian_3d (const Vector &x, Vector &y, int nx, int ny, int nz, double inv_dx2) |
| Compute \(-\Delta_h x\) on a 3D grid. | |
| void | num::gradient_3d (const ScalarField3D &phi, ScalarField3D &gx, ScalarField3D &gy, ScalarField3D &gz) |
| Compute \(\nabla\phi\) with central differences. | |
| void | num::divergence_3d (const ScalarField3D &fx, const ScalarField3D &fy, const ScalarField3D &fz, ScalarField3D &out) |
| Compute \(\nabla\cdot f\) with central differences. | |
| void | num::curl_3d (const ScalarField3D &ax, const ScalarField3D &ay, const ScalarField3D &az, ScalarField3D &bx, ScalarField3D &by, ScalarField3D &bz) |
| Compute \(\nabla\times A\) with central differences. | |
Higher-order stencil and grid-sweep utilities.
The second-order 2D stencil stores \(h^2\Delta_h u\):
\[ y_{ij}=u_{i+1,j}+u_{i-1,j}+u_{i,j+1}+u_{i,j-1}-4u_{ij}. \]
Definition in file stencil.hpp.