Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
henry
2009-06-04 17:36:12 +01:00
79 changed files with 3138 additions and 558 deletions

View File

@ -0,0 +1,4 @@
testExtendedStencil.C
EXE = $(FOAM_USER_APPBIN)/testExtendedStencil

View File

@ -0,0 +1,6 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lfiniteVolume

View 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;
}
// ************************************************************************* //

View File

@ -39,26 +39,40 @@ fvMeshMapper = fvMesh/fvMeshMapper
$(fvMeshMapper)/fvPatchMapper.C
$(fvMeshMapper)/fvSurfaceMapper.C
extendedStencil = fvMesh/extendedStencil
$(extendedStencil)/extendedStencil.C
$(extendedStencil)/extendedUpwindStencil.C
$(extendedStencil)/extendedCentredStencil.C
$(extendedStencil)/faceStencil/faceStencil.C
$(extendedStencil)/faceStencil/faceEdgeCellStencil.C
$(extendedStencil)/faceStencil/cellFaceCellStencil.C
$(extendedStencil)/faceStencil/cellPointCellStencil.C
$(extendedStencil)/faceStencil/cellEdgeCellStencil.C
cellToCell = $(extendedStencil)/cellToCell
$(cellToCell)/fullStencils/cellToCellStencil.C
$(cellToCell)/fullStencils/CFCCellToCellStencil.C
$(cellToCell)/fullStencils/CPCCellToCellStencil.C
$(cellToCell)/fullStencils/CECCellToCellStencil.C
$(extendedStencil)/extendedStencilMeshObjects/centredCECStencilObject.C
$(extendedStencil)/extendedStencilMeshObjects/centredCFCStencilObject.C
$(extendedStencil)/extendedStencilMeshObjects/centredCPCStencilObject.C
$(extendedStencil)/extendedStencilMeshObjects/centredFECStencilObject.C
cellToFace = $(extendedStencil)/cellToFace
$(cellToFace)/fullStencils/cellToFaceStencil.C
$(cellToFace)/fullStencils/CFCCellToFaceStencil.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)/fvPatchField/fvPatchFields.C

View File

@ -39,7 +39,7 @@ SourceFiles
#include "snGradScheme.H"
#include "quadraticFitSnGradData.H"
#include "extendedStencil.H"
#include "extendedCellToFaceStencil.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -133,7 +133,7 @@ public:
centralWeight_
);
const extendedStencil& stencil = qfd.stencil();
const extendedCellToFaceStencil& stencil = qfd.stencil();
const List<scalarList>& f = qfd.fit();
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > sft

View File

@ -38,7 +38,7 @@ SourceFiles
#include "MeshObject.H"
#include "fvMesh.H"
#include "extendedStencil.H"
#include "extendedCellToFaceStencil.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -62,7 +62,7 @@ class quadraticFitSnGradData
const label minSize_;
//- Extended stencil addressing
extendedStencil stencil_;
extendedCellToFaceStencil stencil_;
//- For each cell in the mesh store the values which multiply the
// values of the stencil to obtain the gradient for each direction
@ -107,7 +107,7 @@ public:
// Member functions
//- Return reference to the stencil
const extendedStencil& stencil() const
const extendedCellToFaceStencil& stencil() const
{
return stencil_;
}

View File

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "cellEdgeCellStencil.H"
#include "CECCellToCellStencil.H"
#include "syncTools.H"
//#include "meshTools.H"
//#include "OFstream.H"
@ -33,7 +33,7 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Calculates per edge the neighbour data (= edgeCells)
void Foam::cellEdgeCellStencil::calcEdgeBoundaryData
void Foam::CECCellToCellStencil::calcEdgeBoundaryData
(
const boolList& isValidBFace,
const labelList& boundaryEdges,
@ -72,7 +72,7 @@ void Foam::cellEdgeCellStencil::calcEdgeBoundaryData
// Calculates per cell the neighbour data (= cell or boundary in global
// numbering). First element is always cell itself!
void Foam::cellEdgeCellStencil::calcCellStencil
void Foam::CECCellToCellStencil::calcCellStencil
(
labelListList& globalCellCells
) const
@ -189,20 +189,12 @@ void Foam::cellEdgeCellStencil::calcCellStencil
// * * * * * * * * * * * * * * * * 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)
labelListList globalCellCells;
calcCellStencil(globalCellCells);
// Add stencils of neighbouring cells to create faceStencil
labelListList faceStencil;
calcFaceStencil(globalCellCells, faceStencil);
// Transfer to *this
transfer(faceStencil);
calcCellStencil(*this);
}

View File

@ -23,19 +23,19 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::cellEdgeCellStencil
Foam::CECCellToCellStencil
Description
SourceFiles
cellEdgeCellStencil.C
CECCellToCellStencil.C
\*---------------------------------------------------------------------------*/
#ifndef cellEdgeCellStencil_H
#define cellEdgeCellStencil_H
#ifndef CECCellToCellStencil_H
#define CECCellToCellStencil_H
#include "faceStencil.H"
#include "cellToCellStencil.H"
#include "boolList.H"
#include "HashSet.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
@ -68,10 +68,10 @@ class cellEdgeCellStencil
//- Disallow default bitwise copy construct
cellEdgeCellStencil(const cellEdgeCellStencil&);
CECCellToCellStencil(const CECCellToCellStencil&);
//- Disallow default bitwise assignment
void operator=(const cellEdgeCellStencil&);
void operator=(const CECCellToCellStencil&);
public:
@ -79,7 +79,7 @@ public:
// Constructors
//- Construct from all cells and boundary faces
explicit cellEdgeCellStencil(const polyMesh&);
explicit CECCellToCellStencil(const polyMesh&);
};

View File

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "cellFaceCellStencil.H"
#include "CFCCellToCellStencil.H"
#include "syncTools.H"
#include "SortableList.H"
#include "emptyPolyPatch.H"
@ -32,7 +32,7 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Calculates per face the neighbour data (= cell or boundary face)
void Foam::cellFaceCellStencil::calcFaceBoundaryData
void Foam::CFCCellToCellStencil::calcFaceBoundaryData
(
labelList& neiGlobal
) const
@ -85,7 +85,7 @@ void Foam::cellFaceCellStencil::calcFaceBoundaryData
// Calculates per cell the neighbour data (= cell or boundary in global
// numbering). First element is always cell itself!
void Foam::cellFaceCellStencil::calcCellStencil(labelListList& globalCellCells)
void Foam::CFCCellToCellStencil::calcCellStencil(labelListList& globalCellCells)
const
{
const label nBnd = mesh().nFaces()-mesh().nInternalFaces();
@ -147,20 +147,12 @@ void Foam::cellFaceCellStencil::calcCellStencil(labelListList& globalCellCells)
// * * * * * * * * * * * * * * * * 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)
labelListList globalCellCells;
calcCellStencil(globalCellCells);
// Add stencils of neighbouring cells to create faceStencil
labelListList faceStencil;
calcFaceStencil(globalCellCells, faceStencil);
// Transfer to *this
transfer(faceStencil);
calcCellStencil(*this);
}

View File

