diff --git a/incompressible/fv1/navier_stokes_fv1.cpp b/incompressible/fv1/navier_stokes_fv1.cpp index a5b103e..91cfd35 100644 --- a/incompressible/fv1/navier_stokes_fv1.cpp +++ b/incompressible/fv1/navier_stokes_fv1.cpp @@ -1059,6 +1059,8 @@ ex_velocity_grad(MathMatrix vValue[], // storage for shape function at ip MathVector vLocGrad[numSH]; + MathVector locGrad; + MathVector vGlobGrad; // Reference Mapping MathMatrix JTInv; @@ -1069,30 +1071,35 @@ ex_velocity_grad(MathMatrix vValue[], { // evaluate at shapes at ip rTrialSpace.grads(vLocGrad, vLocIP[ip]); - - // Loop dimensions for direction - for(int d1 = 0; d1 < dim; ++d1) + + // compute global grad + mapping.jacobian_transposed_inverse(JTInv, vLocIP[ip]); + MatSet(vValue[ip],0.0); + + for(size_t sh = 0; sh < numSH; ++sh) { - // Loop dimensions for derivative - for(int d2 = 0; d2