37 #include "LinearBasisFunction.hpp"
38 #include "ChastePoint.hpp"
55 assert(basisIndex <= 3);
60 return 1.0 - rPoint[0] - rPoint[1] - rPoint[2];
92 assert(basisIndex <= 2);
97 return 1.0 - rPoint[0] - rPoint[1];
125 assert(basisIndex <= 1);
130 return 1.0 - rPoint[0];
152 assert(basisIndex == 0);
173 assert(basisIndex <= 3);
175 c_vector<double, 3> gradN;
221 assert(basisIndex <= 2);
223 c_vector<double, 2> gradN;
261 assert(basisIndex <= 1);
263 c_vector<double,1> gradN;
286 template <
unsigned ELEMENT_DIM>
288 c_vector<double, ELEMENT_DIM+1>& rReturnValue)
290 assert(ELEMENT_DIM < 4 && ELEMENT_DIM > 0);
291 for (
unsigned i=0; i<ELEMENT_DIM+1; i++)
293 rReturnValue(i) = ComputeBasisFunction(rPoint, i);
306 c_vector<double,1>& rReturnValue)
320 template <
unsigned ELEMENT_DIM>
322 c_matrix<double, ELEMENT_DIM, ELEMENT_DIM+1>& rReturnValue)
324 assert(ELEMENT_DIM < 4 && ELEMENT_DIM > 0);
326 for (
unsigned j=0; j<ELEMENT_DIM+1; j++)
328 matrix_column<c_matrix<double, ELEMENT_DIM, ELEMENT_DIM+1> > column(rReturnValue, j);
329 column = ComputeBasisFunctionDerivative(rPoint, j);
347 template <
unsigned ELEMENT_DIM>
349 const c_matrix<double, ELEMENT_DIM, ELEMENT_DIM>& rInverseJacobian,
350 c_matrix<double, ELEMENT_DIM, ELEMENT_DIM+1>& rReturnValue)
352 assert(ELEMENT_DIM < 4 && ELEMENT_DIM > 0);
354 ComputeBasisFunctionDerivatives(rPoint, rReturnValue);
355 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)