44 AdjointAdvection::create);
49 AdjointAdvection::AdjointAdvection():
59 const int nConvectiveFields,
68 ASSERTL1(nConvectiveFields == inarray.size(),
69 "Number of convective fields and Inarray are not compatible");
71 int nPointsTot = fields[0]->GetNpoints();
72 int ndim = advVel.size();
77 int nScalar =nConvectiveFields - ndim;
80 for(
int i = 0; i < ndim; ++i)
85 fields[i]->HomogeneousBwdTrans(advVel[i],velocity[i]);
89 velocity[i] = advVel[i];
94 for (
int jj = ndim; jj < nConvectiveFields; ++jj)
96 scalar[jj-ndim] = inarray[jj];
101 for(
int i = 0; i < nDerivs; ++i)
109 for (
int i = 0; i < ndim; ++i)
118 for(
int i = 0; i < ndim; ++i)
125 fields[i]->PhysDeriv(inarray[i], grad[0]);
130 fields[i]->PhysDeriv(inarray[i], grad[0], grad[1]);
135 fields[i]->PhysDeriv(inarray[i], grad[0], grad[1], grad[2]);
139 fields[i]->HomogeneousBwdTrans(grad[0], grad[0]);
140 fields[i]->HomogeneousBwdTrans(grad[1], grad[1]);
141 fields[i]->HomogeneousBwdTrans(grad[2], grad[2]);
149 for(
int j = 1; j < nDerivs; ++j)
164 for(
int j = 0; j < lim; ++j)
172 if (nScalar > 0 && i < ndim)
174 for (
int s = 0; s < nScalar; ++s)
185 fields[i]->HomogeneousFwdTrans(outarray[i],outarray[i]);
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
virtual ~AdjointAdvection()
virtual void v_Advect(const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &advVel, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble &time, const Array< OneD, Array< OneD, NekDouble > > &pFwd=NullNekDoubleArrayOfArray, const Array< OneD, Array< OneD, NekDouble > > &pBwd=NullNekDoubleArrayOfArray)
Advects a vector field.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
NekDouble m_period
period length
void UpdateGradBase(const int var, const MultiRegions::ExpListSharedPtr &field)
bool m_singleMode
flag to determine if use single mode or not
Array< OneD, Array< OneD, NekDouble > > m_baseflow
Storage for base flow.
Array< OneD, Array< OneD, NekDouble > > m_gradBase
void UpdateBase(const NekDouble m_slices, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble m_time, const NekDouble m_period)
bool m_multipleModes
flag to determine if use multiple mode or not
bool m_halfMode
flag to determine if use half mode or not
Array< OneD, Array< OneD, NekDouble > > m_interp
interpolation vector
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
The above copyright notice and this permission notice shall be included.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
void Neg(int n, T *x, const int incx)
Negate x = -x.
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y