37 #include "LinearBasisFunction.hpp"
38 #include "ChastePoint.hpp"
55 assert(basisIndex <= 3);
60 return 1.0 - rPoint[0] - rPoint[1] - rPoint[2];
91 assert(basisIndex <= 2);
96 return 1.0 - rPoint[0] - rPoint[1];
124 assert(basisIndex <= 1);
129 return 1.0 - rPoint[0];
151 assert(basisIndex == 0);
172 assert(basisIndex <= 3);
174 c_vector<double, 3> gradN;
220 assert(basisIndex <= 2);
222 c_vector<double, 2> gradN;
260 assert(basisIndex <= 1);
262 c_vector<double,1> gradN;
285 template <
unsigned ELEMENT_DIM>
287 c_vector<double, ELEMENT_DIM+1>& rReturnValue)
289 assert(ELEMENT_DIM < 4 && ELEMENT_DIM > 0);
290 for (
unsigned i=0; i<ELEMENT_DIM+1; i++)
292 rReturnValue(i) = ComputeBasisFunction(rPoint, i);
305 c_vector<double,1>& rReturnValue)
319 template <
unsigned ELEMENT_DIM>
321 c_matrix<double, ELEMENT_DIM, ELEMENT_DIM+1>& rReturnValue)
323 assert(ELEMENT_DIM < 4 && ELEMENT_DIM > 0);
325 for (
unsigned j=0; j<ELEMENT_DIM+1; j++)
327 matrix_column<c_matrix<double, ELEMENT_DIM, ELEMENT_DIM+1> > column(rReturnValue, j);
328 column = ComputeBasisFunctionDerivative(rPoint, j);
346 template <
unsigned ELEMENT_DIM>
348 const c_matrix<double, ELEMENT_DIM, ELEMENT_DIM>& rInverseJacobian,
349 c_matrix<double, ELEMENT_DIM, ELEMENT_DIM+1>& rReturnValue)
351 assert(ELEMENT_DIM < 4 && ELEMENT_DIM > 0);
353 ComputeBasisFunctionDerivatives(rPoint, rReturnValue);
354 rReturnValue = prod(trans(rInverseJacobian), rReturnValue);
static c_vector< double, ELEMENT_DIM > ComputeBasisFunctionDerivative(const ChastePoint< ELEMENT_DIM > &rPoint, unsigned basisIndex)
static void ComputeBasisFunctionDerivatives(const ChastePoint< ELEMENT_DIM > &rPoint, c_matrix< double, ELEMENT_DIM, ELEMENT_DIM+1 > &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 > &rReturnValue)
static double ComputeBasisFunction(const ChastePoint< ELEMENT_DIM > &rPoint, unsigned basisIndex)
static void ComputeBasisFunctions(const ChastePoint< ELEMENT_DIM > &rPoint, c_vector< double, ELEMENT_DIM+1 > &rReturnValue)