19 #include "atlas/array/ArrayShape.h" 20 #include "atlas/array/DataType.h" 22 #include "atlas/library/config.h" 23 #include "atlas/util/ObjectHandle.h" 26 class Parametrisation;
59 class Field : DOXYGEN_HIDE( public util::ObjectHandle<field::FieldImpl> ) {
65 Field(
const eckit::Parametrisation& );
78 template <
typename DATATYPE>
83 template <
typename DATATYPE>
96 bool valid()
const {
return get() !=
nullptr; }
107 const std::string& name()
const;
110 void rename(
const std::string& name );
122 const std::vector<int>& shapef()
const;
125 const std::vector<int>& stridesf()
const;
146 size_t bytes()
const;
148 bool contiguous()
const;
151 friend std::ostream& operator<<( std::ostream& os,
const Field& v );
154 void dump( std::ostream& os )
const;
157 void set_levels(
idx_t n );
158 idx_t levels()
const;
161 void set_variables(
idx_t n );
162 idx_t variables()
const;
164 void set_functionspace(
const FunctionSpace& functionspace );
168 size_t footprint()
const;
172 void set_dirty(
bool =
true )
const;
174 void haloExchange(
bool on_device =
false )
const;
175 void adjointHaloExchange(
bool on_device =
false )
const;
178 void updateHost()
const;
179 void updateDevice()
const;
180 void syncHostDevice()
const;
181 bool hostNeedsUpdate()
const;
182 bool deviceNeedsUpdate()
const;
183 void reactivateDeviceWriteViews()
const;
184 void reactivateHostWriteViews()
const;
187 extern template Field::Field(
const std::string&,
float*,
const array::ArraySpec& );
188 extern template Field::Field(
const std::string&,
float*,
const array::ArrayShape& );
189 extern template Field::Field(
const std::string&,
double*,
const array::ArraySpec& );
190 extern template Field::Field(
const std::string&,
double*,
const array::ArrayShape& );
191 extern template Field::Field(
const std::string&,
long*,
const array::ArraySpec& );
192 extern template Field::Field(
const std::string&,
long*,
const array::ArrayShape& );
193 extern template Field::Field(
const std::string&,
int*,
const array::ArraySpec& );
194 extern template Field::Field(
const std::string&,
int*,
const array::ArrayShape& );
Definition: ArrayShape.h:33
A Field contains an Array, Metadata, and a reference to a FunctionSpace.
Definition: Field.h:59
Definition: ArraySpec.h:27
Definition: ArrayStrides.h:23
Definition: DataType.h:40
Forward declarations of public API header atlas/array.h.
Contains all atlas classes and methods.
Definition: atlas-grids.cc:33
long idx_t
Integer type for indices in connectivity tables.
Definition: config.h:42
Definition: FunctionSpace.h:39