From 1868031f1e74c36f455e8b913726c8f61e995e36 Mon Sep 17 00:00:00 2001 From: Miikka Vaisala Date: Fri, 18 Sep 2020 17:25:34 +0800 Subject: [PATCH] Working on marking the active edges. --- src/core/device.cc | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/core/device.cc b/src/core/device.cc index a68fbd9..d1640c9 100644 --- a/src/core/device.cc +++ b/src/core/device.cc @@ -1840,12 +1840,24 @@ acGridIntegrate(const Stream stream, const AcReal dt) const int3 m2 = nn; const int3 pid3d = getPid3D(pid, decomposition); // If we are are a boundary element - if ((pid3d.x == 0) || (pid3d.x == decomposition.x - 1) || - (pid3d.y == 0) || (pid3d.y == decomposition.y - 1) || - (pid3d.z == 0) || (pid3d.z == decomposition.z - 1) ||) + int3 bindex = (int3){0, 0, 0}; + + // 1 is top edge, 2 bottom edge, 3 both edges, 0 is no boundary + if (pid3d.x == 0) { bindex.x = 1; } + else if (pid3d.x == decomposition.x - 1) { bindex.x = 2; } + else if ((pid3d.x == 0) && (pid3d.x == decomposition.x - 1)) { bindex.x = 3; } + + if (pid3d.y == 0) { bindex.y = 1; } + else if (pid3d.y == decomposition.y - 1) { bindex.y = 2; } + else if ((pid3d.y == 0) && (pid3d.y == decomposition.y - 1)) { bindex.y = 3; } + + if (pid3d.z == 0) { bindex.z = 1; } + else if (pid3d.z == decomposition.z - 1) { bindex.z = 2; } + else if ((pid3d.z == 0) && (pid3d.z == decomposition.z - 1)) { bindex.z = 3; } + { - //TODO get bound_direction - acDeviceGeneralBoundconds(device, stream, m1, m2, bound_direction); + //TODO get bound_direction -> bindex + acDeviceGeneralBoundconds(device, stream, m1, m2, bindex); } acGridSynchronizeStream(stream);