Go to the documentation of this file.
7 #ifndef INCLUDE_JET_CELL_CENTERED_SCALAR_GRID2_H_
8 #define INCLUDE_JET_CELL_CENTERED_SCALAR_GRID2_H_
37 double gridSpacingX = 1.0,
38 double gridSpacingY = 1.0,
41 double initialValue = 0.0);
49 double initialValue = 0.0);
77 std::shared_ptr<ScalarGrid2>
clone()
const override;
128 double initialVal)
const override;
131 Size2 _resolution{1, 1};
134 double _initialVal = 0.0;
139 #endif // INCLUDE_JET_CELL_CENTERED_SCALAR_GRID2_H_
CellCenteredScalarGrid2(const Size2 &resolution, const Vector2D &gridSpacing=Vector2D(1.0, 1.0), const Vector2D &origin=Vector2D(), double initialValue=0.0)
const Vector2D & origin() const
Returns the grid origin.
Builder & withResolution(const Size2 &resolution)
Returns builder with resolution.
Abstract base class for 2-D scalar grid builder.
Definition: scalar_grid2.h:191
Builder & withInitialValue(double initialVal)
Returns builder with initial value.
Vector2< double > Vector2D
Double-type 2D vector.
Definition: vector2.h:340
Builder & withGridSpacing(double gridSpacingX, double gridSpacingY)
Returns builder with grid spacing.
CellCenteredScalarGrid2()
Constructs zero-sized grid.
2-D Cell-centered scalar grid structure.
Definition: cell_centered_scalar_grid2.h:23
static Builder builder()
Returns builder fox CellCenteredScalarGrid2.
CellCenteredScalarGrid2(const CellCenteredScalarGrid2 &other)
Copy constructor.
CellCenteredScalarGrid2(size_t resolutionX, size_t resolutionY, double gridSpacingX=1.0, double gridSpacingY=1.0, double originX=0.0, double originY=0.0, double initialValue=0.0)
Abstract base class for 2-D cartesian grid structure.
Definition: grid2.h:30
Builder & withGridSpacing(const Vector2D &gridSpacing)
Returns builder with grid spacing.
Builder & withOrigin(double gridOriginX, double gridOriginY)
Returns builder with grid origin.
CellCenteredScalarGrid2 & operator=(const CellCenteredScalarGrid2 &other)
Sets the contents with the given other grid.
Definition: advection_solver2.h:18
Abstract base class for 2-D scalar grid structure.
Definition: scalar_grid2.h:21
2-D vector class.
Definition: vector2.h:24
CellCenteredScalarGrid2 build() const
Builds CellCenteredScalarGrid2 instance.
Size2 dataSize() const override
Returns the actual data point size.
Builder & withResolution(size_t resolutionX, size_t resolutionY)
Returns builder with resolution.
CellCenteredScalarGrid2Ptr makeShared() const
Builds shared pointer of CellCenteredScalarGrid2 instance.
std::shared_ptr< ScalarGrid2 > clone() const override
Returns the copy of the grid instance.
std::shared_ptr< ScalarGrid2 > ScalarGrid2Ptr
Shared pointer for the ScalarGrid2 type.
Definition: scalar_grid2.h:188
2-D size class.
Definition: size2.h:19
#define JET_GRID2_TYPE_NAME(DerivedClassName)
Definition: grid2.h:113
const Size2 & resolution() const
Returns the grid resolution.
Builder & withOrigin(const Vector2D &gridOrigin)
Returns builder with grid origin.
std::shared_ptr< CellCenteredScalarGrid2 > CellCenteredScalarGrid2Ptr
Shared pointer for the CellCenteredScalarGrid2 type.
Definition: cell_centered_scalar_grid2.h:84
const Vector2D & gridSpacing() const
Returns the grid spacing.
Vector2D dataOrigin() const override
void set(const CellCenteredScalarGrid2 &other)
Sets the contents with the given other grid.
void swap(Grid2 *other) override
Swaps the contents with the given other grid.
Front-end to create CellCenteredScalarGrid2 objects step by step.
Definition: cell_centered_scalar_grid2.h:90
ScalarGrid2Ptr build(const Size2 &resolution, const Vector2D &gridSpacing, const Vector2D &gridOrigin, double initialVal) const override
Builds shared pointer of CellCenteredScalarGrid2 instance.