← Back to team overview

dolfin team mailing list archive

[Question #97173]: Collapsed map size assertion error and private declarations of Functions

 

New question #97173 on DOLFIN:
https://answers.launchpad.net/dolfin/+question/97173

I feel like a complete idiot for not being able to figure this out, but I'm still having problems with subFunctions. I tried doing shallow copies but I had an error because my Function.vectors() are not constant. I can't make them constant because I'm constantly changing them. So I've been trying to use the deep copies, ie: subFuction = Function[0];

This is the section of code with the probelm:

			Gradients::FunctionSpace _VGradA(*anode);
			
			Gradients::BilinearForm aGradA(_VGradA, _VGradA);
			Gradients::LinearForm LGradA(_VGradA);
			dolfin::Function _GradA(_VGradA);
			dolfin::Function _GradAvg(_VGradA);
			
			dolfin::Function _GradAvgX(_VGradA);
			dolfin::Function _GradAvgY(_VGradA);
			
			_GradAvgX = _GradAvg[0];
			_GradAvgY = _GradAvg[0];

When it gets to the attempted subFunction declaration, it blows up and gives me this:

forward: dolfin/function/Function.cpp:187: const dolfin::Function& dolfin::Function::operator=(const dolfin::Function&): Assertion `collapsed_map.size() == _function_space->dofmap().global_dimension()' failed.

I think this means that the subfunction declaration doesn't work because the dimension of the function space used for the subfunction (GradAvgX) doesn't match that of the dimension of the function space used to the function (GradAvg), but that seems to be inpossible since both are declared using the same function space. 

I'm also a bit confused about the global term. I'm assuming it means global versus local as in global stiffness matrix and local stiffness matrix. If it in fact means global in the programming way, as in global variables, then that may be the problem. Since I can't declare private functions unless I overload the eval() function, I've been working around using name mangling. Could this be causing the problem? Is there a way to declare private Functions without overloading eval()?

Again I appologise if I'm mising something obvious

Phil

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.