diff --git a/src/core/Grid.cpp b/src/core/Grid.cpp index d127f191ac74b518778f16faf0a4ee4022b82869..6151d5295db6ee98e899719feb5006006f3a5d98 100644 --- a/src/core/Grid.cpp +++ b/src/core/Grid.cpp @@ -233,6 +233,29 @@ bool Grid::hasVertexOnBorder(const int& interId, return hasVertexOnBord; } +bool Grid::isInterfaceDomainBorder(const long& id) +{ + bitpit::Interface& inter = this->getInterface(id); + bitpit::Cell& cell = this->getCell(inter.getOwner()); + + if (inter.isBorder() && cell.isInterior()) + { + return true; + } + return false; +} + +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 40b3f27d80d54d310a92bd98be9e944cf07cf61d..219b4167d8b4ba79843c42597507cf6031d1444c 100644 --- a/src/core/Grid.hpp +++ b/src/core/Grid.hpp @@ -264,6 +264,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 ? *