Jet
v1.3.3
|
Abstract base class for 3-D vector grid structure. More...
#include <jet/vector_grid3.h>
Public Types | |
typedef ArrayAccessor3< Vector3D > | VectorDataAccessor |
Read-write array accessor type. More... | |
typedef ConstArrayAccessor3< Vector3D > | ConstVectorDataAccessor |
Read-only array accessor type. More... | |
![]() | |
typedef std::function< Vector3D(size_t, size_t, size_t)> | DataPositionFunc |
Function type for mapping data index to actual position. More... | |
Public Member Functions | |
VectorGrid3 () | |
Constructs an empty grid. More... | |
virtual | ~VectorGrid3 () |
Default destructor. More... | |
void | clear () |
Clears the contents of the grid. More... | |
void | resize (size_t resolutionX, size_t resolutionY, size_t resolutionZ, double gridSpacingX=1.0, double gridSpacingY=1.0, double gridSpacingZ=1.0, double originX=0.0, double originY=0.0, double originZ=0.0, double initialValueX=0.0, double initialValueY=0.0, double initialValueZ=0.0) |
Resizes the grid using given parameters. More... | |
void | resize (const Size3 &resolution, const Vector3D &gridSpacing=Vector3D(1, 1, 1), const Vector3D &origin=Vector3D(), const Vector3D &initialValue=Vector3D()) |
Resizes the grid using given parameters. More... | |
void | resize (double gridSpacingX, double gridSpacingY, double gridSpacingZ, double originX, double originY, double originZ) |
Resizes the grid using given parameters. More... | |
void | resize (const Vector3D &gridSpacing, const Vector3D &origin) |
Resizes the grid using given parameters. More... | |
virtual void | fill (const Vector3D &value, ExecutionPolicy policy=ExecutionPolicy::kParallel)=0 |
Fills the grid with given value. More... | |
virtual void | fill (const std::function< Vector3D(const Vector3D &)> &func, ExecutionPolicy policy=ExecutionPolicy::kParallel)=0 |
Fills the grid with given position-to-value mapping function. More... | |
virtual std::shared_ptr< VectorGrid3 > | clone () const =0 |
Returns the copy of the grid instance. More... | |
void | serialize (std::vector< uint8_t > *buffer) const override |
Serializes the grid instance to the output buffer. More... | |
void | deserialize (const std::vector< uint8_t > &buffer) override |
Deserializes the input buffer to the grid instance. More... | |
![]() | |
VectorField3 () | |
Default constructor. More... | |
virtual | ~VectorField3 () |
Default destructor. More... | |
virtual Vector3D | sample (const Vector3D &x) const =0 |
Returns sampled value at given position x . More... | |
virtual double | divergence (const Vector3D &x) const |
Returns divergence at given position x . More... | |
virtual Vector3D | curl (const Vector3D &x) const |
Returns curl at given position x . More... | |
virtual std::function< Vector3D(const Vector3D &)> | sampler () const |
Returns sampler function object. More... | |
![]() | |
Field3 () | |
virtual | ~Field3 () |
![]() | |
Grid3 () | |
Constructs an empty grid. More... | |
virtual | ~Grid3 () |
Default destructor. More... | |
virtual std::string | typeName () const =0 |
Returns the type name of derived grid. More... | |
const Size3 & | resolution () const |
Returns the grid resolution. More... | |
const Vector3D & | origin () const |
Returns the grid origin. More... | |
const Vector3D & | gridSpacing () const |
Returns the grid spacing. More... | |
const BoundingBox3D & | boundingBox () const |
Returns the bounding box of the grid. More... | |
DataPositionFunc | cellCenterPosition () const |
Returns the function that maps grid index to the cell-center position. More... | |
void | forEachCellIndex (const std::function< void(size_t, size_t, size_t)> &func) const |
Invokes the given function func for each grid cell. More... | |
void | parallelForEachCellIndex (const std::function< void(size_t, size_t, size_t)> &func) const |
Invokes the given function func for each grid cell parallelly. More... | |
bool | hasSameShape (const Grid3 &other) const |
Returns true if resolution, grid-spacing and origin are same. More... | |
virtual void | swap (Grid3 *other)=0 |
Swaps the data with other grid. More... | |
![]() | |
Serializable ()=default | |
virtual | ~Serializable ()=default |
Protected Member Functions | |
virtual void | onResize (const Size3 &resolution, const Vector3D &gridSpacing, const Vector3D &origin, const Vector3D &initialValue)=0 |
Invoked when the resizing happens. More... | |
![]() | |
void | setSizeParameters (const Size3 &resolution, const Vector3D &gridSpacing, const Vector3D &origin) |
void | swapGrid (Grid3 *other) |
Swaps the size parameters with given grid other . More... | |
void | setGrid (const Grid3 &other) |
Sets the size parameters with given grid other . More... | |
virtual void | getData (std::vector< double > *data) const =0 |
Fetches the data into a continuous linear array. More... | |
virtual void | setData (const std::vector< double > &data)=0 |
Sets the data from a continuous linear array. More... | |
Abstract base class for 3-D vector grid structure.
Read-only array accessor type.
Read-write array accessor type.
jet::VectorGrid3::VectorGrid3 | ( | ) |
Constructs an empty grid.
|
virtual |
Default destructor.
void jet::VectorGrid3::clear | ( | ) |
Clears the contents of the grid.
|
pure virtual |
Returns the copy of the grid instance.
Implemented in jet::FaceCenteredGrid3, jet::VertexCenteredVectorGrid3, and jet::CellCenteredVectorGrid3.
|
overridevirtual |
Deserializes the input buffer to the grid instance.
Implements jet::Grid3.
|
pure virtual |
Fills the grid with given position-to-value mapping function.
Implemented in jet::FaceCenteredGrid3, jet::CellCenteredVectorGrid3, and jet::VertexCenteredVectorGrid3.
|
pure virtual |
Fills the grid with given value.
Implemented in jet::FaceCenteredGrid3, jet::CellCenteredVectorGrid3, and jet::VertexCenteredVectorGrid3.
|
protectedpure virtual |
Invoked when the resizing happens.
This callback function is called when the grid gets resized. The overriding class should allocate the internal storage based on its data layout scheme.
Implemented in jet::FaceCenteredGrid3.
void jet::VectorGrid3::resize | ( | const Size3 & | resolution, |
const Vector3D & | gridSpacing = Vector3D(1, 1, 1) , |
||
const Vector3D & | origin = Vector3D() , |
||
const Vector3D & | initialValue = Vector3D() |
||
) |
Resizes the grid using given parameters.
Resizes the grid using given parameters.
void jet::VectorGrid3::resize | ( | double | gridSpacingX, |
double | gridSpacingY, | ||
double | gridSpacingZ, | ||
double | originX, | ||
double | originY, | ||
double | originZ | ||
) |
Resizes the grid using given parameters.
void jet::VectorGrid3::resize | ( | size_t | resolutionX, |
size_t | resolutionY, | ||
size_t | resolutionZ, | ||
double | gridSpacingX = 1.0 , |
||
double | gridSpacingY = 1.0 , |
||
double | gridSpacingZ = 1.0 , |
||
double | originX = 0.0 , |
||
double | originY = 0.0 , |
||
double | originZ = 0.0 , |
||
double | initialValueX = 0.0 , |
||
double | initialValueY = 0.0 , |
||
double | initialValueZ = 0.0 |
||
) |
Resizes the grid using given parameters.
|
overridevirtual |
Serializes the grid instance to the output buffer.
Implements jet::Grid3.