PISM, A Parallel Ice Sheet Model 2.2.2-d6b3a29ca committed by Constantine Khrulev on 2025-03-28
|
◆ integration_weights() [1/2]
Compute weights for integrating a piece-wise linear or piece-wise constant function defined on the grid Uses constant extrapolation, both on the left and on the right. In the piece-wise constant case points in To evaluate in the integral compute the dot product of data on the grid double result = 0.0;
for (const auto &weight : weights) {
size_t k = weight.first;
double w = weight.second;
result += w * data[k];
}
Definition at line 309 of file Interpolation1D.cc. References LINEAR, PIECEWISE_CONSTANT, PISM_ERROR_LOCATION, weights_piecewise_constant(), and weights_piecewise_linear(). Referenced by pism::array::Forcing::average(), and integration_weights(). |