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);
174 c_vector<double, 3> gradN {};
220 assert(basisIndex <= 2);
221 c_vector<double, 2> gradN {};
259 assert(basisIndex <= 1);
260 c_vector<double,1> gradN {};
283template <
unsigned ELEMENT_DIM>
285 c_vector<double, ELEMENT_DIM+1>& rReturnValue)
287 assert(ELEMENT_DIM < 4 && ELEMENT_DIM > 0);
288 for (
unsigned i=0; i<ELEMENT_DIM+1; i++)
290 rReturnValue(i) = ComputeBasisFunction(rPoint, i);
303 c_vector<double,1>& rReturnValue)
305 rReturnValue(0) = ComputeBasisFunction(rPoint, 0);
316template <
unsigned ELEMENT_DIM>
318 c_matrix<double, ELEMENT_DIM, ELEMENT_DIM+1>& rReturnValue)
320 assert(ELEMENT_DIM < 4 && ELEMENT_DIM > 0);
321 for (
unsigned j=0; j<ELEMENT_DIM+1; j++)
323 matrix_column<c_matrix<double, ELEMENT_DIM, ELEMENT_DIM+1> > column(rReturnValue, j);
324 column = ComputeBasisFunctionDerivative(rPoint, j);
342template <
unsigned ELEMENT_DIM>
344 const c_matrix<double, ELEMENT_DIM, ELEMENT_DIM>& rInverseJacobian,
345 c_matrix<double, ELEMENT_DIM, ELEMENT_DIM+1>& rReturnValue)
347 assert(ELEMENT_DIM < 4 && ELEMENT_DIM > 0);
349 ComputeBasisFunctionDerivatives(rPoint, rReturnValue);
350 rReturnValue = prod(trans(rInverseJacobian), rReturnValue);
static c_vector< double, ELEMENT_DIM > ComputeBasisFunctionDerivative(const ChastePoint< ELEMENT_DIM > &rPoint, unsigned basisIndex)
static void ComputeBasisFunctions(const ChastePoint< ELEMENT_DIM > &rPoint, c_vector< double, 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 void ComputeBasisFunctionDerivatives(const ChastePoint< ELEMENT_DIM > &rPoint, c_matrix< double, ELEMENT_DIM, ELEMENT_DIM+1 > &rReturnValue)
static double ComputeBasisFunction(const ChastePoint< ELEMENT_DIM > &rPoint, unsigned basisIndex)