dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #18646
Re: [Question #116141]: project mesh function into FunctionSpace
Question #116141 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/116141
Status: Open => Answered
Anders Logg proposed the following answer:
On Tue, Jun 29, 2010 at 04:11:50PM -0000, Lars wrote:
> New question #116141 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/116141
>
> Hello,
> how can I project/interpolate a discrete vector gamma, defined on each vertex of a triangular mesh, into a FunctionSpace V?
>
> I have to solve a laplace equation with variable diffusivity as in the following bilinear form:
> a = dot(grad(u), gamma* grad(v))*d
>
> The solution is not possible if gamma is an array or a MeshFunction. What is the correct transformation?
>
> Thanks
> Lars
Just create function on a vector-valued piecewise linear space and set
the dofs in the vector:
V = VectorFunctionSpace(mesh, "CG", 1)
gamma = Function(V)
dofs = gamma.vector()
dofs[:] = ...
The dofs are ordered [vx1 vx2 ... vy1 vy2 ...]
--
Anders
--
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.