ls1-MarDyn
ls1-MarDyn molecular dynamics code
NeutralTerritory.h
1/*
2 * NeutralTerritory.h
3 *
4 * Created on: Mar 1, 2017
5 * Author: seckler
6 */
7
8#pragma once
9
10#include "ZonalMethod.h"
11
18public:
19 NeutralTerritory() = default;
20 ~~NeutralTerritory() override = default;
21
22 std::vector<HaloRegion> getHaloImportForceExportRegions(HaloRegion& initialRegion, double cutoffRadius,
23 bool coversWholeDomain[3], double cellLength[3]) override {
24 auto condition = [](const int d[3]) -> bool {
25 // Determines, whether the region is in the disk.
26 // Here, we cannot directly apply the stencil from the NT traversal, as for multiple cells also the
27 // direction x=0 and y=-1 needs to be taken into account.
28 bool inDisk = (d[2] == 0) && d[0] >= 0;
29
30 // Determines, whether the region is in the tower.
31 bool inTower = (d[0] == 0) && (d[1] == 0) && (d[2] != 0);
32
33 // Return true, if region is in the tower or in the disk.
34 return inDisk || inTower;
35 };
36 return getHaloRegionsConditional(initialRegion, cutoffRadius, coversWholeDomain, condition);
37 }
38
39 std::vector<HaloRegion> getHaloExportForceImportRegions(HaloRegion& initialRegion, double cutoffRadius,
40 bool coversWholeDomain[3], double cellLength[3]) override {
41 auto condition = [](const int d[3]) -> bool {
42 // Determines, whether the region is in the disk.
43 // Here, we cannot directly apply the stencil from the NT traversal, as for multiple cells also the
44 // direction x=0 and y=-1 needs to be taken into account.
45 bool inDisk = (d[2] == 0) && d[0] <= 0;
46 // Difference to haloimportforceexport: here we have a "<="
47 // Determines, whether the region is in the tower.
48 bool inTower = (d[0] == 0) && (d[1] == 0) && (d[2] != 0);
49
50 // Return true, if region is in the tower or in the disk.
51 return inDisk || inTower;
52 };
53 return getHaloRegionsConditionalInside(initialRegion, cutoffRadius, coversWholeDomain, condition);
54 }
55};
Definition: NeutralTerritory.h:17
std::vector< HaloRegion > getHaloImportForceExportRegions(HaloRegion &initialRegion, double cutoffRadius, bool coversWholeDomain[3], double cellLength[3]) override
Definition: NeutralTerritory.h:22
std::vector< HaloRegion > getHaloExportForceImportRegions(HaloRegion &initialRegion, double cutoffRadius, bool coversWholeDomain[3], double cellLength[3]) override
Definition: NeutralTerritory.h:39
Definition: ZonalMethod.h:14
std::vector< HaloRegion > getHaloRegionsConditionalInside(HaloRegion &initialRegion, double cutoffRadius, bool coversWholeDomain[3], const std::function< bool(const int[3])> &condition)
Definition: ZonalMethod.cpp:132
std::vector< HaloRegion > getHaloRegionsConditional(HaloRegion &initialRegion, double cutoffRadius, bool coversWholeDomain[3], const std::function< bool(const int[3])> &condition)
Definition: ZonalMethod.cpp:76
Definition: HaloRegion.h:10