52 "HybridDGHelmholtz matrix not set up "
53 "for non boundary-interior expansions");
66 DNekMat LocMat(ncoeffs, ncoeffs);
74 for (i = 0; i < coordim; ++i)
78 Mat = Mat + Dmat * invMass *
Transpose(Dmat);
83 Mat = Mat + lambdaval * Mass;
89 for (i = 0; i < 2; ++i)
91 Mat(bmap[i], bmap[i]) = Mat(bmap[i], bmap[i]) + tau;
125 for (j = 0; j < nbndry; ++j)
137 for (k = 0; k < ncoeffs; ++k)
139 Umat(k, j) = Ulam[k];
196 ASSERTL0(
false,
"Direction not known");
203 for (j = 0; j < nbndry; ++j)
209 for (k = 0; k < ncoeffs; ++k)
211 Ulam[k] = lamToU(k, j);
226 &(Qmat.GetPtr())[0] + j * ncoeffs, 1);
260 for (j = 0; j < nbndry; ++j)
264 (LamToU(bmap[0], j) - lam[j]);
269 for (j = 0; j < nbndry; ++j)
273 (LamToU(bmap[1], j) - lam[j]);
279 "This matrix type cannot be generated from this class");
315 ASSERTL1(
false,
"input dir is out of range");
351 Vmath::Vmul(nqtot, jac, 1, inarray, 1, outarray, 1);
355 Vmath::Smul(nqtot, jac[0], inarray, 1, outarray, 1);
391 int nquad0 =
m_base[0]->GetNumPoints();
400 Vmath::Vmul(nquad0, &gmat[0][0], 1, &diff[0], 1, &out_d0[0], 1);
405 Vmath::Vmul(nquad0, &gmat[1][0], 1, &diff[0], 1, &out_d1[0], 1);
410 Vmath::Vmul(nquad0, &gmat[2][0], 1, &diff[0], 1, &out_d2[0], 1);
417 Vmath::Smul(nquad0, gmat[0][0], diff, 1, out_d0, 1);
422 Vmath::Smul(nquad0, gmat[1][0], diff, 1, out_d1, 1);
427 Vmath::Smul(nquad0, gmat[2][0], diff, 1, out_d2, 1);
446 for (k = 0; k < nbndry; ++k)
448 outarray[vmap[k]] += (
Basis[(vmap[k] + 1) * nquad - 1] *
449 Basis[(vmap[k] + 1) * nquad - 1] -
450 Basis[vmap[k] * nquad] *
Basis[vmap[k] * nquad]) *
466 ASSERTL0(&inarray[0] != &outarray[0],
467 "Input and output arrays use the same memory");
475 for (i = 0; i < nbndry; ++i)
477 outarray[vmap[i]] += tau *
Basis[(vmap[i] + 1) * nquad - 1] *
478 Basis[(vmap[i] + 1) * nquad - 1] *
480 outarray[vmap[i]] += tau *
Basis[vmap[i] * nquad] *
481 Basis[vmap[i] * nquad] * inarray[vmap[i]];
495 for (n = 0; n < coordim; ++n)
498 for (i = 0; i < ncoeffs; ++i)
501 tmpcoeff[i] -= invMass(i, vmap[0]) *
Basis[vmap[0] * nquad] *
502 Basis[vmap[0] * nquad] * inarray[vmap[0]];
505 tmpcoeff[i] += invMass(i, vmap[1]) *
506 Basis[(vmap[1] + 1) * nquad - 1] *
507 Basis[(vmap[1] + 1) * nquad - 1] * inarray[vmap[1]];
511 Coeffs = Coeffs + Dmat * Tmpcoeff;
520 "Robin boundary conditions are only implemented for "
521 "boundary-interior expanisons");
522 ASSERTL1(inoutmat->GetRows() == inoutmat->GetColumns(),
523 "Assuming that input matrix was square");
536 int rows = inoutmat->GetRows();
548 for (i = 0; i < 2; ++i)
556 ASSERTL1(i != 2,
"Did not find number in map");
560 (*inoutmat)(map, map) += primCoeffs[0];
576 "Not set up for non boundary-interior expansions");
579 coeffs[map] += primCoeffs[0] * incoeffs[map];
589 int nq =
m_base[0]->GetNumPoints();
591 Vmath::Vmul(nq, &vec[0][0], 1, &normals[0][0], 1, &Fn[0], 1);
592 Vmath::Vvtvp(nq, &vec[1][0], 1, &normals[1][0], 1, &Fn[0], 1, &Fn[0], 1);
610 if (factors.size() <= 2)
625 factors[0][0] = gmat[0][nquad - 1] * normal_0[0][0];
626 factors[1][0] = gmat[0][0] * normal_1[0][0];
628 for (
int n = 1; n < normal_0.size(); ++n)
630 factors[0][0] += gmat[n][0] * normal_0[n][0];
631 factors[1][0] += gmat[n][nquad - 1] * normal_1[n][0];
636 factors[0][0] = gmat[0][0] * normal_0[0][0];
637 factors[1][0] = gmat[0][0] * normal_1[0][0];
639 for (
int n = 1; n < normal_0.size(); ++n)
641 factors[0][0] += gmat[n][0] * normal_0[n][0];
642 factors[1][0] += gmat[n][0] * normal_1[n][0];
650 [[maybe_unused]]
const int nq1, [[maybe_unused]]
bool Forwards)
652 if (idmap.size() != 1)
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Represents a basis of a given type.
const Array< OneD, const NekDouble > & GetBdata() const
Return basis definition array m_bdata.
void v_AddRobinTraceContribution(const int vert, const Array< OneD, const NekDouble > &primCoeffs, const Array< OneD, NekDouble > &incoeffs, Array< OneD, NekDouble > &coeffs) override
void AddHDGHelmholtzTraceTerms(const NekDouble tau, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Inner product of inarray over region with respect to expansion basis base and return in outarray.
void v_AddRobinMassMatrix(const int vert, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat) override
void AddNormTraceInt(const int dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble > > &vec) override
void v_ReOrientTracePhysMap(const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1, bool Forwards) override
void v_TraceNormLen(const int traceid, NekDouble &h, NekDouble &p) override
void v_NormalTraceDerivFactors(Array< OneD, Array< OneD, NekDouble > > &factors, Array< OneD, Array< OneD, NekDouble > > &d0factors, Array< OneD, Array< OneD, NekDouble > > &d1factors) override
: This method gets all of the factors which are required as part of the Gradient Jump Penalty stabili...
DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
void v_PhysDeriv(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculate the derivative of the physical points in a given direction.
SpatialDomains::Geometry * GetGeom() const
ExpansionSharedPtr GetLeftAdjacentElementExp() const
int GetLeftAdjacentElementTrace() const
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
const NormalVector & GetTraceNormal(const int id)
SpatialDomains::GeomFactorsUniquePtr m_geomFactors
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
PointGeom * GetVertex(int i) const
Returns vertex i of this object.
NekDouble dist(PointGeom &a)
return distance between this and input a
void PhysTensorDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Evaluate the derivative at the physical quadrature points given by inarray and return in outarray.
void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
bool v_IsCollocatedBasis() const final
virtual void v_IProductWRTBaseKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const Array< OneD, const NekDouble > &jac, const bool Deformed)=0
void GetBoundaryMap(Array< OneD, unsigned int > &outarray)
const LibUtilities::BasisSharedPtr & GetBasis(int dir) const
This function gets the shared point to basis in the dir direction.
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
int NumBndryCoeffs(void) const
int NumDGBndryCoeffs(void) const
int GetVertexMap(const int localVertexId, bool useCoeffPacking=false)
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Array< OneD, LibUtilities::BasisSharedPtr > m_base
bool IsBoundaryInteriorExpansion() const
NekDouble Integral(const Array< OneD, const NekDouble > &inarray)
This function integrates the specified function over the domain.
MatrixType GetMatrixType() const
NekDouble GetConstFactor(const ConstFactorType &factor) const
@ eDeformed
Geometry is curved or has non-constant factors.
std::map< ConstFactorType, NekDouble > ConstFactorMap
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
static Array< OneD, NekDouble > NullNekDouble1DArray
NekMatrix< InnerMatrixType, BlockMatrixTag > Transpose(NekMatrix< InnerMatrixType, BlockMatrixTag > &rhs)
std::shared_ptr< DNekMat > DNekMatSharedPtr
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 Neg(int n, T *x, const int incx)
Negate x = -x.
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 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.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)