Go to the documentation of this file.
7 #ifndef INCLUDE_JET_VERTEX_CENTERED_SCALAR_GRID2_H_
8 #define INCLUDE_JET_VERTEX_CENTERED_SCALAR_GRID2_H_
38 double gridSpacingX = 1.0,
39 double gridSpacingY = 1.0,
42 double initialValue = 0.0);
50 double initialValue = 0.0);
64 std::shared_ptr<ScalarGrid2>
clone()
const override;
130 double initialVal)
const override;
133 Size2 _resolution{1, 1};
136 double _initialVal = 0.0;
141 #endif // INCLUDE_JET_VERTEX_CENTERED_SCALAR_GRID2_H_
Builder & withGridSpacing(double gridSpacingX, double gridSpacingY)
Returns builder with grid spacing.
VertexCenteredScalarGrid2(const VertexCenteredScalarGrid2 &other)
Copy constructor.
Builder & withResolution(size_t resolutionX, size_t resolutionY)
Returns builder with resolution.
Builder & withOrigin(const Vector2D &gridOrigin)
Returns builder with grid origin.
Front-end to create VertexCenteredScalarGrid2 objects step by step.
Definition: vertex_centered_scalar_grid2.h:92
const Vector2D & origin() const
Returns the grid origin.
Abstract base class for 2-D scalar grid builder.
Definition: scalar_grid2.h:191
Vector2< double > Vector2D
Double-type 2D vector.
Definition: vector2.h:340
Size2 dataSize() const override
Returns the actual data point size.
std::shared_ptr< ScalarGrid2 > clone() const override
Returns the copy of the grid instance.
VertexCenteredScalarGrid2(const Size2 &resolution, const Vector2D &gridSpacing=Vector2D(1.0, 1.0), const Vector2D &origin=Vector2D(), double initialValue=0.0)
VertexCenteredScalarGrid2 build() const
Builds VertexCenteredScalarGrid2 instance.
std::shared_ptr< VertexCenteredScalarGrid2 > VertexCenteredScalarGrid2Ptr
Shared pointer for the VertexCenteredScalarGrid2 type.
Definition: vertex_centered_scalar_grid2.h:86
Abstract base class for 2-D cartesian grid structure.
Definition: grid2.h:30
VertexCenteredScalarGrid2()
Constructs zero-sized grid.
Definition: advection_solver2.h:18
static Builder builder()
Returns builder fox VertexCenteredScalarGrid2.
Abstract base class for 2-D scalar grid structure.
Definition: scalar_grid2.h:21
2-D vector class.
Definition: vector2.h:24
Builder & withOrigin(double gridOriginX, double gridOriginY)
Returns builder with grid origin.
2-D Vertex-centered scalar grid structure.
Definition: vertex_centered_scalar_grid2.h:24
std::shared_ptr< ScalarGrid2 > ScalarGrid2Ptr
Shared pointer for the ScalarGrid2 type.
Definition: scalar_grid2.h:188
2-D size class.
Definition: size2.h:19
ScalarGrid2Ptr build(const Size2 &resolution, const Vector2D &gridSpacing, const Vector2D &gridOrigin, double initialVal) const override
Builds shared pointer of VertexCenteredScalarGrid2 instance.
Builder & withResolution(const Size2 &resolution)
Returns builder with resolution.
Builder & withGridSpacing(const Vector2D &gridSpacing)
Returns builder with grid spacing.
#define JET_GRID2_TYPE_NAME(DerivedClassName)
Definition: grid2.h:113
const Size2 & resolution() const
Returns the grid resolution.
VertexCenteredScalarGrid2(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)
void swap(Grid2 *other) override
Swaps the contents with the given other grid.
Vector2D dataOrigin() const override
const Vector2D & gridSpacing() const
Returns the grid spacing.
Builder & withInitialValue(double initialVal)
Returns builder with initial value.
VertexCenteredScalarGrid2 & operator=(const VertexCenteredScalarGrid2 &other)
Sets the contents with the given other grid.
VertexCenteredScalarGrid2Ptr makeShared() const
Builds shared pointer of VertexCenteredScalarGrid2 instance.
void set(const VertexCenteredScalarGrid2 &other)
Sets the contents with the given other grid.