Ejemplo n.º 1
0
print "bounds %s" % veldata.bounds
print veldata.averagevel
npoints = np.array([veldata.nx, veldata.ny])
# pom.output2dfn(veldata.bounds, veldata, npoints)


sourcexpos = (xmax + xmin) / 2
sourcek = veldata(np.array([[sourcexpos, 0]]))[0] * averagek
g = pcb.FourierHankel([sourcexpos, 0], [0], sourcek)

sourceimp = pcbd.generic_boundary_data([-1j * averagek, 1], [-1j * averagek, 1], g)
zeroimp = pcbd.zero_impedance(averagek)

entityton = {5: veldata}
mesh = ptum.regularrectmesh(
    [xmin, xmax], [ymin, ymax], int(((xmax - xmin) / (ymax - ymin)) / effectiveh), int(1 / effectiveh)
)
print mesh.nelements
bnddata = {1: zeroimp, 2: sourceimp, 3: zeroimp, 4: zeroimp}
# bdndata = {0:impbd, 1:pcbd.zero_impedance}

problem = psp.VariableNProblem(entityton, mesh, averagek, bnddata)

alpha = ((pdeg * 1.0) ** 2 / trueh) / averagek
beta = averagek / (pdeg * 1.0 * trueh)

pw = pcbv.PlaneWaveVariableN(pcb.circleDirections(npw))
if usepoly:
    poly = pcbr.ReferenceBasisRule(pcbr.Dubiner(pdeg))
    polypw = pcb.ProductBasisRule(poly, pw)
    basisrule = polypw
Ejemplo n.º 2
0
# Polynomials only:
poly = pcbr.ReferenceBasisRule(pcbr.Dubiner(pdeg))
prodpw = pcb.ProductBasisRule(pw, poly)

# Product basis:
#basisrule = pcb.ProductBasisRule(pcb.planeWaveBases(2,k,npw), pcbr.ReferenceBasisRule(pcbr.Dubiner(1)))

#basisrule=pcb.ProductBasisRule(pw,pcbr.ReferenceBasisRule(pcbr.Dubiner(0)))
#basisrule = pcbred.SVDBasisReduceRule(puq.trianglequadrature(quadpoints), basisrule)


#mesh = pmm.gmshMesh('../../examples/2D/square.msh',dim=2)
for n in [16]:
    bdytag = "BDY"
    volentity = 5 # 6
    mesh = ptum.regularrectmesh(bounds[0], bounds[1], n, n)
    print mesh.nelements
    vtods = prw.nodesToPhases(wavefronts, forwardidxs, mesh, [2])
    rt = prb.RaytracedBasisRule(vtods)
    prodrt = pcb.ProductBasisRule(rt, poly)
    basisrule = prodrt
#    basisrule = pcbred.SVDBasisReduceRule(puq.trianglequadrature(quadpoints), basisrule)
    entityton = {volentity:slow}

    bnddata = {1:zerobd,2:impbd,3:zerobd,4:zerobd}
    problem = psp.VariableNProblem(entityton, mesh, k, bnddata)
#    problem = psp.Problem(mesh, k, bnddata)
    
    alpha = pdeg ^2 * n  / k
    beta = k / (pdeg * n)