TECA
teca_laplacian.h
1 #ifndef teca_laplacian_h
2 #define teca_laplacian_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_laplacian)
12 
13 
18 {
19 public:
20  TECA_ALGORITHM_STATIC_NEW(teca_laplacian)
21  TECA_ALGORITHM_DELETE_COPY_ASSIGN(teca_laplacian)
22  TECA_ALGORITHM_CLASS_NAME(teca_laplacian)
23  ~teca_laplacian();
24 
25  // report/initialize to/from Boost program options
26  // objects.
27  TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
28  TECA_SET_ALGORITHM_PROPERTIES()
29 
30  // set the arrays that contain the vector components
31  // to compute laplacian from
32  TECA_ALGORITHM_PROPERTY(std::string, component_0_variable)
33  TECA_ALGORITHM_PROPERTY(std::string, component_1_variable)
34 
35  // set the name of the array to store the result in.
36  // the default is "laplacian"
37  TECA_ALGORITHM_PROPERTY(std::string, laplacian_variable)
38 
39 protected:
41 
42  std::string get_component_0_variable(const teca_metadata &request);
43  std::string get_component_1_variable(const teca_metadata &request);
44  std::string get_laplacian_variable(const teca_metadata &request);
45 
46 private:
47  teca_metadata get_output_metadata(
48  unsigned int port,
49  const std::vector<teca_metadata> &input_md) override;
50 
51  std::vector<teca_metadata> get_upstream_request(
52  unsigned int port,
53  const std::vector<teca_metadata> &input_md,
54  const teca_metadata &request) override;
55 
56  const_p_teca_dataset execute(
57  unsigned int port,
58  const std::vector<const_p_teca_dataset> &input_data,
59  const teca_metadata &request) override;
60 
61 private:
62  std::string component_0_variable;
63  std::string component_1_variable;
64  std::string laplacian_variable;
65 };
66 
67 #endif
teca_metadata
Definition: teca_metadata.h:17
teca_laplacian
an algorithm that computes laplacian
Definition: teca_laplacian.h:18
teca_algorithm
Definition: teca_algorithm.h:25