55 :
Extrapolate(pSession,pFields,pPressure,pVel,advObject)
83 int ntotpts =
m_fields[0]->GetTotPoints();
85 for(i = 1; i < 2*
m_fields.num_elements(); ++i)
101 int ntotpts =
m_fields[0]->GetTotPoints();
103 for(i = 1; i < 3*nvel; ++i)
111 ASSERTL0(0,
"Integration method not suitable: Options include BackwardEuler or BDFImplicitOrder1");
115 m_intSteps = IntegrationScheme->GetIntegrationSteps();
131 int nVariables = inarray.num_elements();
132 int nQuadraturePts = inarray[0].num_elements();
135 int ncoeffs =
m_fields[0]->GetNcoeffs();
140 for(i = 1; i < nVariables; ++i)
142 WeakAdv[i] = WeakAdv[i-1] + ncoeffs;
150 for(i = 1; i <
m_velocity.num_elements(); ++i)
152 Velfields[i] = Velfields[i-1] + nQuadraturePts;
159 for(i = 0; i < nVariables; ++i)
161 m_fields[i]->IProductWRTBase(outarray[i],WeakAdv[i]);
169 for(i = 0; i < nVariables; ++i)
175 m_fields[i]->MultiplyByElmtInvMass(WeakAdv[i], WeakAdv[i]);
178 m_fields[i]->BwdTrans(WeakAdv[i], outarray[i]);
210 ASSERTL1(inarray.num_elements() == outarray.num_elements(),
"Inarray and outarray of different sizes ");
212 for(
int i = 0; i < inarray.num_elements(); ++i)
214 Vmath::Vcopy(inarray[i].num_elements(),inarray[i],1,outarray[i],1);
227 int nConvectiveFields =
m_fields.num_elements()-1;
230 for(
int i = 0; i < nConvectiveFields; ++i)
254 for(n = 0; n < nvel; ++n)
258 for(i = nblocks-1; i > 0; --i)
267 for(i = 0; i < nvel; ++i)
277 for(n = 0; n < nvel; ++n)
279 for(i = 1; i < nblocks; ++i)
304 static int ncalls = 1;
322 cout <<
"Sub-integrating using "<< nsubsteps
327 for (
int m = 0; m < nint; ++m)
330 fields = integrationSoln->UpdateSolutionVector()[m];
339 for(n = 0; n < nsubsteps; ++n)
342 n, dt, SubIntegrationSoln,
347 integrationSoln->SetSolVector(m,fields);
357 int n_element =
m_fields[0]->GetExpSize();
368 for(
int i = 0; i <
m_velocity.num_elements(); ++i)
374 for(
int el = 0; el < n_element; ++el)
377 (stdVelocity[el] * cLambda *
378 (ExpOrder[el]-1) * (ExpOrder[el]-1));
396 physfield.num_elements() == Outarray.num_elements(),
397 "Physfield and outarray are of different dimensions");
402 int nTracePts =
m_fields[0]->GetTrace()->GetNpoints();
409 for(i = 0; i < nDimensions; ++i)
415 m_fields[0]->GetTrace()->GetNormals(traceNormals);
430 for(i = 0; i < nDimensions; ++i)
433 Vmath::Vvtvp(nTracePts, traceNormals[i], 1, Fwd, 1, Vn, 1, Vn, 1);
436 for(i = 0; i < physfield.num_elements(); ++i)
440 m_fields[i]->GetFwdBwdTracePhys(physfield[i], Fwd, Bwd);
443 m_fields[0]->GetTrace()->Upwind(Vn, Fwd, Bwd, numflux);
446 Vmath::Vsub(nTracePts, numflux, 1, Fwd, 1, Fwd, 1);
447 Vmath::Vsub(nTracePts, numflux, 1, Bwd, 1, Bwd, 1);
454 m_fields[0]->AddFwdBwdTraceIntegral(Fwd,Bwd,Outarray[i]);
476 for(i = 0; i <= ord; ++i)
478 for(j = 0; j <= ord; ++j)
488 for(i = 0; i < nvel; ++i)
492 for(j = 1; j <= ord; ++j)
524 "Velocity correction scheme not designed to have just one velocity component");
550 PBndConds =
m_fields[pindex]->GetBndConditions();
551 PBndExp =
m_fields[pindex]->GetBndCondExpansions();
560 int cnt,elmtid,nq,offset, boundary,ncoeffs;
567 for(cnt = n = 0; n < PBndConds.num_elements(); ++n)
569 std::string type = PBndConds[n]->GetUserDefined();
571 if(boost::iequals(type,
"H"))
573 for(i = 0; i < PBndExp[n]->GetExpSize(); ++i,cnt++)
578 offset =
m_fields[0]->GetPhys_Offset(elmtid);
585 ncoeffs = Pbc->GetNcoeffs();
589 UBndExp[n]->GetExp(i)->BwdTrans(UBndExp[n]->GetCoeffs() + UBndExp[n]->GetCoeff_Offset(i),ubc);
590 VBndExp[n]->GetExp(i)->BwdTrans(VBndExp[n]->GetCoeffs() + VBndExp[n]->GetCoeff_Offset(i),vbc);
594 elmt->GetEdgePhysVals(boundary,Pbc,Nu,N1);
595 elmt->GetEdgePhysVals(boundary,Pbc,Nv,N2);
612 Blas::Dscal(nq,1.0/Aii_Dt,&ubc[0],1);
613 Blas::Dscal(nq,1.0/Aii_Dt,&vbc[0],1);
616 Pbc->NormVectorIProductWRTBase(ubc,vbc,Pvals);
618 Vmath::Vsub(ncoeffs,Ptmp = PBndExp[n]->UpdateCoeffs()
619 +PBndExp[n]->GetCoeff_Offset(i),1, Pvals,1,
620 Ptmp = PBndExp[n]->UpdateCoeffs()+PBndExp[n]->GetCoeff_Offset(i),1);
625 cnt += PBndExp[n]->GetExpSize();
644 PBndConds =
m_fields[pindex]->GetBndConditions();
645 PBndExp =
m_fields[pindex]->GetBndCondExpansions();
654 int cnt,elmtid,nq,offset, boundary,ncoeffs;
663 for(cnt = n = 0; n < PBndConds.num_elements(); ++n)
665 std::string type = PBndConds[n]->GetUserDefined();
667 if(boost::iequals(type,
"H"))
669 for(i = 0; i < PBndExp[n]->GetExpSize(); ++i,cnt++)
674 offset =
m_fields[0]->GetPhys_Offset(elmtid);
682 ncoeffs = Pbc->GetNcoeffs();
686 UBndExp[n]->GetExp(i)->BwdTrans(UBndExp[n]->GetCoeffs() +
687 UBndExp[n]->GetCoeff_Offset(i),ubc);
688 VBndExp[n]->GetExp(i)->BwdTrans(VBndExp[n]->GetCoeffs() +
689 VBndExp[n]->GetCoeff_Offset(i),vbc);
690 WBndExp[n]->GetExp(i)->BwdTrans(WBndExp[n]->GetCoeffs() +
691 WBndExp[n]->GetCoeff_Offset(i),wbc);
694 elmt->GetFacePhysVals(boundary,Pbc,Nu,N1);
695 elmt->GetFacePhysVals(boundary,Pbc,Nv,N2);
696 elmt->GetFacePhysVals(boundary,Pbc,Nw,N3);
713 Blas::Dscal(nq,1.0/Aii_Dt,&ubc[0],1);
714 Blas::Dscal(nq,1.0/Aii_Dt,&vbc[0],1);
715 Blas::Dscal(nq,1.0/Aii_Dt,&wbc[0],1);
718 Pbc->NormVectorIProductWRTBase(ubc,vbc,wbc,Pvals);
722 Ptmp = PBndExp[n]->UpdateCoeffs()+PBndExp[n]->GetCoeff_Offset(i),
724 Ptmp = PBndExp[n]->UpdateCoeffs()+PBndExp[n]->GetCoeff_Offset(i),
730 cnt += PBndExp[n]->GetExpSize();
#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
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
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
boost::shared_ptr< StdExpansion2D > StdExpansion2DSharedPtr
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.
boost::shared_ptr< StdExpansion1D > StdExpansion1DSharedPtr
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
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
#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.