Commit d7628079 by Christophe Geuzaine

Merge branch 'analytic' into 'master'

analytic: fix bug when openmp

See merge request !36
parents fd907ab5 03c4ceb1
Pipeline #1210 passed with stage
in 9 minutes 49 seconds
......@@ -1684,7 +1684,7 @@ void F_AcousticFieldSoftCylinder(F_ARG)
}
std::complex<double> I(0,1);
std::complex<double> val = 0;
double vr=0, vi=0;
#if defined(_OPENMP)
#pragma omp parallel for reduction(+: vr,vi)
#endif
......@@ -1693,10 +1693,12 @@ void F_AcousticFieldSoftCylinder(F_ARG)
std::complex<double> Hnkr( jn(n,kr), yn(n,kr) );
std::complex<double> tmp1 = std::pow(I,n) * Hnkr/HnkR;
double tmp2 = - (!n ? 1. : 2.) * cos(n*theta) * std::real(HnkR);
val += tmp1 * tmp2;
std::complex<double> val = tmp1 * tmp2;
vr += std::real(val);
vi += std::imag(val);
}
V->Val[0] = std::real(val);
V->Val[MAX_DIM] = std::imag(val);
V->Val[0] = vr;
V->Val[MAX_DIM] = vi;
V->Type = SCALAR;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment