42 NekDouble Extrapolate::StifflyStable_Betaq_Coeffs[3][3] = {
43 { 1.0, 0.0, 0.0},{ 2.0, -1.0, 0.0},{ 3.0, -3.0, 1.0}};
44 NekDouble Extrapolate::StifflyStable_Alpha_Coeffs[3][3] = {
45 { 1.0, 0.0, 0.0},{ 2.0, -0.5, 0.0},{ 3.0, -1.5, 1.0/3.0}};
46 NekDouble Extrapolate::StifflyStable_Gamma0_Coeffs[3] = {
55 Extrapolate::Extrapolate(
61 : m_session(pSession),
63 m_pressure(pPressure),
65 m_advObject(advObject)
77 "StandardExtrapolate",
"StandardExtrapolate");
142 for(n = cnt = 0; n <
m_PBndConds.num_elements(); ++n)
147 m_fields[0]->GetBndElmtExpansion(n, BndElmtExp,
false);
149 int nq = BndElmtExp->GetTotPoints();
164 m_fields[0]->ExtractPhysToBndElmt(n, fields[i],Velocity[i]);
171 m_fields[0]->ExtractPhysToBndElmt(n, N[i], Advection[i]);
176 BndElmtExp->CurlCurl(Velocity, Q);
190 m_fields[0]->ExtractElmtToBndPhys(n, Q[i],BndValues[i]);
193 m_PBndExp[n]->NormVectorIProductWRTBase(BndValues, Pvals);
231 for(
int n = 0; n <
m_PBndConds.num_elements(); ++n)
236 m_fields[0]->GetBndElmtExpansion(n, BndElmtExp,
false);
238 int nq = BndElmtExp->GetTotPoints();
243 m_fields[0]->ExtractPhysToBndElmt(n, fields[i],
255 BndElmtExp->HomogeneousBwdTrans(Velocity[i],
258 BndElmtExp->SetWaveSpace(
false);
263 m_fields[0]->GetBoundaryNormals(n, normals);
278 BndElmtExp->PhysDeriv(Velocity[i], grad[0], grad[1]);
282 BndElmtExp->PhysDeriv(Velocity[i], grad[0], grad[1],
288 m_fields[0]->ExtractElmtToBndPhys(n, grad[j],bndVal);
298 nGradUn, 1, nGradUn, 1);
307 m_fields[0]->ExtractElmtToBndPhys(n, Velocity[i],u[i]);
323 for(
int i = 0; i < nqb; i++)
344 Vmath::Vvtvp(nqb, u[i], 1, bndVal, 1, E[i], 1, E[i], 1);
360 m_UBndExp[i][n]->GetPhys(),
377 m_PBndExp[n]->HomogeneousFwdTrans(pbc, bndVal);
389 int nbcoeffs =
m_PBndExp[n]->GetNcoeffs();
393 m_PBndExp[n]->HomogeneousFwdTrans(pbc, bndVal);
394 m_PBndExp[n]->IProductWRTBase(bndVal,bndCoeffs);
398 m_PBndExp[n]->IProductWRTBase(pbc,bndCoeffs);
402 bndCoeffs, 1,
m_PBndExp[n]->UpdateCoeffs(),1,
408 m_fields[0]->ExtractElmtToBndPhys(n,
410 m_outflowVel[cnt][i][0],
459 u[i], 1,divU,1,divU,1);
462 if (
m_houtflow->m_UBndExp[i][n]->GetWaveSpace())
464 m_houtflow->m_UBndExp[i][n]->HomogeneousFwdTrans(divU,
468 m_houtflow->m_UBndExp[i][n]->IProductWRTBase(divU,
488 for(
int n = 0; n <
m_PBndConds.num_elements(); ++n)
502 m_PBndExp[n]->HomogeneousBwdTrans(pbc, pbc);
510 m_fields[0]->GetBoundaryNormals(n, normals);
519 if (
m_houtflow->m_UBndExp[i][n]->GetWaveSpace())
522 HomogeneousFwdTrans(wk, wk);
524 m_houtflow->m_UBndExp[i][n]->IProductWRTBase(wk,wk1);
528 m_houtflow->m_UBndExp[i][n]->UpdateCoeffs(),1);
544 for(n = cnt = 0; n <
m_PBndConds.num_elements(); ++n)
551 m_fields[0]->ExtractPhysToBnd(n, Vel[i], velbc[i]);
553 IProdVnTmp = IProdVn + cnt;
554 m_PBndExp[n]->NormVectorIProductWRTBase(velbc, IProdVnTmp);
580 for(n = cnt = 0; n <
m_PBndConds.num_elements(); ++n)
588 (VelBndExp[i][n]->GetTotPoints(), 0.0);
589 VelBndExp[i][n]->SetWaveSpace(
591 VelBndExp[i][n]->BwdTrans(VelBndExp[i][n]->GetCoeffs(),
594 IProdVnTmp = IProdVn + cnt;
595 m_PBndExp[n]->NormVectorIProductWRTBase(velbc, IProdVnTmp);
614 int nlevels = input.num_elements();
618 tmp = input[nlevels-1];
620 for(
int n = nlevels-1; n > 0; --n)
622 input[n] = input[n-1];
647 int outHBCnumber = 0;
648 int numOutHBCPts = 0;
654 if(boost::iequals(
m_PBndConds[n]->GetUserDefined(),
"H"))
658 m_HBCnumber +=
m_PBndExp[n]->GetExpSize();
669 m_HBCnumber +=
m_PBndExp[n]->GetExpSize();
670 numOutHBCPts +=
m_PBndExp[n]->GetTotPoints();
674 else if(boost::iequals(
m_PBndConds[n]->GetUserDefined(),
678 numOutHBCPts +=
m_PBndExp[n]->GetTotPoints();
719 ASSERTL0(0,
"Dimension not supported");
737 for(n = 0, cnt = 0; n <
m_PBndConds.num_elements(); ++n)
739 if(boost::iequals(
m_PBndConds[n]->GetUserDefined(),
"HOutflow"))
749 m_fields[0]->GetBndElmtExpansion(n, BndElmtExp,
false);
751 int nq = BndElmtExp->GetTotPoints();
777 if(
m_houtflow->m_pressurePrimCoeff.num_elements() == 0)
795 std::static_pointer_cast<
808 std::static_pointer_cast<
810 >(UBndConds[n])->m_robinPrimitiveCoeff;
815 ASSERTL1(UBndConds[n]->GetBoundaryConditionType()
817 "conditions to be of Robin type when pressure" 818 "outflow is specticied as Robin Boundary type");
838 for(
int n = 0; n <
m_PBndConds.num_elements(); ++n)
848 std::string primcoeff =
m_houtflow->m_defVelPrimCoeff[i] +
"*" +
853 std::dynamic_pointer_cast<
858 m_session,rcond->m_robinFunction.GetExpression(),
860 rcond->GetUserDefined(),
863 UBndConds[n] = bcond;
879 int n_points_0 =
m_fields[0]->GetExp(0)->GetTotPoints();
880 int n_element =
m_fields[0]->GetExpSize();
881 int nvel = inarray.num_elements();
892 for (
int i = 0; i < nvel; ++i)
898 for (
int el = 0; el < n_element; ++el)
900 int n_points =
m_fields[0]->GetExp(el)->GetTotPoints();
901 ptsKeys =
m_fields[0]->GetExp(el)->GetPointsKeys();
904 if(n_points != n_points_0)
906 for (
int j = 0; j < nvel; ++j)
910 n_points_0 = n_points;
914 for (
int j = 0; j < nvel; ++j)
921 m_fields[0]->GetExp(el)->GetGeom()->GetMetricInfo()->GetDerivFactors(ptsKeys);
923 if (
m_fields[0]->GetExp(el)->GetGeom()->GetMetricInfo()->GetGtype()
926 for(
int j = 0; j < nvel; ++j)
928 for(
int k = 0; k < nvel; ++k)
931 tmp = inarray[k] + cnt, 1,
939 for(
int j = 0; j < nvel; ++j)
941 for(
int k = 0; k < nvel; ++k)
944 tmp = inarray[k] + cnt, 1,
953 Vmath::Vmul( n_points, stdVelocity[0], 1, stdVelocity[0], 1,
955 for(
int k = 1; k < nvel; ++k)
962 pntVelocity =
Vmath::Vmax( n_points, stdVelocity[0], 1);
963 maxV[el] = sqrt(pntVelocity);
985 int nlevels = array.num_elements();
986 int nPts = array[0].num_elements();
994 array[nlevels-1], 1);
996 for(
int n = 0; n < nint-1; ++n)
999 array[n],1, array[nlevels-1],1,
1000 array[nlevels-1],1);
1015 int nlevels = array.num_elements();
1016 int nPts = array[0].num_elements();
1024 array[nlevels-1], 1);
1026 for(
int n = 0; n < nint-1; ++n)
1029 array[n],1, array[nlevels-1],1,
1030 array[nlevels-1],1);
1043 int nlevels = array.num_elements();
1044 int nPts = array[0].num_elements();
1060 accelerationTerm, 1);
1062 for(
int i = 0; i < acc_order; i++)
1067 accelerationTerm, 1,
1068 accelerationTerm, 1);
1071 array[nlevels-1] = accelerationTerm;
1078 for(cnt = n = 0; n <
m_PBndConds.num_elements(); ++n)
#define ASSERTL0(condition, msg)
std::string GetExpression(void) const
std::vector< PointsKey > PointsKeyVector
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
ExtrapolateFactory & GetExtrapolateFactory()
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
std::shared_ptr< Advection > AdvectionSharedPtr
A shared pointer to an Advection object.
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 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
std::shared_ptr< RobinBoundaryCondition > RobinBCShPtr
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
void Svtvm(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
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
NekDouble Evaluate() const
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
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.
static std::string RegisterDefaultSolverInfo(const std::string &pName, const std::string &pValue)
Registers the default string value of a solver info property.
void Zero(int n, T *x, const int incx)
Zero vector.
#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)
Geometry is curved or has non-constant factors.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
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.
Provides a generic Factory class.