コード例 #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
ファイル: test_mesh.py プロジェクト: youssefessousy/feelpp
def run(m, geofile):
    if e.isMasterRank():
        print("mesh dim:", m.dimension())

    m = mesh.load(m, geofile, 0.1)
    if e.isMasterRank():
        print("mesh ", m.dimension(), "D nelts:", m.numGlobalElements())
        print("mesh ", m.dimension(), "D nfaces:", m.numGlobalFaces())
        print("mesh ", m.dimension(), "D hmin:", m.hMin())
        print("mesh ", m.dimension(), "D havg:", m.hAverage())
        print("mesh ", m.dimension(), "D hmax:", m.hMax())
        print("mesh ", m.dimension(), "D measure:", m.measure())

    r = mesh.elements(m)
    print("mesh elts:", mesh.nelements(r, True))
    r = mesh.boundaryfaces(m)
    print("mesh boundary faces:", mesh.nfaces(r, True))
コード例 #3
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()