Merge lp:~wence/fluidity/fix-mom-dg-assembly into lp:fluidity

Proposed by Lawrence Mitchell
Status: Merged
Merged at revision: 4027
Proposed branch: lp:~wence/fluidity/fix-mom-dg-assembly
Merge into: lp:fluidity
Diff against target: 76 lines (+25/-9)
2 files modified
assemble/Momentum_DG.F90 (+5/-1)
femtools/Parallel_fields.F90 (+20/-8)
To merge this branch: bzr merge lp:~wence/fluidity/fix-mom-dg-assembly
Reviewer Review Type Date Requested Status
Stephan Kramer Approve
Review via email: mp+119341@code.launchpad.net

Description of the change

I think this is the necessary fix for Christian's issue. Have not checked tests, so a buildbot branch for that would be good.

To post a comment you must log in.
Revision history for this message
Lawrence Mitchell (wence) wrote :
Revision history for this message
Stephan Kramer (s-kramer) wrote :

That looks good. Your explanation in the comment makes sense to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'assemble/Momentum_DG.F90'
2--- assemble/Momentum_DG.F90 2012-04-17 11:31:55 +0000
3+++ assemble/Momentum_DG.F90 2012-08-13 12:49:20 +0000
4@@ -905,7 +905,11 @@
5
6 ! In parallel, we construct terms on elements we own and those in
7 ! the L1 element halo.
8- assemble_element = .not.dg.or.element_neighbour_owned(U, ele)
9+ ! Note that element_neighbour_owned(U, ele) may return .false. if
10+ ! ele is owned. For example, if ele is the only owned element on
11+ ! this process. Hence we have to check for element ownership
12+ ! directly as well.
13+ assemble_element = .not.dg.or.element_neighbour_owned(U, ele).or.element_owned(U, ele)
14
15 primal = .not.dg
16 if(viscosity_scheme == CDG) primal = .true.
17
18=== modified file 'femtools/Parallel_fields.F90'
19--- femtools/Parallel_fields.F90 2011-07-28 12:16:05 +0000
20+++ femtools/Parallel_fields.F90 2012-08-13 12:49:20 +0000
21@@ -284,8 +284,11 @@
22 !!< Return .true. if ELEMENT_NUMBER has a neighbour in MESH that
23 !!< is owned by this process otherwise .false.
24
25- !! Effectively, this computes whether ELEMENT_NUMBER is in the L1
26- !! halo.
27+ !! Note, you cannot use this function to compute if
28+ !! ELEMENT_NUMBER is owned. Imagine if this is the only owned
29+ !! element on a process, then none of the neighbours will be owned.
30+ !! You can use this function to compute whether ELEMENT_NUMBER is
31+ !! in the L1 element halo.
32 type(mesh_type), intent(in) :: mesh
33 integer, intent(in) :: element_number
34 logical :: owned
35@@ -311,8 +314,11 @@
36 !!< Return .true. if ELEMENT_NUMBER has a neighbour in FIELD that
37 !!< is owned by this process otherwise .false.
38
39- !! Effectively, this computes whether ELEMENT_NUMBER is in the L1
40- !! halo.
41+ !! Note, you cannot use this function to compute if
42+ !! ELEMENT_NUMBER is owned. Imagine if this is the only owned
43+ !! element on a process, then none of the neighbours will be owned.
44+ !! You can use this function to compute whether ELEMENT_NUMBER is
45+ !! in the L1 element halo.
46 type(scalar_field), intent(in) :: field
47 integer, intent(in) :: element_number
48 logical :: owned
49@@ -324,8 +330,11 @@
50 !!< Return .true. if ELEMENT_NUMBER has a neighbour in FIELD that
51 !!< is owned by this process otherwise .false.
52
53- !! Effectively, this computes whether ELEMENT_NUMBER is in the L1
54- !! halo.
55+ !! Note, you cannot use this function to compute if
56+ !! ELEMENT_NUMBER is owned. Imagine if this is the only owned
57+ !! element on a process, then none of the neighbours will be owned.
58+ !! You can use this function to compute whether ELEMENT_NUMBER is
59+ !! in the L1 element halo.
60 type(vector_field), intent(in) :: field
61 integer, intent(in) :: element_number
62 logical :: owned
63@@ -337,8 +346,11 @@
64 !!< Return .true. if ELEMENT_NUMBER has a neighbour in FIELD that
65 !!< is owned by this process otherwise .false.
66
67- !! Effectively, this computes whether ELEMENT_NUMBER is in the L1
68- !! halo.
69+ !! Note, you cannot use this function to compute if
70+ !! ELEMENT_NUMBER is owned. Imagine if this is the only owned
71+ !! element on a process, then none of the neighbours will be owned.
72+ !! You can use this function to compute whether ELEMENT_NUMBER is
73+ !! in the L1 element halo.
74 type(tensor_field), intent(in) :: field
75 integer, intent(in) :: element_number
76 logical :: owned