TECA
The Toolkit for Extreme Climate Analysis
teca_vorticity.h
1 #ifndef teca_vorticity_h
2 #define teca_vorticity_h
3 
4 #include "teca_shared_object.h"
5 #include "teca_algorithm.h"
6 #include "teca_metadata.h"
7 
8 #include <string>
9 #include <vector>
10 
11 TECA_SHARED_OBJECT_FORWARD_DECL(teca_vorticity)
12 
13 /// An algorithm that computes vorticity from a vector field.
15 {
16 public:
17  TECA_ALGORITHM_STATIC_NEW(teca_vorticity)
18  TECA_ALGORITHM_DELETE_COPY_ASSIGN(teca_vorticity)
19  TECA_ALGORITHM_CLASS_NAME(teca_vorticity)
20  ~teca_vorticity();
21 
22  // report/initialize to/from Boost program options
23  // objects.
24  TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
25  TECA_SET_ALGORITHM_PROPERTIES()
26 
27  /** @name component_0_variable
28  * set the arrays that contain the vector components to compute vorticity
29  * from.
30  */
31  ///@{
32  TECA_ALGORITHM_PROPERTY(std::string, component_0_variable)
33  ///@}
34 
35  /** @name component_1_variable
36  * set the arrays that contain the vector components to compute vorticity
37  * from.
38  */
39  ///@{
40  TECA_ALGORITHM_PROPERTY(std::string, component_1_variable)
41  ///@}
42 
43  /** @name vorticity_variable
44  * set the name of the array to store the result in. the default is
45  * "vorticity"
46  */
47  ///@{
48  TECA_ALGORITHM_PROPERTY(std::string, vorticity_variable)
49  ///@}
50 
51 protected:
53 
54  std::string get_component_0_variable(const teca_metadata &request);
55  std::string get_component_1_variable(const teca_metadata &request);
56  std::string get_vorticity_variable(const teca_metadata &request);
57 
58 private:
59  using teca_algorithm::get_output_metadata;
60 
61  teca_metadata get_output_metadata(
62  unsigned int port,
63  const std::vector<teca_metadata> &input_md) override;
64 
65  std::vector<teca_metadata> get_upstream_request(
66  unsigned int port,
67  const std::vector<teca_metadata> &input_md,
68  const teca_metadata &request) override;
69 
70  const_p_teca_dataset execute(
71  unsigned int port,
72  const std::vector<const_p_teca_dataset> &input_data,
73  const teca_metadata &request) override;
74 
75 private:
76  std::string component_0_variable;
77  std::string component_1_variable;
78  std::string vorticity_variable;
79 };
80 
81 #endif
teca_metadata
A generic container for meta data in the form of name=value pairs.
Definition: teca_metadata.h:21
teca_vorticity
An algorithm that computes vorticity from a vector field.
Definition: teca_vorticity.h:14
teca_shared_object.h
teca_error::TECA_EXPORT
p_teca_error_handler error_handler TECA_EXPORT
The global error handler instance.
teca_algorithm
The interface to TECA pipeline architecture.
Definition: teca_algorithm.h:237