Jet  v1.3.3
Classes | Public Member Functions | Static Public Member Functions | List of all members
jet::VertexCenteredVectorGrid3 Class Referencefinal

3-D Vertex-centered vector grid structure. More...

#include <jet/vertex_centered_vector_grid3.h>

Inheritance diagram for jet::VertexCenteredVectorGrid3:
jet::CollocatedVectorGrid3 jet::VectorGrid3 jet::VectorField3 jet::Grid3 jet::Field3 jet::Serializable

Classes

class  Builder
 Front-end to create VertexCenteredVectorGrid3 objects step by step. More...
 

Public Member Functions

 VertexCenteredVectorGrid3 ()
 Constructs zero-sized grid. More...
 
 VertexCenteredVectorGrid3 (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 initialValueU=0.0, double initialValueV=0.0, double initialValueW=0.0)
 
 VertexCenteredVectorGrid3 (const Size3 &resolution, const Vector3D &gridSpacing=Vector3D(1.0, 1.0, 1.0), const Vector3D &origin=Vector3D(), const Vector3D &initialValue=Vector3D())
 
Size3 dataSize () const override
 Returns the actual data point size. More...
 
Vector3D dataOrigin () const override
 
void swap (Grid3 *other) override
 Swaps the contents with the given other grid. More...
 
void fill (const Vector3D &value, ExecutionPolicy policy=ExecutionPolicy::kParallel) override
 Fills the grid with given value. More...
 
void fill (const std::function< Vector3D(const Vector3D &)> &func, ExecutionPolicy policy=ExecutionPolicy::kParallel) override
 Fills the grid with given function. More...
 
std::shared_ptr< VectorGrid3clone () const override
 Returns the copy of the grid instance. More...
 
void set (const VertexCenteredVectorGrid3 &other)
 Sets the contents with the given other grid. More...
 
VertexCenteredVectorGrid3operator= (const VertexCenteredVectorGrid3 &other)
 Sets the contents with the given other grid. More...
 
- Public Member Functions inherited from jet::CollocatedVectorGrid3
 CollocatedVectorGrid3 ()
 Constructs an empty grid. More...
 
virtual ~CollocatedVectorGrid3 ()
 Default destructor. More...
 
const Vector3Doperator() (size_t i, size_t j, size_t k) const
 Returns the grid data at given data point. More...
 
Vector3Doperator() (size_t i, size_t j, size_t k)
 Returns the grid data at given data point. More...
 
double divergenceAtDataPoint (size_t i, size_t j, size_t k) const
 Returns divergence at data point location. More...
 
Vector3D curlAtDataPoint (size_t i, size_t j, size_t k) const
 Returns curl at data point location. More...
 
VectorDataAccessor dataAccessor ()
 Returns the read-write data array accessor. More...
 
ConstVectorDataAccessor constDataAccessor () const
 Returns the read-only data array accessor. More...
 
DataPositionFunc dataPosition () const
 Returns the function that maps data point to its position. More...
 
void forEachDataPointIndex (const std::function< void(size_t, size_t, size_t)> &func) const
 Invokes the given function func for each data point. More...
 
void parallelForEachDataPointIndex (const std::function< void(size_t, size_t, size_t)> &func) const
 Invokes the given function func for each data point parallelly. More...
 
Vector3D sample (const Vector3D &x) const override
 Returns sampled value at given position x. More...
 
double divergence (const Vector3D &x) const override
 Returns divergence at given position x. More...
 
Vector3D curl (const Vector3D &x) const override
 Returns curl at given position x. More...
 
std::function< Vector3D(const Vector3D &)> sampler () const override
 Returns the sampler function. More...
 
- Public Member Functions inherited from jet::VectorGrid3
 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...
 
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...
 
- Public Member Functions inherited from jet::VectorField3
 VectorField3 ()
 Default constructor. More...
 
virtual ~VectorField3 ()
 Default destructor. More...
 
- Public Member Functions inherited from jet::Field3
 Field3 ()
 
virtual ~Field3 ()
 
- Public Member Functions inherited from jet::Grid3
 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 Size3resolution () const
 Returns the grid resolution. More...
 
const Vector3Dorigin () const
 Returns the grid origin. More...
 
const Vector3DgridSpacing () const
 Returns the grid spacing. More...
 
const BoundingBox3DboundingBox () 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...
 
- Public Member Functions inherited from jet::Serializable
 Serializable ()=default
 
virtual ~Serializable ()=default
 

Static Public Member Functions

static Builder builder ()
 Returns builder fox VertexCenteredVectorGrid3. More...
 

