Go to the documentation of this file.
7 #ifndef INCLUDE_JET_CELL_CENTERED_VECTOR_GRID2_H_
8 #define INCLUDE_JET_CELL_CENTERED_VECTOR_GRID2_H_
38 double gridSpacingX = 1.0,
39 double gridSpacingY = 1.0,
42 double initialValueU = 0.0,
43 double initialValueV = 0.0);
87 std::shared_ptr<VectorGrid2>
clone()
const override;
141 const Vector2D& initialVal)
const override;
144 Size2 _resolution{1, 1};
152 #endif // INCLUDE_JET_CELL_CENTERED_VECTOR_GRID2_H_
void fill(const std::function< Vector2D(const Vector2D &)> &func, ExecutionPolicy policy=ExecutionPolicy::kParallel) override
Fills the grid with given function.
ExecutionPolicy
Execution policy tag.
Definition: parallel.h:13
const Vector2D & origin() const
Returns the grid origin.
2-D Cell-centered vector grid structure.
Definition: cell_centered_vector_grid2.h:24
Vector2< double > Vector2D
Double-type 2D vector.
Definition: vector2.h:340
Builder & withInitialValue(const Vector2D &initialVal)
Returns builder with initial value.
CellCenteredVectorGrid2(const Size2 &resolution, const Vector2D &gridSpacing=Vector2D(1.0, 1.0), const Vector2D &origin=Vector2D(), const Vector2D &initialValue=Vector2D())
Builder & withOrigin(const Vector2D &gridOrigin)
Returns builder with grid origin.
Abstract base class for 2-D cartesian grid structure.
Definition: grid2.h:30
VectorGrid2Ptr build(const Size2 &resolution, const Vector2D &gridSpacing, const Vector2D &gridOrigin, const Vector2D &initialVal) const override
Builds shared pointer of CellCenteredVectorGrid2 instance.
CellCenteredVectorGrid2()
Constructs zero-sized grid.
Builder & withInitialValue(double initialValX, double initialValY)
Returns builder with initial value.
Definition: advection_solver2.h:18
Builder & withResolution(const Size2 &resolution)
Returns builder with resolution.
Builder & withGridSpacing(double gridSpacingX, double gridSpacingY)
Returns builder with grid spacing.
Builder & withResolution(size_t resolutionX, size_t resolutionY)
Returns builder with resolution.
Vector2D dataOrigin() const override
Abstract base class for 2-D vector grid builder.
Definition: vector_grid2.h:91
void set(const CellCenteredVectorGrid2 &other)
Sets the contents with the given other grid.
2-D vector class.
Definition: vector2.h:24
Size2 dataSize() const override
Returns the actual data point size.
Abstract base class for 2-D collocated vector grid structure.
Definition: collocated_vector_grid2.h:18
std::shared_ptr< CellCenteredVectorGrid2 > CellCenteredVectorGrid2Ptr
Shared pointer for the CellCenteredVectorGrid2 type.
Definition: cell_centered_vector_grid2.h:94
CellCenteredVectorGrid2(size_t resolutionX, size_t resolutionY, double gridSpacingX=1.0, double gridSpacingY=1.0, double originX=0.0, double originY=0.0, double initialValueU=0.0, double initialValueV=0.0)
2-D size class.
Definition: size2.h:19
void swap(Grid2 *other) override
Swaps the contents with the given other grid.
CellCenteredVectorGrid2 & operator=(const CellCenteredVectorGrid2 &other)
Sets the contents with the given other grid.
Builder & withGridSpacing(const Vector2D &gridSpacing)
Returns builder with grid spacing.
Builder & withOrigin(double gridOriginX, double gridOriginY)
Returns builder with grid origin.
std::shared_ptr< VectorGrid2 > clone() const override
Returns the copy of the grid instance.
CellCenteredVectorGrid2(const CellCenteredVectorGrid2 &other)
Copy constructor.
static Builder builder()
Returns builder fox CellCenteredVectorGrid2.
void fill(const Vector2D &value, ExecutionPolicy policy=ExecutionPolicy::kParallel) override
Fills the grid with given value.
CellCenteredVectorGrid2Ptr makeShared() const
Builds shared pointer of CellCenteredVectorGrid2 instance.
CellCenteredVectorGrid2 build() const
Builds CellCenteredVectorGrid2 instance.
#define JET_GRID2_TYPE_NAME(DerivedClassName)
Definition: grid2.h:113
const Size2 & resolution() const
Returns the grid resolution.
Front-end to create CellCenteredVectorGrid2 objects step by step.
Definition: cell_centered_vector_grid2.h:100
const Vector2D & gridSpacing() const
Returns the grid spacing.
std::shared_ptr< VectorGrid2 > VectorGrid2Ptr
Shared pointer for the VectorGrid2 type.
Definition: vector_grid2.h:88