35#include <boost/core/ignore_unused.hpp>
56 "HybridDGHelmholtz matrix not set up "
57 "for non boundary-interior expansions");
70 DNekMat LocMat(ncoeffs, ncoeffs);
78 for (i = 0; i < coordim; ++i)
82 Mat = Mat + Dmat * invMass *
Transpose(Dmat);
87 Mat = Mat + lambdaval * Mass;
93 for (i = 0; i < 2; ++i)
95 Mat(bmap[i], bmap[i]) = Mat(bmap[i], bmap[i]) + tau;
129 for (j = 0; j < nbndry; ++j)
141 for (k = 0; k < ncoeffs; ++k)
143 Umat(k, j) = Ulam[k];
200 ASSERTL0(
false,
"Direction not known");
207 for (j = 0; j < nbndry; ++j)
213 for (k = 0; k < ncoeffs; ++k)
215 Ulam[k] = lamToU(k, j);
230 &(Qmat.GetPtr())[0] + j * ncoeffs, 1);
264 for (j = 0; j < nbndry; ++j)
268 (LamToU(bmap[0], j) - lam[j]);
273 for (j = 0; j < nbndry; ++j)
277 (LamToU(bmap[1], j) - lam[j]);
283 "This matrix type cannot be generated from this class");
294 boost::ignore_unused(dir);
306 for (k = 0; k < nbndry; ++k)
308 outarray[vmap[k]] += (
Basis[(vmap[k] + 1) * nquad - 1] *
309 Basis[(vmap[k] + 1) * nquad - 1] -
310 Basis[vmap[k] * nquad] *
Basis[vmap[k] * nquad]) *
326 ASSERTL0(&inarray[0] != &outarray[0],
327 "Input and output arrays use the same memory");
335 for (i = 0; i < nbndry; ++i)
337 outarray[vmap[i]] += tau *
Basis[(vmap[i] + 1) * nquad - 1] *
338 Basis[(vmap[i] + 1) * nquad - 1] *
340 outarray[vmap[i]] += tau *
Basis[vmap[i] * nquad] *
341 Basis[vmap[i] * nquad] * inarray[vmap[i]];
355 for (n = 0; n < coordim; ++n)
358 for (i = 0; i < ncoeffs; ++i)
361 tmpcoeff[i] -= invMass(i, vmap[0]) *
Basis[vmap[0] * nquad] *
362 Basis[vmap[0] * nquad] * inarray[vmap[0]];
365 tmpcoeff[i] += invMass(i, vmap[1]) *
366 Basis[(vmap[1] + 1) * nquad - 1] *
367 Basis[(vmap[1] + 1) * nquad - 1] * inarray[vmap[1]];
371 Coeffs = Coeffs + Dmat * Tmpcoeff;
380 "Robin boundary conditions are only implemented for "
381 "boundary-interior expanisons");
382 ASSERTL1(inoutmat->GetRows() == inoutmat->GetColumns(),
383 "Assuming that input matrix was square");
396 int rows = inoutmat->GetRows();
408 for (i = 0; i < 2; ++i)
416 ASSERTL1(i != 2,
"Did not find number in map");
420 (*inoutmat)(map, map) += primCoeffs[0];
436 "Not set up for non boundary-interior expansions");
439 coeffs[map] += primCoeffs[0] * incoeffs[map];
449 int nq =
m_base[0]->GetNumPoints();
451 Vmath::Vmul(nq, &vec[0][0], 1, &normals[0][0], 1, &Fn[0], 1);
452 Vmath::Vvtvp(nq, &vec[1][0], 1, &normals[1][0], 1, &Fn[0], 1, &Fn[0], 1);
467 boost::ignore_unused(d0factors, d1factors);
487 factors[0][0] = gmat[0][nquad - 1] * normal_0[0][0];
488 factors[1][0] = gmat[0][0] * normal_1[0][0];
490 for (
int n = 1; n < normal_0.size(); ++n)
492 factors[0][0] += gmat[n][0] * normal_0[n][0];
493 factors[1][0] += gmat[n][nquad - 1] * normal_1[n][0];
498 factors[0][0] = gmat[0][0] * normal_0[0][0];
499 factors[1][0] = gmat[0][0] * normal_1[0][0];
501 for (
int n = 1; n < normal_0.size(); ++n)
503 factors[0][0] += gmat[n][0] * normal_0[n][0];
504 factors[1][0] += gmat[n][0] * normal_1[n][0];
513 boost::ignore_unused(orient, nq0, nq1);
515 if (idmap.size() != 1)
525 boost::ignore_unused(traceid);
#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.
virtual void v_AddRobinTraceContribution(const int vert, const Array< OneD, const NekDouble > &primCoeffs, const Array< OneD, NekDouble > &incoeffs, Array< OneD, NekDouble > &coeffs) override
virtual void v_ReOrientTracePhysMap(const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1) override
void AddHDGHelmholtzTraceTerms(const NekDouble tau, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual 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)
virtual NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble > > &vec) override
virtual void v_TraceNormLen(const int traceid, NekDouble &h, NekDouble &p) override
virtual 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...
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
SpatialDomains::GeometrySharedPtr GetGeom() const
ExpansionSharedPtr GetLeftAdjacentElementExp() const
int GetLeftAdjacentElementTrace() const
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
const NormalVector & GetTraceNormal(const int id)
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
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 NumBndryCoeffs(void) const
const LibUtilities::PointsKeyVector GetPointsKeys() 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
StdRegions::ConstFactorMap factors
The above copyright notice and this permission notice shall be included.
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
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 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)