diff --git a/Numeric/JacobianBasis.cpp b/Numeric/JacobianBasis.cpp index 29ea8fb90224a7b1d986974d87724eace6d35b6d..06186615c0cd4e8070aacc8f24661d6f9b56c9da 100644 --- a/Numeric/JacobianBasis.cpp +++ b/Numeric/JacobianBasis.cpp @@ -1143,7 +1143,8 @@ JacobianBasis::JacobianBasis(int tag) for (int i=0; i<numPrimMapNodes; i++) { xBar += primMapBasis->points(i,0); yBar += primMapBasis->points(i,1); - zBar += primMapBasis->points(i,2); + if (primMapBasis->points.size2() > 2) + zBar += primMapBasis->points(i,2); } xBar /= numPrimMapNodes; yBar /= numPrimMapNodes; diff --git a/Numeric/polynomialBasis.cpp b/Numeric/polynomialBasis.cpp index d33cf242d9f83bfd74a755b1a11fd8ffe434c1bc..d5c06f6c061da3f691316b5767dbe07ec4a44e75 100644 --- a/Numeric/polynomialBasis.cpp +++ b/Numeric/polynomialBasis.cpp @@ -409,7 +409,7 @@ void polynomialBasis::f(const fullMatrix<double> &coord, fullMatrix<double> &sf) double p[1256]; sf.resize (coord.size1(), coefficients.size1()); for (int iPoint=0; iPoint< coord.size1(); iPoint++) { - evaluateMonomials(coord(iPoint,0), coord(iPoint,1), coord(iPoint,2), p); + evaluateMonomials(coord(iPoint,0), coord(iPoint,1), coord.size2() > 2 ? coord(iPoint,2) : 0, p); for (int i = 0; i < coefficients.size1(); i++) { sf(iPoint,i) = 0.; for (int j = 0; j < coefficients.size2(); j++) sf(iPoint,i) += coefficients(i, j) * p[j];