tadd fix for elevated porosities at frictionless side boundaries - sphere - GPU… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 2d6d6b6937b1b3894180194600a3ffdaa24f0e37 | |
parent b0e5f3b5ebb17b6639a2464a9deea444dee67e50 | |
Author: Anders Damsgaard Christensen <[email protected]> | |
Date: Wed, 15 Jun 2016 16:05:44 -0700 | |
add fix for elevated porosities at frictionless side boundaries | |
Diffstat: | |
M src/contactsearch.cuh | 10 ++++++---- | |
M src/darcy.cuh | 10 ++++++---- | |
2 files changed, 12 insertions(+), 8 deletions(-) | |
--- | |
diff --git a/src/contactsearch.cuh b/src/contactsearch.cuh | |
t@@ -41,8 +41,9 @@ __device__ int findDistMod(int3* targetCell, Float3* distmod) | |
} | |
- // Only x-boundaries are periodic | |
- } else if (devC_grid.periodic == 2) { | |
+ } | |
+ // Only x-boundaries are periodic | |
+ if (devC_grid.periodic == 2) { | |
// Periodic x-boundary | |
if (targetCell->x < 0) { | |
t@@ -61,8 +62,9 @@ __device__ int findDistMod(int3* targetCell, Float3* distmod) | |
return -1; | |
- // No periodic boundaries | |
- } else { | |
+ } | |
+ // No periodic boundaries | |
+ if (devC_grid.periodic > 2 || devC_grid.periodic < 1) { | |
// Don't modify targetCell or distmod. | |
diff --git a/src/darcy.cuh b/src/darcy.cuh | |
t@@ -464,12 +464,14 @@ __global__ void findDarcyPorositiesLinear( | |
targetCell.z = 1; | |
// Mirror particle grid at frictionless boundaries | |
- /*if (devC_grid.periodic == 2) { | |
- if (targetCell.y == -1) | |
+ if (devC_grid.periodic == 2) { | |
+ if (targetCell.y == -1) { | |
targetCell.y = 1; | |
- else if (targetCell.y == devC_grid.num[1]) | |
+ } | |
+ if (targetCell.y == devC_grid.num[1]) { | |
targetCell.y = devC_grid.num[1] - 2; | |
- }*/ | |
+ } | |
+ } | |
// Get distance modifier for interparticle | |
// vector, if it crosses a periodic boundary |