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] = {1.0, 1.5, 11.0 / 6.0};
59 : m_session(pSession), m_fields(pFields), m_pressure(pPressure),
60 m_velocity(pVel), m_advObject(advObject)
72 "StandardExtrapolate",
"StandardExtrapolate");
139 m_fields[0]->GetBndElmtExpansion(n, BndElmtExp,
false);
141 int nq = BndElmtExp->GetTotPoints();
156 m_fields[0]->ExtractPhysToBndElmt(n, fields[i], Velocity[i]);
168 BndElmtExp->CurlCurl(Velocity, Q);
182 m_fields[0]->ExtractElmtToBndPhys(n, Q[i], BndValues[i]);
185 m_PBndExp[n]->NormVectorIProductWRTBase(BndValues, Pvals);
203 boost::ignore_unused(nbcoeffs, nreg, u);
229 m_fields[0]->GetBndElmtExpansion(n, BndElmtExp,
false);
231 int nq = BndElmtExp->GetTotPoints();
248 BndElmtExp->HomogeneousBwdTrans(Velocity[i].size(),
249 Velocity[i], Velocity[i]);
251 BndElmtExp->SetWaveSpace(
false);
256 m_fields[0]->GetBoundaryNormals(n, normals);
271 BndElmtExp->PhysDeriv(Velocity[i], grad[0], grad[1]);
275 BndElmtExp->PhysDeriv(Velocity[i], grad[0], grad[1],
281 m_fields[0]->ExtractElmtToBndPhys(n, grad[j], bndVal);
288 Vmath::Vmul(nqb, normals[i], 1, bndVal, 1, bndVal, 1);
299 m_fields[0]->ExtractElmtToBndPhys(n, Velocity[i], u[i]);
307 Vmath::Vvtvp(nqb, normals[i], 1, u[i], 1, un, 1, un, 1);
313 for (
int i = 0; i < nqb; i++)
315 S0[i] = 0.5 * (1.0 - tanh(un[i] / (
m_houtflow->m_U0 *
335 Vmath::Vvtvp(nqb, u[i], 1, bndVal, 1, E[i], 1, E[i], 1);
351 m_houtflow->m_UBndExp[i][n]->GetPhys(), 1, bndVal,
354 Vmath::Vvtvp(nqb, normals[i], 1, bndVal, 1, En, 1, En, 1);
366 m_PBndExp[n]->HomogeneousFwdTrans(nqb, pbc, bndVal);
378 int nbcoeffs =
m_PBndExp[n]->GetNcoeffs();
382 m_PBndExp[n]->HomogeneousFwdTrans(nqb, pbc, bndVal);
383 m_PBndExp[n]->IProductWRTBase(bndVal, bndCoeffs);
387 m_PBndExp[n]->IProductWRTBase(pbc, bndCoeffs);
392 bndCoeffs, 1,
m_PBndExp[n]->UpdateCoeffs(), 1,
426 Vmath::Smul(nqb, -1.0 * kinvis, divU, 1, bndVal, 1);
434 Vmath::Vvtvp(nqb, normals[i], 1, bndVal, 1, E[i], 1, divU, 1);
437 m_houtflow->m_UBndExp[i][n]->GetPhys(), 1, divU, 1);
444 u[i], 1, divU, 1, divU, 1);
447 if (
m_houtflow->m_UBndExp[i][n]->GetWaveSpace())
449 m_houtflow->m_UBndExp[i][n]->HomogeneousFwdTrans(nqb, divU,
454 divU,
m_houtflow->m_UBndExp[i][n]->UpdateCoeffs());
484 m_PBndExp[n]->HomogeneousBwdTrans(nqb, pbc, pbc);
492 m_fields[0]->GetBoundaryNormals(n, normals);
501 if (
m_houtflow->m_UBndExp[i][n]->GetWaveSpace())
503 m_houtflow->m_UBndExp[i][n]->HomogeneousFwdTrans(nqb, wk,
506 m_houtflow->m_UBndExp[i][n]->IProductWRTBase(wk, wk1);
510 m_houtflow->m_UBndExp[i][n]->UpdateCoeffs(), 1);
532 m_fields[0]->ExtractPhysToBnd(n, Vel[i], velbc[i]);
534 IProdVnTmp = IProdVn + cnt;
535 m_PBndExp[n]->NormVectorIProductWRTBase(velbc, IProdVnTmp);
571 VelBndExp[i][n]->GetTotPoints(), 0.0);
572 VelBndExp[i][n]->SetWaveSpace(
574 VelBndExp[i][n]->BwdTrans(VelBndExp[i][n]->GetCoeffs(),
577 IProdVnTmp = IProdVn + cnt;
578 m_PBndExp[n]->NormVectorIProductWRTBase(velbc, IProdVnTmp);
597 int nlevels = input.size();
601 tmp = input[nlevels - 1];
603 for (
int n = nlevels - 1; n > 0; --n)
605 input[n] = input[n - 1];
630 int outHBCnumber = 0;
631 int numOutHBCPts = 0;
637 if (boost::iequals(
m_PBndConds[n]->GetUserDefined(),
"H"))
647 boost::iequals(
m_PBndConds[n]->GetUserDefined(),
"HOutflow"))
652 numOutHBCPts +=
m_PBndExp[n]->GetTotPoints();
656 else if (boost::iequals(
m_PBndConds[n]->GetUserDefined(),
"HOutflow"))
659 numOutHBCPts +=
m_PBndExp[n]->GetTotPoints();
700 ASSERTL0(0,
"Dimension not supported");
705 if (numOutHBCPts > 0)
708 numOutHBCPts, outHBCnumber,
m_curl_dim, pSession);
721 if (boost::iequals(
m_PBndConds[n]->GetUserDefined(),
"HOutflow"))
731 m_fields[0]->GetBndElmtExpansion(n, BndElmtExp,
false);
733 int nq = BndElmtExp->GetTotPoints();
759 if (
m_houtflow->m_pressurePrimCoeff.size() == 0)
774 std::static_pointer_cast<
776 ->m_robinPrimitiveCoeff;
787 std::static_pointer_cast<
790 ->m_robinPrimitiveCoeff;
794 ASSERTL1(UBndConds[n]->GetBoundaryConditionType() ==
797 "conditions to be of Robin type when pressure"
798 "outflow is specticied as Robin Boundary type");
826 std::string primcoeff =
828 boost::lexical_cast<std::string>(
837 m_session, rcond->m_robinFunction.GetExpression(),
838 primcoeff, rcond->GetUserDefined(),
841 UBndConds[n] = bcond;
856 size_t n_points_0 =
m_fields[0]->GetExp(0)->GetTotPoints();
857 size_t n_element =
m_fields[0]->GetExpSize();
858 size_t nvel = inarray.size();
869 for (
size_t i = 0; i < nvel; ++i)
875 for (
size_t el = 0; el < n_element; ++el)
877 size_t n_points =
m_fields[0]->GetExp(el)->GetTotPoints();
878 ptsKeys =
m_fields[0]->GetExp(el)->GetPointsKeys();
881 if (n_points != n_points_0)
883 for (
size_t j = 0; j < nvel; ++j)
887 n_points_0 = n_points;
891 for (
size_t j = 0; j < nvel; ++j)
901 ->GetDerivFactors(ptsKeys);
903 if (
m_fields[0]->GetExp(el)->GetGeom()->GetMetricInfo()->GetGtype() ==
906 for (
size_t j = 0; j < nvel; ++j)
908 for (
size_t k = 0; k < nvel; ++k)
911 tmp = inarray[k] + cnt, 1, stdVelocity[j], 1,
918 for (
size_t j = 0; j < nvel; ++j)
920 for (
size_t k = 0; k < nvel; ++k)
923 tmp = inarray[k] + cnt, 1, stdVelocity[j], 1,
931 Vmath::Vmul(n_points, stdVelocity[0], 1, stdVelocity[0], 1,
933 for (
size_t k = 1; k < nvel; ++k)
935 Vmath::Vvtvp(n_points, stdVelocity[k], 1, stdVelocity[k], 1,
936 stdVelocity[0], 1, stdVelocity[0], 1);
938 pntVelocity =
Vmath::Vmax(n_points, stdVelocity[0], 1);
939 maxV[el] =
sqrt(pntVelocity);
959 int nlevels = array.size();
960 int nPts = array[0].size();
967 array[nint - 1], 1, array[nlevels - 1], 1);
969 for (
int n = 0; n < nint - 1; ++n)
972 array[nlevels - 1], 1, array[nlevels - 1], 1);
985 int nlevels = array.size();
986 int nPts = array[0].size();
993 array[nint - 1], 1, array[nlevels - 1], 1);
995 for (
int n = 0; n < nint - 1; ++n)
998 array[nlevels - 1], 1, array[nlevels - 1], 1);
1010 int nlevels = array.size();
1011 int nPts = array[0].size();
1024 array[0], 1, accelerationTerm, 1);
1026 for (
int i = 0; i < acc_order; i++)
1030 array[i + 1], 1, accelerationTerm, 1, accelerationTerm, 1);
1033 array[nlevels - 1] = accelerationTerm;
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
std::string GetExpression(void) const
NekDouble Evaluate() const
Provides a generic Factory class.
static std::string RegisterDefaultSolverInfo(const std::string &pName, const std::string &pValue)
Registers the default string value of a solver info property.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
An abstract base class encapsulating the concept of advection of a vector field.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::vector< PointsKey > PointsKeyVector
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< Advection > AdvectionSharedPtr
A shared pointer to an Advection object.
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
@ eDeformed
Geometry is curved or has non-constant factors.
std::shared_ptr< RobinBoundaryCondition > RobinBCShPtr
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 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
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 minus vector): z = alpha*x - y
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 Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Zero(int n, T *x, const int incx)
Zero vector.
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
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.
scalarT< T > sqrt(scalarT< T > in)