Consider a VertexFunction. This subtype of MeshFunction
has values only defined at vertices of the mesh, indexed by the vertices of the mesh.
from dolfin import *
mesh = UnitSquareMesh(4, 4)
vf = VertexFunction('size_t', mesh, 0)
for v in vertices(mesh):
vf[v] = v.index()
print vf.array()
Bear in mind that boundary conditions are naturally applied to facets: e.g.
ff = FacetFunction('size_t', mesh, 0)
ds = Measure('ds', subdomain_data=ff)
Is is possible to apply boundary conditions to pointwise data. But this must be done geometrically using DirichletBC
I believe. Someone may correct me.