19 #include "pism/util/array/Vector.hh"
20 #include "pism/util/array/Array_impl.hh"
22 #include "pism/util/Grid.hh"
23 #include "pism/util/Context.hh"
24 #include "pism/util/VariableMetadata.hh"
40 unsigned int stencil_width)
52 auto result = std::make_shared<Vector>(
grid(),
get_name());
53 result->metadata(0) = this->
metadata(0);
54 result->metadata(1) = this->
metadata(1);
65 unsigned int stencil_width)
66 :
Vector(grid, name, stencil_width) {
This class represents a 2D vector field (such as ice velocity) at a certain grid point.
A storage vector combining related fields in a struct.
void set_name(const std::string &name)
Sets the variable name to name.
const std::string & get_name() const
Get the name of an Array object.
std::shared_ptr< const Grid > grid() const
SpatialVariableMetadata & metadata(unsigned int N=0)
Returns a reference to the SpatialVariableMetadata object containing metadata for the compoment N.
Vector1(std::shared_ptr< const Grid > grid, const std::string &name)
Vector2(std::shared_ptr< const Grid > grid, const std::string &name)
std::shared_ptr< Vector > duplicate() const
Vector(std::shared_ptr< const Grid > grid, const std::string &short_name)
std::shared_ptr< const Grid > grid
The computational grid.
std::vector< SpatialVariableMetadata > metadata
Metadata (NetCDF variable attributes)