mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
4
applications/test/extendedStencil/Make/files
Normal file
4
applications/test/extendedStencil/Make/files
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
testExtendedStencil.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_USER_APPBIN)/testExtendedStencil
|
||||||
6
applications/test/extendedStencil/Make/options
Normal file
6
applications/test/extendedStencil/Make/options
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude
|
||||||
|
|
||||||
|
EXE_LIBS = \
|
||||||
|
-lfiniteVolume
|
||||||
499
applications/test/extendedStencil/testExtendedStencil.C
Normal file
499
applications/test/extendedStencil/testExtendedStencil.C
Normal file
@ -0,0 +1,499 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
|
||||||
|
Application
|
||||||
|
testExtendedStencil
|
||||||
|
|
||||||
|
Description
|
||||||
|
Test app for determining extended stencil.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "argList.H"
|
||||||
|
#include "fvMesh.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "Time.H"
|
||||||
|
#include "mapDistribute.H"
|
||||||
|
#include "OFstream.H"
|
||||||
|
#include "meshTools.H"
|
||||||
|
//#include "FECCellToFaceStencil.H"
|
||||||
|
//#include "CFCCellToFaceStencil.H"
|
||||||
|
//#include "CPCCellToFaceStencil.H"
|
||||||
|
//#include "CECCellToFaceStencil.H"
|
||||||
|
//#include "extendedCentredCellToFaceStencil.H"
|
||||||
|
//#include "extendedUpwindCellToFaceStencil.H"
|
||||||
|
|
||||||
|
//#include "centredCFCCellToFaceStencilObject.H"
|
||||||
|
//#include "centredFECCellToFaceStencilObject.H"
|
||||||
|
//#include "centredCPCCellToFaceStencilObject.H"
|
||||||
|
//#include "centredCECCellToFaceStencilObject.H"
|
||||||
|
|
||||||
|
//#include "upwindFECCellToFaceStencilObject.H"
|
||||||
|
//#include "upwindCPCCellToFaceStencilObject.H"
|
||||||
|
//#include "upwindCECCellToFaceStencilObject.H"
|
||||||
|
|
||||||
|
//#include "upwindCFCCellToFaceStencilObject.H"
|
||||||
|
#include "centredCFCFaceToCellStencilObject.H"
|
||||||
|
|
||||||
|
using namespace Foam;
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void writeStencilOBJ
|
||||||
|
(
|
||||||
|
const fileName& fName,
|
||||||
|
const point& fc,
|
||||||
|
const List<point>& stencilCc
|
||||||
|
)
|
||||||
|
{
|
||||||
|
OFstream str(fName);
|
||||||
|
label vertI = 0;
|
||||||
|
|
||||||
|
meshTools::writeOBJ(str, fc);
|
||||||
|
vertI++;
|
||||||
|
|
||||||
|
forAll(stencilCc, i)
|
||||||
|
{
|
||||||
|
meshTools::writeOBJ(str, stencilCc[i]);
|
||||||
|
vertI++;
|
||||||
|
str << "l 1 " << vertI << nl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Stats
|
||||||
|
void writeStencilStats(const labelListList& stencil)
|
||||||
|
{
|
||||||
|
label sumSize = 0;
|
||||||
|
label nSum = 0;
|
||||||
|
label minSize = labelMax;
|
||||||
|
label maxSize = labelMin;
|
||||||
|
|
||||||
|
forAll(stencil, i)
|
||||||
|
{
|
||||||
|
const labelList& sCells = stencil[i];
|
||||||
|
|
||||||
|
if (sCells.size() > 0)
|
||||||
|
{
|
||||||
|
sumSize += sCells.size();
|
||||||
|
nSum++;
|
||||||
|
minSize = min(minSize, sCells.size());
|
||||||
|
maxSize = max(maxSize, sCells.size());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reduce(sumSize, sumOp<label>());
|
||||||
|
reduce(nSum, sumOp<label>());
|
||||||
|
sumSize /= nSum;
|
||||||
|
|
||||||
|
reduce(minSize, minOp<label>());
|
||||||
|
reduce(maxSize, maxOp<label>());
|
||||||
|
|
||||||
|
Info<< "Stencil size :" << nl
|
||||||
|
<< " average : " << sumSize << nl
|
||||||
|
<< " min : " << minSize << nl
|
||||||
|
<< " max : " << maxSize << nl
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Main program:
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
# include "addTimeOptions.H"
|
||||||
|
# include "setRootCase.H"
|
||||||
|
# include "createTime.H"
|
||||||
|
|
||||||
|
// Get times list
|
||||||
|
instantList Times = runTime.times();
|
||||||
|
# include "checkTimeOptions.H"
|
||||||
|
runTime.setTime(Times[startTime], startTime);
|
||||||
|
# include "createMesh.H"
|
||||||
|
|
||||||
|
// Force calculation of extended edge addressing
|
||||||
|
const labelListList& edgeFaces = mesh.edgeFaces();
|
||||||
|
const labelListList& edgeCells = mesh.edgeCells();
|
||||||
|
const labelListList& pointCells = mesh.pointCells();
|
||||||
|
Info<< "dummy:" << edgeFaces.size() + edgeCells.size() + pointCells.size()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
|
||||||
|
// Centred, semi-extended stencil (edge cells only)
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// {
|
||||||
|
// //const FECCellToFaceStencil cfcStencil(mesh);
|
||||||
|
// //const extendedCentredCellToFaceStencil addressing
|
||||||
|
// //(
|
||||||
|
// // cfcStencil
|
||||||
|
// //);
|
||||||
|
// const extendedCentredStencil& addressing =
|
||||||
|
// centredFECCellToFaceStencilObject::New
|
||||||
|
// (
|
||||||
|
// mesh
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// Info<< "faceEdgeCell:" << endl;
|
||||||
|
// writeStencilStats(addressing.stencil());
|
||||||
|
//
|
||||||
|
// // Collect stencil cell centres
|
||||||
|
// List<List<point> > stencilPoints(mesh.nFaces());
|
||||||
|
// addressing.collectData
|
||||||
|
// (
|
||||||
|
// mesh.C(),
|
||||||
|
// stencilPoints
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// forAll(stencilPoints, faceI)
|
||||||
|
// {
|
||||||
|
// writeStencilOBJ
|
||||||
|
// (
|
||||||
|
// runTime.path()/"faceEdgeCell" + Foam::name(faceI) + ".obj",
|
||||||
|
// mesh.faceCentres()[faceI],
|
||||||
|
// stencilPoints[faceI]
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// // Centred, face stencil
|
||||||
|
// // ~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
//
|
||||||
|
// {
|
||||||
|
// const extendedCentredCellToFaceStencil& addressing =
|
||||||
|
// centredCFCCellToFaceStencilObject::New
|
||||||
|
// (
|
||||||
|
// mesh
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// Info<< "cellFaceCell:" << endl;
|
||||||
|
// writeStencilStats(addressing.stencil());
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// //// Do some interpolation.
|
||||||
|
// //{
|
||||||
|
// // const labelListList& stencil = addressing.stencil();
|
||||||
|
// // List<List<scalar> > stencilWeights(stencil.size());
|
||||||
|
// // forAll(stencil, faceI)
|
||||||
|
// // {
|
||||||
|
// // const labelList& fStencil = stencil[faceI];
|
||||||
|
// //
|
||||||
|
// // if (fStencil.size() > 0)
|
||||||
|
// // {
|
||||||
|
// // // Uniform weights
|
||||||
|
// // stencilWeights[faceI] = scalarList
|
||||||
|
// // (
|
||||||
|
// // fStencil.size(),
|
||||||
|
// // 1.0/fStencil.size()
|
||||||
|
// // );
|
||||||
|
// // }
|
||||||
|
// // }
|
||||||
|
// //
|
||||||
|
// // tmp<surfaceVectorField> tfc
|
||||||
|
// // (
|
||||||
|
// // addressing.weightedSum(mesh.C(), stencilWeights)
|
||||||
|
// // );
|
||||||
|
// //}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// // Collect stencil cell centres
|
||||||
|
// List<List<point> > stencilPoints(mesh.nFaces());
|
||||||
|
// addressing.collectData
|
||||||
|
// (
|
||||||
|
// mesh.C(),
|
||||||
|
// stencilPoints
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// forAll(stencilPoints, faceI)
|
||||||
|
// {
|
||||||
|
// if (stencilPoints[faceI].size() >= 15)
|
||||||
|
// {
|
||||||
|
// writeStencilOBJ
|
||||||
|
// (
|
||||||
|
// runTime.path()/"centredFace" + Foam::name(faceI) + ".obj",
|
||||||
|
// mesh.faceCentres()[faceI],
|
||||||
|
// stencilPoints[faceI]
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// // Centred, point stencil
|
||||||
|
// // ~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
//
|
||||||
|
// {
|
||||||
|
// //const extendedCentredCellToFaceStencil& addressing =
|
||||||
|
// //centredCPCStencilObject::New
|
||||||
|
// //(
|
||||||
|
// // mesh
|
||||||
|
// //);
|
||||||
|
// //
|
||||||
|
// //Info<< "cellPointCell:" << endl;
|
||||||
|
// //writeStencilStats(addressing.stencil());
|
||||||
|
// //
|
||||||
|
// //
|
||||||
|
// //// Collect stencil cell centres
|
||||||
|
// //List<List<point> > stencilPoints(mesh.nFaces());
|
||||||
|
// //addressing.collectData
|
||||||
|
// //(
|
||||||
|
// // mesh.C(),
|
||||||
|
// // stencilPoints
|
||||||
|
// //);
|
||||||
|
// //
|
||||||
|
// //forAll(stencilPoints, faceI)
|
||||||
|
// //{
|
||||||
|
// // writeStencilOBJ
|
||||||
|
// // (
|
||||||
|
// // runTime.path()/"centredPoint" + Foam::name(faceI) + ".obj",
|
||||||
|
// // mesh.faceCentres()[faceI],
|
||||||
|
// // stencilPoints[faceI]
|
||||||
|
// // );
|
||||||
|
// //}
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// // Centred, edge stencil
|
||||||
|
// // ~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
//
|
||||||
|
// {
|
||||||
|
// //const extendedCentredCellToFaceStencil& addressing =
|
||||||
|
// //centredCECStencilObject::New
|
||||||
|
// //(
|
||||||
|
// // mesh
|
||||||
|
// //);
|
||||||
|
// //
|
||||||
|
// //Info<< "cellEdgeCell:" << endl;
|
||||||
|
// //writeStencilStats(addressing.stencil());
|
||||||
|
// //
|
||||||
|
// //
|
||||||
|
// //// Collect stencil cell centres
|
||||||
|
// //List<List<point> > stencilPoints(mesh.nFaces());
|
||||||
|
// //addressing.collectData
|
||||||
|
// //(
|
||||||
|
// // mesh.C(),
|
||||||
|
// // stencilPoints
|
||||||
|
// //);
|
||||||
|
// //
|
||||||
|
// //forAll(stencilPoints, faceI)
|
||||||
|
// //{
|
||||||
|
// // writeStencilOBJ
|
||||||
|
// // (
|
||||||
|
// // runTime.path()/"centredEdge" + Foam::name(faceI) + ".obj",
|
||||||
|
// // mesh.faceCentres()[faceI],
|
||||||
|
// // stencilPoints[faceI]
|
||||||
|
// // );
|
||||||
|
// //}
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Upwind, semi-extended stencil
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
//{
|
||||||
|
// const extendedUpwindCellToFaceStencil& addressing =
|
||||||
|
// upwindFECCellToFaceStencilObject::New
|
||||||
|
// (
|
||||||
|
// mesh,
|
||||||
|
// 0.5
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// Info<< "upwind-faceEdgeCell:" << endl;
|
||||||
|
// writeStencilStats(addressing.ownStencil());
|
||||||
|
//
|
||||||
|
// {
|
||||||
|
// // Collect stencil cell centres
|
||||||
|
// List<List<point> > ownPoints(mesh.nFaces());
|
||||||
|
// addressing.collectData
|
||||||
|
// (
|
||||||
|
// addressing.ownMap(),
|
||||||
|
// addressing.ownStencil(),
|
||||||
|
// mesh.C(),
|
||||||
|
// ownPoints
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// forAll(ownPoints, faceI)
|
||||||
|
// {
|
||||||
|
// writeStencilOBJ
|
||||||
|
// (
|
||||||
|
// runTime.path()/"ownFEC" + Foam::name(faceI) + ".obj",
|
||||||
|
// mesh.faceCentres()[faceI],
|
||||||
|
// ownPoints[faceI]
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// {
|
||||||
|
// // Collect stencil cell centres
|
||||||
|
// List<List<point> > neiPoints(mesh.nFaces());
|
||||||
|
// addressing.collectData
|
||||||
|
// (
|
||||||
|
// addressing.neiMap(),
|
||||||
|
// addressing.neiStencil(),
|
||||||
|
// mesh.C(),
|
||||||
|
// neiPoints
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// forAll(neiPoints, faceI)
|
||||||
|
// {
|
||||||
|
// writeStencilOBJ
|
||||||
|
// (
|
||||||
|
// runTime.path()/"neiFEC" + Foam::name(faceI) + ".obj",
|
||||||
|
// mesh.faceCentres()[faceI],
|
||||||
|
// neiPoints[faceI]
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Upwind, extended stencil
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
//{
|
||||||
|
// const extendedUpwindCellToFaceStencil& addressing =
|
||||||
|
// upwindCFCCellToFaceStencilObject::New
|
||||||
|
// (
|
||||||
|
// mesh,
|
||||||
|
// 0.5
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// Info<< "upwind-cellFaceCell:" << endl;
|
||||||
|
// writeStencilStats(addressing.ownStencil());
|
||||||
|
//
|
||||||
|
// {
|
||||||
|
// // Collect stencil cell centres
|
||||||
|
// List<List<point> > ownPoints(mesh.nFaces());
|
||||||
|
// addressing.collectData
|
||||||
|
// (
|
||||||
|
// addressing.ownMap(),
|
||||||
|
// addressing.ownStencil(),
|
||||||
|
// mesh.C(),
|
||||||
|
// ownPoints
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// forAll(ownPoints, faceI)
|
||||||
|
// {
|
||||||
|
// writeStencilOBJ
|
||||||
|
// (
|
||||||
|
// runTime.path()/"ownCFC" + Foam::name(faceI) + ".obj",
|
||||||
|
// mesh.faceCentres()[faceI],
|
||||||
|
// ownPoints[faceI]
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// {
|
||||||
|
// // Collect stencil cell centres
|
||||||
|
// List<List<point> > neiPoints(mesh.nFaces());
|
||||||
|
// addressing.collectData
|
||||||
|
// (
|
||||||
|
// addressing.neiMap(),
|
||||||
|
// addressing.neiStencil(),
|
||||||
|
// mesh.C(),
|
||||||
|
// neiPoints
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// forAll(neiPoints, faceI)
|
||||||
|
// {
|
||||||
|
// writeStencilOBJ
|
||||||
|
// (
|
||||||
|
// runTime.path()/"neiCFC" + Foam::name(faceI) + ".obj",
|
||||||
|
// mesh.faceCentres()[faceI],
|
||||||
|
// neiPoints[faceI]
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//---- CELL CENTRED STENCIL -----
|
||||||
|
|
||||||
|
// Centred, cell stencil
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
{
|
||||||
|
const extendedCentredFaceToCellStencil& addressing =
|
||||||
|
centredCFCFaceToCellStencilObject::New
|
||||||
|
(
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< "cellFaceCell:" << endl;
|
||||||
|
writeStencilStats(addressing.stencil());
|
||||||
|
|
||||||
|
// Collect stencil face centres
|
||||||
|
List<List<point> > stencilPoints(mesh.nCells());
|
||||||
|
addressing.collectData
|
||||||
|
(
|
||||||
|
mesh.Cf(),
|
||||||
|
stencilPoints
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(stencilPoints, cellI)
|
||||||
|
{
|
||||||
|
writeStencilOBJ
|
||||||
|
(
|
||||||
|
runTime.path()/"centredCell" + Foam::name(cellI) + ".obj",
|
||||||
|
mesh.cellCentres()[cellI],
|
||||||
|
stencilPoints[cellI]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//XXXXXX
|
||||||
|
// // Evaluate
|
||||||
|
// List<List<scalar> > stencilData(faceStencils.size());
|
||||||
|
// collectStencilData
|
||||||
|
// (
|
||||||
|
// distMap,
|
||||||
|
// faceStencils,
|
||||||
|
// vf,
|
||||||
|
// stencilData
|
||||||
|
// );
|
||||||
|
// for(label faci = 0; faci < mesh.nInternalFaces(); faci++)
|
||||||
|
// {
|
||||||
|
// const scalarList& stData = stencilData[faceI];
|
||||||
|
// const scalarList& stWeight = fit[faceI];
|
||||||
|
//
|
||||||
|
// forAll(stData, i)
|
||||||
|
// {
|
||||||
|
// sf[faceI] += stWeight[i]*stData[i];
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// See finiteVolume/lnInclude/leastSquaresGrad.C
|
||||||
|
//XXXXXX
|
||||||
|
|
||||||
|
Pout<< "End\n" << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -39,26 +39,40 @@ fvMeshMapper = fvMesh/fvMeshMapper
|
|||||||
$(fvMeshMapper)/fvPatchMapper.C
|
$(fvMeshMapper)/fvPatchMapper.C
|
||||||
$(fvMeshMapper)/fvSurfaceMapper.C
|
$(fvMeshMapper)/fvSurfaceMapper.C
|
||||||
|
|
||||||
|
|
||||||
extendedStencil = fvMesh/extendedStencil
|
extendedStencil = fvMesh/extendedStencil
|
||||||
$(extendedStencil)/extendedStencil.C
|
|
||||||
$(extendedStencil)/extendedUpwindStencil.C
|
|
||||||
$(extendedStencil)/extendedCentredStencil.C
|
|
||||||
|
|
||||||
$(extendedStencil)/faceStencil/faceStencil.C
|
cellToCell = $(extendedStencil)/cellToCell
|
||||||
$(extendedStencil)/faceStencil/faceEdgeCellStencil.C
|
$(cellToCell)/fullStencils/cellToCellStencil.C
|
||||||
$(extendedStencil)/faceStencil/cellFaceCellStencil.C
|
$(cellToCell)/fullStencils/CFCCellToCellStencil.C
|
||||||
$(extendedStencil)/faceStencil/cellPointCellStencil.C
|
$(cellToCell)/fullStencils/CPCCellToCellStencil.C
|
||||||
$(extendedStencil)/faceStencil/cellEdgeCellStencil.C
|
$(cellToCell)/fullStencils/CECCellToCellStencil.C
|
||||||
|
|
||||||
$(extendedStencil)/extendedStencilMeshObjects/centredCECStencilObject.C
|
cellToFace = $(extendedStencil)/cellToFace
|
||||||
$(extendedStencil)/extendedStencilMeshObjects/centredCFCStencilObject.C
|
$(cellToFace)/fullStencils/cellToFaceStencil.C
|
||||||
$(extendedStencil)/extendedStencilMeshObjects/centredCPCStencilObject.C
|
$(cellToFace)/fullStencils/CFCCellToFaceStencil.C
|
||||||
$(extendedStencil)/extendedStencilMeshObjects/centredFECStencilObject.C
|
$(cellToFace)/fullStencils/CECCellToFaceStencil.C
|
||||||
|
$(cellToFace)/fullStencils/CPCCellToFaceStencil.C
|
||||||
|
$(cellToFace)/fullStencils/FECCellToFaceStencil.C
|
||||||
|
$(cellToFace)/extendedCellToFaceStencil.C
|
||||||
|
$(cellToFace)/extendedCentredCellToFaceStencil.C
|
||||||
|
$(cellToFace)/extendedUpwindCellToFaceStencil.C
|
||||||
|
$(cellToFace)/MeshObjects/centredCECCellToFaceStencilObject.C
|
||||||
|
$(cellToFace)/MeshObjects/centredCFCCellToFaceStencilObject.C
|
||||||
|
$(cellToFace)/MeshObjects/centredCPCCellToFaceStencilObject.C
|
||||||
|
$(cellToFace)/MeshObjects/centredFECCellToFaceStencilObject.C
|
||||||
|
$(cellToFace)/MeshObjects/upwindCECCellToFaceStencilObject.C
|
||||||
|
$(cellToFace)/MeshObjects/upwindCFCCellToFaceStencilObject.C
|
||||||
|
$(cellToFace)/MeshObjects/upwindCPCCellToFaceStencilObject.C
|
||||||
|
$(cellToFace)/MeshObjects/upwindFECCellToFaceStencilObject.C
|
||||||
|
|
||||||
|
faceToCell = $(extendedStencil)/faceToCell
|
||||||
|
$(faceToCell)/fullStencils/faceToCellStencil.C
|
||||||
|
$(faceToCell)/fullStencils/CFCFaceToCellStencil.C
|
||||||
|
$(faceToCell)/extendedFaceToCellStencil.C
|
||||||
|
$(faceToCell)/extendedCentredFaceToCellStencil.C
|
||||||
|
$(faceToCell)/MeshObjects/centredCFCFaceToCellStencilObject.C
|
||||||
|
|
||||||
$(extendedStencil)/extendedStencilMeshObjects/upwindCECStencilObject.C
|
|
||||||
$(extendedStencil)/extendedStencilMeshObjects/upwindCFCStencilObject.C
|
|
||||||
$(extendedStencil)/extendedStencilMeshObjects/upwindCPCStencilObject.C
|
|
||||||
$(extendedStencil)/extendedStencilMeshObjects/upwindFECStencilObject.C
|
|
||||||
|
|
||||||
fvPatchFields = fields/fvPatchFields
|
fvPatchFields = fields/fvPatchFields
|
||||||
$(fvPatchFields)/fvPatchField/fvPatchFields.C
|
$(fvPatchFields)/fvPatchField/fvPatchFields.C
|
||||||
|
|||||||
@ -39,7 +39,7 @@ SourceFiles
|
|||||||
|
|
||||||
#include "snGradScheme.H"
|
#include "snGradScheme.H"
|
||||||
#include "quadraticFitSnGradData.H"
|
#include "quadraticFitSnGradData.H"
|
||||||
#include "extendedStencil.H"
|
#include "extendedCellToFaceStencil.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ public:
|
|||||||
centralWeight_
|
centralWeight_
|
||||||
);
|
);
|
||||||
|
|
||||||
const extendedStencil& stencil = qfd.stencil();
|
const extendedCellToFaceStencil& stencil = qfd.stencil();
|
||||||
const List<scalarList>& f = qfd.fit();
|
const List<scalarList>& f = qfd.fit();
|
||||||
|
|
||||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > sft
|
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > sft
|
||||||
|
|||||||
@ -38,7 +38,7 @@ SourceFiles
|
|||||||
|
|
||||||
#include "MeshObject.H"
|
#include "MeshObject.H"
|
||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
#include "extendedStencil.H"
|
#include "extendedCellToFaceStencil.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ class quadraticFitSnGradData
|
|||||||
const label minSize_;
|
const label minSize_;
|
||||||
|
|
||||||
//- Extended stencil addressing
|
//- Extended stencil addressing
|
||||||
extendedStencil stencil_;
|
extendedCellToFaceStencil stencil_;
|
||||||
|
|
||||||
//- For each cell in the mesh store the values which multiply the
|
//- For each cell in the mesh store the values which multiply the
|
||||||
// values of the stencil to obtain the gradient for each direction
|
// values of the stencil to obtain the gradient for each direction
|
||||||
@ -107,7 +107,7 @@ public:
|
|||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
//- Return reference to the stencil
|
//- Return reference to the stencil
|
||||||
const extendedStencil& stencil() const
|
const extendedCellToFaceStencil& stencil() const
|
||||||
{
|
{
|
||||||
return stencil_;
|
return stencil_;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,7 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "cellEdgeCellStencil.H"
|
#include "CECCellToCellStencil.H"
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
//#include "meshTools.H"
|
//#include "meshTools.H"
|
||||||
//#include "OFstream.H"
|
//#include "OFstream.H"
|
||||||
@ -33,7 +33,7 @@ License
|
|||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
// Calculates per edge the neighbour data (= edgeCells)
|
// Calculates per edge the neighbour data (= edgeCells)
|
||||||
void Foam::cellEdgeCellStencil::calcEdgeBoundaryData
|
void Foam::CECCellToCellStencil::calcEdgeBoundaryData
|
||||||
(
|
(
|
||||||
const boolList& isValidBFace,
|
const boolList& isValidBFace,
|
||||||
const labelList& boundaryEdges,
|
const labelList& boundaryEdges,
|
||||||
@ -72,7 +72,7 @@ void Foam::cellEdgeCellStencil::calcEdgeBoundaryData
|
|||||||
|
|
||||||
// Calculates per cell the neighbour data (= cell or boundary in global
|
// Calculates per cell the neighbour data (= cell or boundary in global
|
||||||
// numbering). First element is always cell itself!
|
// numbering). First element is always cell itself!
|
||||||
void Foam::cellEdgeCellStencil::calcCellStencil
|
void Foam::CECCellToCellStencil::calcCellStencil
|
||||||
(
|
(
|
||||||
labelListList& globalCellCells
|
labelListList& globalCellCells
|
||||||
) const
|
) const
|
||||||
@ -189,20 +189,12 @@ void Foam::cellEdgeCellStencil::calcCellStencil
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::cellEdgeCellStencil::cellEdgeCellStencil(const polyMesh& mesh)
|
Foam::CECCellToCellStencil::CECCellToCellStencil(const polyMesh& mesh)
|
||||||
:
|
:
|
||||||
faceStencil(mesh)
|
cellToCellStencil(mesh)
|
||||||
{
|
{
|
||||||
// Calculate per cell the (edge) connected cells (in global numbering)
|
// Calculate per cell the (edge) connected cells (in global numbering)
|
||||||
labelListList globalCellCells;
|
calcCellStencil(*this);
|
||||||
calcCellStencil(globalCellCells);
|
|
||||||
|
|
||||||
// Add stencils of neighbouring cells to create faceStencil
|
|
||||||
labelListList faceStencil;
|
|
||||||
calcFaceStencil(globalCellCells, faceStencil);
|
|
||||||
|
|
||||||
// Transfer to *this
|
|
||||||
transfer(faceStencil);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -23,19 +23,19 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::cellEdgeCellStencil
|
Foam::CECCellToCellStencil
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
cellEdgeCellStencil.C
|
CECCellToCellStencil.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef cellEdgeCellStencil_H
|
#ifndef CECCellToCellStencil_H
|
||||||
#define cellEdgeCellStencil_H
|
#define CECCellToCellStencil_H
|
||||||
|
|
||||||
#include "faceStencil.H"
|
#include "cellToCellStencil.H"
|
||||||
#include "boolList.H"
|
#include "boolList.H"
|
||||||
#include "HashSet.H"
|
#include "HashSet.H"
|
||||||
#include "Map.H"
|
#include "Map.H"
|
||||||
@ -47,12 +47,12 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class cellEdgeCellStencil Declaration
|
Class CECCellToCellStencil Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class cellEdgeCellStencil
|
class CECCellToCellStencil
|
||||||
:
|
:
|
||||||
public faceStencil
|
public cellToCellStencil
|
||||||
{
|
{
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
@ -68,10 +68,10 @@ class cellEdgeCellStencil
|
|||||||
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
cellEdgeCellStencil(const cellEdgeCellStencil&);
|
CECCellToCellStencil(const CECCellToCellStencil&);
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const cellEdgeCellStencil&);
|
void operator=(const CECCellToCellStencil&);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -79,7 +79,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from all cells and boundary faces
|
//- Construct from all cells and boundary faces
|
||||||
explicit cellEdgeCellStencil(const polyMesh&);
|
explicit CECCellToCellStencil(const polyMesh&);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "cellFaceCellStencil.H"
|
#include "CFCCellToCellStencil.H"
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "SortableList.H"
|
#include "SortableList.H"
|
||||||
#include "emptyPolyPatch.H"
|
#include "emptyPolyPatch.H"
|
||||||
@ -32,7 +32,7 @@ License
|
|||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
// Calculates per face the neighbour data (= cell or boundary face)
|
// Calculates per face the neighbour data (= cell or boundary face)
|
||||||
void Foam::cellFaceCellStencil::calcFaceBoundaryData
|
void Foam::CFCCellToCellStencil::calcFaceBoundaryData
|
||||||
(
|
(
|
||||||
labelList& neiGlobal
|
labelList& neiGlobal
|
||||||
) const
|
) const
|
||||||
@ -85,7 +85,7 @@ void Foam::cellFaceCellStencil::calcFaceBoundaryData
|
|||||||
|
|
||||||
// Calculates per cell the neighbour data (= cell or boundary in global
|
// Calculates per cell the neighbour data (= cell or boundary in global
|
||||||
// numbering). First element is always cell itself!
|
// numbering). First element is always cell itself!
|
||||||
void Foam::cellFaceCellStencil::calcCellStencil(labelListList& globalCellCells)
|
void Foam::CFCCellToCellStencil::calcCellStencil(labelListList& globalCellCells)
|
||||||
const
|
const
|
||||||
{
|
{
|
||||||
const label nBnd = mesh().nFaces()-mesh().nInternalFaces();
|
const label nBnd = mesh().nFaces()-mesh().nInternalFaces();
|
||||||
@ -147,20 +147,12 @@ void Foam::cellFaceCellStencil::calcCellStencil(labelListList& globalCellCells)
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::cellFaceCellStencil::cellFaceCellStencil(const polyMesh& mesh)
|
Foam::CFCCellToCellStencil::CFCCellToCellStencil(const polyMesh& mesh)
|
||||||
:
|
:
|
||||||
faceStencil(mesh)
|
cellToCellStencil(mesh)
|
||||||
{
|
{
|
||||||
// Calculate per cell the (face) connected cells (in global numbering)
|
// Calculate per cell the (face) connected cells (in global numbering)
|
||||||
labelListList globalCellCells;
|
calcCellStencil(*this);
|
||||||
calcCellStencil(globalCellCells);
|
|
||||||
|
|
||||||
// Add stencils of neighbouring cells to create faceStencil
|
|
||||||
labelListList faceStencil;
|
|
||||||
calcFaceStencil(globalCellCells, faceStencil);
|
|
||||||
|
|
||||||
// Transfer to *this
|
|
||||||
transfer(faceStencil);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -23,19 +23,19 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::cellFaceCellStencil
|
Foam::CFCCellToCellStencil
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
cellFaceCellStencil.C
|
CFCCellToCellStencil.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef cellFaceCellStencil_H
|
#ifndef CFCCellToCellStencil_H
|
||||||
#define cellFaceCellStencil_H
|
#define CFCCellToCellStencil_H
|
||||||
|
|
||||||
#include "faceStencil.H"
|
#include "cellToCellStencil.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -43,12 +43,12 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class cellFaceCellStencil Declaration
|
Class CFCCellToCellStencil Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class cellFaceCellStencil
|
class CFCCellToCellStencil
|
||||||
:
|
:
|
||||||
public faceStencil
|
public cellToCellStencil
|
||||||
{
|
{
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
@ -57,17 +57,17 @@ class cellFaceCellStencil
|
|||||||
void calcCellStencil(labelListList& globalCellCells) const;
|
void calcCellStencil(labelListList& globalCellCells) const;
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
cellFaceCellStencil(const cellFaceCellStencil&);
|
CFCCellToCellStencil(const CFCCellToCellStencil&);
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const cellFaceCellStencil&);
|
void operator=(const CFCCellToCellStencil&);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from mesh
|
//- Construct from mesh
|
||||||
explicit cellFaceCellStencil(const polyMesh& mesh);
|
explicit CFCCellToCellStencil(const polyMesh& mesh);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -24,13 +24,13 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "cellPointCellStencil.H"
|
#include "CPCCellToCellStencil.H"
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
// Calculates per point the neighbour data (= pointCells)
|
// Calculates per point the neighbour data (= pointCells)
|
||||||
void Foam::cellPointCellStencil::calcPointBoundaryData
|
void Foam::CPCCellToCellStencil::calcPointBoundaryData
|
||||||
(
|
(
|
||||||
const boolList& isValidBFace,
|
const boolList& isValidBFace,
|
||||||
const labelList& boundaryPoints,
|
const labelList& boundaryPoints,
|
||||||
@ -69,7 +69,7 @@ void Foam::cellPointCellStencil::calcPointBoundaryData
|
|||||||
|
|
||||||
// Calculates per cell the neighbour data (= cell or boundary in global
|
// Calculates per cell the neighbour data (= cell or boundary in global
|
||||||
// numbering). First element is always cell itself!
|
// numbering). First element is always cell itself!
|
||||||
void Foam::cellPointCellStencil::calcCellStencil
|
void Foam::CPCCellToCellStencil::calcCellStencil
|
||||||
(
|
(
|
||||||
labelListList& globalCellCells
|
labelListList& globalCellCells
|
||||||
) const
|
) const
|
||||||
@ -154,20 +154,13 @@ void Foam::cellPointCellStencil::calcCellStencil
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::cellPointCellStencil::cellPointCellStencil(const polyMesh& mesh)
|
Foam::CPCCellToCellStencil::CPCCellToCellStencil(const polyMesh& mesh)
|
||||||
:
|
:
|
||||||
faceStencil(mesh)
|
cellToCellStencil(mesh)
|
||||||
{
|
{
|
||||||
// Calculate per cell the (point) connected cells (in global numbering)
|
// Calculate per cell the (point) connected cells (in global numbering)
|
||||||
labelListList globalCellCells;
|
labelListList globalCellCells;
|
||||||
calcCellStencil(globalCellCells);
|
calcCellStencil(*this);
|
||||||
|
|
||||||
// Add stencils of neighbouring cells to create faceStencil
|
|
||||||
labelListList faceStencil;
|
|
||||||
calcFaceStencil(globalCellCells, faceStencil);
|
|
||||||
|
|
||||||
// Transfer to *this
|
|
||||||
transfer(faceStencil);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -23,19 +23,19 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::cellPointCellStencil
|
Foam::CPCCellToCellStencil
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
cellPointCellStencil.C
|
CPCCellToCellStencil.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef cellPointCellStencil_H
|
#ifndef CPCCellToCellStencil_H
|
||||||
#define cellPointCellStencil_H
|
#define CPCCellToCellStencil_H
|
||||||
|
|
||||||
#include "faceStencil.H"
|
#include "cellToCellStencil.H"
|
||||||
#include "boolList.H"
|
#include "boolList.H"
|
||||||
#include "HashSet.H"
|
#include "HashSet.H"
|
||||||
#include "Map.H"
|
#include "Map.H"
|
||||||
@ -46,12 +46,12 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class cellPointCellStencil Declaration
|
Class CPCCellToCellStencil Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class cellPointCellStencil
|
class CPCCellToCellStencil
|
||||||
:
|
:
|
||||||
public faceStencil
|
public cellToCellStencil
|
||||||
{
|
{
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
@ -67,10 +67,10 @@ class cellPointCellStencil
|
|||||||
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
cellPointCellStencil(const cellPointCellStencil&);
|
CPCCellToCellStencil(const CPCCellToCellStencil&);
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const cellPointCellStencil&);
|
void operator=(const CPCCellToCellStencil&);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -78,7 +78,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from all cells and boundary faces
|
//- Construct from all cells and boundary faces
|
||||||
explicit cellPointCellStencil(const polyMesh&);
|
explicit CPCCellToCellStencil(const polyMesh&);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -0,0 +1,350 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "cellToCellStencil.H"
|
||||||
|
#include "syncTools.H"
|
||||||
|
#include "SortableList.H"
|
||||||
|
#include "emptyPolyPatch.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// Merge two list and guarantee global0,global1 are first.
|
||||||
|
void Foam::cellToCellStencil::merge
|
||||||
|
(
|
||||||
|
const label global0,
|
||||||
|
const label global1,
|
||||||
|
const labelList& listA,
|
||||||
|
labelList& listB
|
||||||
|
)
|
||||||
|
{
|
||||||
|
sort(listB);
|
||||||
|
|
||||||
|
// See if global0, global1 already present in listB
|
||||||
|
label nGlobalInsert = 0;
|
||||||
|
|
||||||
|
if (global0 != -1)
|
||||||
|
{
|
||||||
|
label index0 = findSortedIndex(listB, global0);
|
||||||
|
if (index0 == -1)
|
||||||
|
{
|
||||||
|
nGlobalInsert++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (global1 != -1)
|
||||||
|
{
|
||||||
|
label index1 = findSortedIndex(listB, global1);
|
||||||
|
if (index1 == -1)
|
||||||
|
{
|
||||||
|
nGlobalInsert++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// For all in listA see if they are present
|
||||||
|
label nInsert = 0;
|
||||||
|
|
||||||
|
forAll(listA, i)
|
||||||
|
{
|
||||||
|
label elem = listA[i];
|
||||||
|
|
||||||
|
if (elem != global0 && elem != global1)
|
||||||
|
{
|
||||||
|
if (findSortedIndex(listB, elem) == -1)
|
||||||
|
{
|
||||||
|
nInsert++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Extend B with nInsert and whether global0,global1 need to be inserted.
|
||||||
|
labelList result(listB.size() + nGlobalInsert + nInsert);
|
||||||
|
|
||||||
|
label resultI = 0;
|
||||||
|
|
||||||
|
// Insert global0,1 first
|
||||||
|
if (global0 != -1)
|
||||||
|
{
|
||||||
|
result[resultI++] = global0;
|
||||||
|
}
|
||||||
|
if (global1 != -1)
|
||||||
|
{
|
||||||
|
result[resultI++] = global1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Insert listB
|
||||||
|
forAll(listB, i)
|
||||||
|
{
|
||||||
|
label elem = listB[i];
|
||||||
|
|
||||||
|
if (elem != global0 && elem != global1)
|
||||||
|
{
|
||||||
|
result[resultI++] = elem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Insert listA
|
||||||
|
forAll(listA, i)
|
||||||
|
{
|
||||||
|
label elem = listA[i];
|
||||||
|
|
||||||
|
if (elem != global0 && elem != global1)
|
||||||
|
{
|
||||||
|
if (findSortedIndex(listB, elem) == -1)
|
||||||
|
{
|
||||||
|
result[resultI++] = elem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (resultI != result.size())
|
||||||
|
{
|
||||||
|
FatalErrorIn("cellToCellStencil::merge(..)")
|
||||||
|
<< "problem" << abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
listB.transfer(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Merge two list and guarantee globalI is first.
|
||||||
|
void Foam::cellToCellStencil::merge
|
||||||
|
(
|
||||||
|
const label globalI,
|
||||||
|
const labelList& pGlobals,
|
||||||
|
labelList& cCells
|
||||||
|
)
|
||||||
|
{
|
||||||
|
labelHashSet set;
|
||||||
|
forAll(cCells, i)
|
||||||
|
{
|
||||||
|
if (cCells[i] != globalI)
|
||||||
|
{
|
||||||
|
set.insert(cCells[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(pGlobals, i)
|
||||||
|
{
|
||||||
|
if (pGlobals[i] != globalI)
|
||||||
|
{
|
||||||
|
set.insert(pGlobals[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cCells.setSize(set.size()+1);
|
||||||
|
label n = 0;
|
||||||
|
cCells[n++] = globalI;
|
||||||
|
|
||||||
|
forAllConstIter(labelHashSet, set, iter)
|
||||||
|
{
|
||||||
|
cCells[n++] = iter.key();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::cellToCellStencil::validBoundaryFaces(boolList& isValidBFace) const
|
||||||
|
{
|
||||||
|
const polyBoundaryMesh& patches = mesh().boundaryMesh();
|
||||||
|
|
||||||
|
isValidBFace.setSize(mesh().nFaces()-mesh().nInternalFaces(), true);
|
||||||
|
|
||||||
|
forAll(patches, patchI)
|
||||||
|
{
|
||||||
|
const polyPatch& pp = patches[patchI];
|
||||||
|
|
||||||
|
if (pp.coupled() || isA<emptyPolyPatch>(pp))
|
||||||
|
{
|
||||||
|
label bFaceI = pp.start()-mesh().nInternalFaces();
|
||||||
|
forAll(pp, i)
|
||||||
|
{
|
||||||
|
isValidBFace[bFaceI++] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::autoPtr<Foam::indirectPrimitivePatch>
|
||||||
|
Foam::cellToCellStencil::allCoupledFacesPatch() const
|
||||||
|
{
|
||||||
|
const polyBoundaryMesh& patches = mesh().boundaryMesh();
|
||||||
|
|
||||||
|
label nCoupled = 0;
|
||||||
|
|
||||||
|
forAll(patches, patchI)
|
||||||
|
{
|
||||||
|
const polyPatch& pp = patches[patchI];
|
||||||
|
|
||||||
|
if (pp.coupled())
|
||||||
|
{
|
||||||
|
nCoupled += pp.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
labelList coupledFaces(nCoupled);
|
||||||
|
nCoupled = 0;
|
||||||
|
|
||||||
|
forAll(patches, patchI)
|
||||||
|
{
|
||||||
|
const polyPatch& pp = patches[patchI];
|
||||||
|
|
||||||
|
if (pp.coupled())
|
||||||
|
{
|
||||||
|
label faceI = pp.start();
|
||||||
|
|
||||||
|
forAll(pp, i)
|
||||||
|
{
|
||||||
|
coupledFaces[nCoupled++] = faceI++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return autoPtr<indirectPrimitivePatch>
|
||||||
|
(
|
||||||
|
new indirectPrimitivePatch
|
||||||
|
(
|
||||||
|
IndirectList<face>
|
||||||
|
(
|
||||||
|
mesh().faces(),
|
||||||
|
coupledFaces
|
||||||
|
),
|
||||||
|
mesh().points()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::cellToCellStencil::unionEqOp::operator()
|
||||||
|
(
|
||||||
|
labelList& x,
|
||||||
|
const labelList& y
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
if (y.size())
|
||||||
|
{
|
||||||
|
if (x.empty())
|
||||||
|
{
|
||||||
|
x = y;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
labelHashSet set(x);
|
||||||
|
forAll(y, i)
|
||||||
|
{
|
||||||
|
set.insert(y[i]);
|
||||||
|
}
|
||||||
|
x = set.toc();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::cellToCellStencil::insertFaceCells
|
||||||
|
(
|
||||||
|
const label exclude0,
|
||||||
|
const label exclude1,
|
||||||
|
const boolList& isValidBFace,
|
||||||
|
const labelList& faceLabels,
|
||||||
|
labelHashSet& globals
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const labelList& own = mesh().faceOwner();
|
||||||
|
const labelList& nei = mesh().faceNeighbour();
|
||||||
|
|
||||||
|
forAll(faceLabels, i)
|
||||||
|
{
|
||||||
|
label faceI = faceLabels[i];
|
||||||
|
|
||||||
|
label globalOwn = globalNumbering().toGlobal(own[faceI]);
|
||||||
|
if (globalOwn != exclude0 && globalOwn != exclude1)
|
||||||
|
{
|
||||||
|
globals.insert(globalOwn);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mesh().isInternalFace(faceI))
|
||||||
|
{
|
||||||
|
label globalNei = globalNumbering().toGlobal(nei[faceI]);
|
||||||
|
if (globalNei != exclude0 && globalNei != exclude1)
|
||||||
|
{
|
||||||
|
globals.insert(globalNei);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
label bFaceI = faceI-mesh().nInternalFaces();
|
||||||
|
|
||||||
|
if (isValidBFace[bFaceI])
|
||||||
|
{
|
||||||
|
label globalI = globalNumbering().toGlobal
|
||||||
|
(
|
||||||
|
mesh().nCells()
|
||||||
|
+ bFaceI
|
||||||
|
);
|
||||||
|
|
||||||
|
if (globalI != exclude0 && globalI != exclude1)
|
||||||
|
{
|
||||||
|
globals.insert(globalI);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::labelList Foam::cellToCellStencil::calcFaceCells
|
||||||
|
(
|
||||||
|
const boolList& isValidBFace,
|
||||||
|
const labelList& faceLabels,
|
||||||
|
labelHashSet& globals
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
globals.clear();
|
||||||
|
|
||||||
|
insertFaceCells
|
||||||
|
(
|
||||||
|
-1,
|
||||||
|
-1,
|
||||||
|
isValidBFace,
|
||||||
|
faceLabels,
|
||||||
|
globals
|
||||||
|
);
|
||||||
|
|
||||||
|
return globals.toc();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::cellToCellStencil::cellToCellStencil(const polyMesh& mesh)
|
||||||
|
:
|
||||||
|
mesh_(mesh),
|
||||||
|
globalNumbering_(mesh_.nCells()+mesh_.nFaces()-mesh_.nInternalFaces())
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,152 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
Foam::cellToCellStencil
|
||||||
|
|
||||||
|
Description
|
||||||
|
baseclass for extended cell centred addressing. Contains per cell a
|
||||||
|
list of neighbouring cells and/or boundaryfaces in global addressing.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
cellToCellStencil.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef cellToCellStencil_H
|
||||||
|
#define cellToCellStencil_H
|
||||||
|
|
||||||
|
#include "globalIndex.H"
|
||||||
|
#include "boolList.H"
|
||||||
|
#include "HashSet.H"
|
||||||
|
#include "indirectPrimitivePatch.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
class polyMesh;
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class cellToCellStencil Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class cellToCellStencil
|
||||||
|
:
|
||||||
|
public labelListList
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
const polyMesh& mesh_;
|
||||||
|
|
||||||
|
//- Global numbering for cells and boundary faces
|
||||||
|
const globalIndex globalNumbering_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const cellToCellStencil&);
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
//- Merge two lists.
|
||||||
|
static void merge
|
||||||
|
(
|
||||||
|
const label,
|
||||||
|
const label,
|
||||||
|
const labelList&,
|
||||||
|
labelList&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Merge two lists.
|
||||||
|
static void merge(const label, const labelList&, labelList&);
|
||||||
|
|
||||||
|
//- Valid boundary faces (not empty and not coupled)
|
||||||
|
void validBoundaryFaces(boolList& isValidBFace) const;
|
||||||
|
|
||||||
|
//- Return patch of all coupled faces.
|
||||||
|
autoPtr<indirectPrimitivePatch> allCoupledFacesPatch() const;
|
||||||
|
|
||||||
|
//- Combine operator for labelLists
|
||||||
|
class unionEqOp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void operator()( labelList& x, const labelList& y ) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
//- Collect cell neighbours of faces in global numbering
|
||||||
|
void insertFaceCells
|
||||||
|
(
|
||||||
|
const label exclude0,
|
||||||
|
const label exclude1,
|
||||||
|
const boolList& nonEmptyFace,
|
||||||
|
const labelList& faceLabels,
|
||||||
|
labelHashSet& globals
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Collect cell neighbours of faces in global numbering
|
||||||
|
labelList calcFaceCells
|
||||||
|
(
|
||||||
|
const boolList& nonEmptyFace,
|
||||||
|
const labelList& faceLabels,
|
||||||
|
labelHashSet& globals
|
||||||
|
) const;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from mesh
|
||||||
|
explicit cellToCellStencil(const polyMesh&);
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
const polyMesh& mesh() const
|
||||||
|
{
|
||||||
|
return mesh_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Global numbering for cells and boundary faces
|
||||||
|
const globalIndex& globalNumbering() const
|
||||||
|
{
|
||||||
|
return globalNumbering_;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "centredCECCellToFaceStencilObject.H"
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(centredCECCellToFaceStencilObject, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -23,7 +23,7 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::centredFECStencilObject
|
Foam::centredCECCellToFaceStencilObject
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
|
||||||
@ -31,11 +31,11 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef centredFECStencilObject_H
|
#ifndef centredCECCellToFaceStencilObject_H
|
||||||
#define centredFECStencilObject_H
|
#define centredCECCellToFaceStencilObject_H
|
||||||
|
|
||||||
#include "extendedCentredStencil.H"
|
#include "extendedCentredCellToFaceStencil.H"
|
||||||
#include "faceEdgeCellStencil.H"
|
#include "CECCellToFaceStencil.H"
|
||||||
#include "MeshObject.H"
|
#include "MeshObject.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -44,35 +44,35 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class centredFECStencilObject Declaration
|
Class centredCECCellToFaceStencilObject Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class centredFECStencilObject
|
class centredCECCellToFaceStencilObject
|
||||||
:
|
:
|
||||||
public MeshObject<fvMesh, centredFECStencilObject>,
|
public MeshObject<fvMesh, centredCECCellToFaceStencilObject>,
|
||||||
public extendedCentredStencil
|
public extendedCentredCellToFaceStencil
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TypeName("centredCFCStencil");
|
TypeName("centredCECCellToFaceStencil");
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from uncompacted face stencil
|
//- Construct from uncompacted face stencil
|
||||||
explicit centredFECStencilObject
|
explicit centredCECCellToFaceStencilObject
|
||||||
(
|
(
|
||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
MeshObject<fvMesh, centredFECStencilObject>(mesh),
|
MeshObject<fvMesh, centredCECCellToFaceStencilObject>(mesh),
|
||||||
extendedCentredStencil(faceEdgeCellStencil(mesh))
|
extendedCentredCellToFaceStencil(CECCellToFaceStencil(mesh))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
|
||||||
virtual ~centredFECStencilObject()
|
virtual ~centredCECCellToFaceStencilObject()
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "centredCFCCellToFaceStencilObject.H"
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(centredCFCCellToFaceStencilObject, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -23,7 +23,7 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::centredCFCStencilObject
|
Foam::centredCFCCellToFaceStencilObject
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
|
||||||
@ -31,11 +31,11 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef centredCFCStencilObject_H
|
#ifndef centredCFCCellToFaceStencilObject_H
|
||||||
#define centredCFCStencilObject_H
|
#define centredCFCCellToFaceStencilObject_H
|
||||||
|
|
||||||
#include "extendedCentredStencil.H"
|
#include "extendedCentredCellToFaceStencil.H"
|
||||||
#include "cellFaceCellStencil.H"
|
#include "CFCCellToFaceStencil.H"
|
||||||
#include "MeshObject.H"
|
#include "MeshObject.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -44,34 +44,34 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class centredCFCStencilObject Declaration
|
Class centredCFCCellToFaceStencilObject Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class centredCFCStencilObject
|
class centredCFCCellToFaceStencilObject
|
||||||
:
|
:
|
||||||
public MeshObject<fvMesh, centredCFCStencilObject>,
|
public MeshObject<fvMesh, centredCFCCellToFaceStencilObject>,
|
||||||
public extendedCentredStencil
|
public extendedCentredCellToFaceStencil
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TypeName("centredCFCStencil");
|
TypeName("centredCFCCellToFaceStencil");
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from uncompacted face stencil
|
//- Construct from uncompacted face stencil
|
||||||
explicit centredCFCStencilObject
|
explicit centredCFCCellToFaceStencilObject
|
||||||
(
|
(
|
||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
MeshObject<fvMesh, centredCFCStencilObject>(mesh),
|
MeshObject<fvMesh, centredCFCCellToFaceStencilObject>(mesh),
|
||||||
extendedCentredStencil(cellFaceCellStencil(mesh))
|
extendedCentredCellToFaceStencil(CFCCellToFaceStencil(mesh))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~centredCFCStencilObject()
|
virtual ~centredCFCCellToFaceStencilObject()
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "centredCPCCellToFaceStencilObject.H"
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(centredCPCCellToFaceStencilObject, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -23,7 +23,7 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::centredCPCStencilObject
|
Foam::centredCPCCellToFaceStencilObject
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
|
||||||
@ -31,11 +31,11 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef centredCPCStencilObject_H
|
#ifndef centredCPCCellToFaceStencilObject_H
|
||||||
#define centredCPCStencilObject_H
|
#define centredCPCCellToFaceStencilObject_H
|
||||||
|
|
||||||
#include "extendedCentredStencil.H"
|
#include "extendedCentredCellToFaceStencil.H"
|
||||||
#include "cellPointCellStencil.H"
|
#include "CPCCellToFaceStencil.H"
|
||||||
#include "MeshObject.H"
|
#include "MeshObject.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -44,35 +44,35 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class centredCPCStencilObject Declaration
|
Class centredCPCCellToFaceStencilObject Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class centredCPCStencilObject
|
class centredCPCCellToFaceStencilObject
|
||||||
:
|
:
|
||||||
public MeshObject<fvMesh, centredCPCStencilObject>,
|
public MeshObject<fvMesh, centredCPCCellToFaceStencilObject>,
|
||||||
public extendedCentredStencil
|
public extendedCentredCellToFaceStencil
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TypeName("centredCFCStencil");
|
TypeName("centredCFCCellToFaceStencil");
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from uncompacted face stencil
|
//- Construct from uncompacted face stencil
|
||||||
explicit centredCPCStencilObject
|
explicit centredCPCCellToFaceStencilObject
|
||||||
(
|
(
|
||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
MeshObject<fvMesh, centredCPCStencilObject>(mesh),
|
MeshObject<fvMesh, centredCPCCellToFaceStencilObject>(mesh),
|
||||||
extendedCentredStencil(cellPointCellStencil(mesh))
|
extendedCentredCellToFaceStencil(CPCCellToFaceStencil(mesh))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
|
||||||
virtual ~centredCPCStencilObject()
|
virtual ~centredCPCCellToFaceStencilObject()
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "centredFECCellToFaceStencilObject.H"
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(centredFECCellToFaceStencilObject, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -23,7 +23,7 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::centredCECStencilObject
|
Foam::centredFECCellToFaceStencilObject
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
|
||||||
@ -31,11 +31,11 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef centredCECStencilObject_H
|
#ifndef centredFECCellToFaceStencilObject_H
|
||||||
#define centredCECStencilObject_H
|
#define centredFECCellToFaceStencilObject_H
|
||||||
|
|
||||||
#include "extendedCentredStencil.H"
|
#include "extendedCentredCellToFaceStencil.H"
|
||||||
#include "cellEdgeCellStencil.H"
|
#include "FECCellToFaceStencil.H"
|
||||||
#include "MeshObject.H"
|
#include "MeshObject.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -44,35 +44,35 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class centredCECStencilObject Declaration
|
Class centredFECCellToFaceStencilObject Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class centredCECStencilObject
|
class centredFECCellToFaceStencilObject
|
||||||
:
|
:
|
||||||
public MeshObject<fvMesh, centredCECStencilObject>,
|
public MeshObject<fvMesh, centredFECCellToFaceStencilObject>,
|
||||||
public extendedCentredStencil
|
public extendedCentredCellToFaceStencil
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TypeName("centredCECStencil");
|
TypeName("centredCFCCellToFaceStencil");
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from uncompacted face stencil
|
//- Construct from uncompacted face stencil
|
||||||
explicit centredCECStencilObject
|
explicit centredFECCellToFaceStencilObject
|
||||||
(
|
(
|
||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
MeshObject<fvMesh, centredCECStencilObject>(mesh),
|
MeshObject<fvMesh, centredFECCellToFaceStencilObject>(mesh),
|
||||||
extendedCentredStencil(cellEdgeCellStencil(mesh))
|
extendedCentredCellToFaceStencil(FECCellToFaceStencil(mesh))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
|
||||||
virtual ~centredCECStencilObject()
|
virtual ~centredFECCellToFaceStencilObject()
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -24,14 +24,14 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "centredFECStencilObject.H"
|
#include "upwindCECCellToFaceStencilObject.H"
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(centredFECStencilObject, 0);
|
defineTypeNameAndDebug(upwindCECCellToFaceStencilObject, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::upwindCFCStencilObject
|
Foam::upwindCECCellToFaceStencilObject
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
|
||||||
@ -31,11 +31,11 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef upwindCFCStencilObject_H
|
#ifndef upwindCECCellToFaceStencilObject_H
|
||||||
#define upwindCFCStencilObject_H
|
#define upwindCECCellToFaceStencilObject_H
|
||||||
|
|
||||||
#include "extendedUpwindStencil.H"
|
#include "extendedUpwindCellToFaceStencil.H"
|
||||||
#include "cellFaceCellStencil.H"
|
#include "CECCellToFaceStencil.H"
|
||||||
#include "MeshObject.H"
|
#include "MeshObject.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -44,36 +44,40 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class upwindCFCStencilObject Declaration
|
Class upwindCECCellToFaceStencilObject Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class upwindCFCStencilObject
|
class upwindCECCellToFaceStencilObject
|
||||||
:
|
:
|
||||||
public MeshObject<fvMesh, upwindCFCStencilObject>,
|
public MeshObject<fvMesh, upwindCECCellToFaceStencilObject>,
|
||||||
public extendedUpwindStencil
|
public extendedUpwindCellToFaceStencil
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TypeName("upwindCFCStencil");
|
TypeName("upwindCFCCellToFaceStencil");
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from uncompacted face stencil
|
//- Construct from uncompacted face stencil
|
||||||
explicit upwindCFCStencilObject
|
explicit upwindCECCellToFaceStencilObject
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const scalar minOpposedness
|
const scalar minOpposedness
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
MeshObject<fvMesh, upwindCFCStencilObject>(mesh),
|
MeshObject<fvMesh, upwindCECCellToFaceStencilObject>(mesh),
|
||||||
extendedUpwindStencil(cellFaceCellStencil(mesh), minOpposedness)
|
extendedUpwindCellToFaceStencil
|
||||||
|
(
|
||||||
|
CECCellToFaceStencil(mesh),
|
||||||
|
minOpposedness
|
||||||
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
|
||||||
virtual ~upwindCFCStencilObject()
|
virtual ~upwindCECCellToFaceStencilObject()
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -24,14 +24,14 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "centredCECStencilObject.H"
|
#include "upwindCFCCellToFaceStencilObject.H"
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(centredCECStencilObject, 0);
|
defineTypeNameAndDebug(upwindCFCCellToFaceStencilObject, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::upwindCPCStencilObject
|
Foam::upwindCFCCellToFaceStencilObject
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
|
||||||
@ -31,11 +31,11 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef upwindCPCStencilObject_H
|
#ifndef upwindCFCCellToFaceStencilObject_H
|
||||||
#define upwindCPCStencilObject_H
|
#define upwindCFCCellToFaceStencilObject_H
|
||||||
|
|
||||||
#include "extendedUpwindStencil.H"
|
#include "extendedUpwindCellToFaceStencil.H"
|
||||||
#include "cellPointCellStencil.H"
|
#include "FECCellToFaceStencil.H"
|
||||||
#include "MeshObject.H"
|
#include "MeshObject.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -44,36 +44,40 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class upwindCPCStencilObject Declaration
|
Class upwindCFCCellToFaceStencilObject Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class upwindCPCStencilObject
|
class upwindCFCCellToFaceStencilObject
|
||||||
:
|
:
|
||||||
public MeshObject<fvMesh, upwindCPCStencilObject>,
|
public MeshObject<fvMesh, upwindCFCCellToFaceStencilObject>,
|
||||||
public extendedUpwindStencil
|
public extendedUpwindCellToFaceStencil
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TypeName("upwindCFCStencil");
|
TypeName("upwindCFCCellToFaceStencil");
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from uncompacted face stencil
|
//- Construct from uncompacted face stencil
|
||||||
explicit upwindCPCStencilObject
|
explicit upwindCFCCellToFaceStencilObject
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const scalar minOpposedness
|
const scalar minOpposedness
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
MeshObject<fvMesh, upwindCPCStencilObject>(mesh),
|
MeshObject<fvMesh, upwindCFCCellToFaceStencilObject>(mesh),
|
||||||
extendedUpwindStencil(cellPointCellStencil(mesh), minOpposedness)
|
extendedUpwindCellToFaceStencil
|
||||||
|
(
|
||||||
|
FECCellToFaceStencil(mesh),
|
||||||
|
minOpposedness
|
||||||
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
|
||||||
virtual ~upwindCPCStencilObject()
|
virtual ~upwindCFCCellToFaceStencilObject()
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -24,14 +24,14 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "centredCPCStencilObject.H"
|
#include "upwindCPCCellToFaceStencilObject.H"
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(centredCPCStencilObject, 0);
|
defineTypeNameAndDebug(upwindCPCCellToFaceStencilObject, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::upwindCECStencilObject
|
Foam::upwindCPCCellToFaceStencilObject
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
|
||||||
@ -31,11 +31,11 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef upwindCECStencilObject_H
|
#ifndef upwindCPCCellToFaceStencilObject_H
|
||||||
#define upwindCECStencilObject_H
|
#define upwindCPCCellToFaceStencilObject_H
|
||||||
|
|
||||||
#include "extendedUpwindStencil.H"
|
#include "extendedUpwindCellToFaceStencil.H"
|
||||||
#include "cellEdgeCellStencil.H"
|
#include "CPCCellToFaceStencil.H"
|
||||||
#include "MeshObject.H"
|
#include "MeshObject.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -44,36 +44,40 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class upwindCECStencilObject Declaration
|
Class upwindCPCCellToFaceStencilObject Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class upwindCECStencilObject
|
class upwindCPCCellToFaceStencilObject
|
||||||
:
|
:
|
||||||
public MeshObject<fvMesh, upwindCECStencilObject>,
|
public MeshObject<fvMesh, upwindCPCCellToFaceStencilObject>,
|
||||||
public extendedUpwindStencil
|
public extendedUpwindCellToFaceStencil
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TypeName("upwindCFCStencil");
|
TypeName("upwindCFCCellToFaceStencil");
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from uncompacted face stencil
|
//- Construct from uncompacted face stencil
|
||||||
explicit upwindCECStencilObject
|
explicit upwindCPCCellToFaceStencilObject
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const scalar minOpposedness
|
const scalar minOpposedness
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
MeshObject<fvMesh, upwindCECStencilObject>(mesh),
|
MeshObject<fvMesh, upwindCPCCellToFaceStencilObject>(mesh),
|
||||||
extendedUpwindStencil(cellEdgeCellStencil(mesh), minOpposedness)
|
extendedUpwindCellToFaceStencil
|
||||||
|
(
|
||||||
|
CPCCellToFaceStencil(mesh),
|
||||||
|
minOpposedness
|
||||||
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
|
||||||
virtual ~upwindCECStencilObject()
|
virtual ~upwindCPCCellToFaceStencilObject()
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -24,14 +24,14 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "centredCFCStencilObject.H"
|
#include "upwindFECCellToFaceStencilObject.H"
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(centredCFCStencilObject, 0);
|
defineTypeNameAndDebug(upwindFECCellToFaceStencilObject, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::upwindFECStencilObject
|
Foam::upwindFECCellToFaceStencilObject
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
|
||||||
@ -31,11 +31,11 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef upwindFECStencilObject_H
|
#ifndef upwindFECCellToFaceStencilObject_H
|
||||||
#define upwindFECStencilObject_H
|
#define upwindFECCellToFaceStencilObject_H
|
||||||
|
|
||||||
#include "extendedUpwindStencil.H"
|
#include "extendedUpwindCellToFaceStencil.H"
|
||||||
#include "faceEdgeCellStencil.H"
|
#include "FECCellToFaceStencil.H"
|
||||||
#include "MeshObject.H"
|
#include "MeshObject.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -44,36 +44,40 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class upwindFECStencilObject Declaration
|
Class upwindFECCellToFaceStencilObject Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class upwindFECStencilObject
|
class upwindFECCellToFaceStencilObject
|
||||||
:
|
:
|
||||||
public MeshObject<fvMesh, upwindFECStencilObject>,
|
public MeshObject<fvMesh, upwindFECCellToFaceStencilObject>,
|
||||||
public extendedUpwindStencil
|
public extendedUpwindCellToFaceStencil
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TypeName("upwindCFCStencil");
|
TypeName("upwindCFCCellToFaceStencil");
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from uncompacted face stencil
|
//- Construct from uncompacted face stencil
|
||||||
explicit upwindFECStencilObject
|
explicit upwindFECCellToFaceStencilObject
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const scalar minOpposedness
|
const scalar minOpposedness
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
MeshObject<fvMesh, upwindFECStencilObject>(mesh),
|
MeshObject<fvMesh, upwindFECCellToFaceStencilObject>(mesh),
|
||||||
extendedUpwindStencil(faceEdgeCellStencil(mesh), minOpposedness)
|
extendedUpwindCellToFaceStencil
|
||||||
|
(
|
||||||
|
FECCellToFaceStencil(mesh),
|
||||||
|
minOpposedness
|
||||||
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
|
||||||
virtual ~upwindFECStencilObject()
|
virtual ~upwindFECCellToFaceStencilObject()
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -24,22 +24,21 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "extendedStencil.H"
|
#include "extendedCellToFaceStencil.H"
|
||||||
#include "globalIndex.H"
|
#include "globalIndex.H"
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "SortableList.H"
|
#include "SortableList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap
|
Foam::autoPtr<Foam::mapDistribute>
|
||||||
|
Foam::extendedCellToFaceStencil::calcDistributeMap
|
||||||
(
|
(
|
||||||
|
const polyMesh& mesh,
|
||||||
const globalIndex& globalNumbering,
|
const globalIndex& globalNumbering,
|
||||||
labelListList& faceStencil
|
labelListList& faceStencil
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const label nBnd = mesh_.nFaces()-mesh_.nInternalFaces();
|
|
||||||
|
|
||||||
|
|
||||||
// Convert stencil to schedule
|
// Convert stencil to schedule
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
@ -53,8 +52,8 @@ Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap
|
|||||||
// these are always all needed.
|
// these are always all needed.
|
||||||
List<Map<label> > globalToProc(Pstream::nProcs());
|
List<Map<label> > globalToProc(Pstream::nProcs());
|
||||||
{
|
{
|
||||||
const labelList& procPatchMap = mesh_.globalData().procPatchMap();
|
const labelList& procPatchMap = mesh.globalData().procPatchMap();
|
||||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
// Presize with (as estimate) size of patch to neighbour.
|
// Presize with (as estimate) size of patch to neighbour.
|
||||||
forAll(procPatchMap, procI)
|
forAll(procPatchMap, procI)
|
||||||
@ -118,12 +117,12 @@ Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap
|
|||||||
|
|
||||||
|
|
||||||
// 2. The overall compact addressing is
|
// 2. The overall compact addressing is
|
||||||
// - myProcNo first
|
// - myProcNo data first (uncompacted)
|
||||||
// - all other processors consecutively
|
// - all other processors consecutively
|
||||||
|
|
||||||
labelList compactStart(Pstream::nProcs());
|
labelList compactStart(Pstream::nProcs());
|
||||||
compactStart[Pstream::myProcNo()] = 0;
|
compactStart[Pstream::myProcNo()] = 0;
|
||||||
label nCompact = mesh_.nCells()+nBnd;
|
label nCompact = globalNumbering.localSize();
|
||||||
forAll(compactStart, procI)
|
forAll(compactStart, procI)
|
||||||
{
|
{
|
||||||
if (procI != Pstream::myProcNo())
|
if (procI != Pstream::myProcNo())
|
||||||
@ -159,7 +158,7 @@ Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap
|
|||||||
{
|
{
|
||||||
recvCompact[procI] =
|
recvCompact[procI] =
|
||||||
compactStart[procI]
|
compactStart[procI]
|
||||||
+ identity(mesh_.nCells()+nBnd);
|
+ identity(globalNumbering.localSize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
labelListList sendCompact(Pstream::nProcs());
|
labelListList sendCompact(Pstream::nProcs());
|
||||||
@ -228,7 +227,7 @@ Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::extendedStencil::extendedStencil(const polyMesh& mesh)
|
Foam::extendedCellToFaceStencil::extendedCellToFaceStencil(const polyMesh& mesh)
|
||||||
:
|
:
|
||||||
mesh_(mesh)
|
mesh_(mesh)
|
||||||
{}
|
{}
|
||||||
@ -23,10 +23,10 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::extendedStencil
|
Foam::extendedCellToFaceStencil
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Calculates/constains the extended face stencil.
|
Calculates/constains the extended cell-to-face stencil.
|
||||||
|
|
||||||
The stencil is a list of indices into either cells or boundary faces
|
The stencil is a list of indices into either cells or boundary faces
|
||||||
in a compact way. (element 0 is owner, 1 is neighbour). The index numbering
|
in a compact way. (element 0 is owner, 1 is neighbour). The index numbering
|
||||||
@ -41,13 +41,13 @@ Description
|
|||||||
- sum the weights*field.
|
- sum the weights*field.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
extendedStencil.C
|
extendedCellToFaceStencil.C
|
||||||
extendedStencilTemplates.C
|
extendedCellToFaceStencilTemplates.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef extendedStencil_H
|
#ifndef extendedCellToFaceStencil_H
|
||||||
#define extendedStencil_H
|
#define extendedCellToFaceStencil_H
|
||||||
|
|
||||||
#include "mapDistribute.H"
|
#include "mapDistribute.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
@ -61,10 +61,10 @@ namespace Foam
|
|||||||
class globalIndex;
|
class globalIndex;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class extendedStencil Declaration
|
Class extendedCellToFaceStencil Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class extendedStencil
|
class extendedCellToFaceStencil
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -75,12 +75,6 @@ protected:
|
|||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Calculate distribute map
|
|
||||||
autoPtr<mapDistribute> calcDistributeMap
|
|
||||||
(
|
|
||||||
const globalIndex& globalNumbering,
|
|
||||||
labelListList& faceStencil
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -88,10 +82,10 @@ private:
|
|||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
extendedStencil(const extendedStencil&);
|
extendedCellToFaceStencil(const extendedCellToFaceStencil&);
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const extendedStencil&);
|
void operator=(const extendedCellToFaceStencil&);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -99,11 +93,19 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from mesh
|
//- Construct from mesh
|
||||||
explicit extendedStencil(const polyMesh&);
|
explicit extendedCellToFaceStencil(const polyMesh&);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Calculate distribute map
|
||||||
|
static autoPtr<mapDistribute> calcDistributeMap
|
||||||
|
(
|
||||||
|
const polyMesh& mesh,
|
||||||
|
const globalIndex& globalNumbering,
|
||||||
|
labelListList& faceStencil
|
||||||
|
);
|
||||||
|
|
||||||
//- Use map to get the data into stencil order
|
//- Use map to get the data into stencil order
|
||||||
template<class T>
|
template<class T>
|
||||||
static void collectData
|
static void collectData
|
||||||
@ -134,7 +136,7 @@ public:
|
|||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#ifdef NoRepository
|
#ifdef NoRepository
|
||||||
# include "extendedStencilTemplates.C"
|
# include "extendedCellToFaceStencilTemplates.C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -24,12 +24,12 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "extendedStencil.H"
|
#include "extendedCellToFaceStencil.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::extendedStencil::collectData
|
void Foam::extendedCellToFaceStencil::collectData
|
||||||
(
|
(
|
||||||
const mapDistribute& map,
|
const mapDistribute& map,
|
||||||
const labelListList& stencil,
|
const labelListList& stencil,
|
||||||
@ -79,7 +79,7 @@ void Foam::extendedStencil::collectData
|
|||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >
|
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >
|
||||||
Foam::extendedStencil::weightedSum
|
Foam::extendedCellToFaceStencil::weightedSum
|
||||||
(
|
(
|
||||||
const mapDistribute& map,
|
const mapDistribute& map,
|
||||||
const labelListList& stencil,
|
const labelListList& stencil,
|
||||||
@ -25,26 +25,34 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "mapDistribute.H"
|
#include "mapDistribute.H"
|
||||||
#include "extendedCentredStencil.H"
|
#include "extendedCentredCellToFaceStencil.H"
|
||||||
#include "faceStencil.H"
|
#include "cellToFaceStencil.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::extendedCentredStencil::extendedCentredStencil(const faceStencil& stencil)
|
Foam::extendedCentredCellToFaceStencil::extendedCentredCellToFaceStencil
|
||||||
|
(
|
||||||
|
const cellToFaceStencil& stencil
|
||||||
|
)
|
||||||
:
|
:
|
||||||
extendedStencil(stencil.mesh())
|
extendedCellToFaceStencil(stencil.mesh())
|
||||||
{
|
{
|
||||||
stencil_ = stencil;
|
stencil_ = stencil;
|
||||||
|
|
||||||
// Calculate distribute map (also renumbers stencil)
|
// Calculate distribute map (also renumbers elements in stencil)
|
||||||
mapPtr_ = calcDistributeMap(stencil.globalNumbering(), stencil_);
|
mapPtr_ = calcDistributeMap
|
||||||
|
(
|
||||||
|
stencil.mesh(),
|
||||||
|
stencil.globalNumbering(),
|
||||||
|
stencil_
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Per face which elements of the stencil to keep.
|
// Per face which elements of the stencil to keep.
|
||||||
void Foam::extendedCentredStencil::compact()
|
void Foam::extendedCentredCellToFaceStencil::compact()
|
||||||
{
|
{
|
||||||
boolList isInStencil(map().constructSize(), false);
|
boolList isInStencil(map().constructSize(), false);
|
||||||
|
|
||||||
@ -23,34 +23,34 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::extendedCentredStencil
|
Foam::extendedCentredCellToFaceStencil
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
extendedCentredStencil.C
|
extendedCentredCellToFaceStencil.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef extendedCentredStencil_H
|
#ifndef extendedCentredCellToFaceStencil_H
|
||||||
#define extendedCentredStencil_H
|
#define extendedCentredCellToFaceStencil_H
|
||||||
|
|
||||||
#include "extendedStencil.H"
|
#include "extendedCellToFaceStencil.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
class faceStencil;
|
class cellToFaceStencil;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class extendedCentredStencil Declaration
|
Class extendedCentredCellToFaceStencil Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class extendedCentredStencil
|
class extendedCentredCellToFaceStencil
|
||||||
:
|
:
|
||||||
public extendedStencil
|
public extendedCellToFaceStencil
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
@ -64,10 +64,13 @@ class extendedCentredStencil
|
|||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
extendedCentredStencil(const extendedCentredStencil&);
|
extendedCentredCellToFaceStencil
|
||||||
|
(
|
||||||
|
const extendedCentredCellToFaceStencil&
|
||||||
|
);
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const extendedCentredStencil&);
|
void operator=(const extendedCentredCellToFaceStencil&);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -75,7 +78,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from uncompacted face stencil
|
//- Construct from uncompacted face stencil
|
||||||
explicit extendedCentredStencil(const faceStencil&);
|
explicit extendedCentredCellToFaceStencil(const cellToFaceStencil&);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
@ -103,7 +106,13 @@ public:
|
|||||||
List<List<T> >& stencilFld
|
List<List<T> >& stencilFld
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
extendedStencil::collectData(map(), stencil(), fld, stencilFld);
|
extendedCellToFaceStencil::collectData
|
||||||
|
(
|
||||||
|
map(),
|
||||||
|
stencil(),
|
||||||
|
fld,
|
||||||
|
stencilFld
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Sum vol field contributions to create face values
|
//- Sum vol field contributions to create face values
|
||||||
@ -114,7 +123,7 @@ public:
|
|||||||
const List<List<scalar> >& stencilWeights
|
const List<List<scalar> >& stencilWeights
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return extendedStencil::weightedSum
|
return extendedCellToFaceStencil::weightedSum
|
||||||
(
|
(
|
||||||
map(),
|
map(),
|
||||||
stencil(),
|
stencil(),
|
||||||
@ -24,14 +24,14 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "extendedUpwindStencil.H"
|
#include "extendedUpwindCellToFaceStencil.H"
|
||||||
#include "faceStencil.H"
|
#include "cellToFaceStencil.H"
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "SortableList.H"
|
#include "SortableList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::extendedUpwindStencil::selectOppositeFaces
|
void Foam::extendedUpwindCellToFaceStencil::selectOppositeFaces
|
||||||
(
|
(
|
||||||
const boolList& nonEmptyFace,
|
const boolList& nonEmptyFace,
|
||||||
const scalar minOpposedness,
|
const scalar minOpposedness,
|
||||||
@ -103,7 +103,7 @@ void Foam::extendedUpwindStencil::selectOppositeFaces
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::extendedUpwindStencil::transportStencil
|
void Foam::extendedUpwindCellToFaceStencil::transportStencil
|
||||||
(
|
(
|
||||||
const boolList& nonEmptyFace,
|
const boolList& nonEmptyFace,
|
||||||
const labelListList& faceStencil,
|
const labelListList& faceStencil,
|
||||||
@ -168,8 +168,10 @@ void Foam::extendedUpwindStencil::transportStencil
|
|||||||
}
|
}
|
||||||
if (n != transportedStencil.size())
|
if (n != transportedStencil.size())
|
||||||
{
|
{
|
||||||
FatalErrorIn("extendedUpwindStencil::transportStencil(..)")
|
FatalErrorIn
|
||||||
<< "problem:" << faceStencilSet
|
(
|
||||||
|
"extendedUpwindCellToFaceStencil::transportStencil(..)"
|
||||||
|
) << "problem:" << faceStencilSet
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -188,15 +190,17 @@ void Foam::extendedUpwindStencil::transportStencil
|
|||||||
}
|
}
|
||||||
if (n != transportedStencil.size())
|
if (n != transportedStencil.size())
|
||||||
{
|
{
|
||||||
FatalErrorIn("extendedUpwindStencil::transportStencil(..)")
|
FatalErrorIn
|
||||||
<< "problem:" << faceStencilSet
|
(
|
||||||
|
"extendedUpwindCellToFaceStencil::transportStencil(..)"
|
||||||
|
) << "problem:" << faceStencilSet
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::extendedUpwindStencil::transportStencils
|
void Foam::extendedUpwindCellToFaceStencil::transportStencils
|
||||||
(
|
(
|
||||||
const labelListList& faceStencil,
|
const labelListList& faceStencil,
|
||||||
const scalar minOpposedness,
|
const scalar minOpposedness,
|
||||||
@ -240,6 +244,7 @@ void Foam::extendedUpwindStencil::transportStencils
|
|||||||
// Internal faces
|
// Internal faces
|
||||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
||||||
{
|
{
|
||||||
|
// Get stencil as owner + neighbour + stencil from 'opposite' faces
|
||||||
transportStencil
|
transportStencil
|
||||||
(
|
(
|
||||||
nonEmptyFace,
|
nonEmptyFace,
|
||||||
@ -367,13 +372,13 @@ void Foam::extendedUpwindStencil::transportStencils
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::extendedUpwindStencil::extendedUpwindStencil
|
Foam::extendedUpwindCellToFaceStencil::extendedUpwindCellToFaceStencil
|
||||||
(
|
(
|
||||||
const faceStencil& stencil,
|
const cellToFaceStencil& stencil,
|
||||||
const scalar minOpposedness
|
const scalar minOpposedness
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
extendedStencil(stencil.mesh())
|
extendedCellToFaceStencil(stencil.mesh())
|
||||||
{
|
{
|
||||||
//forAll(stencil, faceI)
|
//forAll(stencil, faceI)
|
||||||
//{
|
//{
|
||||||
@ -414,12 +419,14 @@ Foam::extendedUpwindStencil::extendedUpwindStencil
|
|||||||
|
|
||||||
ownMapPtr_ = calcDistributeMap
|
ownMapPtr_ = calcDistributeMap
|
||||||
(
|
(
|
||||||
|
stencil.mesh(),
|
||||||
stencil.globalNumbering(),
|
stencil.globalNumbering(),
|
||||||
ownStencil_
|
ownStencil_
|
||||||
);
|
);
|
||||||
|
|
||||||
neiMapPtr_ = calcDistributeMap
|
neiMapPtr_ = calcDistributeMap
|
||||||
(
|
(
|
||||||
|
stencil.mesh(),
|
||||||
stencil.globalNumbering(),
|
stencil.globalNumbering(),
|
||||||
neiStencil_
|
neiStencil_
|
||||||
);
|
);
|
||||||
@ -23,35 +23,37 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::extendedUpwindStencil
|
Foam::extendedUpwindCellToFaceStencil
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
Creates upwind stencil by shifting a centred stencil to upwind and downwind
|
||||||
|
faces.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
extendedUpwindStencil.C
|
extendedUpwindCellToFaceStencil.C
|
||||||
extendedUpwindStencilTemplates.C
|
extendedUpwindCellToFaceStencilTemplates.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef extendedUpwindStencil_H
|
#ifndef extendedUpwindCellToFaceStencil_H
|
||||||
#define extendedUpwindStencil_H
|
#define extendedUpwindCellToFaceStencil_H
|
||||||
|
|
||||||
#include "extendedStencil.H"
|
#include "extendedCellToFaceStencil.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
class faceStencil;
|
class cellToFaceStencil;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class extendedUpwindStencil Declaration
|
Class extendedUpwindCellToFaceStencil Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class extendedUpwindStencil
|
class extendedUpwindCellToFaceStencil
|
||||||
:
|
:
|
||||||
public extendedStencil
|
public extendedCellToFaceStencil
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
@ -103,10 +105,10 @@ class extendedUpwindStencil
|
|||||||
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
extendedUpwindStencil(const extendedUpwindStencil&);
|
extendedUpwindCellToFaceStencil(const extendedUpwindCellToFaceStencil&);
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const extendedUpwindStencil&);
|
void operator=(const extendedUpwindCellToFaceStencil&);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -114,9 +116,9 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from mesh and uncompacted face stencil
|
//- Construct from mesh and uncompacted face stencil
|
||||||
extendedUpwindStencil
|
extendedUpwindCellToFaceStencil
|
||||||
(
|
(
|
||||||
const faceStencil&,
|
const cellToFaceStencil&,
|
||||||
const scalar minOpposedness
|
const scalar minOpposedness
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -167,7 +169,7 @@ public:
|
|||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#ifdef NoRepository
|
#ifdef NoRepository
|
||||||
# include "extendedUpwindStencilTemplates.C"
|
# include "extendedUpwindCellToFaceStencilTemplates.C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -24,13 +24,13 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "extendedStencil.H"
|
#include "extendedCellToFaceStencil.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >
|
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >
|
||||||
Foam::extendedUpwindStencil::weightedSum
|
Foam::extendedUpwindCellToFaceStencil::weightedSum
|
||||||
(
|
(
|
||||||
const surfaceScalarField& phi,
|
const surfaceScalarField& phi,
|
||||||
const GeometricField<Type, fvPatchField, volMesh>& fld,
|
const GeometricField<Type, fvPatchField, volMesh>& fld,
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "CECCellToFaceStencil.H"
|
||||||
|
#include "CECCellToCellStencil.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::CECCellToFaceStencil::CECCellToFaceStencil(const polyMesh& mesh)
|
||||||
|
:
|
||||||
|
cellToFaceStencil(mesh)
|
||||||
|
{
|
||||||
|
// Calculate per cell the (edge) connected cells (in global numbering)
|
||||||
|
CECCellToCellStencil globalCellCells(mesh);
|
||||||
|
|
||||||
|
// Add stencils of neighbouring cells to create faceStencil
|
||||||
|
labelListList faceStencil;
|
||||||
|
calcFaceStencil(globalCellCells, faceStencil);
|
||||||
|
|
||||||
|
// Transfer to *this
|
||||||
|
transfer(faceStencil);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,81 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
Foam::CECCellToFaceStencil
|
||||||
|
|
||||||
|
Description
|
||||||
|
Combined corresponding cellToCellStencil of owner and neighbour.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
CECCellToFaceStencil.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef CECCellToFaceStencil_H
|
||||||
|
#define CECCellToFaceStencil_H
|
||||||
|
|
||||||
|
#include "cellToFaceStencil.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class CECCellToFaceStencil Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class CECCellToFaceStencil
|
||||||
|
:
|
||||||
|
public cellToFaceStencil
|
||||||
|
{
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
CECCellToFaceStencil(const CECCellToFaceStencil&);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const CECCellToFaceStencil&);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from all cells and boundary faces
|
||||||
|
explicit CECCellToFaceStencil(const polyMesh&);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "CFCCellToFaceStencil.H"
|
||||||
|
#include "CFCCellToCellStencil.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::CFCCellToFaceStencil::CFCCellToFaceStencil(const polyMesh& mesh)
|
||||||
|
:
|
||||||
|
cellToFaceStencil(mesh)
|
||||||
|
{
|
||||||
|
// Calculate per cell the (face) connected cells (in global numbering)
|
||||||
|
CFCCellToCellStencil globalCellCells(mesh);
|
||||||
|
|
||||||
|
// Add stencils of neighbouring cells to create faceStencil
|
||||||
|
labelListList faceStencil;
|
||||||
|
calcFaceStencil(globalCellCells, faceStencil);
|
||||||
|
|
||||||
|
// Transfer to *this
|
||||||
|
transfer(faceStencil);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,79 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
Foam::CFCCellToFaceStencil
|
||||||
|
|
||||||
|
Description
|
||||||
|
Combined corresponding cellToCellStencil of owner and neighbour.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
CFCCellToFaceStencil.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef CFCCellToFaceStencil_H
|
||||||
|
#define CFCCellToFaceStencil_H
|
||||||
|
|
||||||
|
#include "cellToFaceStencil.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class CFCCellToFaceStencil Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class CFCCellToFaceStencil
|
||||||
|
:
|
||||||
|
public cellToFaceStencil
|
||||||
|
{
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
CFCCellToFaceStencil(const CFCCellToFaceStencil&);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const CFCCellToFaceStencil&);
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from mesh
|
||||||
|
explicit CFCCellToFaceStencil(const polyMesh& mesh);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "CPCCellToFaceStencil.H"
|
||||||
|
#include "CPCCellToCellStencil.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::CPCCellToFaceStencil::CPCCellToFaceStencil(const polyMesh& mesh)
|
||||||
|
:
|
||||||
|
cellToFaceStencil(mesh)
|
||||||
|
{
|
||||||
|
// Calculate per cell the (face) connected cells (in global numbering)
|
||||||
|
CPCCellToCellStencil globalCellCells(mesh);
|
||||||
|
|
||||||
|
// Add stencils of neighbouring cells to create faceStencil
|
||||||
|
labelListList faceStencil;
|
||||||
|
calcFaceStencil(globalCellCells, faceStencil);
|
||||||
|
|
||||||
|
// Transfer to *this
|
||||||
|
transfer(faceStencil);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,81 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
Foam::CPCCellToFaceStencil
|
||||||
|
|
||||||
|
Description
|
||||||
|
Combined corresponding cellToCellStencil of owner and neighbour.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
CPCCellToFaceStencil.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef CPCCellToFaceStencil_H
|
||||||
|
#define CPCCellToFaceStencil_H
|
||||||
|
|
||||||
|
#include "cellToFaceStencil.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class CPCCellToFaceStencil Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class CPCCellToFaceStencil
|
||||||
|
:
|
||||||
|
public cellToFaceStencil
|
||||||
|
{
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
CPCCellToFaceStencil(const CPCCellToFaceStencil&);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const CPCCellToFaceStencil&);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from all cells and boundary faces
|
||||||
|
explicit CPCCellToFaceStencil(const polyMesh&);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -24,7 +24,7 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "faceEdgeCellStencil.H"
|
#include "FECCellToFaceStencil.H"
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "emptyPolyPatch.H"
|
#include "emptyPolyPatch.H"
|
||||||
//#include "meshTools.H"
|
//#include "meshTools.H"
|
||||||
@ -34,7 +34,7 @@ License
|
|||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
// Calculates per edge the neighbour data (= edgeCells)
|
// Calculates per edge the neighbour data (= edgeCells)
|
||||||
void Foam::faceEdgeCellStencil::calcEdgeBoundaryData
|
void Foam::FECCellToFaceStencil::calcEdgeBoundaryData
|
||||||
(
|
(
|
||||||
const boolList& isValidBFace,
|
const boolList& isValidBFace,
|
||||||
const labelList& boundaryEdges,
|
const labelList& boundaryEdges,
|
||||||
@ -73,7 +73,7 @@ void Foam::faceEdgeCellStencil::calcEdgeBoundaryData
|
|||||||
|
|
||||||
// Calculates per face the edge connected data (= cell or boundary in global
|
// Calculates per face the edge connected data (= cell or boundary in global
|
||||||
// numbering).
|
// numbering).
|
||||||
void Foam::faceEdgeCellStencil::calcFaceStencil
|
void Foam::FECCellToFaceStencil::calcFaceStencil
|
||||||
(
|
(
|
||||||
labelListList& faceStencil
|
labelListList& faceStencil
|
||||||
) const
|
) const
|
||||||
@ -220,7 +220,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
|
|||||||
{
|
{
|
||||||
if (iter.key() == globalOwn || iter.key() == globalNei)
|
if (iter.key() == globalOwn || iter.key() == globalNei)
|
||||||
{
|
{
|
||||||
FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)")
|
FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)")
|
||||||
<< "problem:" << faceStencilSet
|
<< "problem:" << faceStencilSet
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
@ -281,8 +281,10 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
|
|||||||
{
|
{
|
||||||
if (iter.key() == globalOwn || iter.key() == globalNei)
|
if (iter.key() == globalOwn || iter.key() == globalNei)
|
||||||
{
|
{
|
||||||
FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)")
|
FatalErrorIn
|
||||||
<< "problem:" << faceStencilSet
|
(
|
||||||
|
"FECCellToFaceStencil::calcFaceStencil(..)"
|
||||||
|
) << "problem:" << faceStencilSet
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
faceStencil[faceI][n++] = iter.key();
|
faceStencil[faceI][n++] = iter.key();
|
||||||
@ -345,8 +347,10 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
|
|||||||
{
|
{
|
||||||
if (iter.key() == globalOwn)
|
if (iter.key() == globalOwn)
|
||||||
{
|
{
|
||||||
FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)")
|
FatalErrorIn
|
||||||
<< "problem:" << faceStencilSet
|
(
|
||||||
|
"FECCellToFaceStencil::calcFaceStencil(..)"
|
||||||
|
) << "problem:" << faceStencilSet
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
faceStencil[faceI][n++] = iter.key();
|
faceStencil[faceI][n++] = iter.key();
|
||||||
@ -363,7 +367,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
|
|||||||
label globalOwn = globalNumbering().toGlobal(own[faceI]);
|
label globalOwn = globalNumbering().toGlobal(own[faceI]);
|
||||||
if (faceStencil[faceI][0] != globalOwn)
|
if (faceStencil[faceI][0] != globalOwn)
|
||||||
{
|
{
|
||||||
FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)")
|
FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)")
|
||||||
<< "problem:" << faceStencil[faceI]
|
<< "problem:" << faceStencil[faceI]
|
||||||
<< " globalOwn:" << globalOwn
|
<< " globalOwn:" << globalOwn
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
@ -371,7 +375,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
|
|||||||
label globalNei = globalNumbering().toGlobal(nei[faceI]);
|
label globalNei = globalNumbering().toGlobal(nei[faceI]);
|
||||||
if (faceStencil[faceI][1] != globalNei)
|
if (faceStencil[faceI][1] != globalNei)
|
||||||
{
|
{
|
||||||
FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)")
|
FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)")
|
||||||
<< "problem:" << faceStencil[faceI]
|
<< "problem:" << faceStencil[faceI]
|
||||||
<< " globalNei:" << globalNei
|
<< " globalNei:" << globalNei
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
@ -392,7 +396,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
|
|||||||
label globalOwn = globalNumbering().toGlobal(own[faceI]);
|
label globalOwn = globalNumbering().toGlobal(own[faceI]);
|
||||||
if (faceStencil[faceI][0] != globalOwn)
|
if (faceStencil[faceI][0] != globalOwn)
|
||||||
{
|
{
|
||||||
FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)")
|
FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)")
|
||||||
<< "problem:" << faceStencil[faceI]
|
<< "problem:" << faceStencil[faceI]
|
||||||
<< " globalOwn:" << globalOwn
|
<< " globalOwn:" << globalOwn
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
@ -400,7 +404,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
|
|||||||
label globalNei = neiGlobalCell[faceI-mesh().nInternalFaces()];
|
label globalNei = neiGlobalCell[faceI-mesh().nInternalFaces()];
|
||||||
if (faceStencil[faceI][1] != globalNei)
|
if (faceStencil[faceI][1] != globalNei)
|
||||||
{
|
{
|
||||||
FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)")
|
FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)")
|
||||||
<< "problem:" << faceStencil[faceI]
|
<< "problem:" << faceStencil[faceI]
|
||||||
<< " globalNei:" << globalNei
|
<< " globalNei:" << globalNei
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
@ -416,7 +420,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
|
|||||||
label globalOwn = globalNumbering().toGlobal(own[faceI]);
|
label globalOwn = globalNumbering().toGlobal(own[faceI]);
|
||||||
if (faceStencil[faceI][0] != globalOwn)
|
if (faceStencil[faceI][0] != globalOwn)
|
||||||
{
|
{
|
||||||
FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)")
|
FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)")
|
||||||
<< "problem:" << faceStencil[faceI]
|
<< "problem:" << faceStencil[faceI]
|
||||||
<< " globalOwn:" << globalOwn
|
<< " globalOwn:" << globalOwn
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
@ -429,9 +433,9 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::faceEdgeCellStencil::faceEdgeCellStencil(const polyMesh& mesh)
|
Foam::FECCellToFaceStencil::FECCellToFaceStencil(const polyMesh& mesh)
|
||||||
:
|
:
|
||||||
faceStencil(mesh)
|
cellToFaceStencil(mesh)
|
||||||
{
|
{
|
||||||
// Calculate per face the (edge) connected cells (in global numbering)
|
// Calculate per face the (edge) connected cells (in global numbering)
|
||||||
labelListList faceStencil;
|
labelListList faceStencil;
|
||||||
@ -23,23 +23,20 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::faceEdgeCellStencil
|
Foam::FECCellToFaceStencil
|
||||||
|
|
||||||
Description
|
Description
|
||||||
All cells connected via edge to face.
|
All cells connected via edge to face.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
faceEdgeCellStencil.C
|
FECCellToFaceStencil.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef faceEdgeCellStencil_H
|
#ifndef FECCellToFaceStencil_H
|
||||||
#define faceEdgeCellStencil_H
|
#define FECCellToFaceStencil_H
|
||||||
|
|
||||||
#include "faceStencil.H"
|
#include "cellToFaceStencil.H"
|
||||||
#include "boolList.H"
|
|
||||||
#include "HashSet.H"
|
|
||||||
#include "Map.H"
|
|
||||||
#include "EdgeMap.H"
|
#include "EdgeMap.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -48,12 +45,12 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class faceEdgeCellStencil Declaration
|
Class FECCellToFaceStencil Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class faceEdgeCellStencil
|
class FECCellToFaceStencil
|
||||||
:
|
:
|
||||||
public faceStencil
|
public cellToFaceStencil
|
||||||
{
|
{
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
@ -69,10 +66,10 @@ class faceEdgeCellStencil
|
|||||||
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
faceEdgeCellStencil(const faceEdgeCellStencil&);
|
FECCellToFaceStencil(const FECCellToFaceStencil&);
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const faceEdgeCellStencil&);
|
void operator=(const FECCellToFaceStencil&);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -80,7 +77,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from all cells and boundary faces
|
//- Construct from all cells and boundary faces
|
||||||
explicit faceEdgeCellStencil(const polyMesh&);
|
explicit FECCellToFaceStencil(const polyMesh&);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "faceStencil.H"
|
#include "cellToFaceStencil.H"
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "SortableList.H"
|
#include "SortableList.H"
|
||||||
#include "emptyPolyPatch.H"
|
#include "emptyPolyPatch.H"
|
||||||
@ -32,7 +32,7 @@ License
|
|||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
// Merge two list and guarantee global0,global1 are first.
|
// Merge two list and guarantee global0,global1 are first.
|
||||||
void Foam::faceStencil::merge
|
void Foam::cellToFaceStencil::merge
|
||||||
(
|
(
|
||||||
const label global0,
|
const label global0,
|
||||||
const label global1,
|
const label global1,
|
||||||
@ -124,7 +124,7 @@ void Foam::faceStencil::merge
|
|||||||
|
|
||||||
if (resultI != result.size())
|
if (resultI != result.size())
|
||||||
{
|
{
|
||||||
FatalErrorIn("faceStencil::merge(..)")
|
FatalErrorIn("cellToFaceStencil::merge(..)")
|
||||||
<< "problem" << abort(FatalError);
|
<< "problem" << abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ void Foam::faceStencil::merge
|
|||||||
|
|
||||||
|
|
||||||
// Merge two list and guarantee globalI is first.
|
// Merge two list and guarantee globalI is first.
|
||||||
void Foam::faceStencil::merge
|
void Foam::cellToFaceStencil::merge
|
||||||
(
|
(
|
||||||
const label globalI,
|
const label globalI,
|
||||||
const labelList& pGlobals,
|
const labelList& pGlobals,
|
||||||
@ -168,7 +168,7 @@ void Foam::faceStencil::merge
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::faceStencil::validBoundaryFaces(boolList& isValidBFace) const
|
void Foam::cellToFaceStencil::validBoundaryFaces(boolList& isValidBFace) const
|
||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh().boundaryMesh();
|
const polyBoundaryMesh& patches = mesh().boundaryMesh();
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ void Foam::faceStencil::validBoundaryFaces(boolList& isValidBFace) const
|
|||||||
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::indirectPrimitivePatch>
|
Foam::autoPtr<Foam::indirectPrimitivePatch>
|
||||||
Foam::faceStencil::allCoupledFacesPatch() const
|
Foam::cellToFaceStencil::allCoupledFacesPatch() const
|
||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh().boundaryMesh();
|
const polyBoundaryMesh& patches = mesh().boundaryMesh();
|
||||||
|
|
||||||
@ -239,7 +239,7 @@ Foam::faceStencil::allCoupledFacesPatch() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::faceStencil::unionEqOp::operator()
|
void Foam::cellToFaceStencil::unionEqOp::operator()
|
||||||
(
|
(
|
||||||
labelList& x,
|
labelList& x,
|
||||||
const labelList& y
|
const labelList& y
|
||||||
@ -264,7 +264,7 @@ void Foam::faceStencil::unionEqOp::operator()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::faceStencil::insertFaceCells
|
void Foam::cellToFaceStencil::insertFaceCells
|
||||||
(
|
(
|
||||||
const label exclude0,
|
const label exclude0,
|
||||||
const label exclude1,
|
const label exclude1,
|
||||||
@ -316,7 +316,7 @@ void Foam::faceStencil::insertFaceCells
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::labelList Foam::faceStencil::calcFaceCells
|
Foam::labelList Foam::cellToFaceStencil::calcFaceCells
|
||||||
(
|
(
|
||||||
const boolList& isValidBFace,
|
const boolList& isValidBFace,
|
||||||
const labelList& faceLabels,
|
const labelList& faceLabels,
|
||||||
@ -339,7 +339,7 @@ Foam::labelList Foam::faceStencil::calcFaceCells
|
|||||||
|
|
||||||
|
|
||||||
// Calculates per face a list of global cell/face indices.
|
// Calculates per face a list of global cell/face indices.
|
||||||
void Foam::faceStencil::calcFaceStencil
|
void Foam::cellToFaceStencil::calcFaceStencil
|
||||||
(
|
(
|
||||||
const labelListList& globalCellCells,
|
const labelListList& globalCellCells,
|
||||||
labelListList& faceStencil
|
labelListList& faceStencil
|
||||||
@ -502,7 +502,7 @@ void Foam::faceStencil::calcFaceStencil
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::faceStencil::faceStencil(const polyMesh& mesh)
|
Foam::cellToFaceStencil::cellToFaceStencil(const polyMesh& mesh)
|
||||||
:
|
:
|
||||||
mesh_(mesh),
|
mesh_(mesh),
|
||||||
globalNumbering_(mesh_.nCells()+mesh_.nFaces()-mesh_.nInternalFaces())
|
globalNumbering_(mesh_.nCells()+mesh_.nFaces()-mesh_.nInternalFaces())
|
||||||
@ -23,18 +23,19 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::faceStencil
|
Foam::cellToFaceStencil
|
||||||
|
|
||||||
Description
|
Description
|
||||||
baseclass for extended face-cell addressing.
|
baseclass for extended cell-to-facel stencils (face values from
|
||||||
|
neighbouring cells)
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
faceStencil.C
|
faceStencil.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef faceStencil_H
|
#ifndef cellToFaceStencil_H
|
||||||
#define faceStencil_H
|
#define cellToFaceStencil_H
|
||||||
|
|
||||||
#include "globalIndex.H"
|
#include "globalIndex.H"
|
||||||
#include "boolList.H"
|
#include "boolList.H"
|
||||||
@ -49,10 +50,10 @@ namespace Foam
|
|||||||
class polyMesh;
|
class polyMesh;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class faceStencil Declaration
|
Class cellToFaceStencil Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class faceStencil
|
class cellToFaceStencil
|
||||||
:
|
:
|
||||||
public labelListList
|
public labelListList
|
||||||
{
|
{
|
||||||
@ -66,9 +67,11 @@ class faceStencil
|
|||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise copy construct
|
||||||
void operator=(const faceStencil&);
|
cellToFaceStencil(const cellToFaceStencil&);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const cellToFaceStencil&);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -130,7 +133,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from mesh
|
//- Construct from mesh
|
||||||
explicit faceStencil(const polyMesh&);
|
explicit cellToFaceStencil(const polyMesh&);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
@ -1,38 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
|
||||||
\\/ 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
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "upwindCECStencilObject.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(upwindCECStencilObject, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
|
||||||
\\/ 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
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "upwindCFCStencilObject.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(upwindCFCStencilObject, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
|
||||||
\\/ 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
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "upwindCPCStencilObject.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(upwindCPCStencilObject, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
|
||||||
\\/ 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
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "upwindFECStencilObject.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(upwindFECStencilObject, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "centredCFCFaceToCellStencilObject.H"
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(centredCFCFaceToCellStencilObject, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,87 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
Foam::centredCFCFaceToCellStencilObject
|
||||||
|
|
||||||
|
Description
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef centredCFCFaceToCellStencilObject_H
|
||||||
|
#define centredCFCFaceToCellStencilObject_H
|
||||||
|
|
||||||
|
#include "extendedCentredFaceToCellStencil.H"
|
||||||
|
#include "CFCFaceToCellStencil.H"
|
||||||
|
#include "MeshObject.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class centredCFCFaceToCellStencilObject Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class centredCFCFaceToCellStencilObject
|
||||||
|
:
|
||||||
|
public MeshObject<fvMesh, centredCFCFaceToCellStencilObject>,
|
||||||
|
public extendedCentredFaceToCellStencil
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
TypeName("centredCFCFaceToCellStencil");
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from uncompacted face stencil
|
||||||
|
explicit centredCFCFaceToCellStencilObject
|
||||||
|
(
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
MeshObject<fvMesh, centredCFCFaceToCellStencilObject>(mesh),
|
||||||
|
extendedCentredFaceToCellStencil(CFCFaceToCellStencil(mesh))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~centredCFCFaceToCellStencilObject()
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "mapDistribute.H"
|
||||||
|
#include "extendedCentredFaceToCellStencil.H"
|
||||||
|
#include "faceToCellStencil.H"
|
||||||
|
|
||||||
|
// Only for access to calcDistributeMap <- needs to be moved out
|
||||||
|
#include "extendedCellToFaceStencil.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::extendedCentredFaceToCellStencil::extendedCentredFaceToCellStencil
|
||||||
|
(
|
||||||
|
const faceToCellStencil& stencil
|
||||||
|
)
|
||||||
|
:
|
||||||
|
extendedFaceToCellStencil(stencil.mesh())
|
||||||
|
{
|
||||||
|
stencil_ = stencil;
|
||||||
|
|
||||||
|
// Calculate distribute map (also renumbers elements in stencil)
|
||||||
|
mapPtr_ = extendedCellToFaceStencil::calcDistributeMap
|
||||||
|
(
|
||||||
|
stencil.mesh(),
|
||||||
|
stencil.globalNumbering(),
|
||||||
|
stencil_
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// Per face which elements of the stencil to keep.
|
||||||
|
void Foam::extendedCentredFaceToCellStencil::compact()
|
||||||
|
{
|
||||||
|
boolList isInStencil(map().constructSize(), false);
|
||||||
|
|
||||||
|
forAll(stencil_, faceI)
|
||||||
|
{
|
||||||
|
const labelList& stencilCells = stencil_[faceI];
|
||||||
|
|
||||||
|
forAll(stencilCells, i)
|
||||||
|
{
|
||||||
|
isInStencil[stencilCells[i]] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mapPtr_().compact(isInStencil);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,146 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
Foam::extendedCentredFaceToCellStencil
|
||||||
|
|
||||||
|
Description
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
extendedCentredFaceToCellStencil.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef extendedCentredFaceToCellStencil_H
|
||||||
|
#define extendedCentredFaceToCellStencil_H
|
||||||
|
|
||||||
|
#include "extendedFaceToCellStencil.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
class faceToCellStencil;
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class extendedCentredFaceToCellStencil Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class extendedCentredFaceToCellStencil
|
||||||
|
:
|
||||||
|
public extendedFaceToCellStencil
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Swap map for getting neigbouring data
|
||||||
|
autoPtr<mapDistribute> mapPtr_;
|
||||||
|
|
||||||
|
//- Per face the stencil.
|
||||||
|
labelListList stencil_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
extendedCentredFaceToCellStencil
|
||||||
|
(
|
||||||
|
const extendedCentredFaceToCellStencil&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const extendedCentredFaceToCellStencil&);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from uncompacted face stencil
|
||||||
|
explicit extendedCentredFaceToCellStencil(const faceToCellStencil&);
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return reference to the parallel distribution map
|
||||||
|
const mapDistribute& map() const
|
||||||
|
{
|
||||||
|
return mapPtr_();
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return reference to the stencil
|
||||||
|
const labelListList& stencil() const
|
||||||
|
{
|
||||||
|
return stencil_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- After removing elements from the stencil adapt the schedule (map).
|
||||||
|
void compact();
|
||||||
|
|
||||||
|
//- Use map to get the data into stencil order
|
||||||
|
template<class T>
|
||||||
|
void collectData
|
||||||
|
(
|
||||||
|
const GeometricField<T, fvsPatchField, surfaceMesh>& fld,
|
||||||
|
List<List<T> >& stencilFld
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
extendedFaceToCellStencil::collectData
|
||||||
|
(
|
||||||
|
map(),
|
||||||
|
stencil(),
|
||||||
|
fld,
|
||||||
|
stencilFld
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Sum surface field contributions to create cell values
|
||||||
|
template<class Type>
|
||||||
|
tmp<GeometricField<Type, fvPatchField, volMesh> > weightedSum
|
||||||
|
(
|
||||||
|
const GeometricField<Type, fvsPatchField, surfaceMesh>& fld,
|
||||||
|
const List<List<scalar> >& stencilWeights
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return extendedFaceToCellStencil::weightedSum
|
||||||
|
(
|
||||||
|
map(),
|
||||||
|
stencil(),
|
||||||
|
fld,
|
||||||
|
stencilWeights
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "extendedFaceToCellStencil.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::extendedFaceToCellStencil::extendedFaceToCellStencil(const polyMesh& mesh)
|
||||||
|
:
|
||||||
|
mesh_(mesh)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,119 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
Foam::extendedFaceToCellStencil
|
||||||
|
|
||||||
|
Description
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
extendedFaceToCellStencil.C
|
||||||
|
extendedFaceToCellStencilTemplates.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef extendedFaceToCellStencil_H
|
||||||
|
#define extendedFaceToCellStencil_H
|
||||||
|
|
||||||
|
#include "mapDistribute.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "surfaceFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
class globalIndex;
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class extendedFaceToCellStencil Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class extendedFaceToCellStencil
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
const polyMesh& mesh_;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
extendedFaceToCellStencil(const extendedFaceToCellStencil&);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const extendedFaceToCellStencil&);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from mesh
|
||||||
|
explicit extendedFaceToCellStencil(const polyMesh&);
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Use map to get the data into stencil order
|
||||||
|
template<class T>
|
||||||
|
static void collectData
|
||||||
|
(
|
||||||
|
const mapDistribute& map,
|
||||||
|
const labelListList& stencil,
|
||||||
|
const GeometricField<T, fvsPatchField, surfaceMesh>& fld,
|
||||||
|
List<List<T> >& stencilFld
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Sum surface field contributions to create cell values
|
||||||
|
template<class Type>
|
||||||
|
static tmp<GeometricField<Type, fvPatchField, volMesh> > weightedSum
|
||||||
|
(
|
||||||
|
const mapDistribute& map,
|
||||||
|
const labelListList& stencil,
|
||||||
|
const GeometricField<Type, fvsPatchField, surfaceMesh>& fld,
|
||||||
|
const List<List<scalar> >& stencilWeights
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "extendedFaceToCellStencilTemplates.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,135 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "extendedFaceToCellStencil.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::extendedFaceToCellStencil::collectData
|
||||||
|
(
|
||||||
|
const mapDistribute& map,
|
||||||
|
const labelListList& stencil,
|
||||||
|
const GeometricField<Type, fvsPatchField, surfaceMesh>& fld,
|
||||||
|
List<List<Type> >& stencilFld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// 1. Construct face data in compact addressing
|
||||||
|
List<Type> compactFld(map.constructSize(), pTraits<Type>::zero);
|
||||||
|
|
||||||
|
// Insert my internal values
|
||||||
|
forAll(fld, cellI)
|
||||||
|
{
|
||||||
|
compactFld[cellI] = fld[cellI];
|
||||||
|
}
|
||||||
|
// Insert my boundary values
|
||||||
|
label nCompact = fld.size();
|
||||||
|
forAll(fld.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
const fvsPatchField<Type>& pfld = fld.boundaryField()[patchI];
|
||||||
|
|
||||||
|
forAll(pfld, i)
|
||||||
|
{
|
||||||
|
compactFld[nCompact++] = pfld[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do all swapping
|
||||||
|
map.distribute(compactFld);
|
||||||
|
|
||||||
|
// 2. Pull to stencil
|
||||||
|
stencilFld.setSize(stencil.size());
|
||||||
|
|
||||||
|
forAll(stencil, faceI)
|
||||||
|
{
|
||||||
|
const labelList& compactCells = stencil[faceI];
|
||||||
|
|
||||||
|
stencilFld[faceI].setSize(compactCells.size());
|
||||||
|
|
||||||
|
forAll(compactCells, i)
|
||||||
|
{
|
||||||
|
stencilFld[faceI][i] = compactFld[compactCells[i]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
||||||
|
Foam::extendedFaceToCellStencil::weightedSum
|
||||||
|
(
|
||||||
|
const mapDistribute& map,
|
||||||
|
const labelListList& stencil,
|
||||||
|
const GeometricField<Type, fvsPatchField, surfaceMesh>& fld,
|
||||||
|
const List<List<scalar> >& stencilWeights
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const fvMesh& mesh = fld.mesh();
|
||||||
|
|
||||||
|
// Collect internal and boundary values
|
||||||
|
List<List<Type> > stencilFld;
|
||||||
|
collectData(map, stencil, fld, stencilFld);
|
||||||
|
|
||||||
|
tmp<GeometricField<Type, fvPatchField, volMesh> > tsfCorr
|
||||||
|
(
|
||||||
|
new GeometricField<Type, fvPatchField, volMesh>
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
fld.name(),
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensioned<Type>
|
||||||
|
(
|
||||||
|
fld.name(),
|
||||||
|
fld.dimensions(),
|
||||||
|
pTraits<Type>::zero
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
GeometricField<Type, fvPatchField, volMesh>& sf = tsfCorr();
|
||||||
|
|
||||||
|
// cells
|
||||||
|
forAll(sf, cellI)
|
||||||
|
{
|
||||||
|
const List<Type>& stField = stencilFld[cellI];
|
||||||
|
const List<scalar>& stWeight = stencilWeights[cellI];
|
||||||
|
|
||||||
|
forAll(stField, i)
|
||||||
|
{
|
||||||
|
sf[cellI] += stField[i]*stWeight[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Boundaries values?
|
||||||
|
|
||||||
|
return tsfCorr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,231 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "CFCFaceToCellStencil.H"
|
||||||
|
#include "syncTools.H"
|
||||||
|
#include "emptyPolyPatch.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// Calculates per face the neighbour data (= faces of cell). Leaves out the
|
||||||
|
// face itself since this is already in stencil.
|
||||||
|
void Foam::CFCFaceToCellStencil::calcFaceBoundaryData
|
||||||
|
(
|
||||||
|
labelListList& neiGlobal
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const polyBoundaryMesh& patches = mesh().boundaryMesh();
|
||||||
|
const label nBnd = mesh().nFaces()-mesh().nInternalFaces();
|
||||||
|
const labelList& own = mesh().faceOwner();
|
||||||
|
|
||||||
|
neiGlobal.setSize(nBnd);
|
||||||
|
|
||||||
|
forAll(patches, patchI)
|
||||||
|
{
|
||||||
|
const polyPatch& pp = patches[patchI];
|
||||||
|
label faceI = pp.start();
|
||||||
|
|
||||||
|
if (pp.coupled())
|
||||||
|
{
|
||||||
|
// For coupled faces get the faces of the cell on the other side
|
||||||
|
forAll(pp, i)
|
||||||
|
{
|
||||||
|
const labelList& cFaces = mesh().cells()[own[faceI]];
|
||||||
|
|
||||||
|
labelList& globFaces = neiGlobal[faceI-mesh().nInternalFaces()];
|
||||||
|
globFaces.setSize(cFaces.size()-1);
|
||||||
|
label globI = 0;
|
||||||
|
|
||||||
|
forAll(cFaces, j)
|
||||||
|
{
|
||||||
|
if (cFaces[j] != faceI)
|
||||||
|
{
|
||||||
|
globFaces[globI++] = globalNumbering().toGlobal
|
||||||
|
(
|
||||||
|
cFaces[j]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
faceI++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (isA<emptyPolyPatch>(pp))
|
||||||
|
{
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Do nothing since face itself already in stencil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
syncTools::swapBoundaryFaceList(mesh(), neiGlobal, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Calculates per cell the neighbour data (= cell or boundary in global
|
||||||
|
// numbering). First element is always cell itself!
|
||||||
|
void Foam::CFCFaceToCellStencil::calcCellStencil(labelListList& globalCellFaces)
|
||||||
|
const
|
||||||
|
{
|
||||||
|
const label nBnd = mesh().nFaces()-mesh().nInternalFaces();
|
||||||
|
const labelList& own = mesh().faceOwner();
|
||||||
|
const labelList& nei = mesh().faceNeighbour();
|
||||||
|
|
||||||
|
|
||||||
|
// Calculate faces of coupled neighbour (in global numbering)
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
labelListList neiGlobal(nBnd);
|
||||||
|
calcFaceBoundaryData(neiGlobal);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Non-empty boundary faces
|
||||||
|
boolList validBFace(mesh().nFaces()-mesh().nInternalFaces(), true);
|
||||||
|
|
||||||
|
const polyBoundaryMesh& patches = mesh().boundaryMesh();
|
||||||
|
forAll(patches, patchI)
|
||||||
|
{
|
||||||
|
const polyPatch& pp = patches[patchI];
|
||||||
|
|
||||||
|
if (isA<emptyPolyPatch>(pp))
|
||||||
|
{
|
||||||
|
label bFaceI = pp.start()-mesh().nInternalFaces();
|
||||||
|
forAll(pp, i)
|
||||||
|
{
|
||||||
|
validBFace[bFaceI++] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Determine faces of cellCells in global numbering
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
DynamicList<label> allGlobalFaces(100);
|
||||||
|
|
||||||
|
globalCellFaces.setSize(mesh().nCells());
|
||||||
|
forAll(globalCellFaces, cellI)
|
||||||
|
{
|
||||||
|
const cell& cFaces = mesh().cells()[cellI];
|
||||||
|
|
||||||
|
allGlobalFaces.clear();
|
||||||
|
|
||||||
|
// My faces first
|
||||||
|
forAll(cFaces, i)
|
||||||
|
{
|
||||||
|
label faceI = cFaces[i];
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
mesh().isInternalFace(faceI)
|
||||||
|
|| validBFace[faceI-mesh().nInternalFaces()]
|
||||||
|
)
|
||||||
|
{
|
||||||
|
allGlobalFaces.append(globalNumbering().toGlobal(faceI));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// faces of neighbouring cells second
|
||||||
|
forAll(cFaces, i)
|
||||||
|
{
|
||||||
|
label faceI = cFaces[i];
|
||||||
|
|
||||||
|
if (mesh().isInternalFace(faceI))
|
||||||
|
{
|
||||||
|
label nbrCellI = own[faceI];
|
||||||
|
if (nbrCellI == cellI)
|
||||||
|
{
|
||||||
|
nbrCellI = nei[faceI];
|
||||||
|
}
|
||||||
|
const cell& nbrFaces = mesh().cells()[nbrCellI];
|
||||||
|
|
||||||
|
forAll(nbrFaces, j)
|
||||||
|
{
|
||||||
|
label nbrFaceI = nbrFaces[j];
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
mesh().isInternalFace(nbrFaceI)
|
||||||
|
|| validBFace[nbrFaceI-mesh().nInternalFaces()]
|
||||||
|
)
|
||||||
|
{
|
||||||
|
label nbrGlobalI = globalNumbering().toGlobal(nbrFaceI);
|
||||||
|
|
||||||
|
// Check if already there. Note:should use hashset?
|
||||||
|
if (findIndex(allGlobalFaces, nbrGlobalI) == -1)
|
||||||
|
{
|
||||||
|
allGlobalFaces.append(nbrGlobalI);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const labelList& nbrGlobalFaces =
|
||||||
|
neiGlobal[faceI-mesh().nInternalFaces()];
|
||||||
|
|
||||||
|
forAll(nbrGlobalFaces, j)
|
||||||
|
{
|
||||||
|
label nbrGlobalI = nbrGlobalFaces[j];
|
||||||
|
|
||||||
|
// Check if already there. Note:should use hashset?
|
||||||
|
if (findIndex(allGlobalFaces, nbrGlobalI) == -1)
|
||||||
|
{
|
||||||
|
allGlobalFaces.append(nbrGlobalI);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
globalCellFaces[cellI] = allGlobalFaces;
|
||||||
|
//Pout<< "** cell:" << cellI
|
||||||
|
// << " at:" << mesh().cellCentres()[cellI]
|
||||||
|
// << endl;
|
||||||
|
//const labelList& globalFaces = globalCellFaces[cellI];
|
||||||
|
//forAll(globalFaces, i)
|
||||||
|
//{
|
||||||
|
// label faceI = globalNumbering().toLocal(globalFaces[i]);
|
||||||
|
// Pout<< " face:" << faceI
|
||||||
|
// << " at:" << mesh().faceCentres()[faceI]
|
||||||
|
// << endl;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::CFCFaceToCellStencil::CFCFaceToCellStencil(const polyMesh& mesh)
|
||||||
|
:
|
||||||
|
faceToCellStencil(mesh)
|
||||||
|
{
|
||||||
|
// Calculate per cell the (face) connected cells (in global numbering)
|
||||||
|
calcCellStencil(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,82 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
Foam::CFCFaceToCellStencil
|
||||||
|
|
||||||
|
Description
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
CFCFaceToCellStencil.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef CFCFaceToCellStencil_H
|
||||||
|
#define CFCFaceToCellStencil_H
|
||||||
|
|
||||||
|
#include "faceToCellStencil.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class CFCFaceToCellStencil Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class CFCFaceToCellStencil
|
||||||
|
:
|
||||||
|
public faceToCellStencil
|
||||||
|
{
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
void calcFaceBoundaryData(labelListList& neiGlobal) const;
|
||||||
|
|
||||||
|
void calcCellStencil(labelListList& globalCellFaces) const;
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
CFCFaceToCellStencil(const CFCFaceToCellStencil&);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const CFCFaceToCellStencil&);
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from mesh
|
||||||
|
explicit CFCFaceToCellStencil(const polyMesh& mesh);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "faceToCellStencil.H"
|
||||||
|
#include "polyMesh.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::faceToCellStencil::faceToCellStencil(const polyMesh& mesh)
|
||||||
|
:
|
||||||
|
mesh_(mesh),
|
||||||
|
globalNumbering_(mesh_.nFaces())
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,108 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ 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
|
||||||
|
Foam::faceToCellStencil
|
||||||
|
|
||||||
|
Description
|
||||||
|
baseclass for extended cell centred addressing. Contains per cell a
|
||||||
|
list of neighbouring faces in global addressing.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
faceToCellStencil.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef faceToCellStencil_H
|
||||||
|
#define faceToCellStencil_H
|
||||||
|
|
||||||
|
#include "globalIndex.H"
|
||||||
|
#include "boolList.H"
|
||||||
|
#include "HashSet.H"
|
||||||
|
#include "indirectPrimitivePatch.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
class polyMesh;
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class faceToCellStencil Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class faceToCellStencil
|
||||||
|
:
|
||||||
|
public labelListList
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
const polyMesh& mesh_;
|
||||||
|
|
||||||
|
//- Global numbering for faces
|
||||||
|
const globalIndex globalNumbering_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
faceToCellStencil(const faceToCellStencil&);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const faceToCellStencil&);
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from mesh
|
||||||
|
explicit faceToCellStencil(const polyMesh&);
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
const polyMesh& mesh() const
|
||||||
|
{
|
||||||
|
return mesh_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Global numbering for faces
|
||||||
|
const globalIndex& globalNumbering() const
|
||||||
|
{
|
||||||
|
return globalNumbering_;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -47,14 +47,17 @@ License
|
|||||||
#include "quadraticLinearFitPolynomial.H"
|
#include "quadraticLinearFitPolynomial.H"
|
||||||
#include "skewCorrectionVectors.H"
|
#include "skewCorrectionVectors.H"
|
||||||
|
|
||||||
#include "centredCECStencilObject.H"
|
|
||||||
#include "centredCFCStencilObject.H"
|
#include "centredCECCellToFaceStencilObject.H"
|
||||||
#include "centredCPCStencilObject.H"
|
#include "centredCFCCellToFaceStencilObject.H"
|
||||||
#include "centredFECStencilObject.H"
|
#include "centredCPCCellToFaceStencilObject.H"
|
||||||
#include "upwindCECStencilObject.H"
|
#include "centredFECCellToFaceStencilObject.H"
|
||||||
#include "upwindCFCStencilObject.H"
|
#include "upwindCECCellToFaceStencilObject.H"
|
||||||
#include "upwindCPCStencilObject.H"
|
#include "upwindCFCCellToFaceStencilObject.H"
|
||||||
#include "upwindFECStencilObject.H"
|
#include "upwindCPCCellToFaceStencilObject.H"
|
||||||
|
#include "upwindFECCellToFaceStencilObject.H"
|
||||||
|
|
||||||
|
#include "centredCFCFaceToCellStencilObject.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -111,14 +114,16 @@ void Foam::fvMesh::clearAddressing()
|
|||||||
CentredFitData<quadraticLinearFitPolynomial>::Delete(*this);
|
CentredFitData<quadraticLinearFitPolynomial>::Delete(*this);
|
||||||
skewCorrectionVectors::Delete(*this);
|
skewCorrectionVectors::Delete(*this);
|
||||||
|
|
||||||
centredCECStencilObject::Delete(*this);
|
centredCECCellToFaceStencilObject::Delete(*this);
|
||||||
centredCFCStencilObject::Delete(*this);
|
centredCFCCellToFaceStencilObject::Delete(*this);
|
||||||
centredCPCStencilObject::Delete(*this);
|
centredCPCCellToFaceStencilObject::Delete(*this);
|
||||||
centredFECStencilObject::Delete(*this);
|
centredFECCellToFaceStencilObject::Delete(*this);
|
||||||
upwindCECStencilObject::Delete(*this);
|
upwindCECCellToFaceStencilObject::Delete(*this);
|
||||||
upwindCFCStencilObject::Delete(*this);
|
upwindCFCCellToFaceStencilObject::Delete(*this);
|
||||||
upwindCPCStencilObject::Delete(*this);
|
upwindCPCCellToFaceStencilObject::Delete(*this);
|
||||||
upwindFECStencilObject::Delete(*this);
|
upwindFECCellToFaceStencilObject::Delete(*this);
|
||||||
|
|
||||||
|
centredCFCFaceToCellStencilObject::Delete(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@ License
|
|||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "SVD.H"
|
#include "SVD.H"
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "extendedCentredStencil.H"
|
#include "extendedCentredCellToFaceStencil.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -37,12 +37,17 @@ template<class Polynomial>
|
|||||||
Foam::CentredFitData<Polynomial>::CentredFitData
|
Foam::CentredFitData<Polynomial>::CentredFitData
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const extendedCentredStencil& stencil,
|
const extendedCentredCellToFaceStencil& stencil,
|
||||||
const scalar linearLimitFactor,
|
const scalar linearLimitFactor,
|
||||||
const scalar centralWeight
|
const scalar centralWeight
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
FitData<CentredFitData<Polynomial>, extendedCentredStencil, Polynomial>
|
FitData
|
||||||
|
<
|
||||||
|
CentredFitData<Polynomial>,
|
||||||
|
extendedCentredCellToFaceStencil,
|
||||||
|
Polynomial
|
||||||
|
>
|
||||||
(
|
(
|
||||||
mesh, stencil, linearLimitFactor, centralWeight
|
mesh, stencil, linearLimitFactor, centralWeight
|
||||||
),
|
),
|
||||||
@ -83,8 +88,12 @@ void Foam::CentredFitData<Polynomial>::calcFit()
|
|||||||
|
|
||||||
for(label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
for(label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||||
{
|
{
|
||||||
FitData<CentredFitData<Polynomial>, extendedCentredStencil, Polynomial>::
|
FitData
|
||||||
calcFit(coeffs_[facei], stencilPoints[facei], w[facei], facei);
|
<
|
||||||
|
CentredFitData<Polynomial>,
|
||||||
|
extendedCentredCellToFaceStencil,
|
||||||
|
Polynomial
|
||||||
|
>::calcFit(coeffs_[facei], stencilPoints[facei], w[facei], facei);
|
||||||
}
|
}
|
||||||
|
|
||||||
const surfaceScalarField::GeometricBoundaryField& bw = w.boundaryField();
|
const surfaceScalarField::GeometricBoundaryField& bw = w.boundaryField();
|
||||||
@ -101,7 +110,9 @@ void Foam::CentredFitData<Polynomial>::calcFit()
|
|||||||
{
|
{
|
||||||
FitData
|
FitData
|
||||||
<
|
<
|
||||||
CentredFitData<Polynomial>, extendedCentredStencil, Polynomial
|
CentredFitData<Polynomial>,
|
||||||
|
extendedCentredCellToFaceStencil,
|
||||||
|
Polynomial
|
||||||
>::calcFit(coeffs_[facei], stencilPoints[facei], pw[i], facei);
|
>::calcFit(coeffs_[facei], stencilPoints[facei], pw[i], facei);
|
||||||
facei++;
|
facei++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,7 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
class extendedCentredStencil;
|
class extendedCentredCellToFaceStencil;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class CentredFitData Declaration
|
Class CentredFitData Declaration
|
||||||
@ -52,7 +52,7 @@ class extendedCentredStencil;
|
|||||||
template<class Polynomial>
|
template<class Polynomial>
|
||||||
class CentredFitData
|
class CentredFitData
|
||||||
:
|
:
|
||||||
public FitData<CentredFitData<Polynomial>, extendedCentredStencil, Polynomial>
|
public FitData<CentredFitData<Polynomial>, extendedCentredCellToFaceStencil, Polynomial>
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ public:
|
|||||||
CentredFitData
|
CentredFitData
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const extendedCentredStencil& stencil,
|
const extendedCentredCellToFaceStencil& stencil,
|
||||||
const scalar linearLimitFactor,
|
const scalar linearLimitFactor,
|
||||||
const scalar centralWeight
|
const scalar centralWeight
|
||||||
);
|
);
|
||||||
|
|||||||
@ -119,7 +119,7 @@ public:
|
|||||||
{
|
{
|
||||||
const fvMesh& mesh = this->mesh();
|
const fvMesh& mesh = this->mesh();
|
||||||
|
|
||||||
const extendedCentredStencil& stencil = Stencil::New
|
const extendedCentredCellToFaceStencil& stencil = Stencil::New
|
||||||
(
|
(
|
||||||
mesh
|
mesh
|
||||||
);
|
);
|
||||||
|
|||||||
@ -28,16 +28,14 @@ License
|
|||||||
#include "surfaceFields.H"
|
#include "surfaceFields.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "SVD.H"
|
#include "SVD.H"
|
||||||
#include "syncTools.H"
|
|
||||||
#include "extendedStencil.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Form, class extendedStencil, class Polynomial>
|
template<class Form, class ExtendedStencil, class Polynomial>
|
||||||
Foam::FitData<Form, extendedStencil, Polynomial>::FitData
|
Foam::FitData<Form, ExtendedStencil, Polynomial>::FitData
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const extendedStencil& stencil,
|
const ExtendedStencil& stencil,
|
||||||
const scalar linearLimitFactor,
|
const scalar linearLimitFactor,
|
||||||
const scalar centralWeight
|
const scalar centralWeight
|
||||||
)
|
)
|
||||||
|
|||||||
@ -29,7 +29,7 @@ License
|
|||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "SVD.H"
|
#include "SVD.H"
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "extendedUpwindStencil.H"
|
#include "extendedUpwindCellToFaceStencil.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -37,12 +37,17 @@ template<class Polynomial>
|
|||||||
Foam::UpwindFitData<Polynomial>::UpwindFitData
|
Foam::UpwindFitData<Polynomial>::UpwindFitData
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const extendedUpwindStencil& stencil,
|
const extendedUpwindCellToFaceStencil& stencil,
|
||||||
const scalar linearLimitFactor,
|
const scalar linearLimitFactor,
|
||||||
const scalar centralWeight
|
const scalar centralWeight
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
FitData<UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial>
|
FitData
|
||||||
|
<
|
||||||
|
UpwindFitData<Polynomial>,
|
||||||
|
extendedUpwindCellToFaceStencil,
|
||||||
|
Polynomial
|
||||||
|
>
|
||||||
(
|
(
|
||||||
mesh, stencil, linearLimitFactor, centralWeight
|
mesh, stencil, linearLimitFactor, centralWeight
|
||||||
),
|
),
|
||||||
@ -98,10 +103,18 @@ void Foam::UpwindFitData<Polynomial>::calcFit()
|
|||||||
|
|
||||||
for(label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
for(label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||||
{
|
{
|
||||||
FitData<UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial>::
|
FitData
|
||||||
calcFit(owncoeffs_[facei], ownStencilPoints[facei], w[facei], facei);
|
<
|
||||||
FitData<UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial>::
|
UpwindFitData<Polynomial>,
|
||||||
calcFit(neicoeffs_[facei], neiStencilPoints[facei], w[facei], facei);
|
extendedUpwindCellToFaceStencil,
|
||||||
|
Polynomial
|
||||||
|
>::calcFit(owncoeffs_[facei], ownStencilPoints[facei], w[facei], facei);
|
||||||
|
FitData
|
||||||
|
<
|
||||||
|
UpwindFitData<Polynomial>,
|
||||||
|
extendedUpwindCellToFaceStencil,
|
||||||
|
Polynomial
|
||||||
|
>::calcFit(neicoeffs_[facei], neiStencilPoints[facei], w[facei], facei);
|
||||||
}
|
}
|
||||||
|
|
||||||
const surfaceScalarField::GeometricBoundaryField& bw = w.boundaryField();
|
const surfaceScalarField::GeometricBoundaryField& bw = w.boundaryField();
|
||||||
@ -118,14 +131,18 @@ void Foam::UpwindFitData<Polynomial>::calcFit()
|
|||||||
{
|
{
|
||||||
FitData
|
FitData
|
||||||
<
|
<
|
||||||
UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial
|
UpwindFitData<Polynomial>,
|
||||||
|
extendedUpwindCellToFaceStencil,
|
||||||
|
Polynomial
|
||||||
>::calcFit
|
>::calcFit
|
||||||
(
|
(
|
||||||
owncoeffs_[facei], ownStencilPoints[facei], pw[i], facei
|
owncoeffs_[facei], ownStencilPoints[facei], pw[i], facei
|
||||||
);
|
);
|
||||||
FitData
|
FitData
|
||||||
<
|
<
|
||||||
UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial
|
UpwindFitData<Polynomial>,
|
||||||
|
extendedUpwindCellToFaceStencil,
|
||||||
|
Polynomial
|
||||||
>::calcFit
|
>::calcFit
|
||||||
(
|
(
|
||||||
neicoeffs_[facei], neiStencilPoints[facei], pw[i], facei
|
neicoeffs_[facei], neiStencilPoints[facei], pw[i], facei
|
||||||
|
|||||||
@ -44,7 +44,7 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
class extendedUpwindStencil;
|
class extendedUpwindCellToFaceStencil;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class UpwindFitData Declaration
|
Class UpwindFitData Declaration
|
||||||
@ -53,7 +53,12 @@ class extendedUpwindStencil;
|
|||||||
template<class Polynomial>
|
template<class Polynomial>
|
||||||
class UpwindFitData
|
class UpwindFitData
|
||||||
:
|
:
|
||||||
public FitData<UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial>
|
public FitData
|
||||||
|
<
|
||||||
|
UpwindFitData<Polynomial>,
|
||||||
|
extendedUpwindCellToFaceStencil,
|
||||||
|
Polynomial
|
||||||
|
>
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
@ -84,7 +89,7 @@ public:
|
|||||||
UpwindFitData
|
UpwindFitData
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const extendedUpwindStencil& stencil,
|
const extendedUpwindCellToFaceStencil& stencil,
|
||||||
const scalar linearLimitFactor,
|
const scalar linearLimitFactor,
|
||||||
const scalar centralWeight
|
const scalar centralWeight
|
||||||
);
|
);
|
||||||
|
|||||||
@ -126,7 +126,7 @@ public:
|
|||||||
{
|
{
|
||||||
const fvMesh& mesh = this->mesh();
|
const fvMesh& mesh = this->mesh();
|
||||||
|
|
||||||
const extendedUpwindStencil& stencil = Stencil::New
|
const extendedUpwindCellToFaceStencil& stencil = Stencil::New
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
scalar(0.5)
|
scalar(0.5)
|
||||||
|
|||||||
@ -26,7 +26,7 @@ License
|
|||||||
|
|
||||||
#include "CentredFitScheme.H"
|
#include "CentredFitScheme.H"
|
||||||
#include "biLinearFitPolynomial.H"
|
#include "biLinearFitPolynomial.H"
|
||||||
#include "centredCFCStencilObject.H"
|
#include "centredCFCCellToFaceStencilObject.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ namespace Foam
|
|||||||
(
|
(
|
||||||
biLinearFit,
|
biLinearFit,
|
||||||
biLinearFitPolynomial,
|
biLinearFitPolynomial,
|
||||||
centredCFCStencilObject
|
centredCFCCellToFaceStencilObject
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ License
|
|||||||
|
|
||||||
#include "UpwindFitScheme.H"
|
#include "UpwindFitScheme.H"
|
||||||
#include "cubicUpwindFitPolynomial.H"
|
#include "cubicUpwindFitPolynomial.H"
|
||||||
#include "upwindCFCStencilObject.H"
|
#include "upwindCFCCellToFaceStencilObject.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ namespace Foam
|
|||||||
(
|
(
|
||||||
cubicUpwindFit,
|
cubicUpwindFit,
|
||||||
cubicUpwindFitPolynomial,
|
cubicUpwindFitPolynomial,
|
||||||
upwindCFCStencilObject
|
upwindCFCCellToFaceStencilObject
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ License
|
|||||||
|
|
||||||
#include "CentredFitScheme.H"
|
#include "CentredFitScheme.H"
|
||||||
#include "linearFitPolynomial.H"
|
#include "linearFitPolynomial.H"
|
||||||
#include "centredCFCStencilObject.H"
|
#include "centredCFCCellToFaceStencilObject.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ namespace Foam
|
|||||||
(
|
(
|
||||||
linearFit,
|
linearFit,
|
||||||
linearFitPolynomial,
|
linearFitPolynomial,
|
||||||
centredCFCStencilObject
|
centredCFCCellToFaceStencilObject
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ License
|
|||||||
|
|
||||||
#include "CentredFitScheme.H"
|
#include "CentredFitScheme.H"
|
||||||
#include "quadraticFitPolynomial.H"
|
#include "quadraticFitPolynomial.H"
|
||||||
#include "centredCFCStencilObject.H"
|
#include "centredCFCCellToFaceStencilObject.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ namespace Foam
|
|||||||
(
|
(
|
||||||
quadraticFit,
|
quadraticFit,
|
||||||
quadraticFitPolynomial,
|
quadraticFitPolynomial,
|
||||||
centredCFCStencilObject
|
centredCFCCellToFaceStencilObject
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ License
|
|||||||
|
|
||||||
#include "CentredFitScheme.H"
|
#include "CentredFitScheme.H"
|
||||||
#include "quadraticLinearFitPolynomial.H"
|
#include "quadraticLinearFitPolynomial.H"
|
||||||
#include "centredCFCStencilObject.H"
|
#include "centredCFCCellToFaceStencilObject.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ namespace Foam
|
|||||||
(
|
(
|
||||||
quadraticLinearFit,
|
quadraticLinearFit,
|
||||||
quadraticLinearFitPolynomial,
|
quadraticLinearFitPolynomial,
|
||||||
centredCFCStencilObject
|
centredCFCCellToFaceStencilObject
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ License
|
|||||||
|
|
||||||
#include "UpwindFitScheme.H"
|
#include "UpwindFitScheme.H"
|
||||||
#include "quadraticLinearUpwindFitPolynomial.H"
|
#include "quadraticLinearUpwindFitPolynomial.H"
|
||||||
#include "upwindCFCStencilObject.H"
|
#include "upwindCFCCellToFaceStencilObject.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ namespace Foam
|
|||||||
(
|
(
|
||||||
quadraticLinearUpwindFit,
|
quadraticLinearUpwindFit,
|
||||||
quadraticLinearUpwindFitPolynomial,
|
quadraticLinearUpwindFitPolynomial,
|
||||||
upwindCFCStencilObject
|
upwindCFCCellToFaceStencilObject
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ License
|
|||||||
|
|
||||||
#include "UpwindFitScheme.H"
|
#include "UpwindFitScheme.H"
|
||||||
#include "quadraticUpwindFitPolynomial.H"
|
#include "quadraticUpwindFitPolynomial.H"
|
||||||
#include "upwindFECStencilObject.H"
|
#include "upwindFECCellToFaceStencilObject.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ namespace Foam
|
|||||||
(
|
(
|
||||||
quadraticUpwindFit,
|
quadraticUpwindFit,
|
||||||
quadraticUpwindFitPolynomial,
|
quadraticUpwindFitPolynomial,
|
||||||
upwindFECStencilObject
|
upwindFECCellToFaceStencilObject
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -244,6 +244,8 @@ snapControls
|
|||||||
// Settings for the layer addition.
|
// Settings for the layer addition.
|
||||||
addLayersControls
|
addLayersControls
|
||||||
{
|
{
|
||||||
|
relativeSizes true;
|
||||||
|
|
||||||
// Per final patch (so not geometry!) the layer information
|
// Per final patch (so not geometry!) the layer information
|
||||||
layers
|
layers
|
||||||
{
|
{
|
||||||
@ -264,7 +266,7 @@ addLayersControls
|
|||||||
// is the
|
// is the
|
||||||
// thickness of the layer furthest away from the wall.
|
// thickness of the layer furthest away from the wall.
|
||||||
// Relative to undistorted size of cell outside layer.
|
// Relative to undistorted size of cell outside layer.
|
||||||
finalLayerRatio 0.5;
|
finalLayerThickness 0.5;
|
||||||
|
|
||||||
//- Minimum thickness of cell layer. If for any reason layer
|
//- Minimum thickness of cell layer. If for any reason layer
|
||||||
// cannot be above minThickness do not add layer.
|
// cannot be above minThickness do not add layer.
|
||||||
|
|||||||
Reference in New Issue
Block a user