diff --git a/src/dynamicMesh/dynamicFvMesh/dynamicTopoFvMesh/meshOpsI.H b/src/dynamicMesh/dynamicFvMesh/dynamicTopoFvMesh/meshOpsI.H new file mode 100644 index 000000000..9c9d4259a --- /dev/null +++ b/src/dynamicMesh/dynamicFvMesh/dynamicTopoFvMesh/meshOpsI.H @@ -0,0 +1,597 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + meshOps + +Description + Various utility functions that perform mesh-related operations. + +Author + Sandeep Menon + University of Massachusetts Amherst + All rights reserved + +\*---------------------------------------------------------------------------*/ + +#include "Pair.H" +#include "meshOps.H" +#include "ListOps.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +namespace meshOps +{ + +// Utility method to find the common edge between two faces. +inline bool findCommonEdge +( + const label first, + const label second, + const UList& faceEdges, + label& common +) +{ + bool found = false; + + const labelList& fEi = faceEdges[first]; + const labelList& fEj = faceEdges[second]; + + forAll(fEi, edgeI) + { + forAll(fEj, edgeJ) + { + if (fEi[edgeI] == fEj[edgeJ]) + { + common = fEi[edgeI]; + + found = true; + break; + } + } + + if (found) + { + break; + } + } + + return found; +} + + +// Utility method to find the interior (quad) / boundary (tri) faces +// for an input quad-face and adjacent triangle-prism cell. +inline void findPrismFaces +( + const label fIndex, + const label cIndex, + const UList& faces, + const UList& cells, + const UList