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
=== modified file 'assemble/Momentum_DG.F90'
--- assemble/Momentum_DG.F90 2012-04-17 11:31:55 +0000
+++ assemble/Momentum_DG.F90 2012-08-13 12:49:20 +0000
@@ -905,7 +905,11 @@
905 905
906 ! In parallel, we construct terms on elements we own and those in906 ! In parallel, we construct terms on elements we own and those in
907 ! the L1 element halo.907 ! the L1 element halo.
908 assemble_element = .not.dg.or.element_neighbour_owned(U, ele)908 ! Note that element_neighbour_owned(U, ele) may return .false. if
909 ! ele is owned. For example, if ele is the only owned element on
910 ! this process. Hence we have to check for element ownership
911 ! directly as well.
912 assemble_element = .not.dg.or.element_neighbour_owned(U, ele).or.element_owned(U, ele)
909913
910 primal = .not.dg914 primal = .not.dg
911 if(viscosity_scheme == CDG) primal = .true.915 if(viscosity_scheme == CDG) primal = .true.
912916
=== modified file 'femtools/Parallel_fields.F90'
--- femtools/Parallel_fields.F90 2011-07-28 12:16:05 +0000
+++ femtools/Parallel_fields.F90 2012-08-13 12:49:20 +0000
@@ -284,8 +284,11 @@
284 !!< Return .true. if ELEMENT_NUMBER has a neighbour in MESH that284 !!< Return .true. if ELEMENT_NUMBER has a neighbour in MESH that
285 !!< is owned by this process otherwise .false.285 !!< is owned by this process otherwise .false.
286286
287 !! Effectively, this computes whether ELEMENT_NUMBER is in the L1287 !! Note, you cannot use this function to compute if
288 !! halo.288 !! ELEMENT_NUMBER is owned. Imagine if this is the only owned
289 !! element on a process, then none of the neighbours will be owned.
290 !! You can use this function to compute whether ELEMENT_NUMBER is
291 !! in the L1 element halo.
289 type(mesh_type), intent(in) :: mesh292 type(mesh_type), intent(in) :: mesh
290 integer, intent(in) :: element_number293 integer, intent(in) :: element_number
291 logical :: owned294 logical :: owned
@@ -311,8 +314,11 @@
311 !!< Return .true. if ELEMENT_NUMBER has a neighbour in FIELD that314 !!< Return .true. if ELEMENT_NUMBER has a neighbour in FIELD that
312 !!< is owned by this process otherwise .false.315 !!< is owned by this process otherwise .false.
313316
314 !! Effectively, this computes whether ELEMENT_NUMBER is in the L1317 !! Note, you cannot use this function to compute if
315 !! halo.318 !! ELEMENT_NUMBER is owned. Imagine if this is the only owned
319 !! element on a process, then none of the neighbours will be owned.
320 !! You can use this function to compute whether ELEMENT_NUMBER is
321 !! in the L1 element halo.
316 type(scalar_field), intent(in) :: field322 type(scalar_field), intent(in) :: field
317 integer, intent(in) :: element_number323 integer, intent(in) :: element_number
318 logical :: owned324 logical :: owned
@@ -324,8 +330,11 @@
324 !!< Return .true. if ELEMENT_NUMBER has a neighbour in FIELD that330 !!< Return .true. if ELEMENT_NUMBER has a neighbour in FIELD that
325 !!< is owned by this process otherwise .false.331 !!< is owned by this process otherwise .false.
326332
327 !! Effectively, this computes whether ELEMENT_NUMBER is in the L1333 !! Note, you cannot use this function to compute if
328 !! halo.334 !! ELEMENT_NUMBER is owned. Imagine if this is the only owned
335 !! element on a process, then none of the neighbours will be owned.
336 !! You can use this function to compute whether ELEMENT_NUMBER is
337 !! in the L1 element halo.
329 type(vector_field), intent(in) :: field338 type(vector_field), intent(in) :: field
330 integer, intent(in) :: element_number339 integer, intent(in) :: element_number
331 logical :: owned340 logical :: owned
@@ -337,8 +346,11 @@
337 !!< Return .true. if ELEMENT_NUMBER has a neighbour in FIELD that346 !!< Return .true. if ELEMENT_NUMBER has a neighbour in FIELD that
338 !!< is owned by this process otherwise .false.347 !!< is owned by this process otherwise .false.
339348
340 !! Effectively, this computes whether ELEMENT_NUMBER is in the L1349 !! Note, you cannot use this function to compute if
341 !! halo.350 !! ELEMENT_NUMBER is owned. Imagine if this is the only owned
351 !! element on a process, then none of the neighbours will be owned.
352 !! You can use this function to compute whether ELEMENT_NUMBER is
353 !! in the L1 element halo.
342 type(tensor_field), intent(in) :: field354 type(tensor_field), intent(in) :: field
343 integer, intent(in) :: element_number355 integer, intent(in) :: element_number
344 logical :: owned356 logical :: owned