Additional Inherited Members

- Public Types inherited from jet::VectorGrid3
typedef ArrayAccessor3< Vector3DVectorDataAccessor
 Read-write array accessor type. More...
 
typedef ConstArrayAccessor3< Vector3DConstVectorDataAccessor
 Read-only array accessor type. More...
 
- Public Types inherited from jet::Grid3
typedef std::function< Vector3D(size_t, size_t, size_t)> DataPositionFunc
 Function type for mapping data index to actual position. More...
 
- Protected Member Functions inherited from jet::CollocatedVectorGrid3
void swapCollocatedVectorGrid (CollocatedVectorGrid3 *other)
 Swaps the data storage and predefined samplers with given grid. More...
 
void setCollocatedVectorGrid (const CollocatedVectorGrid3 &other)
 Sets the data storage and predefined samplers with given grid. More...
 
void getData (std::vector< double > *data) const override
 Fetches the data into a continuous linear array. More...
 
void setData (const std::vector< double > &data) override
 Sets the data from a continuous linear array. More...
 
- Protected Member Functions inherited from jet::Grid3
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...
 

Detailed Description

3-D Vertex-centered vector grid structure.

This class represents 3-D vertex-centered vector grid which extends CollocatedVectorGrid3. As its name suggests, the class defines the data point at the grid vertices (corners). Thus, A x B x C grid resolution will have (A+1) x (B+1) x (C+1) data points.

Constructor & Destructor Documentation

◆ VertexCenteredVectorGrid3() [1/3]

jet::VertexCenteredVectorGrid3::VertexCenteredVectorGrid3 ( )

Constructs zero-sized grid.

◆ VertexCenteredVectorGrid3() [2/3]

jet::VertexCenteredVectorGrid3::VertexCenteredVectorGrid3 ( 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  initialValueU = 0.0,
double  initialValueV = 0.0,
double  initialValueW = 0.0 
)

Constructs a grid with given resolution, grid spacing, origin and initial value.

◆ VertexCenteredVectorGrid3() [3/3]

jet::VertexCenteredVectorGrid3::VertexCenteredVectorGrid3 ( const Size3 resolution,
const Vector3D gridSpacing = Vector3D(1.0, 1.0, 1.0),
const Vector3D origin = Vector3D(),
const Vector3D initialValue = Vector3D() 
)

Constructs a grid with given resolution, grid spacing, origin and initial value.

Member Function Documentation

◆ builder()

static Builder jet::VertexCenteredVectorGrid3::builder ( )
static

Returns builder fox VertexCenteredVectorGrid3.

◆ clone()

std::shared_ptr<VectorGrid3> jet::VertexCenteredVectorGrid3::clone ( ) const
overridevirtual

Returns the copy of the grid instance.

Implements jet::VectorGrid3.

◆ dataOrigin()

Vector3D jet::VertexCenteredVectorGrid3::dataOrigin ( ) const
overridevirtual

Returns data position for the grid point at (0, 0, 0). Note that this is different from origin() since origin() returns the lower corner point of the bounding box.

Implements jet::CollocatedVectorGrid3.

◆ dataSize()

Size3 jet::VertexCenteredVectorGrid3::dataSize ( ) const
overridevirtual

Returns the actual data point size.

Implements jet::CollocatedVectorGrid3.

◆ fill() [1/2]

void jet::VertexCenteredVectorGrid3::fill ( const std::function< Vector3D(const Vector3D &)> &  func,
ExecutionPolicy  policy = ExecutionPolicy::kParallel 
)
overridevirtual

Fills the grid with given function.

Implements jet::VectorGrid3.

◆ fill() [2/2]

void jet::VertexCenteredVectorGrid3::fill ( const Vector3D value,
ExecutionPolicy  policy = ExecutionPolicy::kParallel 
)
overridevirtual

Fills the grid with given value.

Implements jet::VectorGrid3.

◆ operator=()

VertexCenteredVectorGrid3& jet::VertexCenteredVectorGrid3::operator= ( const VertexCenteredVectorGrid3 other)

Sets the contents with the given other grid.

◆ set()

void jet::VertexCenteredVectorGrid3::set ( const VertexCenteredVectorGrid3 other)

Sets the contents with the given other grid.

◆ swap()

void jet::VertexCenteredVectorGrid3::swap ( Grid3 other)
overridevirtual

Swaps the contents with the given other grid.

This function swaps the contents of the grid instance with the given grid object other only if other has the same type with this grid.

Implements jet::Grid3.


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