From c44992c4196249f73abf963b1f1bfe2912915a77 Mon Sep 17 00:00:00 2001 From: Nicolas Marsic <nicolas.marsic@gmail.com> Date: Mon, 28 Jan 2013 11:15:59 +0000 Subject: [PATCH] Comparaison between fast and slow integration + Mapper with faster interface + Minor Fix --- FunctionSpace/FunctionSpaceVector.cpp | 40 +++++++++++++++------------ 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/FunctionSpace/FunctionSpaceVector.cpp b/FunctionSpace/FunctionSpaceVector.cpp index 5cbb3657f4..8ca871ef95 100644 --- a/FunctionSpace/FunctionSpaceVector.cpp +++ b/FunctionSpace/FunctionSpaceVector.cpp @@ -27,7 +27,7 @@ interpolate(const MElement& element, eelement.xyz2uvw(phys, uvw); // Get Jacobian // - fullMatrix<double> invJac(3, 3); + fullMatrix<double> invJac(3, 3); eelement.getJacobian(uvw[0], uvw[1], uvw[2], invJac); invJac.invertInPlace(); @@ -38,20 +38,23 @@ interpolate(const MElement& element, const unsigned int nFun = fun->size1(); // Interpolate (in Reference Place) // - fullVector<double> val(3); - val(0) = 0; - val(1) = 0; - val(2) = 0; + fullMatrix<double> val(1, 3); + val(0, 0) = 0; + val(0, 1) = 0; + val(0, 2) = 0; for(unsigned int i = 0; i < nFun; i++){ - val(0) += (*fun)(i, 0) * coef[i]; - val(1) += (*fun)(i, 1) * coef[i]; - val(2) += (*fun)(i, 2) * coef[i]; + val(0, 0) += (*fun)(i, 0) * coef[i]; + val(0, 1) += (*fun)(i, 1) * coef[i]; + val(0, 2) += (*fun)(i, 2) * coef[i]; } // Return Interpolated Value // delete fun; - return Mapper::grad(val, invJac); + + fullVector<double> map(3); + Mapper::hCurl(val, 0, 0, invJac, map); + return map; } fullVector<double> FunctionSpaceVector:: @@ -76,18 +79,21 @@ interpolateInRefSpace(const MElement& element, // Interpolate (in Reference Place) // - fullVector<double> val(3); - val(0) = 0; - val(1) = 0; - val(2) = 0; + fullMatrix<double> val(1, 3); + val(0, 0) = 0; + val(0, 1) = 0; + val(0, 2) = 0; for(unsigned int i = 0; i < nFun; i++){ - val(0) += (*fun)(i, 0) * coef[i]; - val(1) += (*fun)(i, 1) * coef[i]; - val(2) += (*fun)(i, 2) * coef[i]; + val(0, 0) += (*fun)(i, 0) * coef[i]; + val(0, 1) += (*fun)(i, 1) * coef[i]; + val(0, 2) += (*fun)(i, 2) * coef[i]; } // Return Interpolated Value // delete fun; - return Mapper::grad(val, invJac); + + fullVector<double> map(3); + Mapper::hCurl(val, 0, 0, invJac, map); + return map; } -- GitLab