예제 #1
0
def run( m, geo ):
    m2d = mesh.load(m,geo,0.1)

    Xh=discr.functionSpace( space="Pch", mesh=m2d, order=1 )
    P0h = discr.functionSpace( space="Pdh", mesh=m2d, order=0 )
    #u=Xh.elementFromExpr("{sin(2*pi*x)*cos(pi*y)}:x:y")
    u=Xh.element()
    u.on(range=mesh.elements(m2d),expr=vf.expr("x*x:x"))

    e = filters.exporter(mesh=m2d,name="feelpp"+str(m.dimension())+"d")
    e.addScalar("un", 1.)
    e.addP1c("u",u);
    e.addP0d("pid",discr.pid( P0h ));
    e.save()
예제 #2
0
def run(m, geo):
    m2d = mesh.load(m, geo, 0.1)
    Xh = discr.functionSpace(mesh=m2d)

    if e.isMasterRank():
        print("Xh basisname: ", Xh.basisName())
        print("Xh nDof: ", Xh.nDof())
        print("Xh nLocalDof: ", Xh.nLocalDof())
        print("Xh nLocalDofWithGhost: ", Xh.nLocalDofWithGhost())
        print("Xh nLocalDofWithoutGhost: ", Xh.nLocalDofWithoutGhost())

    m3 = Xh.mesh()

    assert m3 == m2d

    u = Xh.element()
    u.on(range=mesh.elements(m2d), expr=vf.expr("x:x"))

    assert u.functionSpace() == Xh
    assert u.size() == Xh.nDof()