@ -23,19 +23,19 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::cellFaceCellStencil
Foam::CFCCellToCellStencil
Description
SourceFiles
cellFaceCellStencil.C
CFCCellToCellStencil.C
\*---------------------------------------------------------------------------*/
#ifndef cellFaceCellStencil_H
#define cellFaceCellStencil_H
#ifndef CFCCellToCellStencil_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
@ -57,17 +57,17 @@ class cellFaceCellStencil
void calcCellStencil(labelListList& globalCellCells) const;
//- Disallow default bitwise copy construct
cellFaceCellStencil(const cellFaceCellStencil&);
CFCCellToCellStencil(const CFCCellToCellStencil&);
//- Disallow default bitwise assignment
void operator=(const cellFaceCellStencil&);
void operator=(const CFCCellToCellStencil&);
public:
// Constructors
//- Construct from mesh
explicit cellFaceCellStencil(const polyMesh& mesh);
explicit CFCCellToCellStencil(const polyMesh& mesh);
};

View File

@ -24,13 +24,13 @@ License
\*---------------------------------------------------------------------------*/
#include "cellPointCellStencil.H"
#include "CPCCellToCellStencil.H"
#include "syncTools.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Calculates per point the neighbour data (= pointCells)
void Foam::cellPointCellStencil::calcPointBoundaryData
void Foam::CPCCellToCellStencil::calcPointBoundaryData
(
const boolList& isValidBFace,
const labelList& boundaryPoints,
@ -69,7 +69,7 @@ void Foam::cellPointCellStencil::calcPointBoundaryData
// Calculates per cell the neighbour data (= cell or boundary in global
// numbering). First element is always cell itself!
void Foam::cellPointCellStencil::calcCellStencil
void Foam::CPCCellToCellStencil::calcCellStencil
(
labelListList& globalCellCells
) const
@ -154,20 +154,13 @@ void Foam::cellPointCellStencil::calcCellStencil
// * * * * * * * * * * * * * * * * 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)
labelListList globalCellCells;
calcCellStencil(globalCellCells);
// Add stencils of neighbouring cells to create faceStencil
labelListList faceStencil;
calcFaceStencil(globalCellCells, faceStencil);
// Transfer to *this
transfer(faceStencil);
calcCellStencil(*this);
}

View File

@ -23,19 +23,19 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::cellPointCellStencil
Foam::CPCCellToCellStencil
Description
SourceFiles
cellPointCellStencil.C
CPCCellToCellStencil.C
\*---------------------------------------------------------------------------*/
#ifndef cellPointCellStencil_H
#define cellPointCellStencil_H
#ifndef CPCCellToCellStencil_H
#define CPCCellToCellStencil_H
#include "faceStencil.H"
#include "cellToCellStencil.H"
#include "boolList.H"
#include "HashSet.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
@ -67,10 +67,10 @@ class cellPointCellStencil
//- Disallow default bitwise copy construct
cellPointCellStencil(const cellPointCellStencil&);
CPCCellToCellStencil(const CPCCellToCellStencil&);
//- Disallow default bitwise assignment
void operator=(const cellPointCellStencil&);
void operator=(const CPCCellToCellStencil&);
public:
@ -78,7 +78,7 @@ public:
// Constructors
//- Construct from all cells and boundary faces
explicit cellPointCellStencil(const polyMesh&);
explicit CPCCellToCellStencil(const polyMesh&);
};

View File

@ -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())
{}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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);
}
// ************************************************************************* //

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::centredFECStencilObject
Foam::centredCECCellToFaceStencilObject
Description
@ -31,11 +31,11 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef centredFECStencilObject_H
#define centredFECStencilObject_H
#ifndef centredCECCellToFaceStencilObject_H
#define centredCECCellToFaceStencilObject_H
#include "extendedCentredStencil.H"
#include "faceEdgeCellStencil.H"
#include "extendedCentredCellToFaceStencil.H"
#include "CECCellToFaceStencil.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 extendedCentredStencil
public MeshObject<fvMesh, centredCECCellToFaceStencilObject>,
public extendedCentredCellToFaceStencil
{
public:
TypeName("centredCFCStencil");
TypeName("centredCECCellToFaceStencil");
// Constructors
//- Construct from uncompacted face stencil
explicit centredFECStencilObject
explicit centredCECCellToFaceStencilObject
(
const fvMesh& mesh
)
:
MeshObject<fvMesh, centredFECStencilObject>(mesh),
extendedCentredStencil(faceEdgeCellStencil(mesh))
MeshObject<fvMesh, centredCECCellToFaceStencilObject>(mesh),
extendedCentredCellToFaceStencil(CECCellToFaceStencil(mesh))
{}
// Destructor
virtual ~centredFECStencilObject()
virtual ~centredCECCellToFaceStencilObject()
{}
};

View File

@ -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);
}
// ************************************************************************* //

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::centredCFCStencilObject
Foam::centredCFCCellToFaceStencilObject
Description
@ -31,11 +31,11 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef centredCFCStencilObject_H
#define centredCFCStencilObject_H
#ifndef centredCFCCellToFaceStencilObject_H
#define centredCFCCellToFaceStencilObject_H
#include "extendedCentredStencil.H"
#include "cellFaceCellStencil.H"
#include "extendedCentredCellToFaceStencil.H"
#include "CFCCellToFaceStencil.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 extendedCentredStencil
public MeshObject<fvMesh, centredCFCCellToFaceStencilObject>,
public extendedCentredCellToFaceStencil
{
public:
TypeName("centredCFCStencil");
TypeName("centredCFCCellToFaceStencil");
// Constructors
//- Construct from uncompacted face stencil
explicit centredCFCStencilObject
explicit centredCFCCellToFaceStencilObject
(
const fvMesh& mesh
)
:
MeshObject<fvMesh, centredCFCStencilObject>(mesh),
extendedCentredStencil(cellFaceCellStencil(mesh))
MeshObject<fvMesh, centredCFCCellToFaceStencilObject>(mesh),
extendedCentredCellToFaceStencil(CFCCellToFaceStencil(mesh))
{}
//- Destructor
virtual ~centredCFCStencilObject()
virtual ~centredCFCCellToFaceStencilObject()
{}
};

View File

@ -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);
}
// ************************************************************************* //

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::centredCPCStencilObject
Foam::centredCPCCellToFaceStencilObject
Description
@ -31,11 +31,11 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef centredCPCStencilObject_H
#define centredCPCStencilObject_H
#ifndef centredCPCCellToFaceStencilObject_H
#define centredCPCCellToFaceStencilObject_H
#include "extendedCentredStencil.H"
#include "cellPointCellStencil.H"
#include "extendedCentredCellToFaceStencil.H"
#include "CPCCellToFaceStencil.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 extendedCentredStencil
public MeshObject<fvMesh, centredCPCCellToFaceStencilObject>,
public extendedCentredCellToFaceStencil
{
public:
TypeName("centredCFCStencil");
TypeName("centredCFCCellToFaceStencil");
// Constructors
//- Construct from uncompacted face stencil
explicit centredCPCStencilObject
explicit centredCPCCellToFaceStencilObject
(
const fvMesh& mesh
)
:
MeshObject<fvMesh, centredCPCStencilObject>(mesh),
extendedCentredStencil(cellPointCellStencil(mesh))
MeshObject<fvMesh, centredCPCCellToFaceStencilObject>(mesh),
extendedCentredCellToFaceStencil(CPCCellToFaceStencil(mesh))
{}
// Destructor
virtual ~centredCPCStencilObject()
virtual ~centredCPCCellToFaceStencilObject()
{}
};

