Re: [firedrake] Mixed system
I suspect Andrew is correct. However the deeper issue is that you edited the installed file, which is never a safe thing to do. One must always edit the file in the source directory and then (if necessary) re-install. Anyway, I have committed Andrew's patch to the repository, so hopefully the problem will go away if you do a git update. Regards, David On Wed, 14 Sep 2016 at 18:39 Andrew McRae <A.T.T.McRae@bath.ac.uk> wrote:
Probably related to installing Firedrake in development mode or not.
I can't help any further here; I don't know if someone else can.
On 14 September 2016 at 16:13, Anna Kalogirou <A.Kalogirou@leeds.ac.uk> wrote:
Ok, so I replace line 3366 in file “ /Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py” with the suggested patch, but I now get the error below.
Note that the error I get comes from file firedrake/lib/python2.7/site-packages/pyop2/base.py while in the reported issue the error comes from firedrake/src/PyOP2/pyop2/base.py so the two might not be related after all.
Thanks, Anna.
Traceback (most recent call last): File "buoy-swe.py", line 89, in <module> F_solver = solver_F(phi0_5, eta1, mu0_5, I, w, phi0, eta0, Z0, W0, step_b, etaR, phi_t, eta_t, mu_t, I_t, v1, v2, v3, v4, dt, Hb, H0, L, dR_dt, g, rho, Mass, solvers_print); File "/Users/matak/Documents/Simulations/Firedrake/Ship/Modules/Mixed system/solvers.py", line 41, in solver_F F_solver = LinearVariationalSolver(F_problem, solver_parameters=solvers_print) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/variational_solver.py", line 264, in __init__ super(LinearVariationalSolver, self).__init__(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/variational_solver.py", line 127, in __init__ ctx = solving_utils._SNESContext(problem) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/solving_utils.py", line 107, in __init__ for problem in problems) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/solving_utils.py", line 107, in <genexpr> for problem in problems) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/assemble.py", line 67, in assemble inverse=inverse, nest=nest) File "<decorator-gen-294>", line 2, in _assemble File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/utils.py", line 62, in wrapper return f(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/assemble.py", line 179, in _assemble nest=nest) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/backends.py", line 118, in __call__ return t(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/caching.py", line 122, in __new__ args, kwargs = cls._process_args(*args, **kwargs) File "<decorator-gen-258>", line 2, in _process_args File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/utils.py", line 130, in wrapper return f(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py", line 3592, in _process_args if not (pair[0].toset == dsets[0].set and File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/utils.py", line 64, in __get__ obj.__dict__[self.__name__] = result = self.fget(obj) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py", line 3373, in toset m.toset for m in self._maps)) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/caching.py", line 156, in __new__ obj = make_obj() File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/caching.py", line 137, in make_obj obj.__init__(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py", line 977, in __init__ "All components of a MixedSet must have the same number of layers." AssertionError: All components of a MixedSet must have the same number of layers.
**********************************************************
Dr Anna Kalogirou Research Fellow
Department of Applied Mathematics
University of Leeds
Youtube: https://www.youtube.com/channel/UCUZAYHtVoiMqepQflisp66g
********************************************************** Leverhulme Trust Early Career Fellow 2017-2019
**********************************************************
On 14 Sep 2016, at 16:00, Andrew McRae <A.T.T.McRae@bath.ac.uk> wrote:
Not as a branch, but you can change PyOP2 locally using the code at the bottom of that post, "Suggested patch"
On 14 September 2016 at 15:54, Anna Kalogirou <A.Kalogirou@leeds.ac.uk> wrote:
Hi Andrew,
Yes indeed, the two might be related. Was there a fix for the issue reported on github?
Best, Anna.
**********************************************************
Dr Anna Kalogirou Research Fellow
Department of Applied Mathematics
University of Leeds
Youtube: https://www.youtube.com/channel/UCUZAYHtVoiMqepQflisp66g
********************************************************** Leverhulme Trust Early Career Fellow 2017-2019
**********************************************************
On 13 Sep 2016, at 16:34, Andrew McRae <A.T.T.McRae@bath.ac.uk> wrote:
Probably related to https://github.com/firedrakeproject/firedrake/issues/862 (third post, not first). You might be able to adapt the fix; I haven't looked in detail.
On 12 September 2016 at 16:34, Anna Kalogirou <A.Kalogirou@leeds.ac.uk> wrote:
Dear all,
Regarding the problem described in my email sent of Friday, I fixed a minor typo and now get the error below. Any ideas what might be causing it? Thanks!
Best, Anna.
Traceback (most recent call last): File "buoy-swe.py", line 89, in <module> F_solver = solver_F(phi0_5, eta1, mu0_5, I, w, phi0, eta0, Z0, W0, step_b, etaR, phi_t, eta_t, mu_t, I_t, v1, v2, v3, v4, dt, Hb, H0, L, dR_dt, g, rho, Mass, solvers_print); File "/Users/matak/Documents/Simulations/Firedrake/Ship/Modules/Mixed system/solvers.py", line 41, in solver_F F_solver = LinearVariationalSolver(F_problem, solver_parameters=solvers_print) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/variational_solver.py", line 264, in __init__ super(LinearVariationalSolver, self).__init__(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/variational_solver.py", line 127, in __init__ ctx = solving_utils._SNESContext(problem) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/solving_utils.py", line 107, in __init__ for problem in problems) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/solving_utils.py", line 107, in <genexpr> for problem in problems) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/assemble.py", line 67, in assemble inverse=inverse, nest=nest) File "<decorator-gen-294>", line 2, in _assemble File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/utils.py", line 62, in wrapper return f(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/assemble.py", line 163, in _assemble map_pairs.append((op2.DecoratedMap(test.cell_node_map(), cell_domains), File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/functionspaceimpl.py", line 646, in cell_node_map for i, s in enumerate(self._spaces)) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/backends.py", line 118, in __call__ return t(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/caching.py", line 156, in __new__ obj = make_obj() File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/caching.py", line 137, in make_obj obj.__init__(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py", line 3342, in __init__ if not all(m is None or m.iterset == self.iterset for m in self._maps): File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py", line 3342, in <genexpr> if not all(m is None or m.iterset == self.iterset for m in self._maps): File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/utils.py", line 64, in __get__ obj.__dict__[self.__name__] = result = self.fget(obj) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py", line 3366, in iterset return reduce(lambda a, b: a if a is None else a.iterset or b if b is None else b.iterset, self._maps) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py", line 3366, in <lambda> return reduce(lambda a, b: a if a is None else a.iterset or b if b is None else b.iterset, self._maps) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py", line 799, in __getattr__ return getattr(self._parent, name) AttributeError: 'Set' object has no attribute ‘iterset'
**********************************************************
Dr Anna Kalogirou Research Fellow
Department of Applied Mathematics
University of Leeds
Youtube: https://www.youtube.com/channel/UCUZAYHtVoiMqepQflisp66g
********************************************************** Leverhulme Trust Early Career Fellow 2017-2019
**********************************************************
On 9 Sep 2016, at 17:37, Anna Kalogirou <a.kalogirou@leeds.ac.uk> wrote:
Hi David,
I have tried to implement my problem (attached) using the real function spaces but I get the error below. The code can be found here <https://bitbucket.org/annakalog/buoy2d/src/d6a805b6a8d0/Mixed%20system/?at=master> .
I define the real space by V_R = FunctionSpace(mesh, "R", 0). Is that correct? Also, is it a problem that the linear part of the variational form does not depend on one of the test functions from the mixed function space (only depends on v1, v2, v3 and not v4)?
Best,
Anna.
Traceback (most recent call last): File "buoy-swe.py", line 89, in <module> F_solver = solver_F(phi0_5, eta1, mu0_5, I, w, phi0, eta0, Z0, W0, step_b, etaR, phi_t, eta_t, mu_t, I_t, v1, v2, v3, v4, dt, Hb, H0, L, dR_dt, g, rho, Mass, solvers_print); File "/Users/matak/Documents/Simulations/Firedrake/Ship/Modules/Mixed system/solvers.py", line 41, in solver_F F_solver = LinearVariationalSolver(F_problem, solver_parameters=solvers_print) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/variational_solver.py", line 264, in __init__ super(LinearVariationalSolver, self).__init__(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/variational_solver.py", line 127, in __init__ ctx = solving_utils._SNESContext(problem) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/solving_utils.py", line 107, in __init__ for problem in problems) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/solving_utils.py", line 107, in <genexpr> for problem in problems) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/assemble.py", line 67, in assemble inverse=inverse, nest=nest) File "<decorator-gen-294>", line 2, in _assemble File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/utils.py", line 62, in wrapper return f(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/assemble.py", line 101, in _assemble inverse=inverse) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/tsfc_interface.py", line 307, in compile_form number_map).kernels File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/caching.py", line 198, in __new__ obj = make_obj() File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/caching.py", line 188, in make_obj obj.__init__(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/tsfc_interface.py", line 212, in __init__ tree = tsfc_compile_form(form, prefix=name, parameters=parameters) File "/Users/matak/firedrake/lib/python2.7/site-packages/tsfc/driver.py", line 47, in compile_form do_estimate_degrees=True) File "/Users/matak/firedrake/lib/python2.7/site-packages/ufl/algorithms/compute_form_data.py", line 386, in compute_form_data check_form_arity(preprocessed_form, self.original_form.arguments()) # Currently testing how fast this is File "/Users/matak/firedrake/lib/python2.7/site-packages/ufl/algorithms/check_arities.py", line 152, in check_form_arity check_integrand_arity(itg.integrand(), arguments) File "/Users/matak/firedrake/lib/python2.7/site-packages/ufl/algorithms/check_arities.py", line 145, in check_integrand_arity args = map_expr_dag(rules, expr, compress=False) File "/Users/matak/firedrake/lib/python2.7/site-packages/ufl/corealg/map_dag.py", line 37, in map_expr_dag result, = map_expr_dags(function, [expression], compress=compress) File "/Users/matak/firedrake/lib/python2.7/site-packages/ufl/corealg/map_dag.py", line 86, in map_expr_dags r = handlers[v._ufl_typecode_](v, *[vcache[u] for u in v.ufl_operands]) File "/Users/matak/firedrake/lib/python2.7/site-packages/ufl/algorithms/check_arities.py", line 42, in sum raise ArityMismatch("Adding expressions with non-matching form arguments {0} vs {1}.".format(a, b)) ufl.algorithms.check_arities.ArityMismatch: Adding expressions with non-matching form arguments () vs (Argument(WithGeometry(IndexedProxyFunctionSpace(<firedrake.mesh.ExtrudedMeshTopology object at 0x113e6b890>, TensorProductElement(FiniteElement('Lagrange', interval, 1), FiniteElement('Lagrange', interval, 1), cell=TensorProductCell(interval, interval)), name=None, index=0, component=None), Mesh(VectorElement(TensorProductElement(FiniteElement('Lagrange', interval, 1), FiniteElement('Lagrange', interval, 1), cell=TensorProductCell(interval, interval)), dim=2), 4)), 1, None),). <coupled_system.pdf>
On 18 Aug 2016, at 16:03, David Ham <david.ham@imperial.ac.uk> wrote:
Hi Anna,
Real function spaces now pass some simple tests, at least on my machine. You need the real-function-space branch of firedrake, and the globals_matrices branch of PyOP2. It's not going to get merged before I disappear for a week - not least because I need to update documentation. However you should be able to test it out on the branches.
Regards,
David
On Wed, 10 Aug 2016 at 16:58 David Ham <David.Ham@imperial.ac.uk> wrote:
Unfortunately, It isn't as simple as saying "no mpi". MPI pervades Firedrake. Unless real function spaces play nicely with communicators, Firedrake will simply crash. I'm sorry that this feature is not available right now, but it actually does require significant work.
On Wed, 10 Aug 2016 at 16:51 Anna Kalogirou <A.Kalogirou@leeds.ac.uk> wrote:
Yes indeed, but I believe David would want to make it work for all cases. The merge is necessary in order to proceed with my simulations, so an update as soon as possible would be greatly appreciated.
Best, Anna.
On 10 Aug 2016, at 16:29, Onno Bokhove <O.Bokhove@leeds.ac.uk> wrote:
We would already be helped for the case without MPI, I think that is correct, Anna?
*From:* firedrake-bounces@imperial.ac.uk < firedrake-bounces@imperial.ac.uk> on behalf of David Ham < David.Ham@imperial.ac.uk>
*Sent:* Wednesday, August 10, 2016 10:01 AM
*To:* firedrake *Subject:* Re: [firedrake] Mixed system
The short version is it depends on when I find some time to work on it. It is not simply the case that we have new features lying around waiting to be merged. The current proximate issue is to make the real spaces work properly with MPI communicators. I can't guarantee that will be the last issue.
On Tue, 9 Aug 2016 at 17:37 Onno Bokhove <O.Bokhove@leeds.ac.uk> wrote:
> It is possible to merge the branch for the mixed system > relatively soon? > Anna's results are relevant for the grant application Colin and I > aim to submit in Sept. on further wave-ship modelling. > Sorry for asking! > ------------------------------ > *From:* firedrake-bounces@imperial.ac.uk < > firedrake-bounces@imperial.ac.uk> on behalf of David Ham < > David.Ham@imperial.ac.uk> > *Sent:* Friday, August 5, 2016 11:37:23 AM > *To:* firedrake > *Subject:* Re: [firedrake] Mixed system > > > > On Fri, 5 Aug 2016 at 11:31 Anna Kalogirou <a.kalogirou@leeds.ac.uk> > wrote: > >> Hi Kramer, >> >> Thank you for the reply. >> >> The only problem I see with the solution you suggest, is that both >> I and >> lambda will be trial functions, so both terms should be on the >> bilinear >> part of the variational form. >> > > Not quite. I and lambda together form a Function in a mixed finite > element space. You solve for both of them together, just like pressure and > velocity in a fluid simulation. > > >> >> I could, of course, define a residual and solve everything using >> nonlinear solvers, but I don't know how efficient that would be. >> > > I think you are confused. None of the relevant issues change in the > nonlinear case. After all, the nonlinear solver will differentiate the > residual to create a bilinear form anyway. > > Incidentally, there is no particular reason to believe that writing > the problem in nonlinear form would be inefficient. > > Regards, > > David > > >> >> Best, >> >> Anna. >> >> Dr Anna Kalogirou >> Research Fellow >> School of Mathematics >> University of Leeds >> >> http://www1.maths.leeds.ac.uk/~matak/ >> >> On 04/08/16 17:29, Stephan Kramer wrote: >> > On 27/07/16 11:01, Anna Kalogirou wrote: >> >> Dear all, >> >> >> >> I am trying to solve the system found in the attached pdf as a >> mixed >> >> system. I want to solve the same >> >> problem as the one found here >> >> < >> https://bitbucket.org/annakalog/buoy2d/src/14334d3c20b9f10ed7c1246cde9e3cb60... >> >, >> >> >> >> but with the use of Schur complements and not linear algebra. >> >> >> >> In a previous discussion about this problem, Lawrence mentioned >> that the >> >> test function for integral(lambda*Theta(x-Lp)dx) needs to be >> considered >> >> as coming from the real space of constant functions. Could you >> please >> >> elaborate on this? >> > >> > My guess at what Lawrence means is (it's how I would probably >> approach >> > it), is that you add an additional equation that says >> > >> > (1) I = integral(lambda*Theta(x-Lp)dx) >> > >> > and then substitute I in your third equation. Equation (1) can >> > be turned into a finite element weak formulation by considering >> the >> > function space of functions that are constant over the entire >> domain >> > This function space is just 1-dimensional and therefore >> equivalent to >> > the space of reals R and hence we denote this function space of >> > constants simply as R. Then we can consider I to be a trial >> function >> > in R, and with a test function v4 in R, we can write: >> > >> > v4*lambda*Theta(x-Lp)*dx == v4*I*dx/area(domain) >> > >> > This is a proper finite element equation that you could solve in >> > conjuction with the other equations. I believe however that this >> > function space R is not currently implemented in Firedrake. It is >> > available in fenics, and is on the wishlist. >> > >> > Cheers >> > Stephan >> > >> > _______________________________________________ >> > firedrake mailing list >> > firedrake@imperial.ac.uk >> > https://mailman.ic.ac.uk/mailman/listinfo/firedrake >> >> >> _______________________________________________ >> firedrake mailing list >> firedrake@imperial.ac.uk >> https://mailman.ic.ac.uk/mailman/listinfo/firedrake >> > _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
_______________________________________________
firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
_______________________________________________
firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
Actually, you probably want to firedrake-update so that the install happens automagically. On Thu, 15 Sep 2016 at 18:16 David Ham <David.Ham@imperial.ac.uk> wrote:
I suspect Andrew is correct. However the deeper issue is that you edited the installed file, which is never a safe thing to do. One must always edit the file in the source directory and then (if necessary) re-install.
Anyway, I have committed Andrew's patch to the repository, so hopefully the problem will go away if you do a git update.
Regards,
David
On Wed, 14 Sep 2016 at 18:39 Andrew McRae <A.T.T.McRae@bath.ac.uk> wrote:
Probably related to installing Firedrake in development mode or not.
I can't help any further here; I don't know if someone else can.
On 14 September 2016 at 16:13, Anna Kalogirou <A.Kalogirou@leeds.ac.uk> wrote:
Ok, so I replace line 3366 in file “ /Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py” with the suggested patch, but I now get the error below.
Note that the error I get comes from file firedrake/lib/python2.7/site-packages/pyop2/base.py while in the reported issue the error comes from firedrake/src/PyOP2/pyop2/base.py so the two might not be related after all.
Thanks, Anna.
Traceback (most recent call last): File "buoy-swe.py", line 89, in <module> F_solver = solver_F(phi0_5, eta1, mu0_5, I, w, phi0, eta0, Z0, W0, step_b, etaR, phi_t, eta_t, mu_t, I_t, v1, v2, v3, v4, dt, Hb, H0, L, dR_dt, g, rho, Mass, solvers_print); File "/Users/matak/Documents/Simulations/Firedrake/Ship/Modules/Mixed system/solvers.py", line 41, in solver_F F_solver = LinearVariationalSolver(F_problem, solver_parameters=solvers_print) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/variational_solver.py", line 264, in __init__ super(LinearVariationalSolver, self).__init__(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/variational_solver.py", line 127, in __init__ ctx = solving_utils._SNESContext(problem) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/solving_utils.py", line 107, in __init__ for problem in problems) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/solving_utils.py", line 107, in <genexpr> for problem in problems) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/assemble.py", line 67, in assemble inverse=inverse, nest=nest) File "<decorator-gen-294>", line 2, in _assemble File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/utils.py", line 62, in wrapper return f(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/assemble.py", line 179, in _assemble nest=nest) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/backends.py", line 118, in __call__ return t(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/caching.py", line 122, in __new__ args, kwargs = cls._process_args(*args, **kwargs) File "<decorator-gen-258>", line 2, in _process_args File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/utils.py", line 130, in wrapper return f(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py", line 3592, in _process_args if not (pair[0].toset == dsets[0].set and File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/utils.py", line 64, in __get__ obj.__dict__[self.__name__] = result = self.fget(obj) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py", line 3373, in toset m.toset for m in self._maps)) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/caching.py", line 156, in __new__ obj = make_obj() File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/caching.py", line 137, in make_obj obj.__init__(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py", line 977, in __init__ "All components of a MixedSet must have the same number of layers." AssertionError: All components of a MixedSet must have the same number of layers.
**********************************************************
Dr Anna Kalogirou Research Fellow
Department of Applied Mathematics
University of Leeds
Youtube: https://www.youtube.com/channel/UCUZAYHtVoiMqepQflisp66g
********************************************************** Leverhulme Trust Early Career Fellow 2017-2019
**********************************************************
On 14 Sep 2016, at 16:00, Andrew McRae <A.T.T.McRae@bath.ac.uk> wrote:
Not as a branch, but you can change PyOP2 locally using the code at the bottom of that post, "Suggested patch"
On 14 September 2016 at 15:54, Anna Kalogirou <A.Kalogirou@leeds.ac.uk> wrote:
Hi Andrew,
Yes indeed, the two might be related. Was there a fix for the issue reported on github?
Best, Anna.
**********************************************************
Dr Anna Kalogirou Research Fellow
Department of Applied Mathematics
University of Leeds
Youtube: https://www.youtube.com/channel/UCUZAYHtVoiMqepQflisp66g
********************************************************** Leverhulme Trust Early Career Fellow 2017-2019
**********************************************************
On 13 Sep 2016, at 16:34, Andrew McRae <A.T.T.McRae@bath.ac.uk> wrote:
Probably related to https://github.com/firedrakeproject/firedrake/issues/862 (third post, not first). You might be able to adapt the fix; I haven't looked in detail.
On 12 September 2016 at 16:34, Anna Kalogirou <A.Kalogirou@leeds.ac.uk> wrote:
Dear all,
Regarding the problem described in my email sent of Friday, I fixed a minor typo and now get the error below. Any ideas what might be causing it? Thanks!
Best, Anna.
Traceback (most recent call last): File "buoy-swe.py", line 89, in <module> F_solver = solver_F(phi0_5, eta1, mu0_5, I, w, phi0, eta0, Z0, W0, step_b, etaR, phi_t, eta_t, mu_t, I_t, v1, v2, v3, v4, dt, Hb, H0, L, dR_dt, g, rho, Mass, solvers_print); File "/Users/matak/Documents/Simulations/Firedrake/Ship/Modules/Mixed system/solvers.py", line 41, in solver_F F_solver = LinearVariationalSolver(F_problem, solver_parameters=solvers_print) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/variational_solver.py", line 264, in __init__ super(LinearVariationalSolver, self).__init__(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/variational_solver.py", line 127, in __init__ ctx = solving_utils._SNESContext(problem) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/solving_utils.py", line 107, in __init__ for problem in problems) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/solving_utils.py", line 107, in <genexpr> for problem in problems) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/assemble.py", line 67, in assemble inverse=inverse, nest=nest) File "<decorator-gen-294>", line 2, in _assemble File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/utils.py", line 62, in wrapper return f(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/assemble.py", line 163, in _assemble map_pairs.append((op2.DecoratedMap(test.cell_node_map(), cell_domains), File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/functionspaceimpl.py", line 646, in cell_node_map for i, s in enumerate(self._spaces)) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/backends.py", line 118, in __call__ return t(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/caching.py", line 156, in __new__ obj = make_obj() File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/caching.py", line 137, in make_obj obj.__init__(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py", line 3342, in __init__ if not all(m is None or m.iterset == self.iterset for m in self._maps): File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py", line 3342, in <genexpr> if not all(m is None or m.iterset == self.iterset for m in self._maps): File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/utils.py", line 64, in __get__ obj.__dict__[self.__name__] = result = self.fget(obj) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py", line 3366, in iterset return reduce(lambda a, b: a if a is None else a.iterset or b if b is None else b.iterset, self._maps) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py", line 3366, in <lambda> return reduce(lambda a, b: a if a is None else a.iterset or b if b is None else b.iterset, self._maps) File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/base.py", line 799, in __getattr__ return getattr(self._parent, name) AttributeError: 'Set' object has no attribute ‘iterset'
**********************************************************
Dr Anna Kalogirou Research Fellow
Department of Applied Mathematics
University of Leeds
Youtube: https://www.youtube.com/channel/UCUZAYHtVoiMqepQflisp66g
********************************************************** Leverhulme Trust Early Career Fellow 2017-2019
**********************************************************
On 9 Sep 2016, at 17:37, Anna Kalogirou <a.kalogirou@leeds.ac.uk> wrote:
Hi David,
I have tried to implement my problem (attached) using the real function spaces but I get the error below. The code can be found here <https://bitbucket.org/annakalog/buoy2d/src/d6a805b6a8d0/Mixed%20system/?at=master> .
I define the real space by V_R = FunctionSpace(mesh, "R", 0). Is that correct? Also, is it a problem that the linear part of the variational form does not depend on one of the test functions from the mixed function space (only depends on v1, v2, v3 and not v4)?
Best,
Anna.
Traceback (most recent call last): File "buoy-swe.py", line 89, in <module> F_solver = solver_F(phi0_5, eta1, mu0_5, I, w, phi0, eta0, Z0, W0, step_b, etaR, phi_t, eta_t, mu_t, I_t, v1, v2, v3, v4, dt, Hb, H0, L, dR_dt, g, rho, Mass, solvers_print); File "/Users/matak/Documents/Simulations/Firedrake/Ship/Modules/Mixed system/solvers.py", line 41, in solver_F F_solver = LinearVariationalSolver(F_problem, solver_parameters=solvers_print) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/variational_solver.py", line 264, in __init__ super(LinearVariationalSolver, self).__init__(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/variational_solver.py", line 127, in __init__ ctx = solving_utils._SNESContext(problem) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/solving_utils.py", line 107, in __init__ for problem in problems) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/solving_utils.py", line 107, in <genexpr> for problem in problems) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/assemble.py", line 67, in assemble inverse=inverse, nest=nest) File "<decorator-gen-294>", line 2, in _assemble File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/utils.py", line 62, in wrapper return f(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/assemble.py", line 101, in _assemble inverse=inverse) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/tsfc_interface.py", line 307, in compile_form number_map).kernels File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/caching.py", line 198, in __new__ obj = make_obj() File "/Users/matak/firedrake/lib/python2.7/site-packages/pyop2/caching.py", line 188, in make_obj obj.__init__(*args, **kwargs) File "/Users/matak/firedrake/lib/python2.7/site-packages/firedrake/tsfc_interface.py", line 212, in __init__ tree = tsfc_compile_form(form, prefix=name, parameters=parameters) File "/Users/matak/firedrake/lib/python2.7/site-packages/tsfc/driver.py", line 47, in compile_form do_estimate_degrees=True) File "/Users/matak/firedrake/lib/python2.7/site-packages/ufl/algorithms/compute_form_data.py", line 386, in compute_form_data check_form_arity(preprocessed_form, self.original_form.arguments()) # Currently testing how fast this is File "/Users/matak/firedrake/lib/python2.7/site-packages/ufl/algorithms/check_arities.py", line 152, in check_form_arity check_integrand_arity(itg.integrand(), arguments) File "/Users/matak/firedrake/lib/python2.7/site-packages/ufl/algorithms/check_arities.py", line 145, in check_integrand_arity args = map_expr_dag(rules, expr, compress=False) File "/Users/matak/firedrake/lib/python2.7/site-packages/ufl/corealg/map_dag.py", line 37, in map_expr_dag result, = map_expr_dags(function, [expression], compress=compress) File "/Users/matak/firedrake/lib/python2.7/site-packages/ufl/corealg/map_dag.py", line 86, in map_expr_dags r = handlers[v._ufl_typecode_](v, *[vcache[u] for u in v.ufl_operands]) File "/Users/matak/firedrake/lib/python2.7/site-packages/ufl/algorithms/check_arities.py", line 42, in sum raise ArityMismatch("Adding expressions with non-matching form arguments {0} vs {1}.".format(a, b)) ufl.algorithms.check_arities.ArityMismatch: Adding expressions with non-matching form arguments () vs (Argument(WithGeometry(IndexedProxyFunctionSpace(<firedrake.mesh.ExtrudedMeshTopology object at 0x113e6b890>, TensorProductElement(FiniteElement('Lagrange', interval, 1), FiniteElement('Lagrange', interval, 1), cell=TensorProductCell(interval, interval)), name=None, index=0, component=None), Mesh(VectorElement(TensorProductElement(FiniteElement('Lagrange', interval, 1), FiniteElement('Lagrange', interval, 1), cell=TensorProductCell(interval, interval)), dim=2), 4)), 1, None),). <coupled_system.pdf>
On 18 Aug 2016, at 16:03, David Ham <david.ham@imperial.ac.uk> wrote:
Hi Anna,
Real function spaces now pass some simple tests, at least on my machine. You need the real-function-space branch of firedrake, and the globals_matrices branch of PyOP2. It's not going to get merged before I disappear for a week - not least because I need to update documentation. However you should be able to test it out on the branches.
Regards,
David
On Wed, 10 Aug 2016 at 16:58 David Ham <David.Ham@imperial.ac.uk> wrote:
Unfortunately, It isn't as simple as saying "no mpi". MPI pervades Firedrake. Unless real function spaces play nicely with communicators, Firedrake will simply crash. I'm sorry that this feature is not available right now, but it actually does require significant work.
On Wed, 10 Aug 2016 at 16:51 Anna Kalogirou <A.Kalogirou@leeds.ac.uk> wrote:
> Yes indeed, but I believe David would want to make it work for all > cases. The merge is necessary in order to proceed with my simulations, so > an update as soon as possible would be greatly appreciated. > > Best, Anna. > > > On 10 Aug 2016, at 16:29, Onno Bokhove <O.Bokhove@leeds.ac.uk> > wrote: > > We would already be helped for the case without MPI, I think that is > correct, Anna? > > > *From:* firedrake-bounces@imperial.ac.uk < > firedrake-bounces@imperial.ac.uk> on behalf of David Ham < > David.Ham@imperial.ac.uk> > > *Sent:* Wednesday, August 10, 2016 10:01 AM > > > *To:* firedrake > *Subject:* Re: [firedrake] Mixed system > > The short version is it depends on when I find some time to work on > it. It is not simply the case that we have new features lying around > waiting to be merged. The current proximate issue is to make the real > spaces work properly with MPI communicators. I can't guarantee that will be > the last issue. > > > On Tue, 9 Aug 2016 at 17:37 Onno Bokhove <O.Bokhove@leeds.ac.uk> > wrote: > >> It is possible to merge the branch for the mixed system >> relatively soon? >> Anna's results are relevant for the grant application Colin and I >> aim to submit in Sept. on further wave-ship modelling. >> Sorry for asking! >> ------------------------------ >> *From:* firedrake-bounces@imperial.ac.uk < >> firedrake-bounces@imperial.ac.uk> on behalf of David Ham < >> David.Ham@imperial.ac.uk> >> *Sent:* Friday, August 5, 2016 11:37:23 AM >> *To:* firedrake >> *Subject:* Re: [firedrake] Mixed system >> >> >> >> On Fri, 5 Aug 2016 at 11:31 Anna Kalogirou <a.kalogirou@leeds.ac.uk> >> wrote: >> >>> Hi Kramer, >>> >>> Thank you for the reply. >>> >>> The only problem I see with the solution you suggest, is that both >>> I and >>> lambda will be trial functions, so both terms should be on the >>> bilinear >>> part of the variational form. >>> >> >> Not quite. I and lambda together form a Function in a mixed finite >> element space. You solve for both of them together, just like pressure and >> velocity in a fluid simulation. >> >> >>> >>> I could, of course, define a residual and solve everything using >>> nonlinear solvers, but I don't know how efficient that would be. >>> >> >> I think you are confused. None of the relevant issues change in the >> nonlinear case. After all, the nonlinear solver will differentiate the >> residual to create a bilinear form anyway. >> >> Incidentally, there is no particular reason to believe that writing >> the problem in nonlinear form would be inefficient. >> >> Regards, >> >> David >> >> >>> >>> Best, >>> >>> Anna. >>> >>> Dr Anna Kalogirou >>> Research Fellow >>> School of Mathematics >>> University of Leeds >>> >>> http://www1.maths.leeds.ac.uk/~matak/ >>> >>> On 04/08/16 17:29, Stephan Kramer wrote: >>> > On 27/07/16 11:01, Anna Kalogirou wrote: >>> >> Dear all, >>> >> >>> >> I am trying to solve the system found in the attached pdf as a >>> mixed >>> >> system. I want to solve the same >>> >> problem as the one found here >>> >> < >>> https://bitbucket.org/annakalog/buoy2d/src/14334d3c20b9f10ed7c1246cde9e3cb60... >>> >, >>> >> >>> >> but with the use of Schur complements and not linear algebra. >>> >> >>> >> In a previous discussion about this problem, Lawrence mentioned >>> that the >>> >> test function for integral(lambda*Theta(x-Lp)dx) needs to be >>> considered >>> >> as coming from the real space of constant functions. Could you >>> please >>> >> elaborate on this? >>> > >>> > My guess at what Lawrence means is (it's how I would probably >>> approach >>> > it), is that you add an additional equation that says >>> > >>> > (1) I = integral(lambda*Theta(x-Lp)dx) >>> > >>> > and then substitute I in your third equation. Equation (1) can >>> > be turned into a finite element weak formulation by considering >>> the >>> > function space of functions that are constant over the entire >>> domain >>> > This function space is just 1-dimensional and therefore >>> equivalent to >>> > the space of reals R and hence we denote this function space of >>> > constants simply as R. Then we can consider I to be a trial >>> function >>> > in R, and with a test function v4 in R, we can write: >>> > >>> > v4*lambda*Theta(x-Lp)*dx == v4*I*dx/area(domain) >>> > >>> > This is a proper finite element equation that you could solve in >>> > conjuction with the other equations. I believe however that this >>> > function space R is not currently implemented in Firedrake. It is >>> > available in fenics, and is on the wishlist. >>> > >>> > Cheers >>> > Stephan >>> > >>> > _______________________________________________ >>> > firedrake mailing list >>> > firedrake@imperial.ac.uk >>> > https://mailman.ic.ac.uk/mailman/listinfo/firedrake >>> >>> >>> _______________________________________________ >>> firedrake mailing list >>> firedrake@imperial.ac.uk >>> https://mailman.ic.ac.uk/mailman/listinfo/firedrake >>> >> _______________________________________________ > firedrake mailing list > firedrake@imperial.ac.uk > https://mailman.ic.ac.uk/mailman/listinfo/firedrake > > _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
_______________________________________________
firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
_______________________________________________
firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
participants (1)
- 
                
                David Ham