Commit 9b1b024f authored by sergio's avatar sergio Committed by Andrew Heather
Browse files

DEFEATURE: remove explicit regionCoupled methods

- did not perform as well as desired. Slated for replacement with a
  different approach.
parent cd503cdb
......@@ -95,7 +95,6 @@ fvAgglomerationMethods/Allwmake $targetType $*
wmake $targetType waveModels
wmake $targetType engine
wmake $targetType regionCoupled
conversion/Allwmake $targetType $*
functionObjects/Allwmake $targetType $*
......
......@@ -35,9 +35,6 @@ derivedFvPatches = $(fvPatches)/derived
$(derivedFvPatches)/wall/wallFvPatch.C
$(derivedFvPatches)/mapped/mappedFvPatch.C
$(derivedFvPatches)/mapped/mappedWallFvPatch.C
$(derivedFvPatches)/regionCoupled/regionCoupledBaseFvPatch.C
$(derivedFvPatches)/regionCoupled/regionCoupledFvPatch.C
$(derivedFvPatches)/regionCoupled/regionCoupledWallFvPatch.C
wallDist = fvMesh/wallDist
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
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 <http://www.gnu.org/licenses/>.
Description
\*---------------------------------------------------------------------------*/
#include "regionCoupledBaseFvPatch.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(regionCoupledBaseFvPatch, 0);
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
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 <http://www.gnu.org/licenses/>.
Class
Foam::regionCoupledBaseFvPatch
Description
Base class of regionCoupledFvPatch with common functionality for
regionCoupledFvPatch and regionCoupledWallFvPatch
SourceFiles
regionCoupledBaseFvPatch.C
\*---------------------------------------------------------------------------*/
#ifndef regionCoupledBaseFvPatch_H
#define regionCoupledBaseFvPatch_H
#include "regionCoupledBase.H"
#include "fvMesh.H"
#include "Time.H"
#include "polyPatch.H"
#include "regionCoupledLduInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class regionCoupledBaseFvPatch Declaration
\*---------------------------------------------------------------------------*/
class regionCoupledBaseFvPatch
:
public regionCoupledLduInterface
{
protected:
// Protected data
//- Reference to regionCoupledBase
const regionCoupledBase& regionCoupledBase_;
//- Reference to fvPatch
const fvPatch& patch_;
// Protected members
//- Returns fvMesh
const fvMesh& nbrFvMesh() const
{
return
(
patch_.boundaryMesh().mesh().time().lookupObject<fvMesh>
(
regionCoupledBase_.nbrRegionName()
)
);
}
public:
//- Runtime type information
TypeName("regionCoupledBase");
// Constructors
//- Construct from polyPatch
regionCoupledBaseFvPatch
(
const polyPatch& pp,
const fvPatch& patch
)
:
regionCoupledLduInterface(),
regionCoupledBase_
(
refCast<const regionCoupledBase>(pp)
),
patch_(patch)
{}
//- Destructor
virtual ~regionCoupledBaseFvPatch() = default;
// Member Functions
// Access
//- Return neighbour
virtual label neighbPatchID() const
{
return regionCoupledBase_.neighbPatchID();
}
//- Is it the owner?
virtual bool owner() const
{
return regionCoupledBase_.owner();
}
//- Return regionCoupledBase neighbour Patch
virtual const regionCoupledBaseFvPatch& neighbPatch() const
{
return refCast<const regionCoupledBaseFvPatch>
(
nbrFvMesh().boundary()
[
regionCoupledBase_.neighbPatchID()
]
);
}
//- Return a reference to the AMI interpolator
virtual const AMIPatchToPatchInterpolation& AMI() const
{
return regionCoupledBase_.AMI();
}
//- Returns neighbour polyMesh
virtual const polyMesh& nbrMesh() const
{
return
(
patch_.boundaryMesh().mesh().time().lookupObject<polyMesh>
(
regionCoupledBase_.nbrRegionName()
)
);
}
//- Return fvPatch
const fvPatch& patch() const
{
return patch_;
}
//- Returns if it is the same Region
bool sameRegion() const
{
return regionCoupledBase_.sameRegion();
}
//- Return regionCoupledPolyPatch
const regionCoupledBase& regionCoupledPatch() const
{
return regionCoupledBase_;
}
//- Return neighbour fvPatch
const fvPatch& neighbFvPatch() const
{
return refCast<const fvPatch>
(
nbrFvMesh().boundary()
[
regionCoupledBase_.neighbPatchID()
]
);
}
//- Return the interface type
const word& regionCoupleType() const
{
return regionCoupledBase_.regionCoupleType();
}
//- Return faceCell addressing
virtual const labelUList& faceCells() const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "regionCoupledFvPatch.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(regionCoupledFvPatch, 0);
addToRunTimeSelectionTable(fvPatch, regionCoupledFvPatch, polyPatch);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::labelField> Foam::regionCoupledFvPatch::interfaceInternalField
(
const labelUList& internalData
) const
{
return patchInternalField(internalData);
}
Foam::tmp<Foam::labelField> Foam::regionCoupledFvPatch::internalFieldTransfer
(
const Pstream::commsTypes commsType,
const labelUList& iF
) const
{
if (neighbFvPatch().sameRegion())
{
return neighbFvPatch().patchInternalField(iF);
}
return tmp<labelField>::New(iF.size(), Zero);
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
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 <http://www.gnu.org/licenses/>.
Class
Foam::regionCoupledFvPatch
Description
Common functionality for regionCoupleFvPatch and regionCoupledWallFvPatch
SourceFiles
regionCoupledFvPatch.C
\*---------------------------------------------------------------------------*/
#ifndef regionCoupledFvPatch_H
#define regionCoupledFvPatch_H
#include "fvPatch.H"
#include "fvMesh.H"
#include "Time.H"
#include "regionCoupledPolyPatch.H"
#include "regionCoupledBaseFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class regionCoupledFvPatch Declaration
\*---------------------------------------------------------------------------*/
class regionCoupledFvPatch
:
public lduInterface,
public fvPatch,
public regionCoupledBaseFvPatch
{
// Private data
const regionCoupledPolyPatch& regionCoupledPolyPatch_;
// Private members
//- Return regionCoupledFvPatch nbr
const regionCoupledFvPatch& neighbFvPatch() const
{
return refCast<const regionCoupledFvPatch>
(
nbrFvMesh().boundary()
[
neighbPatchID()
]
);
}
public:
//- Runtime type information
TypeName(regionCoupledPolyPatch::typeName_());
// Constructors
//- Construct from polyPatch
regionCoupledFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
:
fvPatch(patch, bm),
regionCoupledBaseFvPatch
(
patch,
*this
),
regionCoupledPolyPatch_
(
refCast<const regionCoupledPolyPatch>(patch)
)
{}
//- Destructor
~regionCoupledFvPatch()
{}
// Member Functions
// Access
//- Return faceCell addressing
virtual const labelUList& faceCells() const
{
return fvPatch::faceCells();
}
//- Return true because this patch is coupled
virtual bool coupled() const
{
return regionCoupledPolyPatch_.coupled();
}
// Interface transfer functions
//- Return the values of the given internal data adjacent to
// the interface as a field
virtual tmp<labelField> interfaceInternalField
(
const labelUList& internalData
) const;
//- Inherit initInternalFieldTransfer from lduInterface
using lduInterface::initInternalFieldTransfer;
//- Initialise neighbour field transfer
virtual void initInternalFieldTransfer
(
const Pstream::commsTypes commsType,
labelUList& iF
) const
{}
//- Return neighbour field
virtual tmp<labelField> internalFieldTransfer
(
const Pstream::commsTypes commsType,
const labelUList& iF
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "regionCoupledWallFvPatch.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(regionCoupledWallFvPatch, 0);
addToRunTimeSelectionTable(fvPatch, regionCoupledWallFvPatch, polyPatch);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::labelField> Foam::regionCoupledWallFvPatch::
interfaceInternalField
(
const labelUList& internalData
) const
{
return patchInternalField(internalData);
}
Foam::tmp<Foam::labelField> Foam::regionCoupledWallFvPatch::
internalFieldTransfer
(
const Pstream::commsTypes commsType,
const labelUList& iF
) const
{
if (neighbFvPatch().sameRegion())
{
return neighbFvPatch().patchInternalField(iF);
}
return tmp<labelField>::New(iF.size(), Zero);
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
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