View File

@ -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);
}
// ************************************************************************* //

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::centredCECStencilObject
Foam::centredFECCellToFaceStencilObject
Description
@ -31,11 +31,11 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef centredCECStencilObject_H
#define centredCECStencilObject_H
#ifndef centredFECCellToFaceStencilObject_H
#define centredFECCellToFaceStencilObject_H
#include "extendedCentredStencil.H"
#include "cellEdgeCellStencil.H"
#include "extendedCentredCellToFaceStencil.H"
#include "FECCellToFaceStencil.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 extendedCentredStencil
public MeshObject<fvMesh, centredFECCellToFaceStencilObject>,
public extendedCentredCellToFaceStencil
{
public:
TypeName("centredCECStencil");
TypeName("centredCFCCellToFaceStencil");
// Constructors
//- Construct from uncompacted face stencil
explicit centredCECStencilObject
explicit centredFECCellToFaceStencilObject
(
const fvMesh& mesh
)
:
MeshObject<fvMesh, centredCECStencilObject>(mesh),
extendedCentredStencil(cellEdgeCellStencil(mesh))
MeshObject<fvMesh, centredFECCellToFaceStencilObject>(mesh),
extendedCentredCellToFaceStencil(FECCellToFaceStencil(mesh))
{}
// Destructor
virtual ~centredCECStencilObject()
virtual ~centredFECCellToFaceStencilObject()
{}
};

View File

@ -24,14 +24,14 @@ License
\*---------------------------------------------------------------------------*/
#include "centredFECStencilObject.H"
#include "upwindCECCellToFaceStencilObject.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(centredFECStencilObject, 0);
defineTypeNameAndDebug(upwindCECCellToFaceStencilObject, 0);
}

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::upwindCFCStencilObject
Foam::upwindCECCellToFaceStencilObject
Description
@ -31,11 +31,11 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef upwindCFCStencilObject_H
#define upwindCFCStencilObject_H
#ifndef upwindCECCellToFaceStencilObject_H
#define upwindCECCellToFaceStencilObject_H
#include "extendedUpwindStencil.H"
#include "cellFaceCellStencil.H"
#include "extendedUpwindCellToFaceStencil.H"
#include "CECCellToFaceStencil.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 extendedUpwindStencil
public MeshObject<fvMesh, upwindCECCellToFaceStencilObject>,
public extendedUpwindCellToFaceStencil
{
public:
TypeName("upwindCFCStencil");
TypeName("upwindCFCCellToFaceStencil");
// Constructors
//- Construct from uncompacted face stencil
explicit upwindCFCStencilObject
explicit upwindCECCellToFaceStencilObject
(
const fvMesh& mesh,
const scalar minOpposedness
)
:
MeshObject<fvMesh, upwindCFCStencilObject>(mesh),
extendedUpwindStencil(cellFaceCellStencil(mesh), minOpposedness)
MeshObject<fvMesh, upwindCECCellToFaceStencilObject>(mesh),
extendedUpwindCellToFaceStencil
(
CECCellToFaceStencil(mesh),
minOpposedness
)
{}
// Destructor
virtual ~upwindCFCStencilObject()
virtual ~upwindCECCellToFaceStencilObject()
{}
};

View File

@ -24,14 +24,14 @@ License
\*---------------------------------------------------------------------------*/
#include "centredCECStencilObject.H"
#include "upwindCFCCellToFaceStencilObject.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(centredCECStencilObject, 0);
defineTypeNameAndDebug(upwindCFCCellToFaceStencilObject, 0);
}

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::upwindCPCStencilObject
Foam::upwindCFCCellToFaceStencilObject
Description
@ -31,11 +31,11 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef upwindCPCStencilObject_H
#define upwindCPCStencilObject_H
#ifndef upwindCFCCellToFaceStencilObject_H
#define upwindCFCCellToFaceStencilObject_H
#include "extendedUpwindStencil.H"
#include "cellPointCellStencil.H"
#include "extendedUpwindCellToFaceStencil.H"
#include "FECCellToFaceStencil.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 extendedUpwindStencil
public MeshObject<fvMesh, upwindCFCCellToFaceStencilObject>,
public extendedUpwindCellToFaceStencil
{
public:
TypeName("upwindCFCStencil");
TypeName("upwindCFCCellToFaceStencil");
// Constructors
//- Construct from uncompacted face stencil
explicit upwindCPCStencilObject
explicit upwindCFCCellToFaceStencilObject
(
const fvMesh& mesh,
const scalar minOpposedness
)
:
MeshObject<fvMesh, upwindCPCStencilObject>(mesh),
extendedUpwindStencil(cellPointCellStencil(mesh), minOpposedness)
MeshObject<fvMesh, upwindCFCCellToFaceStencilObject>(mesh),
extendedUpwindCellToFaceStencil
(
FECCellToFaceStencil(mesh),
minOpposedness
)
{}
// Destructor
virtual ~upwindCPCStencilObject()
virtual ~upwindCFCCellToFaceStencilObject()
{}
};

View File

@ -24,14 +24,14 @@ License
\*---------------------------------------------------------------------------*/
#include "centredCPCStencilObject.H"
#include "upwindCPCCellToFaceStencilObject.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(centredCPCStencilObject, 0);
defineTypeNameAndDebug(upwindCPCCellToFaceStencilObject, 0);
}

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::upwindCECStencilObject
Foam::upwindCPCCellToFaceStencilObject
Description
@ -31,11 +31,11 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef upwindCECStencilObject_H
#define upwindCECStencilObject_H
#ifndef upwindCPCCellToFaceStencilObject_H
#define upwindCPCCellToFaceStencilObject_H
#include "extendedUpwindStencil.H"
#include "cellEdgeCellStencil.H"
#include "extendedUpwindCellToFaceStencil.H"
#include "CPCCellToFaceStencil.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 extendedUpwindStencil
public MeshObject<fvMesh, upwindCPCCellToFaceStencilObject>,
public extendedUpwindCellToFaceStencil
{
public:
TypeName("upwindCFCStencil");
TypeName("upwindCFCCellToFaceStencil");
// Constructors
//- Construct from uncompacted face stencil
explicit upwindCECStencilObject
explicit upwindCPCCellToFaceStencilObject
(
const fvMesh& mesh,
const scalar minOpposedness
)
:
MeshObject<fvMesh, upwindCECStencilObject>(mesh),
extendedUpwindStencil(cellEdgeCellStencil(mesh), minOpposedness)
MeshObject<fvMesh, upwindCPCCellToFaceStencilObject>(mesh),
extendedUpwindCellToFaceStencil
(
CPCCellToFaceStencil(mesh),
minOpposedness
)
{}
// Destructor
virtual ~upwindCECStencilObject()
virtual ~upwindCPCCellToFaceStencilObject()
{}
};

