This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

FunctionSpace error for large RectangleMesh

+1 vote

Hi!

I'm trying to make a huge rectangle mesh, but the I cannot create a FunctionSpace for it. Anyone know why? Here is the code:

from fenics import *
mesh = RectangleMesh(-638000.0, -3349500.0, 864700.0, -657600.0, 10018, 17946)
Q    = FunctionSpace(mesh, "CG", 1)

and the error:

/home/pf4d/Work/FEniCS/lib/python2.7/site-packages/dolfin/functions/functionspace.pyc in __init__(self, mesh, family, degree, form_degree, constrained_domain, restriction)
    466
    467         # Initialize base class
--> 468         FunctionSpaceBase.__init__(self, mesh, element, constrained_domain)
    469
    470         self.___degree = degree

/home/pf4d/Work/FEniCS/lib/python2.7/site-packages/dolfin/functions/functionspace.pyc in __init__(self, mesh, element, constrained_domain)
    166                 mesh = mesh.mesh()
    167             else:
--> 168                 dolfin_dofmap  = cpp.DofMap(ufc_dofmap, mesh)
    169
    170         # Initialize the cpp_FunctionSpace

/home/pf4d/Work/FEniCS/lib/python2.7/site-packages/dolfin/cpp/fem.pyc in __init__(self, *args)
    640
    641         """
--> 642         _fem.DofMap_swiginit(self,_fem.new_DofMap(*args))
    643     __swig_destroy__ = _fem.delete_DofMap
    644     def is_restricted(self):

StandardError: vector::reserve
asked Oct 23, 2014 by pf4d FEniCS User (2,970 points)

Looks like you are out of memory?

I just ran into this problem as well. The machine I am running on has 5TB of RAM so I do not believe I am running out of physical memory.

My mesh has about 30m elements and I want to use MINI elements. The mesh is based on real world data (ct-scan of a complex structure) - generating a smaller mesh is not really an option. In fact, I want to run a much larger problem than this. Given that dolfin can run on ~10k processors this is an unfortunate bottleneck.

The trace back from master is:
File "/apps/dolfin/1.4.0/lib/python2.7/site-packages/dolfin/functions/functionspace.py", line 195, in add
return EnrichedFunctionSpace((self, other))
File "/apps/dolfin/1.4.0/lib/python2.7/site-packages/dolfin/functions/functionspace.py", line 524, in init
FunctionSpaceBase.init(self, mesh, element, constrained_domain=constrained_domain)
File "/apps/dolfin/1.4.0/lib/python2.7/site-packages/dolfin/functions/functionspace.py", line 168, in init
dolfin_dofmap = cpp.DofMap(ufc_dofmap, mesh)
File "/apps/dolfin/1.4.0/lib/python2.7/site-packages/dolfin/cpp/fem.py", line 555, in init
_fem.DofMap_swiginit(self,_fem.new_DofMap(*args))
StandardError: vector::reserve

1 Answer

–2 votes

Your mesh has about 360 million cells, try a smaller mesh to fit in memory.

answered Oct 23, 2014 by martinal FEniCS User (2,800 points)

Negative, not out of physical memory.

...