[CIG-SHORT] error: mesh object not callable

Brad Aagaard baagaard at usgs.gov
Wed Sep 9 12:27:20 PDT 2015


On 09/09/2015 12:22 PM, Birendra jha wrote:
> Hi
>
> Can you please help me understand the meaning of the following error:
>
>    File "/home/bjha/pylith-1.9.0/lib/python2.7/site-packages/pylith/problems/TimeDependent.py", line 103, in verifyConfiguration
>      Problem.verifyConfiguration(self)
>    File "/home/bjha/pylith-1.9.0/lib/python2.7/site-packages/pylith/problems/Problem.py", line 151, in verifyConfiguration
>      if self.dimension != self.mesh().dimension():
> TypeError: 'Mesh' object is not callable

This is a Python error. Python is telling you that self.mesh is a Mesh 
object, so it can't be called as a function (self.mesh()).

self.mesh should be a weak reference. We assign self.mesh a weak 
reference via

     import weakref
     self.mesh = weakref.ref(mesh)

in TimeDependent.py and GreensFns.py. If you define your own problem, 
then you need to make sure mesh is a weak reference.

Regards,
Brad



More information about the CIG-SHORT mailing list