View File

@ -24,14 +24,14 @@ License
\*---------------------------------------------------------------------------*/
#include "centredCFCStencilObject.H"
#include "upwindFECCellToFaceStencilObject.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(centredCFCStencilObject, 0);
defineTypeNameAndDebug(upwindFECCellToFaceStencilObject, 0);
}

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::upwindFECStencilObject
Foam::upwindFECCellToFaceStencilObject
Description
@ -31,11 +31,11 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef upwindFECStencilObject_H
#define upwindFECStencilObject_H
#ifndef upwindFECCellToFaceStencilObject_H
#define upwindFECCellToFaceStencilObject_H
#include "extendedUpwindStencil.H"
#include "faceEdgeCellStencil.H"
#include "extendedUpwindCellToFaceStencil.H"
#include "FECCellToFaceStencil.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 extendedUpwindStencil
public MeshObject<fvMesh, upwindFECCellToFaceStencilObject>,
public extendedUpwindCellToFaceStencil
{
public:
TypeName("upwindCFCStencil");
TypeName("upwindCFCCellToFaceStencil");
// Constructors
//- Construct from uncompacted face stencil
explicit upwindFECStencilObject
explicit upwindFECCellToFaceStencilObject
(
const fvMesh& mesh,
const scalar minOpposedness
)
:
MeshObject<fvMesh, upwindFECStencilObject>(mesh),
extendedUpwindStencil(faceEdgeCellStencil(mesh), minOpposedness)
MeshObject<fvMesh, upwindFECCellToFaceStencilObject>(mesh),
extendedUpwindCellToFaceStencil
(
FECCellToFaceStencil(mesh),
minOpposedness
)
{}
// Destructor
virtual ~upwindFECStencilObject()
virtual ~upwindFECCellToFaceStencilObject()
{}
};

View File

@ -24,22 +24,21 @@ License
\*---------------------------------------------------------------------------*/
#include "extendedStencil.H"
#include "extendedCellToFaceStencil.H"
#include "globalIndex.H"
#include "syncTools.H"
#include "SortableList.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap
Foam::autoPtr<Foam::mapDistribute>
Foam::extendedCellToFaceStencil::calcDistributeMap
(
const polyMesh& mesh,
const globalIndex& globalNumbering,
labelListList& faceStencil
)
{
const label nBnd = mesh_.nFaces()-mesh_.nInternalFaces();
// Convert stencil to schedule
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -53,8 +52,8 @@ Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap
// these are always all needed.
List<Map<label> > globalToProc(Pstream::nProcs());
{
const labelList& procPatchMap = mesh_.globalData().procPatchMap();
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
const labelList& procPatchMap = mesh.globalData().procPatchMap();
const polyBoundaryMesh& patches = mesh.boundaryMesh();
// Presize with (as estimate) size of patch to neighbour.
forAll(procPatchMap, procI)
@ -118,12 +117,12 @@ Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap
// 2. The overall compact addressing is
// - myProcNo first
// - myProcNo data first (uncompacted)
// - all other processors consecutively
labelList compactStart(Pstream::nProcs());
compactStart[Pstream::myProcNo()] = 0;
label nCompact = mesh_.nCells()+nBnd;
label nCompact = globalNumbering.localSize();
forAll(compactStart, procI)
{
if (procI != Pstream::myProcNo())
@ -159,7 +158,7 @@ Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap
{
recvCompact[procI] =
compactStart[procI]
+ identity(mesh_.nCells()+nBnd);
+ identity(globalNumbering.localSize());
}
}
labelListList sendCompact(Pstream::nProcs());
@ -228,7 +227,7 @@ Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::extendedStencil::extendedStencil(const polyMesh& mesh)
Foam::extendedCellToFaceStencil::extendedCellToFaceStencil(const polyMesh& mesh)
:
mesh_(mesh)
{}

View File

@ -23,10 +23,10 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::extendedStencil
Foam::extendedCellToFaceStencil
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
in a compact way. (element 0 is owner, 1 is neighbour). The index numbering
@ -41,13 +41,13 @@ Description
- sum the weights*field.
SourceFiles
extendedStencil.C
extendedStencilTemplates.C
extendedCellToFaceStencil.C
extendedCellToFaceStencilTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef extendedStencil_H
#define extendedStencil_H
#ifndef extendedCellToFaceStencil_H
#define extendedCellToFaceStencil_H
#include "mapDistribute.H"
#include "volFields.H"
@ -61,10 +61,10 @@ namespace Foam
class globalIndex;
/*---------------------------------------------------------------------------*\
Class extendedStencil Declaration
Class extendedCellToFaceStencil Declaration
\*---------------------------------------------------------------------------*/
class extendedStencil
class extendedCellToFaceStencil
{
protected:
@ -75,12 +75,6 @@ protected:
// Protected Member Functions
//- Calculate distribute map
autoPtr<mapDistribute> calcDistributeMap
(
const globalIndex& globalNumbering,
labelListList& faceStencil
);
private:
@ -88,10 +82,10 @@ private:
// Private Member Functions
//- Disallow default bitwise copy construct
extendedStencil(const extendedStencil&);
extendedCellToFaceStencil(const extendedCellToFaceStencil&);
//- Disallow default bitwise assignment
void operator=(const extendedStencil&);
void operator=(const extendedCellToFaceStencil&);
public:
@ -99,11 +93,19 @@ public:
// Constructors
//- Construct from mesh
explicit extendedStencil(const polyMesh&);
explicit extendedCellToFaceStencil(const polyMesh&);
// 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
template<class T>
static void collectData
@ -134,7 +136,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "extendedStencilTemplates.C"
# include "extendedCellToFaceStencilTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -24,12 +24,12 @@ License
\*---------------------------------------------------------------------------*/
#include "extendedStencil.H"
#include "extendedCellToFaceStencil.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::extendedStencil::collectData
void Foam::extendedCellToFaceStencil::collectData
(
const mapDistribute& map,
const labelListList& stencil,
@ -79,7 +79,7 @@ void Foam::extendedStencil::collectData
template<class Type>
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >
Foam::extendedStencil::weightedSum
Foam::extendedCellToFaceStencil::weightedSum
(
const mapDistribute& map,
const labelListList& stencil,

View File

@ -25,26 +25,34 @@ License
\*---------------------------------------------------------------------------*/
#include "mapDistribute.H"
#include "extendedCentredStencil.H"
#include "faceStencil.H"
#include "extendedCentredCellToFaceStencil.H"
#include "cellToFaceStencil.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::extendedCentredStencil::extendedCentredStencil(const faceStencil& stencil)
Foam::extendedCentredCellToFaceStencil::extendedCentredCellToFaceStencil
(
const cellToFaceStencil& stencil
)
:
extendedStencil(stencil.mesh())
extendedCellToFaceStencil(stencil.mesh())
{
stencil_ = stencil;
// Calculate distribute map (also renumbers stencil)
mapPtr_ = calcDistributeMap(stencil.globalNumbering(), stencil_);
// Calculate distribute map (also renumbers elements in stencil)
mapPtr_ = calcDistributeMap
(
stencil.mesh(),
stencil.globalNumbering(),
stencil_
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Per face which elements of the stencil to keep.
void Foam::extendedCentredStencil::compact()
void Foam::extendedCentredCellToFaceStencil::compact()
{
boolList isInStencil(map().constructSize(), false);

View File

@ -23,34 +23,34 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::extendedCentredStencil
Foam::extendedCentredCellToFaceStencil
Description
SourceFiles
extendedCentredStencil.C
extendedCentredCellToFaceStencil.C
\*---------------------------------------------------------------------------*/
#ifndef extendedCentredStencil_H
#define extendedCentredStencil_H
#ifndef extendedCentredCellToFaceStencil_H
#define extendedCentredCellToFaceStencil_H
#include "extendedStencil.H"
#include "extendedCellToFaceStencil.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class faceStencil;
class cellToFaceStencil;
/*---------------------------------------------------------------------------*\
Class extendedCentredStencil Declaration
Class extendedCentredCellToFaceStencil Declaration
\*---------------------------------------------------------------------------*/
class extendedCentredStencil
class extendedCentredCellToFaceStencil
:
public extendedStencil
public extendedCellToFaceStencil
{
// Private data
@ -64,10 +64,13 @@ class extendedCentredStencil
// Private Member Functions
//- Disallow default bitwise copy construct
extendedCentredStencil(const extendedCentredStencil&);
extendedCentredCellToFaceStencil
(
const extendedCentredCellToFaceStencil&
);
//- Disallow default bitwise assignment
void operator=(const extendedCentredStencil&);
void operator=(const extendedCentredCellToFaceStencil&);
public:
@ -75,7 +78,7 @@ public:
// Constructors
//- Construct from uncompacted face stencil
explicit extendedCentredStencil(const faceStencil&);
explicit extendedCentredCellToFaceStencil(const cellToFaceStencil&);
// Member Functions
@ -103,7 +106,13 @@ public:
List<List<T> >& stencilFld
) const
{
extendedStencil::collectData(map(), stencil(), fld, stencilFld);
extendedCellToFaceStencil::collectData
(
map(),
stencil(),
fld,
stencilFld
);
}
//- Sum vol field contributions to create face values
@ -114,7 +123,7 @@ public:
const List<List<scalar> >& stencilWeights
) const
{
return extendedStencil::weightedSum
return extendedCellToFaceStencil::weightedSum
(
map(),
stencil(),

View File

@ -24,14 +24,14 @@ License
\*---------------------------------------------------------------------------*/
#include "extendedUpwindStencil.H"
#include "faceStencil.H"
#include "extendedUpwindCellToFaceStencil.H"
#include "cellToFaceStencil.H"
#include "syncTools.H"
#include "SortableList.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::extendedUpwindStencil::selectOppositeFaces
void Foam::extendedUpwindCellToFaceStencil::selectOppositeFaces
(
const boolList& nonEmptyFace,
const scalar minOpposedness,
@ -103,7 +103,7 @@ void Foam::extendedUpwindStencil::selectOppositeFaces
}
void Foam::extendedUpwindStencil::transportStencil
void Foam::extendedUpwindCellToFaceStencil::transportStencil
(
const boolList& nonEmptyFace,
const labelListList& faceStencil,
@ -168,8 +168,10 @@ void Foam::extendedUpwindStencil::transportStencil
}
if (n != transportedStencil.size())
{
FatalErrorIn("extendedUpwindStencil::transportStencil(..)")
<< "problem:" << faceStencilSet
FatalErrorIn
(
"extendedUpwindCellToFaceStencil::transportStencil(..)"
) << "problem:" << faceStencilSet
<< abort(FatalError);
}
}
@ -188,15 +190,17 @@ void Foam::extendedUpwindStencil::transportStencil
}
if (n != transportedStencil.size())
{
FatalErrorIn("extendedUpwindStencil::transportStencil(..)")
<< "problem:" << faceStencilSet
FatalErrorIn
(
"extendedUpwindCellToFaceStencil::transportStencil(..)"
) << "problem:" << faceStencilSet
<< abort(FatalError);
}
}
}
void Foam::extendedUpwindStencil::transportStencils
void Foam::extendedUpwindCellToFaceStencil::transportStencils
(
const labelListList& faceStencil,
const scalar minOpposedness,
@ -240,6 +244,7 @@ void Foam::extendedUpwindStencil::transportStencils
// Internal faces
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
{
// Get stencil as owner + neighbour + stencil from 'opposite' faces
transportStencil
(
nonEmptyFace,
@ -367,13 +372,13 @@ void Foam::extendedUpwindStencil::transportStencils
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::extendedUpwindStencil::extendedUpwindStencil
Foam::extendedUpwindCellToFaceStencil::extendedUpwindCellToFaceStencil
(
const faceStencil& stencil,
const cellToFaceStencil& stencil,
const scalar minOpposedness
)
:
extendedStencil(stencil.mesh())
extendedCellToFaceStencil(stencil.mesh())
{
//forAll(stencil, faceI)
//{
@ -414,12 +419,14 @@ Foam::extendedUpwindStencil::extendedUpwindStencil
ownMapPtr_ = calcDistributeMap
(
stencil.mesh(),
stencil.globalNumbering(),
ownStencil_
);
neiMapPtr_ = calcDistributeMap
(
stencil.mesh(),
stencil.globalNumbering(),
neiStencil_
);

View File

@ -23,35 +23,37 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::extendedUpwindStencil
Foam::extendedUpwindCellToFaceStencil
Description
Creates upwind stencil by shifting a centred stencil to upwind and downwind
faces.
SourceFiles
extendedUpwindStencil.C
extendedUpwindStencilTemplates.C
extendedUpwindCellToFaceStencil.C
extendedUpwindCellToFaceStencilTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef extendedUpwindStencil_H
#define extendedUpwindStencil_H
#ifndef extendedUpwindCellToFaceStencil_H
#define extendedUpwindCellToFaceStencil_H
#include "extendedStencil.H"
#include "extendedCellToFaceStencil.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class faceStencil;
class cellToFaceStencil;
/*---------------------------------------------------------------------------*\
Class extendedUpwindStencil Declaration
Class extendedUpwindCellToFaceStencil Declaration
\*---------------------------------------------------------------------------*/
class extendedUpwindStencil
class extendedUpwindCellToFaceStencil
:
public extendedStencil
public extendedCellToFaceStencil
{
// Private data
@ -103,10 +105,10 @@ class extendedUpwindStencil
//- Disallow default bitwise copy construct
extendedUpwindStencil(const extendedUpwindStencil&);
extendedUpwindCellToFaceStencil(const extendedUpwindCellToFaceStencil&);
//- Disallow default bitwise assignment
void operator=(const extendedUpwindStencil&);
void operator=(const extendedUpwindCellToFaceStencil&);
public:
@ -114,9 +116,9 @@ public:
// Constructors
//- Construct from mesh and uncompacted face stencil
extendedUpwindStencil
extendedUpwindCellToFaceStencil
(
const faceStencil&,
const cellToFaceStencil&,
const scalar minOpposedness
);
@ -167,7 +169,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "extendedUpwindStencilTemplates.C"
# include "extendedUpwindCellToFaceStencilTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -24,13 +24,13 @@ License
\*---------------------------------------------------------------------------*/
#include "extendedStencil.H"
#include "extendedCellToFaceStencil.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >
Foam::extendedUpwindStencil::weightedSum
Foam::extendedUpwindCellToFaceStencil::weightedSum
(
const surfaceScalarField& phi,
const GeometricField<Type, fvPatchField, volMesh>& fld,

View File

@ -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);
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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);
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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);
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "faceEdgeCellStencil.H"
#include "FECCellToFaceStencil.H"
#include "syncTools.H"
#include "emptyPolyPatch.H"
//#include "meshTools.H"
@ -34,7 +34,7 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Calculates per edge the neighbour data (= edgeCells)
void Foam::faceEdgeCellStencil::calcEdgeBoundaryData
void Foam::FECCellToFaceStencil::calcEdgeBoundaryData
(
const boolList& isValidBFace,
const labelList& boundaryEdges,
@ -73,7 +73,7 @@ void Foam::faceEdgeCellStencil::calcEdgeBoundaryData
// Calculates per face the edge connected data (= cell or boundary in global
// numbering).
void Foam::faceEdgeCellStencil::calcFaceStencil
void Foam::FECCellToFaceStencil::calcFaceStencil
(
labelListList& faceStencil
) const
@ -220,7 +220,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
{
if (iter.key() == globalOwn || iter.key() == globalNei)
{
FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)")
FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)")
<< "problem:" << faceStencilSet
<< abort(FatalError);
}
@ -281,8 +281,10 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
{
if (iter.key() == globalOwn || iter.key() == globalNei)
{
FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)")
<< "problem:" << faceStencilSet
FatalErrorIn
(
"FECCellToFaceStencil::calcFaceStencil(..)"
) << "problem:" << faceStencilSet
<< abort(FatalError);
}
faceStencil[faceI][n++] = iter.key();
@ -345,8 +347,10 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
{
if (iter.key() == globalOwn)
{
FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)")
<< "problem:" << faceStencilSet
FatalErrorIn
(
"FECCellToFaceStencil::calcFaceStencil(..)"
) << "problem:" << faceStencilSet
<< abort(FatalError);
}
faceStencil[faceI][n++] = iter.key();
@ -363,7 +367,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
label globalOwn = globalNumbering().toGlobal(own[faceI]);
if (faceStencil[faceI][0] != globalOwn)
{
FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)")
FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)")
<< "problem:" << faceStencil[faceI]
<< " globalOwn:" << globalOwn
<< abort(FatalError);
@ -371,7 +375,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
label globalNei = globalNumbering().toGlobal(nei[faceI]);
if (faceStencil[faceI][1] != globalNei)
{
FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)")
FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)")
<< "problem:" << faceStencil[faceI]
<< " globalNei:" << globalNei
<< abort(FatalError);
@ -392,7 +396,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
label globalOwn = globalNumbering().toGlobal(own[faceI]);
if (faceStencil[faceI][0] != globalOwn)
{
FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)")
FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)")
<< "problem:" << faceStencil[faceI]
<< " globalOwn:" << globalOwn
<< abort(FatalError);
@ -400,7 +404,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
label globalNei = neiGlobalCell[faceI-mesh().nInternalFaces()];
if (faceStencil[faceI][1] != globalNei)
{
FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)")
FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)")
<< "problem:" << faceStencil[faceI]
<< " globalNei:" << globalNei
<< abort(FatalError);
@ -416,7 +420,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
label globalOwn = globalNumbering().toGlobal(own[faceI]);
if (faceStencil[faceI][0] != globalOwn)
{
FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)")
FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)")
<< "problem:" << faceStencil[faceI]
<< " globalOwn:" << globalOwn
<< abort(FatalError);
@ -429,9 +433,9 @@ void Foam::faceEdgeCellStencil::calcFaceStencil
// * * * * * * * * * * * * * * * * 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)
labelListList faceStencil;

View File

@ -23,23 +23,20 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::faceEdgeCellStencil
Foam::FECCellToFaceStencil
Description
All cells connected via edge to face.
SourceFiles
faceEdgeCellStencil.C
FECCellToFaceStencil.C
\*---------------------------------------------------------------------------*/
#ifndef faceEdgeCellStencil_H
#define faceEdgeCellStencil_H
#ifndef FECCellToFaceStencil_H
#define FECCellToFaceStencil_H
#include "faceStencil.H"
#include "boolList.H"
#include "HashSet.H"
#include "Map.H"
#include "cellToFaceStencil.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
@ -69,10 +66,10 @@ class faceEdgeCellStencil
//- Disallow default bitwise copy construct
faceEdgeCellStencil(const faceEdgeCellStencil&);
FECCellToFaceStencil(const FECCellToFaceStencil&);
//- Disallow default bitwise assignment
void operator=(const faceEdgeCellStencil&);
void operator=(const FECCellToFaceStencil&);
public:
@ -80,7 +77,7 @@ public:
// Constructors
//- Construct from all cells and boundary faces
explicit faceEdgeCellStencil(const polyMesh&);
explicit FECCellToFaceStencil(const polyMesh&);
};

View File

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "faceStencil.H"
#include "cellToFaceStencil.H"
#include "syncTools.H"
#include "SortableList.H"
#include "emptyPolyPatch.H"
@ -32,7 +32,7 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Merge two list and guarantee global0,global1 are first.
void Foam::faceStencil::merge
void Foam::cellToFaceStencil::merge
(
const label global0,
const label global1,
@ -124,7 +124,7 @@ void Foam::faceStencil::merge
if (resultI != result.size())
{
FatalErrorIn("faceStencil::merge(..)")
FatalErrorIn("cellToFaceStencil::merge(..)")
<< "problem" << abort(FatalError);
}
@ -133,7 +133,7 @@ void Foam::faceStencil::merge
// Merge two list and guarantee globalI is first.
void Foam::faceStencil::merge
void Foam::cellToFaceStencil::merge
(
const label globalI,
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();
@ -191,7 +191,7 @@ void Foam::faceStencil::validBoundaryFaces(boolList& isValidBFace) const
Foam::autoPtr<Foam::indirectPrimitivePatch>
Foam::faceStencil::allCoupledFacesPatch() const
Foam::cellToFaceStencil::allCoupledFacesPatch() const
{
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,
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 exclude1,
@ -316,7 +316,7 @@ void Foam::faceStencil::insertFaceCells
}
Foam::labelList Foam::faceStencil::calcFaceCells
Foam::labelList Foam::cellToFaceStencil::calcFaceCells
(
const boolList& isValidBFace,
const labelList& faceLabels,
@ -339,7 +339,7 @@ Foam::labelList Foam::faceStencil::calcFaceCells
// Calculates per face a list of global cell/face indices.
void Foam::faceStencil::calcFaceStencil
void Foam::cellToFaceStencil::calcFaceStencil
(
const labelListList& globalCellCells,
labelListList& faceStencil
@ -502,7 +502,7 @@ void Foam::faceStencil::calcFaceStencil
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::faceStencil::faceStencil(const polyMesh& mesh)
Foam::cellToFaceStencil::cellToFaceStencil(const polyMesh& mesh)
:
mesh_(mesh),
globalNumbering_(mesh_.nCells()+mesh_.nFaces()-mesh_.nInternalFaces())

View File

@ -23,18 +23,19 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::faceStencil
Foam::cellToFaceStencil
Description
baseclass for extended face-cell addressing.
baseclass for extended cell-to-facel stencils (face values from
neighbouring cells)
SourceFiles
faceStencil.C
\*---------------------------------------------------------------------------*/
#ifndef faceStencil_H
#define faceStencil_H
#ifndef cellToFaceStencil_H
#define cellToFaceStencil_H
#include "globalIndex.H"
#include "boolList.H"
@ -49,10 +50,10 @@ namespace Foam
class polyMesh;
/*---------------------------------------------------------------------------*\
Class faceStencil Declaration
Class cellToFaceStencil Declaration
\*---------------------------------------------------------------------------*/
class faceStencil
class cellToFaceStencil
:
public labelListList
{
@ -66,10 +67,12 @@ class faceStencil
// Private Member Functions
//- Disallow default bitwise assignment
void operator=(const faceStencil&);
//- Disallow default bitwise copy construct
cellToFaceStencil(const cellToFaceStencil&);
//- Disallow default bitwise assignment
void operator=(const cellToFaceStencil&);
protected:
@ -130,7 +133,7 @@ public:
// Constructors
//- Construct from mesh
explicit faceStencil(const polyMesh&);
explicit cellToFaceStencil(const polyMesh&);
// Member Functions

View File

@ -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);
}
// ************************************************************************* //

View File

@ -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);
}
// ************************************************************************* //

View File

@ -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);
}
// ************************************************************************* //

View File

@ -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);
}
// ************************************************************************* //

View File

@ -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);
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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);
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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)
{}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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);
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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())
{}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -47,14 +47,17 @@ License
#include "quadraticLinearFitPolynomial.H"
#include "skewCorrectionVectors.H"
#include "centredCECStencilObject.H"
#include "centredCFCStencilObject.H"
#include "centredCPCStencilObject.H"
#include "centredFECStencilObject.H"
#include "upwindCECStencilObject.H"
#include "upwindCFCStencilObject.H"
#include "upwindCPCStencilObject.H"
#include "upwindFECStencilObject.H"
#include "centredCECCellToFaceStencilObject.H"
#include "centredCFCCellToFaceStencilObject.H"
#include "centredCPCCellToFaceStencilObject.H"
#include "centredFECCellToFaceStencilObject.H"
#include "upwindCECCellToFaceStencilObject.H"
#include "upwindCFCCellToFaceStencilObject.H"
#include "upwindCPCCellToFaceStencilObject.H"
#include "upwindFECCellToFaceStencilObject.H"
#include "centredCFCFaceToCellStencilObject.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -111,14 +114,16 @@ void Foam::fvMesh::clearAddressing()
CentredFitData<quadraticLinearFitPolynomial>::Delete(*this);
skewCorrectionVectors::Delete(*this);
centredCECStencilObject::Delete(*this);
centredCFCStencilObject::Delete(*this);
centredCPCStencilObject::Delete(*this);
centredFECStencilObject::Delete(*this);
upwindCECStencilObject::Delete(*this);
upwindCFCStencilObject::Delete(*this);
upwindCPCStencilObject::Delete(*this);
upwindFECStencilObject::Delete(*this);
centredCECCellToFaceStencilObject::Delete(*this);
centredCFCCellToFaceStencilObject::Delete(*this);
centredCPCCellToFaceStencilObject::Delete(*this);
centredFECCellToFaceStencilObject::Delete(*this);
upwindCECCellToFaceStencilObject::Delete(*this);
upwindCFCCellToFaceStencilObject::Delete(*this);
upwindCPCCellToFaceStencilObject::Delete(*this);
upwindFECCellToFaceStencilObject::Delete(*this);
centredCFCFaceToCellStencilObject::Delete(*this);
}

View File

@ -29,7 +29,7 @@ License
#include "volFields.H"
#include "SVD.H"
#include "syncTools.H"
#include "extendedCentredStencil.H"
#include "extendedCentredCellToFaceStencil.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -37,12 +37,17 @@ template<class Polynomial>
Foam::CentredFitData<Polynomial>::CentredFitData
(
const fvMesh& mesh,
const extendedCentredStencil& stencil,
const extendedCentredCellToFaceStencil& stencil,
const scalar linearLimitFactor,
const scalar centralWeight
)
:
FitData<CentredFitData<Polynomial>, extendedCentredStencil, Polynomial>
FitData
<
CentredFitData<Polynomial>,
extendedCentredCellToFaceStencil,
Polynomial
>
(
mesh, stencil, linearLimitFactor, centralWeight
),
@ -83,8 +88,12 @@ void Foam::CentredFitData<Polynomial>::calcFit()
for(label facei = 0; facei < mesh.nInternalFaces(); facei++)
{
FitData<CentredFitData<Polynomial>, extendedCentredStencil, Polynomial>::
calcFit(coeffs_[facei], stencilPoints[facei], w[facei], facei);
FitData
<
CentredFitData<Polynomial>,
extendedCentredCellToFaceStencil,
Polynomial
>::calcFit(coeffs_[facei], stencilPoints[facei], w[facei], facei);
}
const surfaceScalarField::GeometricBoundaryField& bw = w.boundaryField();
@ -101,7 +110,9 @@ void Foam::CentredFitData<Polynomial>::calcFit()
{
FitData
<
CentredFitData<Polynomial>, extendedCentredStencil, Polynomial
CentredFitData<Polynomial>,
extendedCentredCellToFaceStencil,
Polynomial
>::calcFit(coeffs_[facei], stencilPoints[facei], pw[i], facei);
facei++;
}

View File

@ -43,7 +43,7 @@ SourceFiles
namespace Foam
{
class extendedCentredStencil;
class extendedCentredCellToFaceStencil;
/*---------------------------------------------------------------------------*\
Class CentredFitData Declaration
@ -52,7 +52,7 @@ class extendedCentredStencil;
template<class Polynomial>
class CentredFitData
:
public FitData<CentredFitData<Polynomial>, extendedCentredStencil, Polynomial>
public FitData<CentredFitData<Polynomial>, extendedCentredCellToFaceStencil, Polynomial>
{
// Private data
@ -79,7 +79,7 @@ public:
CentredFitData
(
const fvMesh& mesh,
const extendedCentredStencil& stencil,
const extendedCentredCellToFaceStencil& stencil,
const scalar linearLimitFactor,
const scalar centralWeight
);

View File

@ -119,7 +119,7 @@ public:
{
const fvMesh& mesh = this->mesh();
const extendedCentredStencil& stencil = Stencil::New
const extendedCentredCellToFaceStencil& stencil = Stencil::New
(
mesh
);

View File

@ -28,16 +28,14 @@ License
#include "surfaceFields.H"
#include "volFields.H"
#include "SVD.H"
#include "syncTools.H"
#include "extendedStencil.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Form, class extendedStencil, class Polynomial>
Foam::FitData<Form, extendedStencil, Polynomial>::FitData
template<class Form, class ExtendedStencil, class Polynomial>
Foam::FitData<Form, ExtendedStencil, Polynomial>::FitData
(
const fvMesh& mesh,
const extendedStencil& stencil,
const ExtendedStencil& stencil,
const scalar linearLimitFactor,
const scalar centralWeight
)

View File

@ -29,7 +29,7 @@ License
#include "volFields.H"
#include "SVD.H"
#include "syncTools.H"
#include "extendedUpwindStencil.H"
#include "extendedUpwindCellToFaceStencil.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -37,12 +37,17 @@ template<class Polynomial>
Foam::UpwindFitData<Polynomial>::UpwindFitData
(
const fvMesh& mesh,
const extendedUpwindStencil& stencil,
const extendedUpwindCellToFaceStencil& stencil,
const scalar linearLimitFactor,
const scalar centralWeight
)
:
FitData<UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial>
FitData
<
UpwindFitData<Polynomial>,
extendedUpwindCellToFaceStencil,
Polynomial
>
(
mesh, stencil, linearLimitFactor, centralWeight
),
@ -98,10 +103,18 @@ void Foam::UpwindFitData<Polynomial>::calcFit()
for(label facei = 0; facei < mesh.nInternalFaces(); facei++)
{
FitData<UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial>::
calcFit(owncoeffs_[facei], ownStencilPoints[facei], w[facei], facei);
FitData<UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial>::
calcFit(neicoeffs_[facei], neiStencilPoints[facei], w[facei], facei);
FitData
<
UpwindFitData<Polynomial>,
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();
@ -118,14 +131,18 @@ void Foam::UpwindFitData<Polynomial>::calcFit()
{
FitData
<
UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial
UpwindFitData<Polynomial>,
extendedUpwindCellToFaceStencil,
Polynomial
>::calcFit
(
owncoeffs_[facei], ownStencilPoints[facei], pw[i], facei
);
FitData
<
UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial
UpwindFitData<Polynomial>,
extendedUpwindCellToFaceStencil,
Polynomial
>::calcFit
(
neicoeffs_[facei], neiStencilPoints[facei], pw[i], facei

View File

@ -44,7 +44,7 @@ SourceFiles
namespace Foam
{
class extendedUpwindStencil;
class extendedUpwindCellToFaceStencil;
/*---------------------------------------------------------------------------*\
Class UpwindFitData Declaration
@ -53,7 +53,12 @@ class extendedUpwindStencil;
template<class Polynomial>
class UpwindFitData
:
public FitData<UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial>
public FitData
<
UpwindFitData<Polynomial>,
extendedUpwindCellToFaceStencil,
Polynomial
>
{
// Private data
@ -84,7 +89,7 @@ public:
UpwindFitData
(
const fvMesh& mesh,
const extendedUpwindStencil& stencil,
const extendedUpwindCellToFaceStencil& stencil,
const scalar linearLimitFactor,
const scalar centralWeight
);

View File

@ -126,7 +126,7 @@ public:
{
const fvMesh& mesh = this->mesh();
const extendedUpwindStencil& stencil = Stencil::New
const extendedUpwindCellToFaceStencil& stencil = Stencil::New
(
mesh,
scalar(0.5)

View File

@ -26,7 +26,7 @@ License
#include "CentredFitScheme.H"
#include "biLinearFitPolynomial.H"
#include "centredCFCStencilObject.H"
#include "centredCFCCellToFaceStencilObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -42,7 +42,7 @@ namespace Foam
(
biLinearFit,
biLinearFitPolynomial,
centredCFCStencilObject
centredCFCCellToFaceStencilObject
);
}

View File

@ -26,7 +26,7 @@ License
#include "UpwindFitScheme.H"
#include "cubicUpwindFitPolynomial.H"
#include "upwindCFCStencilObject.H"
#include "upwindCFCCellToFaceStencilObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -42,7 +42,7 @@ namespace Foam
(
cubicUpwindFit,
cubicUpwindFitPolynomial,
upwindCFCStencilObject
upwindCFCCellToFaceStencilObject
);
}

View File

@ -26,7 +26,7 @@ License
#include "CentredFitScheme.H"
#include "linearFitPolynomial.H"
#include "centredCFCStencilObject.H"
#include "centredCFCCellToFaceStencilObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -42,7 +42,7 @@ namespace Foam
(
linearFit,
linearFitPolynomial,
centredCFCStencilObject
centredCFCCellToFaceStencilObject
);
}

View File

@ -26,7 +26,7 @@ License
#include "CentredFitScheme.H"
#include "quadraticFitPolynomial.H"
#include "centredCFCStencilObject.H"
#include "centredCFCCellToFaceStencilObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -42,7 +42,7 @@ namespace Foam
(
quadraticFit,
quadraticFitPolynomial,
centredCFCStencilObject
centredCFCCellToFaceStencilObject
);
}

View File

@ -26,7 +26,7 @@ License
#include "CentredFitScheme.H"
#include "quadraticLinearFitPolynomial.H"
#include "centredCFCStencilObject.H"
#include "centredCFCCellToFaceStencilObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -42,7 +42,7 @@ namespace Foam
(
quadraticLinearFit,
quadraticLinearFitPolynomial,
centredCFCStencilObject
centredCFCCellToFaceStencilObject
);
}

View File

@ -26,7 +26,7 @@ License
#include "UpwindFitScheme.H"
#include "quadraticLinearUpwindFitPolynomial.H"
#include "upwindCFCStencilObject.H"
#include "upwindCFCCellToFaceStencilObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -42,7 +42,7 @@ namespace Foam
(
quadraticLinearUpwindFit,
quadraticLinearUpwindFitPolynomial,
upwindCFCStencilObject
upwindCFCCellToFaceStencilObject
);
}

View File

@ -26,7 +26,7 @@ License
#include "UpwindFitScheme.H"
#include "quadraticUpwindFitPolynomial.H"
#include "upwindFECStencilObject.H"
#include "upwindFECCellToFaceStencilObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -42,7 +42,7 @@ namespace Foam
(
quadraticUpwindFit,
quadraticUpwindFitPolynomial,
upwindFECStencilObject
upwindFECCellToFaceStencilObject
);
}

View File

@ -244,6 +244,8 @@ snapControls
// Settings for the layer addition.
addLayersControls
{
relativeSizes true;
// Per final patch (so not geometry!) the layer information
layers
{
@ -264,7 +266,7 @@ addLayersControls
// is the
// thickness of the layer furthest away from the wall.
// Relative to undistorted size of cell outside layer.
finalLayerRatio 0.5;
finalLayerThickness 0.5;
//- Minimum thickness of cell layer. If for any reason layer
// cannot be above minThickness do not add layer.