/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 3 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, see .
\*---------------------------------------------------------------------------*/
#include "enrichedPatch.H"
#include "DynamicList.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::label Foam::enrichedPatch::enrichedFaceRatio_ = 3;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::enrichedPatch::calcEnrichedFaces
(
const labelListList& pointsIntoMasterEdges,
const labelListList& pointsIntoSlaveEdges,
const pointField& projectedSlavePoints
)
{
if (enrichedFacesPtr_)
{
FatalErrorInFunction
<< "Enriched faces already calculated."
<< abort(FatalError);
}
// Create a list of enriched faces
// Algorithm:
// 1) Grab the original face and start from point zero.
// 2) If the point has been merged away, grab the merge label;
// otherwise, keep the original label.
// 3) Go to the next edge. Collect all the points to be added along
// the edge; order them in the necessary direction and insert onto the
// face.
// 4) Grab the next point and return on step 2.
enrichedFacesPtr_.reset
(
new faceList(masterPatch_.size() + slavePatch_.size())
);
auto& enrichedFaces = *enrichedFacesPtr_;
label nEnrichedFaces = 0;
const pointField& masterLocalPoints = masterPatch_.localPoints();
const faceList& masterLocalFaces = masterPatch_.localFaces();
const labelListList& masterFaceEdges = masterPatch_.faceEdges();
const faceList& slaveLocalFaces = slavePatch_.localFaces();
const labelListList& slaveFaceEdges = slavePatch_.faceEdges();
// For correct functioning of the enrichedPatch class, the slave
// faces need to be inserted first. See comments in
// enrichedPatch.H
// Get reference to the point merge map
const Map