numerics
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)
 
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 14 of file grid3d.hpp.

Constructor & Destructor Documentation

◆ Grid3D()

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 6 of file grid3d.cpp.

Member Function Documentation

◆ dx()

◆ fill()

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

Definition at line 9 of file grid3d.cpp.

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

◆ from_vector()

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

Copy solver result back into grid.

Definition at line 19 of file grid3d.cpp.

References num::ipow(), and size().

◆ nx()

◆ ny()

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

◆ nz()

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

◆ operator()() [1/2]

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

Definition at line 26 of file grid3d.hpp.

References num::ipow().

◆ operator()() [2/2]

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

Definition at line 27 of file grid3d.hpp.

References num::ipow().

◆ set()

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

Definition at line 29 of file grid3d.hpp.

References num::ipow().

Referenced by physics::ElectricSolver::joule_heating(), main(), and num::ScalarField3D::set().

◆ size()

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

Definition at line 24 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 13 of file grid3d.cpp.

References num::ipow(), and size().


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