TECA
The Toolkit for Extreme Climate Analysis
teca_uniform_cartesian_mesh.h
1 #ifndef teca_uniform_cartesian_mesh_h
2 #define teca_uniform_cartesian_mesh_h
3 
4 #include "teca_config.h"
5 #include "teca_mesh.h"
6 #include "teca_shared_object.h"
7 
8 TECA_SHARED_OBJECT_FORWARD_DECL(teca_uniform_cartesian_mesh)
9 
10 /// Data on a uniform cartesian mesh.
12 {
13 public:
14  TECA_DATASET_STATIC_NEW(teca_uniform_cartesian_mesh)
15  TECA_DATASET_NEW_INSTANCE()
16  TECA_DATASET_NEW_COPY()
17 
18  virtual ~teca_uniform_cartesian_mesh() = default;
19 
20  // set/get metadata
21  TECA_DATASET_METADATA(time, double, 1)
22  TECA_DATASET_METADATA(time_step, unsigned long, 1)
23  TECA_DATASET_METADATA(spacing, double, 3)
24  TECA_DATASET_METADATA(origin, double, 3)
25  TECA_DATASET_METADATA(extent, unsigned long, 6)
26  TECA_DATASET_METADATA(whole_extent, unsigned long, 6)
27 
28  /// get the number of points in the mesh
29  unsigned long get_number_of_points() const override;
30 
31  /// get the number of cells in the mesh
32  unsigned long get_number_of_cells() const override;
33 
34  /// return a unique string identifier
35  std::string get_class_name() const override
36  { return "teca_uniform_cartesian_mesh"; }
37 
38  /// return a unique integer identifier
39  int get_type_code() const override;
40 
41  /// @copydoc teca_dataset::copy(const const_p_teca_dataset &,allocator)
42  void copy(const const_p_teca_dataset &other,
43  allocator alloc = allocator::malloc) override;
44 
45  /// @copydoc teca_dataset::shallow_copy(const p_teca_dataset &)
46  void shallow_copy(const p_teca_dataset &other) override;
47 
48  /// swap internals of the two objects
49  void swap(const p_teca_dataset &) override;
50 
51 #if defined(SWIG)
52 protected:
53 #else
54 public:
55 #endif
56  // NOTE: constructors are public to enable std::make_shared. do not use.
58 };
59 
60 #endif
teca_mesh
A base class for geometric data.
Definition: teca_mesh.h:19
teca_py_array::copy
TECA_EXPORT bool copy(teca_variant_array *varr, PyObject *obj)
Copy values from the object into variant array.
Definition: teca_py_array.h:290
teca_shared_object.h
teca_uniform_cartesian_mesh
Data on a uniform cartesian mesh.
Definition: teca_uniform_cartesian_mesh.h:11
teca_error::TECA_EXPORT
p_teca_error_handler error_handler TECA_EXPORT
The global error handler instance.