42 namespace LocalRegions
53 ASSERTL1(IsBoundaryInteriorExpansion(),
54 "HybridDGHelmholtz matrix not set up "
55 "for non boundary-interior expansions");
59 int ncoeffs = GetNcoeffs();
61 int coordim = GetCoordim();
67 DNekMat LocMat(ncoeffs,ncoeffs);
74 for(i=0; i < coordim; ++i)
83 Mat = Mat + lambdaval*Mass;
89 for(i = 0; i < 2; ++i)
91 Mat(bmap[i],bmap[i]) = Mat(bmap[i],bmap[i]) + tau;
98 int nbndry = NumDGBndryCoeffs();
99 int ncoeffs = GetNcoeffs();
121 for(j = 0; j < nbndry; ++j)
132 for(k = 0; k < ncoeffs; ++k)
144 int nbndry = NumDGBndryCoeffs();
145 int ncoeffs = GetNcoeffs();
185 ASSERTL0(
false,
"Direction not known");
192 for(j = 0; j < nbndry; ++j)
198 for(k = 0; k < ncoeffs; ++k)
200 Ulam[k] = lamToU(k,j);
209 AddNormTraceInt(dir,lambda,f);
215 Vmath::Vcopy(ncoeffs,&ulam[0],1,&(Qmat.GetPtr())[0]+j*ncoeffs,1);
222 int nbndry = NumBndryCoeffs();
230 GetBoundaryMap(bmap);
242 lam[0] = 1.0; lam[1] = 0.0;
243 for(j = 0; j < nbndry; ++j)
248 lam[0] = 0.0; lam[1] = 1.0;
249 for(j = 0; j < nbndry; ++j)
256 ASSERTL0(
false,
"This matrix type cannot be generated from this class");
263 void Expansion1D::AddNormTraceInt(
const int dir,
269 int nbndry = NumBndryCoeffs();
270 int nquad = GetNumPoints(0);
274 GetBoundaryMap(vmap);
278 for(k = 0; k < nbndry; ++k)
280 outarray[vmap[k]] += (Basis[(vmap[k]+1)*nquad-1]*Basis[(vmap[k]+1)*nquad-1] - Basis[vmap[k]*nquad]*Basis[vmap[k]*nquad])*inarray[vmap[k]];
284 void Expansion1D::AddHDGHelmholtzTraceTerms(
const NekDouble tau,
288 int nbndry = NumBndryCoeffs();
289 int nquad = GetNumPoints(0);
290 int ncoeffs = GetNcoeffs();
291 int coordim = GetCoordim();
294 ASSERTL0(&inarray[0] != &outarray[0],
"Input and output arrays use the same memory");
300 GetBoundaryMap(vmap);
303 for(i = 0; i < nbndry; ++i)
305 outarray[vmap[i]] += tau*Basis[(vmap[i]+1)*nquad-1]*Basis[(vmap[i]+1)*nquad-1]*inarray[vmap[i]];
306 outarray[vmap[i]] += tau*Basis[vmap[i]*nquad]*Basis[vmap[i]*nquad]*inarray[vmap[i]];
321 for(n = 0; n < coordim; ++n)
324 for(i = 0; i < ncoeffs; ++i)
327 tmpcoeff[i] -= invMass(i,vmap[0])*Basis[vmap[0]*nquad]*Basis[vmap[0]*nquad]*inarray[vmap[0]];
330 tmpcoeff[i] += invMass(i,vmap[1])*Basis[(vmap[1]+1)*nquad-1]*Basis[(vmap[1]+1)*nquad-1]*inarray[vmap[1]];
335 Coeffs = Coeffs + Dmat*Tmpcoeff;
341 ASSERTL0(IsBoundaryInteriorExpansion(),
"Robin boundary conditions are only implemented for boundary-interior expanisons");
342 ASSERTL1(inoutmat->GetRows() == inoutmat->GetColumns(),
343 "Assuming that input matrix was square");
346 int map = GetVertexMap(vert);
356 int rows = inoutmat->GetRows();
358 if (rows == GetNcoeffs())
362 else if(rows == NumBndryCoeffs())
366 GetBoundaryMap(bmap);
368 for(i = 0; i < 2; ++i)
376 ASSERTL1(i != 2,
"Did not find number in map");
380 (*inoutmat)(map,map) += primCoeffs[0];
394 ASSERTL1(IsBoundaryInteriorExpansion(),
395 "Not set up for non boundary-interior expansions");
397 int map = GetVertexMap(vert);
399 coeffs[map] = primCoeffs[0];
NekDouble GetConstFactor(const ConstFactorType &factor) const
#define ASSERTL0(condition, msg)
MatrixType GetMatrixType() const
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
std::map< ConstFactorType, NekDouble > ConstFactorMap
boost::shared_ptr< DNekMat > DNekMatSharedPtr
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
NekMatrix< InnerMatrixType, BlockMatrixTag > Transpose(NekMatrix< InnerMatrixType, BlockMatrixTag > &rhs)
void Neg(int n, T *x, const int incx)
Negate x = -x.
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)