16 bool SpectralHex::_init =
false;
20 if( _init &&
_n == order )
return;
21 if( _init &&
_n != order )
30 for(
int d = 0; d < 3; d++ )
38 unsigned int nf =
_n *
_n, ne =
_n, nw = 2 *
_n *
_n + 3 *
_n;
41 void SpectralHex::freedata()
43 for(
int d = 0; d < 3; d++ )
52 void SpectralHex::set_gl_points(
double* x,
double* y,
double* z )
62 for( d = 0; d < 3; d++ )
67 for( d = 0; d < 3; d++ )
76 bool SpectralHex::evaluate_reverse(
CartVect const& xyz,
79 const double inside_tol,
88 double r[3] = { 0, 0, 0 };
92 if( dist > 0.9e+30 )
return false;
98 return is_inside( params, inside_tol );
122 void SpectralHex::evaluate_vector(
const CartVect& params,
const double* field,
int num_tuples,
double* eval )
const
126 for( d = 0; d < 3; d++ )
133 void SpectralHex::integrate_vector(
const double* field_values,
int num_tuples,
double* integral )
const
142 for(
int l = 0; l < num_tuples; l++ )
146 for(
int k = 0; k <
_n; k++ )
148 params[2] =
_ld[2].
z[k];
150 for(
int j = 0; j <
_n; j++ )
152 params[1] =
_ld[1].
z[j];
154 for(
int i = 0; i <
_n; i++ )
156 params[0] =
_ld[0].
z[i];
159 double wk =
_ld[2].
J[k];
160 double wj =
_ld[1].
J[j];
161 double wi =
_ld[0].
J[i];
173 double bm = wk * wj * wi * J.determinant();
174 for(
int l = 0; l < num_tuples; l++ )
175 integral[l] += bm * field_values[num_tuples * index + l];
185 return EvalSet::inside( params, ndim, tol );