41 using namespace LibUtilities;
55 :
Extrapolate(pSession, pFields, pPressure, pVel, advObject)
62 int dim =
m_fields[0]->GetCoordim(0);
65 int nTracePts =
m_fields[0]->GetTrace()->GetNpoints();
66 for (
int i = 0; i < dim; ++i)
81 ASSERTL0(
false,
"This method should not be called by Substepping routine");
89 unsigned int order = IntegrationScheme->GetOrder();
93 if ((IntegrationScheme->GetName() ==
"Euler" &&
94 IntegrationScheme->GetVariant() ==
"Backward") ||
96 (IntegrationScheme->GetName() ==
"BDFImplicit" &&
97 (order == 1 || order == 2)))
100 std::string vSubStepIntScheme =
"RungeKutta";
101 std::string vSubStepIntSchemeVariant =
"SSP";
102 int vSubStepIntSchemeOrder = order;
104 if (
m_session->DefinesSolverInfo(
"SubStepIntScheme"))
106 vSubStepIntScheme =
m_session->GetSolverInfo(
"SubStepIntScheme");
107 vSubStepIntSchemeVariant =
"";
108 vSubStepIntSchemeOrder = order;
113 vSubStepIntScheme, vSubStepIntSchemeVariant,
114 vSubStepIntSchemeOrder, std::vector<NekDouble>());
117 int ndim = order + 1;
121 int ntotpts =
m_fields[0]->GetTotPoints();
124 for (
int i = 1; i < ndim * nvel; ++i)
131 ASSERTL0(0,
"Integration method not suitable: Options include "
132 "BackwardEuler or BDFImplicitOrder{1,2}");
135 m_intSteps = IntegrationScheme->GetNumIntegrationPhases();
152 int nVariables = inarray.size();
153 int nQuadraturePts = inarray[0].size();
156 int ncoeffs =
m_fields[0]->GetNcoeffs();
161 for (i = 1; i < nVariables; ++i)
163 WeakAdv[i] = WeakAdv[i - 1] + ncoeffs;
172 Velfields[i] = Velfields[i - 1] + nQuadraturePts;
179 x->PreApply(
m_fields, Velfields, Velfields, time);
185 x->Apply(
m_fields, outarray, outarray, time);
188 for (i = 0; i < nVariables; ++i)
190 m_fields[i]->IProductWRTBase(outarray[i], WeakAdv[i]);
198 for (i = 0; i < nVariables; ++i)
204 m_fields[i]->MultiplyByElmtInvMass(WeakAdv[i], WeakAdv[i]);
207 m_fields[i]->BwdTrans(WeakAdv[i], outarray[i]);
218 ASSERTL1(inarray.size() == outarray.size(),
219 "Inarray and outarray of different sizes ");
221 for (
int i = 0; i < inarray.size(); ++i)
223 Vmath::Vcopy(inarray[i].size(), inarray[i], 1, outarray[i], 1);
263 int npts =
m_fields[0]->GetTotPoints();
270 for (n = 0; n < nvel; ++n)
274 for (i = nblocks - 1; i > 0; --i)
284 for (i = 0; i < nvel; ++i)
295 for (n = 0; n < nvel; ++n)
297 for (i = 1; i < nblocks; ++i)
318 static int ncalls = 1;
331 "Number of substeps has exceeded maximum");
337 std::cout <<
"Sub-integrating using " << nsubsteps
344 for (
int m = 0; m < nint; ++m)
347 fields = solutionVector[m];
355 for (n = 0; n < nsubsteps; ++n)
374 int n_element =
m_fields[0]->GetExpSize();
390 for (
int el = 0; el < n_element; ++el)
394 (ExpOrder[el] - 1) * (ExpOrder[el] - 1));
408 ASSERTL1(physfield.size() == Outarray.size(),
409 "Physfield and outarray are of different dimensions");
414 int nTracePts =
m_fields[0]->GetTrace()->GetNpoints();
433 for (i = 0; i < nDimensions; ++i)
435 m_fields[0]->ExtractTracePhys(velfield[i], Fwd);
439 for (i = 0; i < physfield.size(); ++i)
443 m_fields[i]->GetFwdBwdTracePhys(physfield[i], Fwd, Bwd);
446 m_fields[0]->GetTrace()->Upwind(Vn, Fwd, Bwd, numflux);
449 Vmath::Vsub(nTracePts, numflux, 1, Fwd, 1, Fwd, 1);
450 Vmath::Vsub(nTracePts, numflux, 1, Bwd, 1, Bwd, 1);
457 m_fields[0]->AddFwdBwdTraceIntegral(Fwd, Bwd, Outarray[i]);
468 int npts =
m_fields[0]->GetTotPoints();
478 for (i = 0; i <= ord; ++i)
480 for (j = 0; j <= ord; ++j)
490 for (i = 0; i < nvel; ++i)
494 for (j = 1; j <= ord; ++j)
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
An abstract base class encapsulating the concept of advection of a vector field.
static void Daxpy(const int &n, const double &alpha, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: y = alpha x plus y.
TimeIntegrationSchemeFactory & GetTimeIntegrationSchemeFactory()
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< TimeIntegrationScheme > TimeIntegrationSchemeSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< Advection > AdvectionSharedPtr
A shared pointer to an Advection object.
The above copyright notice and this permission notice shall be included.
ExtrapolateFactory & GetExtrapolateFactory()
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.
T Vmin(int n, const T *x, const int incx)
Return the minimum element in x - called vmin to avoid conflict with min.
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
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.