Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

src/f/e/fenicstools-HEAD/demo/CRInterpolation.py   fenicstools(Download)
from dolfin import *
from fenicstools import divergence_matrix
from numpy import cos, pi
 
mesh = UnitSquareMesh(10, 10)
u = interpolate(Expression(("sin(2*pi*x[0])", "cos(3*pi*x[1])")), CG)
 
C = divergence_matrix(mesh)
DG = FunctionSpace(mesh, 'DG', 0)
cc = Function(DG)