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

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

src/f/e/fenicstools-HEAD/demo/Interpolation.py   fenicstools(Download)
from dolfin import *
from fenicstools import interpolate_nonmatching_mesh
 
# Test for nonmatching mesh and FunctionSpace
mesh = UnitCubeMesh(16, 16, 16)
x0 = interpolate(Expression('x[0]'), V)
x0.update()
u = interpolate_nonmatching_mesh(x0, V2)
 
VV = VectorFunctionSpace(mesh, 'CG', 1)
VV2 = VectorFunctionSpace(mesh2, 'CG', 1)
v0 = interpolate(Expression(('x[0]', '2*x[1]', '3*x[2]')), VV)    
v0.update()
v = interpolate_nonmatching_mesh(v0, VV2)