← Back to team overview

dolfin team mailing list archive

Re: Arrays and pyDOLFIN

 



Martin Sandve Alnæs wrote:
Add an instantiation of Array<DirichletBC*> to the .i files beside
ArrayFunctionPtr.

I added this.

An use cpp_DirichletBC.

I tried this is demo/pde/sym-dirichlet-bc/python/demo.py, but I get

Traceback (most recent call last):
  File "demo.py", line 55, in <module>
    bc = cpp_DirichletBC(u0, mesh, boundary)
NameError: name 'cpp_DirichletBC' is not defined


As you say, this is a problem with this
"inheritance pattern".


Is there a way to 'up cast' Python objects. For example, DirichletBC is derived from cpp_DirichletBC, so can I get a cast a DirichletBC object to a cpp_DirichletBC object?

Garth





Follow ups

References