63{
64 int nPts =
m_fields[0]->GetTotPoints();
65 int nElements =
m_fields[0]->GetExpSize();
66
67
68 Array<OneD, NekDouble> Lambda(nPts, 0.0);
69 Array<OneD, NekDouble> soundspeed(nPts, 0.0);
70 Array<OneD, NekDouble> absVelocity(nPts, 0.0);
71 m_varConv->GetSoundSpeed(physfield, soundspeed);
72 m_varConv->GetAbsoluteVelocity(physfield, absVelocity);
73 Vmath::Vadd(nPts, absVelocity, 1, soundspeed, 1, Lambda, 1);
74
75
76 Array<OneD, NekDouble> Sensor(nPts, 0.0);
78
79
80 Array<OneD, NekDouble> tmp;
81 for (int e = 0; e < nElements; e++)
82 {
83 int physOffset =
m_fields[0]->GetPhys_Offset(e);
84 int nElmtPoints =
m_fields[0]->GetExp(e)->GetTotPoints();
85
86
88 LambdaElmt =
Vmath::Vmax(nElmtPoints, tmp = Lambda + physOffset, 1);
89
90
92 Vmath::Smul(nElmtPoints, LambdaElmt, tmp = mu + physOffset, 1,
93 tmp = mu + physOffset, 1);
94 }
95}
NekDouble m_mu0
Constant scaling.
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.