Assigning new values
Hi all,
i want to change the values on each node, but it seems only logical to me not to FEniCS:
-------
from dolfin import *
import numpy
class before(Expression):
def eval(self, out, x):
out[0] = 1.0
out[1] = x[0]
out[2] = x[1]
out[3] = x[2]
def value_shape(self):
return (4,)
class after(Expression):
def __init__(self, c):
self.a = c.split(
self.b = c.split(
def eval(self, out, x):
out[0] = self.a**2
out[1] = self.b[0] + 1.0
out[2] = self.b[1] + 2.0
out[3] = self.b[2] + 3.0
def value_shape(self):
return (4,)
mesh = Box(0.0,0.0,0.0 , 100.0,10.0,10.0 , 5,1,1)
a_space = FunctionSpace(
b_space = VectorFunctionS
space = MixedFunctionSp
c=Function(space)
before_
c.interpolate(
after_values=
c.interpolate(
-------
...
out[0] = self.a**2
ValueError: setting an array element with a sequence.
-------
any suggestions would help a lot! Thanks a lot...
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Johan Hake
- Solved:
- Last query:
- Last reply: