10 const double LinearQuad::corner[4][2] = { { -1, -1 }, { 1, -1 }, { 1, 1 }, { -1, 1 } };
27 for(
unsigned i = 0; i < 4; ++i )
29 const double xi_p = 1 + params[0] *
corner[i][0];
30 const double eta_p = 1 + params[1] *
corner[i][1];
31 const double dNi_dxi =
corner[i][0] * eta_p;
32 const double dNi_deta =
corner[i][1] * xi_p;
33 ( *J )( 0, 0 ) += dNi_dxi * verts[i * 3 + 0];
34 ( *J )( 1, 0 ) += dNi_dxi * verts[i * 3 + 1];
35 ( *J )( 0, 1 ) += dNi_deta * verts[i * 3 + 0];
36 ( *J )( 1, 1 ) += dNi_deta * verts[i * 3 + 1];
50 for(
int i = 0; i < num_tuples; i++ )
52 for(
unsigned i = 0; i < 4; ++i )
54 const double N_i = ( 1 + params[0] *
corner[i][0] ) * ( 1 + params[1] *
corner[i][1] );
55 for(
int j = 0; j < num_tuples; j++ )
56 result[j] += N_i * field[i * num_tuples + j];
58 for(
int i = 0; i < num_tuples; i++ )
74 for(
int i = 0; i < num_tuples; i++ )
86 rval =
evalFcn( x.
array(), field, ndim, num_tuples, NULL, tmp_result );
91 for(
int i = 0; i < num_tuples; i++ )
92 result[i] += tmp_result[i] * tmp_det;
105 const double iter_tol,
106 const double inside_tol,
111 return EvalSet::evaluate_reverse( eval, jacob, ins, posn, verts, nverts, ndim, iter_tol, inside_tol, work, params,
127 if( nverts != 4 )
MB_SET_ERR( MB_FAILURE,
"Incorrect vertex count for passed quad :: expected value = 4" );
128 if( ientDim != 1 )
MB_SET_ERR( MB_FAILURE,
"Requesting normal for unsupported dimension :: expected value = 1 " );
129 if( facet > 4 || facet < 0 )
MB_SET_ERR( MB_FAILURE,
"Incorrect local edge id :: expected value = one of 0-3" );
137 for(
int i = 0; i < 3; i++ )
139 edge[i] = verts[3 * id1 + i] - verts[3 * id0 + i];
142 double x0[3], x1[3], fnrm[3];
143 for(
int i = 0; i < 3; i++ )
145 x0[i] = verts[3 * 1 + i] - verts[3 * 0 + i];
146 x1[i] = verts[3 * 3 + i] - verts[3 * 0 + i];
148 fnrm[0] = x0[1] * x1[2] - x1[1] * x0[2];
149 fnrm[1] = x1[0] * x0[2] - x0[0] * x1[2];
150 fnrm[2] = x0[0] * x1[1] - x1[0] * x0[1];
154 double a =
edge[1] * fnrm[2] - fnrm[1] *
edge[2];
155 double b =
edge[2] * fnrm[0] - fnrm[2] *
edge[0];
156 double c =
edge[0] * fnrm[1] - fnrm[0] *
edge[1];
157 double nrm = sqrt( a * a + b * b + c * c );
159 if( nrm > std::numeric_limits< double >::epsilon() )