Manipulating functions and function spaces

``````import feelpp
import sys

app=feelppEnvironment(["myapp"],config=localRepository(""))

from pyfeelpp import mesh,discr,vf
geo={
}
print(" . 2D geometry file: {}".format(geo['2']))
print(" . 3D geometry file: {}".format(geo['3']))``````
Details
``` . 2D geometry file: /scratch/jupyter/feelppdb/downloads/feelpp2d.geo

1. Notations

The domain $\Omega$ is discretized using a mesh of triangles or tetrahedra. Scalar functions $f \Omega \rightarrow \mathbb{R}$ are defined on the mesh and are represented by a finite element space.

2. Scalar function spaces

2D mesh and function space example
``````def run( m, geo ):
Xh=feelpp.functionSpace(mesh=m2d)

if app.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=feelpp.elements(m2d),expr=feelpp.expr("x:x"))

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

run( feelpp.mesh(dim=2), geo['2'] )``````
Results
```Xh basisname:  lagrange
Xh nDof:  2867
Xh nLocalDof:  2867
Xh nLocalDofWithGhost:  2867
Xh nLocalDofWithoutGhost:  2867```

Finally, we can do the same in 3D

3D mesh and function space example
``run( feelpp.mesh(dim=3,realdim=3), geo['3'] )``
Results
```Xh basisname:  lagrange
Xh nDof:  21739
Xh nLocalDof:  21739
Xh nLocalDofWithGhost:  21739
Xh nLocalDofWithoutGhost:  21739```