diff --git a/src/core/Grid.cpp b/src/core/Grid.cpp index d127f191ac74b518778f16faf0a4ee4022b82869..4b68021d99b9a87182124f0c160fb9c32ce78ee8 100644 --- a/src/core/Grid.cpp +++ b/src/core/Grid.cpp @@ -233,6 +233,22 @@ bool Grid::hasVertexOnBorder(const int& interId, return hasVertexOnBord; } +bool Grid::isInterfaceDomainBorder(const long& id) +{ + return isInterfaceDomainBorder(this->getInterface(id)); +} + +bool Grid::isInterfaceDomainBorder(const bitpit::Interface& inter) +{ + bitpit::Cell& cell = this->getCell(inter.getOwner()); + + if (inter.isBorder() && cell.isInterior()) + { + return true; + } + return false; +} + bool Grid::isBorder(const long& id) { diff --git a/src/core/Grid.hpp b/src/core/Grid.hpp index c2d92b18c20cfb7b82924902777a155ab21ff2cd..cdfdca1a8ee2c5ed841f49684d59724329ec48b7 100644 --- a/src/core/Grid.hpp +++ b/src/core/Grid.hpp @@ -272,6 +272,24 @@ std::vector<int> getFaceVertexLocalIds(int face); bool hasVertexOnBorder(const int& interId, int& interOnBorder); +/** + * @brief Is the interface "interId" is a domain boundary cell ? + * + * @param[in] interId Global id of the interface + * + * @return True if the interface is on the domain boundary + */ +bool isInterfaceDomainBorder(const long& interId ); + +/** + * @brief Is the interface "inter" a domain boundary cell ? + * + * @param[in] inter : the interface + * + * @return True if the interface is on the domain boundary + */ +bool isInterfaceDomainBorder(const bitpit::Interface& inter); + /** * @brief Is the cell "cellId" is a boundary cell ? *