Skip to content
Snippets Groups Projects
Commit ef22ce61 authored by Andreas Dedner's avatar Andreas Dedner
Browse files

some more cleanup

parent 9812e2e3
Branches gsoc
No related tags found
No related merge requests found
from __future__ import print_function
# from mpi4py import MPI
import dune.fem.grid as grid
import dune.fem.space as space
import math
yaspgrid = grid.leafGrid("../data/unitcube-2d.dgf", "YaspGrid", dimgrid=2)
lagrangespace = space.create("Lagrange", yaspgrid)
def expr_global(x):
return [-(x[1] - 0.5)*math.sin(x[0]*12)]
gf = yaspgrid.globalGridFunction("expr_global", expr_global)
df = lagrangespace.interpolate(gf)
vtk_yaspgrid = yaspgrid.vtkWriter()
df.addToVTKWriter(vtk_yaspgrid, vtk_yaspgrid.DataType.PointData)
df2 = lagrangespace.interpolate([5])
df2.addToVTKWriter(vtk_yaspgrid, vtk_yaspgrid.DataType.CellData)
df3 = lagrangespace.interpolate(df)
df3.addToVTKWriter(vtk_yaspgrid, vtk_yaspgrid.DataType.PointData)
vtk_yaspgrid.write("space_demo");
ls-R 0 → 100644
./data:
circle.dgf
corner.dgf
sphere.dgf
unitcube-1d.dgf
unitcube-2d.dgf
unitcube-3d.dgf
----------------------------------------
./demo:
grid-demo.py
space-demo.py
----------------------------------------
./dune/fempy/function:
gridfunctionview.hh
simplegridfunction.hh
./dune/fempy/py:
grid
grid.hh
./dune/fempy/py/grid:
entity.hh
function.hh
geometry.hh
gridview.hh
hierarchical.hh
range.hh
vtk.hh
---------------------------------------------------
./python/database/grid:
dune-alugrid.db
dune-grid.db
dune-spgrid.db
---------------------------------------------------
./python/dune:
common.cc
function.py
generated
generator
grid.py
__init__.py
mpihelper.cc
./python/dune/generated:
generated_module.cc
__init__.py
model.hh.in
modelimpl.cc
modelimpl.hh.in
./python/dune/generator:
database.py
generator.py
__init__.py
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment