我正在尝试在Ubuntu 12.04(amd64)机器(使用python 2.7)的Fenics(dolfin 1.2.0)中的Raviart-Thomas有限元空间内使用周期性边界条件。如果使用其他 FE 空间,一切正常,但如果考虑 Raviart-Thomas,python 崩溃(由于 libdolfin 错误)。在下文中,附上一个测试代码来重现错误:
from dolfin import *
# Periodic boundary condition class
class PeriodicWall(SubDomain):
def inside(self, x, on_boundary):
return bool(on_boundary and near(x[0], 0.5))
def map(self, x, y):
y[0] = x[0]
y[1] = x[1] + 1.0
# Mesh and periodic boundary conditions
mesh = RectangleMesh(-0.5,-0.5,0.5,0.5,5,5,"left")
periodicwall = PeriodicWall()
# Raviart-Thomas space with periodic boundaries
V = FunctionSpace(mesh, "RT", 1, constrained_domain=periodicwall)
任何形式的帮助都会有所帮助:测试代码中是否有任何错误?还是 Dolfin 中的一个已知错误?