diff --git a/src/overset/oversetMesh/oversetFringe/donorBasedLayerFringe/donorBasedLayeredFringe.C b/src/overset/oversetMesh/oversetFringe/donorBasedLayerFringe/donorBasedLayeredFringe.C deleted file mode 100644 index f293cb0d1..000000000 --- a/src/overset/oversetMesh/oversetFringe/donorBasedLayerFringe/donorBasedLayeredFringe.C +++ /dev/null @@ -1,216 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | foam-extend: Open Source CFD - \\ / O peration | Version: 4.1 - \\ / A nd | Web: http://www.foam-extend.org - \\/ M anipulation | For copyright notice see file Copyright -------------------------------------------------------------------------------- -License - This file is part of foam-extend. - - foam-extend 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. - - foam-extend 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 foam-extend. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "donorBasedLayeredFringe.H" -#include "oversetRegion.H" -#include "polyPatchID.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(donorBasedLayeredFringe, 0); - addToRunTimeSelectionTable - ( - oversetFringe, - donorBasedLayeredFringe, - dictionary - ); -} - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void Foam::donorBasedLayeredFringe::calcAddressing() const -{ - if (fringeHolesPtr_ || acceptorsPtr_) - { - FatalErrorIn - ( - "void Foam::donorBasedLayeredFringe::calcAddressing() const" - ) << "Fringe addressing already calculated" - << abort(FatalError); - } - - // We need to wait for the fringe from donor region to finish the - // assembly. Simply create empty acceptor and fringe hole lists - acceptorsPtr_ = new labelList(); - fringeHolesPtr_ = new labelList(); -} - - -void Foam::donorBasedLayeredFringe::clearAddressing() const -{ - deleteDemandDrivenData(fringeHolesPtr_); - deleteDemandDrivenData(acceptorsPtr_); - deleteDemandDrivenData(finalDonorAcceptorsPtr_); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -// Construct from dictionary -Foam::donorBasedLayeredFringe::donorBasedLayeredFringe -( - const fvMesh& mesh, - const oversetRegion& region, - const dictionary& dict -) -: - oversetFringe(mesh, region, dict), - fringeHolesPtr_(NULL), - acceptorsPtr_(NULL), - finalDonorAcceptorsPtr_(NULL), - nLayers_(readLabel(dict.lookup("nLayers"))) -{ - // Sanity check for number of layers - if (nLayers_ < 1) - { - FatalErrorIn - ( - "donorBasedLayeredFringe::donorBasedLayeredFringe\n" - "(\n" - " const fvMesh& mesh,\n" - " const oversetRegion& region,\n" - " const dictionary& dict,\n" - ")\n" - ) << "Invalid number of layers specified in donor based layered" - << "fringe dictionary." - << nl - << "Please specify value between greater than 0." - << endl; - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::donorBasedLayeredFringe::~donorBasedLayeredFringe() -{ - clearAddressing(); -} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -bool Foam::donorBasedLayeredFringe::updateIteration -( - donorAcceptorList& donorAcceptorRegionData -) const -{ - if (finalDonorAcceptorsPtr_) - { - FatalErrorIn("donorBasedLayeredFringe::updateIteration(donorAcceptorList&") - << "finalDonorAcceptorPtr_ already allocated. Something went " - << "wrong with the iteration procedure (flag was not updated)." - << abort(FatalError); - } - - // Get overset mesh - const oversetMesh& om = region().overset(); - - // Get list of donor regions of this overset region - const labelList& donorRegions = region().donorRegions(); - - // Check whether all donor regions have finished with the donor search - - - - // Allocate the list by reusing the argument list - finalDonorAcceptorsPtr_ = new donorAcceptorList - ( - donorAcceptorRegionData, - true - ); - - // Set the flag to true and return - updateSuitableOverlapFlag(true); - - return foundSuitableOverlap(); -} - - -const Foam::labelList& Foam::donorBasedLayeredFringe::fringeHoles() const -{ - if (!fringeHolesPtr_) - { - calcAddressing(); - } - - return *fringeHolesPtr_; -} - - -const Foam::labelList& Foam::donorBasedLayeredFringe::candidateAcceptors() const -{ - if (!acceptorsPtr_) - { - calcAddressing(); - } - - return *acceptorsPtr_; -} - - -Foam::donorAcceptorList& Foam::donorBasedLayeredFringe::finalDonorAcceptors() const -{ - if (!finalDonorAcceptorsPtr_) - { - FatalErrorIn("donorBasedLayeredFringe::finalDonorAcceptors()") - << "finalDonorAcceptorPtr_ not allocated. Make sure you have " - << "called donorBasedLayeredFringe::updateIteration() before asking for " - << "final set of donor/acceptor pairs." - << abort(FatalError); - } - - if (!foundSuitableOverlap()) - { - FatalErrorIn("donorBasedLayeredFringe::finalDonorAcceptors()") - << "Attemted to access finalDonorAcceptors but suitable overlap " - << "has not been found. This is not allowed. " - << abort(FatalError); - } - - return *finalDonorAcceptorsPtr_; -} - - -void Foam::donorBasedLayeredFringe::update() const -{ - if (updateFringe_) - { - Info<< "donorBasedLayeredFringe::update() const" << endl; - - // Clear out - clearAddressing(); - } - - // Set flag to false and clear final donor/acceptors only - deleteDemandDrivenData(finalDonorAcceptorsPtr_); - updateSuitableOverlapFlag(false); -} - - -// ************************************************************************* // diff --git a/src/overset/oversetMesh/oversetFringe/donorBasedLayerFringe/donorBasedLayeredFringe.H b/src/overset/oversetMesh/oversetFringe/donorBasedLayerFringe/donorBasedLayeredFringe.H deleted file mode 100644 index f645f4ab1..000000000 --- a/src/overset/oversetMesh/oversetFringe/donorBasedLayerFringe/donorBasedLayeredFringe.H +++ /dev/null @@ -1,147 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | foam-extend: Open Source CFD - \\ / O peration | Version: 4.1 - \\ / A nd | Web: http://www.foam-extend.org - \\/ M anipulation | For copyright notice see file Copyright -------------------------------------------------------------------------------- -License - This file is part of foam-extend. - - foam-extend 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. - - foam-extend 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 foam-extend. If not, see . - -Class - donorBasedLayeredFringeFringe - -Description - Fringe algorithm based on layered approach, where the acceptors of the - region are defined as neighbours of the donors toward the interior of the - region. - - This is achieved by waiting for the acceptors of the donor region to be - found and then defining acceptors. - -Author - Vuko Vukcevic, Wikki Ltd. All rights reserved. - -SourceFiles - donorBasedLayeredFringeFringe.C - -\*---------------------------------------------------------------------------*/ - -#ifndef donorBasedLayeredFringeFringe_H -#define donorBasedLayeredFringeFringe_H - -#include "oversetFringe.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class donorBasedLayeredFringeFringe Declaration -\*---------------------------------------------------------------------------*/ - -class donorBasedLayeredFringeFringe -: - public oversetFringe -{ - // Private data - - //- Fringe hole cells - mutable labelList* fringeHolesPtr_; - - //- Acceptor cells - mutable labelList* acceptorsPtr_; - - //- Final donor/acceptor pairs for this region (fringe) - mutable donorAcceptorList* finalDonorAcceptorsPtr_; - - //- Number of layers from donors to acceptors of this region - label nLayers_; - - - // Private Member Functions - - //- Disallow default bitwise copy construct - donorBasedLayeredFringeFringe(const donorBasedLayeredFringeFringe&); - - //- Disallow default bitwise assignment - void operator=(const donorBasedLayeredFringeFringe&); - - - // Calculate hole and acceptor addressing - void calcAddressing() const; - - // Clear addressing - void clearAddressing() const; - - -public: - - //- Runtime type information - TypeName("donorBasedLayeredFringe"); - - - // Constructors - - //- Construct from dictionary - donorBasedLayeredFringeFringe - ( - const fvMesh& mesh, - const oversetRegion& region, - const dictionary& dict - ); - - - // Destructor - - virtual ~donorBasedLayeredFringeFringe(); - - - // Member Functions - - //- Update iteration. Note: invalidates parameter - virtual bool updateIteration - ( - donorAcceptorList& donorAcceptorRegionData - ) const; - - //- Return list of deactivated (hole) cells - // Fringe hole cells are collected in addition to geometric hole - // cells, which fall outside of all donor regions - virtual const labelList& fringeHoles() const; - - //- Return list of acceptor cells - virtual const labelList& candidateAcceptors() const; - - //- Return list of final donor acceptor pairs. Note: caller may - // invalidate finalDonorAcceptorsPtr_ for optimisation purposes - virtual donorAcceptorList& finalDonorAcceptors() const; - - //- Update the fringe - virtual void update() const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* //