Volume form not what I expected.
Hello everyone,
Let us suppose I want to create a finite element representation of half-sphere of radius one, where the surface is described by a 3-component vector phi = (X, Y, Z). I then wish to compute the volume of this half-sphere.
Here is a minimal example:
# Begin
from dolfin import *
mesh = UnitCircle(7) # I'm aware that this is deprecated, but I can't recall the new syntax
space= VectorFunctionS
class phiexpression(
def eval(self,
values[0] = x[0]
values[1] = x[1]
values[2] = sqrt(abs(
def value_shape(self):
return (3,)
phi = Function(space)
phiexp = phiexpression()
phi.interpolate
V = (1./3)*
initial_
print initial_
# End
Now, this ought to give me 2 pi / 3, but instead I get 1.92919724808
What am I doing wrong? Is this just round-off error?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Christopher Laing
- Solved:
- Last query:
- Last reply: