47 SubSteppingExtrapolate::create,
50 SubSteppingExtrapolate::SubSteppingExtrapolate(
56 :
Extrapolate(pSession,pFields,pPressure,pVel,advObject)
63 int dim =
m_fields[0]->GetCoordim(0);
66 int nTracePts =
m_fields[0]->GetTrace()->GetNpoints();
67 for(
int i = 0; i < dim; ++i)
81 ASSERTL0(
false,
"This method should not be called by Substepping routine");
98 std::string vSubStepIntScheme =
"ForwardEuler";
100 if(
m_session->DefinesSolverInfo(
"SubStepIntScheme"))
102 vSubStepIntScheme =
m_session->GetSolverInfo(
"SubStepIntScheme");
111 int ntotpts =
m_fields[0]->GetTotPoints();
113 for(i = 1; i < 2*nvel; ++i)
122 std::string vSubStepIntScheme =
"RungeKutta2_ImprovedEuler";
124 if(
m_session->DefinesSolverInfo(
"SubStepIntScheme"))
126 vSubStepIntScheme =
m_session->GetSolverInfo(
"SubStepIntScheme");
136 int ntotpts =
m_fields[0]->GetTotPoints();
138 for(i = 1; i < 3*nvel; ++i)
146 ASSERTL0(0,
"Integration method not suitable: Options include BackwardEuler or BDFImplicitOrder1");
150 m_intSteps = IntegrationScheme->GetIntegrationSteps();
166 int nVariables = inarray.num_elements();
167 int nQuadraturePts = inarray[0].num_elements();
170 int ncoeffs =
m_fields[0]->GetNcoeffs();
175 for(i = 1; i < nVariables; ++i)
177 WeakAdv[i] = WeakAdv[i-1] + ncoeffs;
184 for(i = 1; i <
m_velocity.num_elements(); ++i)
186 Velfields[i] = Velfields[i-1] + nQuadraturePts;
193 for(i = 0; i < nVariables; ++i)
195 m_fields[i]->IProductWRTBase(outarray[i],WeakAdv[i]);
203 for(i = 0; i < nVariables; ++i)
209 m_fields[i]->MultiplyByElmtInvMass(WeakAdv[i], WeakAdv[i]);
212 m_fields[i]->BwdTrans(WeakAdv[i], outarray[i]);
224 ASSERTL1(inarray.num_elements() == outarray.num_elements(),
"Inarray and outarray of different sizes ");
226 for(
int i = 0; i < inarray.num_elements(); ++i)
228 Vmath::Vcopy(inarray[i].num_elements(),inarray[i],1,outarray[i],1);
271 int npts =
m_fields[0]->GetTotPoints();
278 for(n = 0; n < nvel; ++n)
282 for(i = nblocks-1; i > 0; --i)
291 for(i = 0; i < nvel; ++i)
301 for(n = 0; n < nvel; ++n)
303 for(i = 1; i < nblocks; ++i)
328 static int ncalls = 1;
346 cout <<
"Sub-integrating using "<< nsubsteps
351 for (
int m = 0; m < nint; ++m)
354 fields = integrationSoln->UpdateSolutionVector()[m];
363 for(n = 0; n < nsubsteps; ++n)
373 integrationSoln->SetSolVector(m,fields);
383 int n_element =
m_fields[0]->GetExpSize();
393 for(
int i = 0; i <
m_velocity.num_elements(); ++i)
399 for(
int el = 0; el < n_element; ++el)
402 (stdVelocity[el] * cLambda *
403 (ExpOrder[el]-1) * (ExpOrder[el]-1));
421 physfield.num_elements() == Outarray.num_elements(),
422 "Physfield and outarray are of different dimensions");
427 int nTracePts =
m_fields[0]->GetTrace()->GetNpoints();
445 for(i = 0; i < nDimensions; ++i)
447 m_fields[0]->ExtractTracePhys(velfield[i], Fwd);
451 for(i = 0; i < physfield.num_elements(); ++i)
455 m_fields[i]->GetFwdBwdTracePhys(physfield[i], Fwd, Bwd);
458 m_fields[0]->GetTrace()->Upwind(Vn, Fwd, Bwd, numflux);
461 Vmath::Vsub(nTracePts, numflux, 1, Fwd, 1, Fwd, 1);
462 Vmath::Vsub(nTracePts, numflux, 1, Bwd, 1, Bwd, 1);
469 m_fields[0]->AddFwdBwdTraceIntegral(Fwd,Bwd,Outarray[i]);
481 int npts =
m_fields[0]->GetTotPoints();
491 for(i = 0; i <= ord; ++i)
493 for(j = 0; j <= ord; ++j)
503 for(i = 0; i < nvel; ++i)
507 for(j = 1; j <= ord; ++j)
#define ASSERTL0(condition, msg)
BDF multi-step scheme of order 1 (implicit)
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
ExtrapolateFactory & GetExtrapolateFactory()
T Vmin(int n, const T *x, const int incx)
Return the minimum element in x - called vmin to avoid conflict with min.
std::shared_ptr< Advection > AdvectionSharedPtr
A shared pointer to an Advection object.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
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 DefineProjection(FuncPointerT func, ObjectPointerT obj)
std::shared_ptr< TimeIntegrationWrapper > TimeIntegrationWrapperSharedPtr
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
void Neg(int n, T *x, const int incx)
Negate x = -x.
TimeIntegrationWrapperFactory & GetTimeIntegrationWrapperFactory()
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.
BDF multi-step scheme of order 2 (implicit)
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
std::shared_ptr< TimeIntegrationSolution > TimeIntegrationSolutionSharedPtr
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
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.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
std::shared_ptr< SessionReader > SessionReaderSharedPtr
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.
An abstract base class encapsulating the concept of advection of a vector field.