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)
80 ASSERTL0(
false,
"This method should not be called by Substepping routine");
97 std::string vSubStepIntScheme =
"ForwardEuler";
99 if(
m_session->DefinesSolverInfo(
"SubStepIntScheme"))
101 vSubStepIntScheme =
m_session->GetSolverInfo(
"SubStepIntScheme");
110 int ntotpts =
m_fields[0]->GetTotPoints();
112 for(i = 1; i < 2*nvel; ++i)
121 std::string vSubStepIntScheme =
"RungeKutta2_ImprovedEuler";
123 if(
m_session->DefinesSolverInfo(
"SubStepIntScheme"))
125 vSubStepIntScheme =
m_session->GetSolverInfo(
"SubStepIntScheme");
135 int ntotpts =
m_fields[0]->GetTotPoints();
137 for(i = 1; i < 3*nvel; ++i)
145 ASSERTL0(0,
"Integration method not suitable: Options include BackwardEuler or BDFImplicitOrder1");
149 m_intSteps = IntegrationScheme->GetIntegrationSteps();
165 int nVariables = inarray.num_elements();
166 int nQuadraturePts = inarray[0].num_elements();
169 int ncoeffs =
m_fields[0]->GetNcoeffs();
174 for(i = 1; i < nVariables; ++i)
176 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);
241 int nConvectiveFields =
m_fields.num_elements()-1;
244 for(
int i = 0; i < nConvectiveFields; ++i)
285 for(n = 0; n < nvel; ++n)
289 for(i = nblocks-1; i > 0; --i)
298 for(i = 0; i < nvel; ++i)
308 for(n = 0; n < nvel; ++n)
310 for(i = 1; i < nblocks; ++i)
335 static int ncalls = 1;
355 cout <<
"Sub-integrating using "<< nsubsteps
360 for (
int m = 0; m < nint; ++m)
363 fields = integrationSoln->UpdateSolutionVector()[m];
372 for(n = 0; n < nsubsteps; ++n)
382 integrationSoln->SetSolVector(m,fields);
392 int n_element =
m_fields[0]->GetExpSize();
403 for(
int i = 0; i <
m_velocity.num_elements(); ++i)
409 for(
int el = 0; el < n_element; ++el)
412 (stdVelocity[el] * cLambda *
413 (ExpOrder[el]-1) * (ExpOrder[el]-1));
431 physfield.num_elements() == Outarray.num_elements(),
432 "Physfield and outarray are of different dimensions");
437 int nTracePts =
m_fields[0]->GetTrace()->GetNpoints();
455 for(i = 0; i < nDimensions; ++i)
457 m_fields[0]->ExtractTracePhys(velfield[i], Fwd);
461 for(i = 0; i < physfield.num_elements(); ++i)
465 m_fields[i]->GetFwdBwdTracePhys(physfield[i], Fwd, Bwd);
468 m_fields[0]->GetTrace()->Upwind(Vn, Fwd, Bwd, numflux);
471 Vmath::Vsub(nTracePts, numflux, 1, Fwd, 1, Fwd, 1);
472 Vmath::Vsub(nTracePts, numflux, 1, Bwd, 1, Bwd, 1);
479 m_fields[0]->AddFwdBwdTraceIntegral(Fwd,Bwd,Outarray[i]);
501 for(i = 0; i <= ord; ++i)
503 for(j = 0; j <= ord; ++j)
513 for(i = 0; i < nvel; ++i)
517 for(j = 1; j <= ord; ++j)
554 for(
int i = 0; i < acc_order; i++)
560 accelerationTerm, 1);
#define ASSERTL0(condition, msg)
BDF multi-step scheme of order 1 (implicit)
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
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.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
boost::shared_ptr< TimeIntegrationWrapper > TimeIntegrationWrapperSharedPtr
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
boost::shared_ptr< Advection > AdvectionSharedPtr
A shared pointer to an Advection object.
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
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
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)
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
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)
boost::shared_ptr< TimeIntegrationSolution > TimeIntegrationSolutionSharedPtr
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
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.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.