11 template<
int N>
double shape_fun(
double xi,
double eta);
13 template<>
inline double shape_fun<0>(
double xi,
double eta) {
return -0.25*(1-xi)*(1-eta)*(1+xi+eta); }
14 template<>
inline double shape_fun<1>(
double xi,
double eta) {
return 0.5*(1-xi)*(1+xi)*(1-eta); }
15 template<>
inline double shape_fun<2>(
double xi,
double eta) {
return -0.25*(1+xi)*(1-eta)*(1-xi+eta); }
16 template<>
inline double shape_fun<3>(
double xi,
double eta) {
return 0.5*(1+xi)*(1+eta)*(1-eta); }
17 template<>
inline double shape_fun<4>(
double xi,
double eta) {
return -0.25*(1+xi)*(1+eta)*(1-xi-eta); }
18 template<>
inline double shape_fun<5>(
double xi,
double eta) {
return 0.5*(1-xi)*(1+xi)*(1+eta); }
19 template<>
inline double shape_fun<6>(
double xi,
double eta) {
return -0.25*(1-xi)*(1+eta)*(1+xi-eta); }
20 template<>
inline double shape_fun<7>(
double xi,
double eta) {
return 0.5*(1-xi)*(1+eta)*(1-eta); }
24 inline double isop(
const double nodes[],
double xi,
double eta)
26 return isop<N-1>(nodes, xi, eta) + nodes[N-1]*shape_fun<N-1>(xi, eta);
30 inline double isop<0>(
const double[],
double,
double)
43 return detail::isop(nodes, xi, eta);
47 template<
typename Function>
50 isop_map(Function f,
const double* x,
const double* y) : f(f), x(x), y(y) {}
52 double operator()(
double xi,
double eta)
54 return f(
isop(x, xi, eta),
isop(y, xi, eta));
63 template<
typename Function>
Base class for all sources.
Definition source.h:44
ISOP namespace is for functions related to isoparametric interpolation.
Definition isop.h:7
double isop_render(Source &source, const double nodx[], const double nody[], double a_xi, double b_xi, double a_eta, double b_eta)
Integrate source flux using the isoparameterized lens.
Definition isop_render.cpp:5
isop_map< Function > make_isop_map(Function f, const double *x, const double *y)
Creates an isoparametric mapping functor.
Definition isop.h:64
double isop(const double nodes[], double xi, double eta)
Do the isoparametric interpolation given a list of 8 nodes. See notes for isop_render().
Definition isop.h:37
Functor to transparently map [-1,1]x[-1,1] to interpolation space.
Definition isop.h:49