Easy assignment to (vector) real functions in a way that is robust w.r.t. renumbering and in parallel

Registered by Martin Sandve Alnæs

We need a simple interface for assigning to constants and Real functions. Suggestions:

R = FunctionSpace(mesh, "Real", 0)
f = Function(R)
f.assign_constant(1.23)

RV = VectorFunctionSpace(mesh, "Real", 0, dim=4)
v = Function(RV)
v.assign_constant([1.0, 2.0, 3.0, 4.0])
v.assign_constant(numpy.array([1.0, 2.0, 3.0, 4.0]))

c = Constant(0.0)
c.assign_constant(1.23)

w = Constant((0.0, 0.0, 0.0, 0.0))
w.assign_constant([1.0, 2.0, 3.0, 4.0])
w.assign_constant(numpy.array([1.0, 2.0, 3.0, 4.0]))

This interface must work in parallell, and be robust w.r.t. dof renumbering in the vector valued case.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Essential
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.