def __init__(self, problem, basisrule, nquadpoints, usecache = False): self.problem = problem self.basis = psp.constructBasis(problem, basisrule) fquad, equad = puq.quadrules(problem.mesh.dim, nquadpoints) self.facequads = pmmu.MeshQuadratures(problem.mesh, fquad) self.elementquads = pmmu.MeshElementQuadratures(problem.mesh, equad) self.facevandermondes = self.faceVandermondes(pcbu.FaceToBasis(problem.mesh, self.basis), usecache=usecache) self.elementvandermondes = pcv.ElementVandermondes(problem.mesh, self.basis, self.elementquads)
def testDubiner(self): # The Dubiner basis is L^2-orthogonal, so we can test that the SVN reduction doesn't do much to it # ... On reflection, this doesn't test very much. But it at least exercises the code, so leaving it in k = 10 N = 3 bounds=np.array([[0.1,0.1],[0.9,0.9]],dtype='d') npoints=np.array([20,20]) sp = pug.StructuredPoints(bounds, npoints) for n in range(1,4): mesh = tum.regularsquaremesh(n) dubrule = pcbr.ReferenceBasisRule(pcbr.Dubiner(N)) problem = psp.Problem(mesh, k, {}) dubbasis = psp.constructBasis(problem, dubrule) refquad = puq.trianglequadrature(N+1) svnrule = pcbred.SVDBasisReduceRule(refquad, dubrule) svnbasis = psp.constructBasis(problem, svnrule) # The bases should be equivalent: testEquivalentBases(dubbasis, svnbasis, mesh, sp)