/usr/include/dune/localfunctions/lagrange/pk3d/pk3dlocalinterpolation.hh is in libdune-localfunctions-dev 2.2.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | // -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set ts=8 sw=4 et sts=4:
#ifndef DUNE_Pk3DLOCALINTERPOLATION_HH
#define DUNE_Pk3DLOCALINTERPOLATION_HH
#include <vector>
namespace Dune
{
template<class LB>
class Pk3DLocalInterpolation
{
enum {N = LB::N};
enum {k = LB::O};
private:
static const int kdiv = (k == 0 ? 1 : k);
public:
template<typename F, typename C>
void interpolate (const F& f, std::vector<C>& out) const
{
typename LB::Traits::DomainType x;
typename LB::Traits::RangeType y;
typedef typename LB::Traits::DomainFieldType D;
out.resize(N);
int n=0;
for (int i2 = 0; i2 <= k; i2++)
for (int i1 = 0; i1 <= k-i2; i1++)
for (int i0 = 0; i0 <= k-i1-i2; i0++)
{
x[0] = ((D)i0)/((D)kdiv);
x[1] = ((D)i1)/((D)kdiv);
x[2] = ((D)i2)/((D)kdiv);
f.evaluate(x,y);
out[n] = y;
n++;
}
}
};
}
#endif
|