6 #ifndef ESTIMATE_H_INC_ 7 #define ESTIMATE_H_INC_ 27 template<
int dim,
class TargetSwarmState>
34 Estimate(SwarmState<dim>
const& source_state):
35 source_state_(source_state)
44 void set_interpolation_variable(std::string
const & interp_var_name,
size_t derivative=0) {
45 var_name_ = interp_var_name;
46 derivative_ = derivative;
57 double operator()(
int const target_index,
58 std::vector<Weights_t>
const &sources_and_mults)
const 60 int nsrc = sources_and_mults.size();
61 if (nsrc > 0) assert(derivative_ < sources_and_mults[0].weights.size());
64 for (
int i = 0; i < nsrc; i++) {
65 Weights_t
const& wt = sources_and_mults[i];
67 std::vector<double>
const& shape_vec = wt.weights;
68 result += source_vals_[p] * shape_vec[derivative_];
73 void set_variable(std::string
const & var_name,
size_t derivin=0) {
75 derivative_ = derivin;
76 source_vals_ = source_state_.get_field(var_name_);
80 SwarmState<dim>
const& source_state_;
81 std::string var_name_;
89 #endif // ESTIMATE_H_INC std::vector< T > vector
Definition: portage.h:238
Definition: coredriver.h:42