numerics 0.1.0
Loading...
Searching...
No Matches
num::Grid3D Class Reference

#include <grid3d.hpp>

Public Member Functions

 Grid3D (int nx, int ny, int nz, double dx=1.0)
 
int nx () const
 
int ny () const
 
int nz () const
 
double dx () const
 
int size () const
 
realoperator() (int i, int j, int k)
 
real operator() (int i, int j, int k) const
 
void set (int i, int j, int k, real v)
 
void fill (real v)
 
template<typename F >
void fill (F &&f)
 Fill every cell with f(i, j, k).
 
template<typename F >
 Grid3D (int nx, int ny, int nz, double dx, F &&f)
 Construct and fill from callable f(i, j, k) -> real.
 
Vector to_vector () const
 Copy contents into a new Vector (for solver interop).
 
void from_vector (const Vector &v)
 Copy solver result back into grid.
 

Detailed Description

Definition at line 15 of file grid3d.hpp.

Constructor & Destructor Documentation

◆ Grid3D() [1/2]

num::Grid3D::Grid3D ( int  nx,
int  ny,
int  nz,
double  dx = 1.0 
)
Parameters
nx,ny,nzNumber of cells in each dimension
dxUniform cell size [m]

Definition at line 7 of file grid3d.cpp.

◆ Grid3D() [2/2]

template<typename F >
num::Grid3D::Grid3D ( int  nx,
int  ny,
int  nz,
double  dx,
F &&  f 
)
inline

Construct and fill from callable f(i, j, k) -> real.

Definition at line 60 of file grid3d.hpp.

References fill().

Member Function Documentation

◆ dx()

double num::Grid3D::dx ( ) const
inline

◆ fill() [1/2]

template<typename F >
void num::Grid3D::fill ( F &&  f)
inline

Fill every cell with f(i, j, k).

Definition at line 51 of file grid3d.hpp.

◆ fill() [2/2]

void num::Grid3D::fill ( real  v)

Definition at line 14 of file grid3d.cpp.

Referenced by num::ScalarField3D::fill(), num::ScalarField3D::fill(), and Grid3D().

◆ from_vector()

void num::Grid3D::from_vector ( const Vector v)

Copy solver result back into grid.

Definition at line 26 of file grid3d.cpp.

References size().

◆ nx()

◆ ny()

◆ nz()

◆ operator()() [1/2]

real & num::Grid3D::operator() ( int  i,
int  j,
int  k 
)
inline

Definition at line 37 of file grid3d.hpp.

◆ operator()() [2/2]

real num::Grid3D::operator() ( int  i,
int  j,
int  k 
) const
inline

Definition at line 40 of file grid3d.hpp.

◆ set()

void num::Grid3D::set ( int  i,
int  j,
int  k,
real  v 
)
inline

Definition at line 44 of file grid3d.hpp.

Referenced by num::ScalarField3D::set().

◆ size()

int num::Grid3D::size ( ) const
inline

Definition at line 33 of file grid3d.hpp.

Referenced by from_vector(), and to_vector().

◆ to_vector()

Vector num::Grid3D::to_vector ( ) const

Copy contents into a new Vector (for solver interop).

Definition at line 18 of file grid3d.cpp.

References size().


The documentation for this class was generated from the following files: