Merge lp:~fluidity-core/fluidity/firedrake-val-removal into lp:fluidity/firedrake

Proposed by Lawrence Mitchell
Status: Merged
Approved by: Lawrence Mitchell
Approved revision: 4294
Merged at revision: 4284
Proposed branch: lp:~fluidity-core/fluidity/firedrake-val-removal
Merge into: lp:fluidity/firedrake
Diff against target: 70 lines (+11/-12)
3 files modified
python/firedrake/core_types.pyx (+9/-10)
tests/ufl_firedrake/test.py (+1/-1)
tests/ufl_firedrake_parallel/test.py (+1/-1)
To merge this branch: bzr merge lp:~fluidity-core/fluidity/firedrake-val-removal
Reviewer Review Type Date Requested Status
Lawrence Mitchell Approve
Florian Rathgeber Approve
Review via email: mp+182333@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Florian Rathgeber (florian-rathgeber) wrote :

Entirely sensible.

review: Approve
Revision history for this message
Lawrence Mitchell (wence) wrote :

Now that this is going to the right place, it looks eminently sensible, approve.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'python/firedrake/core_types.pyx'
2--- python/firedrake/core_types.pyx 2013-08-27 08:55:15 +0000
3+++ python/firedrake/core_types.pyx 2013-08-27 10:26:44 +0000
4@@ -447,7 +447,7 @@
5 """Return a newly allocated :class:`pyop2.Dat` defined on the
6 :attr:`dof.dset` of this :class:`Function`."""
7
8- return op2.Dat(self.dof_dset, np.zeros(self.dof_count * self._dim),
9+ return op2.Dat(self.dof_dset, np.zeros(self.dof_count),
10 valuetype)
11
12
13@@ -515,12 +515,16 @@
14
15 ufl.Coefficient.__init__(self, self._function_space.ufl_element())
16
17+ self.name = name
18+ self.uid = _new_uid()
19+
20 if val is not None:
21- self.val = val
22+ self.dat = op2.Dat(self.dof_dset, val, valuetype, self.name,
23+ uid=self.uid)
24 else:
25- self.val = np.zeros(self._function_space.dof_count)
26- self.name = name
27- self.uid = _new_uid()
28+ self.dat = op2.Dat(self.dof_dset,
29+ np.zeros(self._function_space.dof_count),
30+ valuetype, self.name, uid=self.uid)
31
32 self._repr = None
33
34@@ -538,11 +542,6 @@
35 def dof_dset(self):
36 return self._function_space.dof_dset
37
38- @utils.cached_property
39- def dat(self):
40- return op2.Dat(self.dof_dset, self.val, valuetype, self.name,
41- uid=self.uid)
42-
43 @property
44 def cell_node_map(self):
45 return self._function_space.cell_node_map
46
47=== modified file 'tests/ufl_firedrake/test.py'
48--- tests/ufl_firedrake/test.py 2013-08-08 12:55:12 +0000
49+++ tests/ufl_firedrake/test.py 2013-08-27 10:26:44 +0000
50@@ -22,7 +22,7 @@
51
52 firedrake.solve(u*v*firedrake.dx==f*v*firedrake.dx, out)
53
54- return np.max(np.abs(out.val-f.val))
55+ return np.max(np.abs(out.dat.data-f.dat.data))
56
57 def run_test():
58 family = "Lagrange"
59
60=== modified file 'tests/ufl_firedrake_parallel/test.py'
61--- tests/ufl_firedrake_parallel/test.py 2013-08-08 12:55:12 +0000
62+++ tests/ufl_firedrake_parallel/test.py 2013-08-27 10:26:44 +0000
63@@ -23,7 +23,7 @@
64
65 firedrake.solve(u*v*firedrake.dx==f*v*firedrake.dx, out)
66
67- err = np.max(np.abs(out.val - f.val))
68+ err = np.max(np.abs(out.dat.data - f.dat.data))
69 MPI.COMM_WORLD.allreduce(MPI.IN_PLACE, err, MPI.MAX)
70 return err
71

Subscribers

People subscribed via source and target branches

to all changes: