Exemple #1
0
def regularrectmesh(xlims, ylims, nx, ny):
    return pmm.meshFromInfo(regularrectmeshinfo(xlims,ylims, nx,ny))
Exemple #2
0
bnddata={1:dg,2:dg,3:dg,4:dg}

bounds=array([[0,1],[0,1]],dtype='d')
npoints=array([200,200])
#mesh = tum.regularsquaremesh(n, bdytag)
meshinfo = tum.regularrectmeshinfo([0,1], [0,1], n, n)
topology = pmm.Topology(meshinfo)

#def partitions(nparts):
#    ne = meshinfo.nelements
#    return [np.arange((i * ne) / nparts, ((i+1) * ne) / nparts) for i in range(nparts)] 
#
#partition = pmm.BespokePartition(meshinfo, topology, partitions)

#mesh = pmm.MeshView(meshinfo, topology, partition)
mesh = pmm.meshFromInfo(meshinfo)

problem = psp.Problem(mesh, k, bnddata)
basisrule = pcb.planeWaveBases(2,k,11)
#basisrule = pcbr.ReferenceBasisRule(pcbr.Dubiner(0))
mortarrule = pcbr.ReferenceBasisRule(pcbr.Legendre1D(1))
s = -1j*k
#s = 0
#tracebc = [0,0]

mc = psm.MortarComputation(problem, basisrule, mortarrule, nquad, pcp.HelmholtzSystem, pcp.HelmholtzBoundary, s)
#sol = mc.solution(psi.BrutalSolver(np.complex), dovolumes=True)
sol = mc.solution(psi.GMRESSolver('ctor'), dovolumes=True)
#solfaked = mc.fakesolution(g, [s, 1])
#print sol.x
#pos.standardoutput(sol, 20, bounds, npoints, 'squaremortar')
Exemple #3
0
def regularsquaremesh(n = 1, bdytag="BDY"):
    return pmm.meshFromInfo(regularsquaremeshinfo(n, bdytag))