36 #include "QuadraticBasisFunction.hpp" 51 assert(basisIndex == 0);
63 c_vector<double, 1>& rReturnValue)
77 template <
unsigned ELEMENT_DIM>
80 assert(ELEMENT_DIM < 4 && ELEMENT_DIM >= 0);
85 assert(basisIndex == 0);
94 return 2.0*(x-1.0)*(x-0.5);
100 return 4.0*x*(1.0-x);
113 return 2.0 * (1.0 - x - y) * (0.5 - x - y);
116 return 2.0*x*(x-0.5);
119 return 2.0*y*(y-0.5);
125 return 4.0 * (1.0 - x - y) * y;
128 return 4.0 * (1.0 - x - y) * x;
142 return 2.0 * (1.0 - x - y - z) * (0.5 - x - y - z);
145 return 2.0*x*(x-0.5);
148 return 2.0*y*(y-0.5);
151 return 2.0*z*(z-0.5);
154 return 4.0 * (1.0 - x - y - z) * x;
160 return 4.0 * (1.0 - x - y - z) * y;
163 return 4.0 * (1.0 - x - y - z) * z;
189 template <
unsigned ELEMENT_DIM>
192 c_vector<double, ELEMENT_DIM> gradN;
193 assert(ELEMENT_DIM < 4 && ELEMENT_DIM > 0);
203 gradN(0) = 4.0*x-3.0;
206 gradN(0) = 4.0*x-1.0;
209 gradN(0) = 4.0-8.0*x;
222 gradN(0) = -3.0 + 4.0*x + 4.0*y;
223 gradN(1) = -3.0 + 4.0*x + 4.0*y;
226 gradN(0) = 4.0*x - 1.0;
231 gradN(1) = 4.0*y - 1.0;
239 gradN(1) = 4.0-4.0*x-8.0*y;
242 gradN(0) = 4.0-8.0*x-4.0*y;
257 gradN(0) = -3.0 + 4.0*(x+y+z);
258 gradN(1) = -3.0 + 4.0*(x+y+z);
259 gradN(2) = -3.0 + 4.0*(x+y+z);
262 gradN(0) = 4.0*x-1.0;
268 gradN(1) = 4.0*y-1.0;
274 gradN(2) = 4.0*z-1.0;
277 gradN(0) = 4.0-8.0*x-4.0*y-4.0*z;
288 gradN(1) = 4.0-4.0*x-8.0*y-4.0*z;
294 gradN(2) = 4.0-4.0*x-4.0*y-8.0*z;
321 template <
unsigned ELEMENT_DIM>
323 c_vector<
double, (ELEMENT_DIM+1)*(ELEMENT_DIM+2)/2>& rReturnValue)
325 assert(ELEMENT_DIM < 4 && ELEMENT_DIM >= 0);
327 for (
unsigned i=0; i<(ELEMENT_DIM+1)*(ELEMENT_DIM+2)/2; i++)
342 template <
unsigned ELEMENT_DIM>
344 c_matrix<
double, ELEMENT_DIM, (ELEMENT_DIM+1)*(ELEMENT_DIM+2)/2>& rReturnValue)
346 assert(ELEMENT_DIM < 4 && ELEMENT_DIM > 0);
348 for (
unsigned j=0; j<(ELEMENT_DIM+1)*(ELEMENT_DIM+2)/2; j++)
350 matrix_column<c_matrix<
double, ELEMENT_DIM, (ELEMENT_DIM+1)*(ELEMENT_DIM+2)/2> > column(rReturnValue, j);
368 template <
unsigned ELEMENT_DIM>
370 const c_matrix<double, ELEMENT_DIM, ELEMENT_DIM>& rInverseJacobian,
371 c_matrix<
double, ELEMENT_DIM, (ELEMENT_DIM+1)*(ELEMENT_DIM+2)/2>& rReturnValue)
373 assert(ELEMENT_DIM < 4 && ELEMENT_DIM > 0);
376 rReturnValue = prod(trans(rInverseJacobian), rReturnValue);
static void ComputeBasisFunctionDerivatives(const ChastePoint< ELEMENT_DIM > &rPoint, c_matrix< double, ELEMENT_DIM,(ELEMENT_DIM+1)*(ELEMENT_DIM+2)/2 > &rReturnValue)
static void ComputeTransformedBasisFunctionDerivatives(const ChastePoint< ELEMENT_DIM > &rPoint, const c_matrix< double, ELEMENT_DIM, ELEMENT_DIM > &rInverseJacobian, c_matrix< double, ELEMENT_DIM,(ELEMENT_DIM+1)*(ELEMENT_DIM+2)/2 > &rReturnValue)
static void ComputeBasisFunctions(const ChastePoint< ELEMENT_DIM > &rPoint, c_vector< double,(ELEMENT_DIM+1)*(ELEMENT_DIM+2)/2 > &rReturnValue)
static c_vector< double, ELEMENT_DIM > ComputeBasisFunctionDerivative(const ChastePoint< ELEMENT_DIM > &rPoint, unsigned basisIndex)
static double ComputeBasisFunction(const ChastePoint< ELEMENT_DIM > &rPoint, unsigned basisIndex)