41 using namespace LibUtilities;
57 :
Extrapolate(pSession,pFields,pPressure,pVel,advObject)
64 int dim =
m_fields[0]->GetCoordim(0);
67 int nTracePts =
m_fields[0]->GetTrace()->GetNpoints();
68 for(
int i = 0; i < dim; ++i)
82 ASSERTL0(
false,
"This method should not be called by Substepping routine");
90 unsigned int order = IntegrationScheme->GetOrder();
94 if( (IntegrationScheme->GetName() ==
"Euler" &&
95 IntegrationScheme->GetVariant() ==
"Backward") ||
97 (IntegrationScheme->GetName() ==
"BDFImplicit" &&
98 (order == 1 || order == 2)) )
101 std::string vSubStepIntScheme =
"RungeKutta";
102 std::string vSubStepIntSchemeVariant =
"SSP";
103 int vSubStepIntSchemeOrder = order;
105 if(
m_session->DefinesSolverInfo(
"SubStepIntScheme" ) )
108 m_session->GetSolverInfo(
"SubStepIntScheme" );
109 vSubStepIntSchemeVariant =
"";
110 vSubStepIntSchemeOrder = order;
116 vSubStepIntSchemeVariant,
117 vSubStepIntSchemeOrder,
118 std::vector<NekDouble>() );
125 int ntotpts =
m_fields[0]->GetTotPoints();
128 for(
int i = 1; i < ndim*nvel; ++i )
135 ASSERTL0(0,
"Integration method not suitable: Options include BackwardEuler or BDFImplicitOrder{1,2}");
138 m_intSteps = IntegrationScheme->GetNumIntegrationPhases();
154 int nVariables = inarray.size();
155 int nQuadraturePts = inarray[0].size();
158 int ncoeffs =
m_fields[0]->GetNcoeffs();
163 for(i = 1; i < nVariables; ++i)
165 WeakAdv[i] = WeakAdv[i-1] + ncoeffs;
174 Velfields[i] = Velfields[i-1] + nQuadraturePts;
181 x->PreApply(
m_fields, Velfields, Velfields, time);
186 x->Apply(
m_fields, outarray, outarray, time);
189 for(i = 0; i < nVariables; ++i)
191 m_fields[i]->IProductWRTBase(outarray[i],WeakAdv[i]);
199 for(i = 0; i < nVariables; ++i)
205 m_fields[i]->MultiplyByElmtInvMass(WeakAdv[i], WeakAdv[i]);
208 m_fields[i]->BwdTrans(WeakAdv[i], outarray[i]);
220 ASSERTL1(inarray.size() == outarray.size(),
"Inarray and outarray of different sizes ");
222 for(
int i = 0; i < inarray.size(); ++i)
224 Vmath::Vcopy(inarray[i].size(),inarray[i],1,outarray[i],1);
267 int npts =
m_fields[0]->GetTotPoints();
274 for(n = 0; n < nvel; ++n)
278 for(i = nblocks-1; i > 0; --i)
287 for(i = 0; i < nvel; ++i)
297 for(n = 0; n < nvel; ++n)
299 for(i = 1; i < nblocks; ++i)
323 static int ncalls = 1;
341 std::cout <<
"Sub-integrating using "<< nsubsteps
348 for (
int m = 0; m < nint; ++m)
351 fields = solutionVector[m];
359 for(n = 0; n < nsubsteps; ++n)
379 int n_element =
m_fields[0]->GetExpSize();
395 for(
int el = 0; el < n_element; ++el)
398 (stdVelocity[el] * cLambda *
399 (ExpOrder[el]-1) * (ExpOrder[el]-1));
417 physfield.size() == Outarray.size(),
418 "Physfield and outarray are of different dimensions");
423 int nTracePts =
m_fields[0]->GetTrace()->GetNpoints();
441 for(i = 0; i < nDimensions; ++i)
443 m_fields[0]->ExtractTracePhys(velfield[i], Fwd);
447 for(i = 0; i < physfield.size(); ++i)
451 m_fields[i]->GetFwdBwdTracePhys(physfield[i], Fwd, Bwd);
454 m_fields[0]->GetTrace()->Upwind(Vn, Fwd, Bwd, numflux);
457 Vmath::Vsub(nTracePts, numflux, 1, Fwd, 1, Fwd, 1);
458 Vmath::Vsub(nTracePts, numflux, 1, Bwd, 1, Bwd, 1);
465 m_fields[0]->AddFwdBwdTraceIntegral(Fwd,Bwd,Outarray[i]);
477 int npts =
m_fields[0]->GetTotPoints();
487 for(i = 0; i <= ord; ++i)
489 for(j = 0; j <= ord; ++j)
499 for(i = 0; i < nvel; ++i)
503 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.