Skip to content
Snippets Groups Projects
Commit c44992c4 authored by Nicolas Marsic's avatar Nicolas Marsic
Browse files

Comparaison between fast and slow integration + Mapper with faster interface + Minor Fix

parent 4331047a
No related branches found
No related tags found
No related merge requests found
...@@ -38,20 +38,23 @@ interpolate(const MElement& element, ...@@ -38,20 +38,23 @@ interpolate(const MElement& element,
const unsigned int nFun = fun->size1(); const unsigned int nFun = fun->size1();
// Interpolate (in Reference Place) // // Interpolate (in Reference Place) //
fullVector<double> val(3); fullMatrix<double> val(1, 3);
val(0) = 0; val(0, 0) = 0;
val(1) = 0; val(0, 1) = 0;
val(2) = 0; val(0, 2) = 0;
for(unsigned int i = 0; i < nFun; i++){ for(unsigned int i = 0; i < nFun; i++){
val(0) += (*fun)(i, 0) * coef[i]; val(0, 0) += (*fun)(i, 0) * coef[i];
val(1) += (*fun)(i, 1) * coef[i]; val(0, 1) += (*fun)(i, 1) * coef[i];
val(2) += (*fun)(i, 2) * coef[i]; val(0, 2) += (*fun)(i, 2) * coef[i];
} }
// Return Interpolated Value // // Return Interpolated Value //
delete fun; delete fun;
return Mapper::grad(val, invJac);
fullVector<double> map(3);
Mapper::hCurl(val, 0, 0, invJac, map);
return map;
} }
fullVector<double> FunctionSpaceVector:: fullVector<double> FunctionSpaceVector::
...@@ -76,18 +79,21 @@ interpolateInRefSpace(const MElement& element, ...@@ -76,18 +79,21 @@ interpolateInRefSpace(const MElement& element,
// Interpolate (in Reference Place) // // Interpolate (in Reference Place) //
fullVector<double> val(3); fullMatrix<double> val(1, 3);
val(0) = 0; val(0, 0) = 0;
val(1) = 0; val(0, 1) = 0;
val(2) = 0; val(0, 2) = 0;
for(unsigned int i = 0; i < nFun; i++){ for(unsigned int i = 0; i < nFun; i++){
val(0) += (*fun)(i, 0) * coef[i]; val(0, 0) += (*fun)(i, 0) * coef[i];
val(1) += (*fun)(i, 1) * coef[i]; val(0, 1) += (*fun)(i, 1) * coef[i];
val(2) += (*fun)(i, 2) * coef[i]; val(0, 2) += (*fun)(i, 2) * coef[i];
} }
// Return Interpolated Value // // Return Interpolated Value //
delete fun; delete fun;
return Mapper::grad(val, invJac);
fullVector<double> map(3);
Mapper::hCurl(val, 0, 0, invJac, map);
return map;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment