I have #Define trial and test functions (u,r,p) = TrialFunctions(W) # Velocity, density, pressure respectively (dFdu_vec, dFdr, dFdp) = TestFunctions(W) # Test functions for velocity, density, pressure respectively defined earlier in the code. Is the problem that I have reused the name of my trial functions as a split(w) later on? Will ________________________________________ From: firedrake-bounces@imperial.ac.uk <firedrake-bounces@imperial.ac.uk> on behalf of Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> Sent: 10 March 2016 09:47 To: firedrake@imperial.ac.uk Subject: Re: [firedrake] (no subject) On 10/03/16 08:33, William Booker wrote:
Dear all,
I've implemented my boundary conditions weakly in my compressible stratified problem, but I get the following error now:
How should I proceed to fix this?
The problem is that you have defined your bilinear form "a" without using trial functions. Your code does: w = Function(W) u, r, p = split(w) v, s, q = TestFunctions(W) ... a = some_function(u, r, p, v, s, q) So when the linear solver comes to assemble it, thinking it's a matrix, you get an error. However, this is clearly an unfriendly error, and we should do a better job of catching it early. Cheers, Lawrence
Traceback (most recent call last): File "compressible.py", line 181, in <module> solve(a == L, out) File "/home/cserv1_a/apps/install/firedrake/0.12.0/lib64/python2.7/site-packages/firedrake/solving.py", line 120, in solve _solve_varproblem(*args, **kwargs) File "/home/cserv1_a/apps/install/firedrake/0.12.0/lib64/python2.7/site-packages/firedrake/solving.py", line 145, in _solve_varproblem options_prefix=options_prefix) File "/home/cserv1_a/apps/install/firedrake/0.12.0/lib64/python2.7/site-packages/firedrake/variational_solver.py", line 232, in __init__ super(LinearVariationalSolver, self).__init__(*args, **kwargs) File "/home/cserv1_a/apps/install/firedrake/0.12.0/lib64/python2.7/site-packages/firedrake/variational_solver.py", line 118, in __init__ if ctx.is_mixed: File "/home/cserv1_a/apps/install/firedrake/0.12.0/lib64/python2.7/site-packages/firedrake/solving_utils.py", line 152, in is_mixed return self._jacs[-1]._M.sparsity.shape != (1, 1) File "/home/cserv1_a/apps/install/firedrake/0.12.0/lib64/python2.7/site-packages/firedrake/function.py", line 248, in __getattr__ return getattr(self._data, name) AttributeError: 'CoordinatelessFunction' object has no attribute '_M' Exception AttributeError: "'LinearVariationalSolver' object has no attribute '_parameters'" in <bound method LinearVariationalSolver.__del__ of <firedrake.variational_solver.LinearVariationalSolver object at 0x7fcc08180090>> ignored