DOLFIN can't find point inside mesh
Hi,
I'm trying to solve Poisson's equation with a variable conductivity, sigma, and I'm overriding the "eval" function of Expression to
do so. For some reason the interpolated "sigma" can't return values at seemingly random points inside the domain.
A minimal working script is given bellow as well as the error messages I get with and without extrapolation.
Is there any way around this problem?
Error with "parameters[
Evaluating at x = <Point x = 0.233 y = 0.638 z = 0.039>
Traceback (most recent call last):
File "minimal_debug.py", line 26, in <module>
print sigma(0.233, 0.638, 0.039)
File "/usr/lib/
self.
RuntimeError:
*** -------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** https:/
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------
*** Error: Unable to evaluate function at point.
*** Reason: The point is not inside the domain. Consider setting "allow_
*** Where: This error was encountered inside Function.cpp.
*** Process: 0
*** -------
Error with "parameters[
Traceback (most recent call last):
File "minimal_debug.py", line 27, in <module>
print sigma(0.233, 0.638, 0.039)
File "/usr/lib/
self.
RuntimeError:
*** -------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** https:/
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------
*** Error: Unable to perform call to DOLFIN function.
*** Reason: The function compute has not been implemented (in /build/
*** Where: This error was encountered inside log.h.
*** Process: 0
*** -------
from dolfin import *
class DebugConductivi
""" This inherits from ConductivityClass and contains the specific
conductivity of the control set-up"""
def eval(self, value, x):
""" This function is written like this so I can use return_
debugging reasons """
value[0] = 1
parameters[
N = 25
mesh = BoxMesh(0, 1, 0, 1, 0, 1, N, N, N)
V = FunctionSpace(mesh, "CG", 2)
Vs = FunctionSpace(mesh, "DG", 0) # For conductivity tensor
sigma = Function(Vs)
Cond = DebugConductivity()
sigma.interpola
Cheers,
Torbjørn
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Torbjørn Bækø Ness
- Solved:
- Last query:
- Last reply: