41using namespace LibUtilities;
55 :
Extrapolate(pSession, pFields, pPressure, pVel, advObject)
62 size_t dim =
m_fields[0]->GetCoordim(0);
65 size_t nTracePts =
m_fields[0]->GetTrace()->GetNpoints();
66 for (
size_t i = 0; i < dim; ++i)
82 ASSERTL0(
false,
"This method should not be called by Substepping routine");
92 size_t order = IntegrationScheme->GetOrder();
96 if ((IntegrationScheme->GetName() ==
"Euler" &&
97 IntegrationScheme->GetVariant() ==
"Backward") ||
99 (IntegrationScheme->GetName() ==
"BDFImplicit" &&
100 (order == 1 || order == 2)))
103 std::string vSubStepIntScheme =
"RungeKutta";
104 std::string vSubStepIntSchemeVariant =
"SSP";
105 int vSubStepIntSchemeOrder = order;
107 if (
m_session->DefinesSolverInfo(
"SubStepIntScheme"))
109 vSubStepIntScheme =
m_session->GetSolverInfo(
"SubStepIntScheme");
110 vSubStepIntSchemeVariant =
"";
111 vSubStepIntSchemeOrder = order;
116 vSubStepIntScheme, vSubStepIntSchemeVariant,
117 vSubStepIntSchemeOrder, std::vector<NekDouble>());
120 size_t ndim = order + 1;
124 int ntotpts =
m_fields[0]->GetTotPoints();
127 for (
size_t i = 1; i < ndim * nvel; ++i)
133 ntotpts =
m_fields[0]->GetTrace()->GetTotPoints();
135 for (
size_t i = 1; i < ndim; ++i)
142 ASSERTL0(0,
"Integration method not suitable: Options include "
143 "BackwardEuler or BDFImplicitOrder{1,2}");
146 m_intSteps = IntegrationScheme->GetNumIntegrationPhases();
155 "SubSteppingExtrapolate:v_SubSteppingTimeIntegration", 10);
167 size_t nVariables = inarray.size();
168 size_t nQuadraturePts = inarray[0].size();
172 size_t ncoeffs =
m_fields[0]->GetNcoeffs();
177 for (i = 1; i < nVariables; ++i)
179 WeakAdv[i] = WeakAdv[i - 1] + ncoeffs;
188 Velfields[i] = Velfields[i - 1] + nQuadraturePts;
197 x->PreApply(
m_fields, Velfields, Velfields, time);
207 x->Apply(
m_fields, outarray, outarray, time);
210 for (i = 0; i < nVariables; ++i)
212 m_fields[i]->IProductWRTBase(outarray[i], WeakAdv[i]);
220 for (i = 0; i < nVariables; ++i)
226 m_fields[i]->MultiplyByElmtInvMass(WeakAdv[i], WeakAdv[i]);
229 m_fields[i]->BwdTrans(WeakAdv[i], outarray[i]);
244 ASSERTL1(inarray.size() == outarray.size(),
245 "Inarray and outarray of different sizes ");
248 for (
size_t i = 0; i < inarray.size(); ++i)
250 Vmath::Vcopy(inarray[i].size(), inarray[i], 1, outarray[i], 1);
299 int nlevels = array.size();
300 int nPts = array[0].size();
313 1, accelerationTerm, 1);
315 for (
int i = 0; i < acc_order; i++)
319 array[i + 1], 1, accelerationTerm, 1, accelerationTerm, 1);
321 array[nlevels - 1] = accelerationTerm;
340 size_t npts =
m_fields[0]->GetTotPoints();
341 size_t ntracepts =
m_fields[0]->GetTrace()->GetTotPoints();
348 for (n = 0; n < nvel; ++n)
352 for (i = nblocks - 1; i > 0; --i)
362 for (i = nblocks - 1; i > 0; --i)
369 for (i = 0; i < nvel; ++i)
393 for (n = 0; n < nvel; ++n)
395 for (i = 1; i < nblocks; ++i)
402 for (i = 1; i < nblocks; ++i)
426 static int ncalls = 1;
439 "Number of substeps has exceeded maximum");
445 std::cout <<
"Sub-integrating using " << nsubsteps
452 for (
size_t m = 0; m < nint; ++m)
455 fields = solutionVector[m];
463 for (n = 0; n < nsubsteps; ++n)
485 size_t n_element =
m_fields[0]->GetExpSize();
495 for (
size_t i = 0; i <
m_velocity.size(); ++i)
501 for (
size_t el = 0; el < n_element; ++el)
505 (ExpOrder[el] - 1) * (ExpOrder[el] - 1));
527 ASSERTL1(physfield.size() == Outarray.size(),
528 "Physfield and outarray are of different dimensions");
535 size_t nTracePts =
m_fields[0]->GetTrace()->GetNpoints();
546 for (i = 0; i < physfield.size(); ++i)
553 std::dynamic_pointer_cast<MultiRegions::DisContField>(
m_fields[0])
554 ->GetFwdBwdTracePhys(physfield[i], Fwd, Bwd,
556 m_fields[i]->GetBndCondExpansions());
559 m_fields[0]->GetTrace()->Upwind(Vn, Fwd, Bwd, numflux);
562 Vmath::Vsub(nTracePts, numflux, 1, Fwd, 1, Fwd, 1);
563 Vmath::Vsub(nTracePts, numflux, 1, Bwd, 1, Bwd, 1);
570 m_fields[0]->AddFwdBwdTraceIntegral(Fwd, Bwd, Outarray[i]);
586 size_t npts =
m_fields[0]->GetTotPoints();
587 size_t ntracepts =
m_fields[0]->GetTrace()->GetTotPoints();
599 for (i = 0; i <= ord; ++i)
601 for (j = 0; j <= ord; ++j)
611 for (i = 0; i < nvel; ++i)
615 for (j = 1; j <= ord; ++j)
623 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)
void AccumulateRegion(std::string, int iolevel=0)
Accumulate elapsed time for a region.
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.
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 Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Svtvp (scalar times vector plus vector): z = alpha*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.