From ba9e8437841c8d57bd33145e77ed3ea49f1b20a0 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 4 Jun 2009 16:29:40 +0100 Subject: [PATCH 1/3] new syntax --- .../snappyHexMesh/iglooWithFridges/system/snappyHexMeshDict | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tutorials/mesh/snappyHexMesh/iglooWithFridges/system/snappyHexMeshDict b/tutorials/mesh/snappyHexMesh/iglooWithFridges/system/snappyHexMeshDict index be30045c6d..0c11dad74f 100644 --- a/tutorials/mesh/snappyHexMesh/iglooWithFridges/system/snappyHexMeshDict +++ b/tutorials/mesh/snappyHexMesh/iglooWithFridges/system/snappyHexMeshDict @@ -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. From 84c64aa17cc8edf97984955ab7e6d1dc214a4ea0 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 4 Jun 2009 17:27:35 +0100 Subject: [PATCH 2/3] extended stencil renaming --- src/finiteVolume/Make/files | 46 ++- .../quadraticFitSnGrad/quadraticFitSnGrad.H | 4 +- .../quadraticFitSnGradData.H | 6 +- .../fullStencils/CECCellToCellStencil.C} | 20 +- .../fullStencils/CECCellToCellStencil.H} | 22 +- .../fullStencils/CFCCellToCellStencil.C} | 20 +- .../fullStencils/CFCCellToCellStencil.H} | 22 +- .../fullStencils/CPCCellToCellStencil.C} | 19 +- .../fullStencils/CPCCellToCellStencil.H} | 22 +- .../fullStencils/cellToCellStencil.C | 350 ++++++++++++++++++ .../fullStencils/cellToCellStencil.H | 152 ++++++++ .../centredCECCellToFaceStencilObject.C | 38 ++ .../centredCECCellToFaceStencilObject.H} | 28 +- .../centredCFCCellToFaceStencilObject.C | 38 ++ .../centredCFCCellToFaceStencilObject.H} | 28 +- .../centredCPCCellToFaceStencilObject.C | 38 ++ .../centredCPCCellToFaceStencilObject.H} | 28 +- .../centredFECCellToFaceStencilObject.C | 38 ++ .../centredFECCellToFaceStencilObject.H} | 28 +- .../upwindCECCellToFaceStencilObject.C} | 4 +- .../upwindCECCellToFaceStencilObject.H} | 32 +- .../upwindCFCCellToFaceStencilObject.C} | 4 +- .../upwindCFCCellToFaceStencilObject.H} | 32 +- .../upwindCPCCellToFaceStencilObject.C} | 4 +- .../upwindCPCCellToFaceStencilObject.H} | 32 +- .../upwindFECCellToFaceStencilObject.C} | 4 +- .../upwindFECCellToFaceStencilObject.H} | 32 +- .../extendedCellToFaceStencil.C} | 21 +- .../extendedCellToFaceStencil.H} | 38 +- .../extendedCellToFaceStencilTemplates.C} | 6 +- .../extendedCentredCellToFaceStencil.C} | 22 +- .../extendedCentredCellToFaceStencil.H} | 37 +- .../extendedUpwindCellToFaceStencil.C} | 31 +- .../extendedUpwindCellToFaceStencil.H} | 32 +- ...xtendedUpwindCellToFaceStencilTemplates.C} | 4 +- .../fullStencils/CECCellToFaceStencil.C | 50 +++ .../fullStencils/CECCellToFaceStencil.H | 81 ++++ .../fullStencils/CFCCellToFaceStencil.C | 50 +++ .../fullStencils/CFCCellToFaceStencil.H | 79 ++++ .../fullStencils/CPCCellToFaceStencil.C | 50 +++ .../fullStencils/CPCCellToFaceStencil.H | 81 ++++ .../fullStencils/FECCellToFaceStencil.C} | 34 +- .../fullStencils/FECCellToFaceStencil.H} | 25 +- .../fullStencils/cellToFaceStencil.C} | 22 +- .../fullStencils/cellToFaceStencil.H} | 23 +- .../upwindCECStencilObject.C | 38 -- .../upwindCFCStencilObject.C | 38 -- .../upwindCPCStencilObject.C | 38 -- .../upwindFECStencilObject.C | 38 -- .../centredCFCFaceToCellStencilObject.C | 38 ++ .../centredCFCFaceToCellStencilObject.H | 87 +++++ .../extendedCentredFaceToCellStencil.C | 76 ++++ .../extendedCentredFaceToCellStencil.H | 146 ++++++++ .../faceToCell/extendedFaceToCellStencil.C | 39 ++ .../faceToCell/extendedFaceToCellStencil.H | 119 ++++++ .../extendedFaceToCellStencilTemplates.C | 135 +++++++ .../fullStencils/CFCFaceToCellStencil.C | 231 ++++++++++++ .../fullStencils/CFCFaceToCellStencil.H | 82 ++++ .../fullStencils/faceToCellStencil.C | 41 ++ .../fullStencils/faceToCellStencil.H | 108 ++++++ src/finiteVolume/fvMesh/fvMesh.C | 37 +- .../schemes/CentredFitScheme/CentredFitData.C | 23 +- .../schemes/CentredFitScheme/CentredFitData.H | 6 +- .../CentredFitScheme/CentredFitScheme.H | 2 +- .../schemes/FitData/FitData.C | 8 +- .../schemes/UpwindFitScheme/UpwindFitData.C | 35 +- .../schemes/UpwindFitScheme/UpwindFitData.H | 11 +- .../schemes/UpwindFitScheme/UpwindFitScheme.H | 2 +- .../schemes/biLinearFit/biLinearFit.C | 4 +- .../schemes/cubicUpwindFit/cubicUpwindFit.C | 4 +- .../schemes/linearFit/linearFit.C | 4 +- .../schemes/quadraticFit/quadraticFit.C | 4 +- .../quadraticLinearFit/quadraticLinearFit.C | 4 +- .../quadraticLinearUpwindFit.C | 4 +- .../quadraticUpwindFit/quadraticUpwindFit.C | 4 +- 75 files changed, 2626 insertions(+), 557 deletions(-) rename src/finiteVolume/fvMesh/extendedStencil/{faceStencil/cellEdgeCellStencil.C => cellToCell/fullStencils/CECCellToCellStencil.C} (91%) rename src/finiteVolume/fvMesh/extendedStencil/{faceStencil/cellEdgeCellStencil.H => cellToCell/fullStencils/CECCellToCellStencil.H} (84%) rename src/finiteVolume/fvMesh/extendedStencil/{faceStencil/cellFaceCellStencil.C => cellToCell/fullStencils/CFCCellToCellStencil.C} (89%) rename src/finiteVolume/fvMesh/extendedStencil/{faceStencil/cellFaceCellStencil.H => cellToCell/fullStencils/CFCCellToCellStencil.H} (82%) rename src/finiteVolume/fvMesh/extendedStencil/{faceStencil/cellPointCellStencil.C => cellToCell/fullStencils/CPCCellToCellStencil.C} (90%) rename src/finiteVolume/fvMesh/extendedStencil/{faceStencil/cellPointCellStencil.H => cellToCell/fullStencils/CPCCellToCellStencil.H} (84%) create mode 100644 src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.C create mode 100644 src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.H create mode 100644 src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.C rename src/finiteVolume/fvMesh/extendedStencil/{extendedStencilMeshObjects/centredFECStencilObject.H => cellToFace/MeshObjects/centredCECCellToFaceStencilObject.H} (73%) create mode 100644 src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.C rename src/finiteVolume/fvMesh/extendedStencil/{extendedStencilMeshObjects/centredCFCStencilObject.H => cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.H} (73%) create mode 100644 src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.C rename src/finiteVolume/fvMesh/extendedStencil/{extendedStencilMeshObjects/centredCPCStencilObject.H => cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.H} (73%) create mode 100644 src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.C rename src/finiteVolume/fvMesh/extendedStencil/{extendedStencilMeshObjects/centredCECStencilObject.H => cellToFace/MeshObjects/centredFECCellToFaceStencilObject.H} (73%) rename src/finiteVolume/fvMesh/extendedStencil/{extendedStencilMeshObjects/centredFECStencilObject.C => cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.C} (92%) rename src/finiteVolume/fvMesh/extendedStencil/{extendedStencilMeshObjects/upwindCFCStencilObject.H => cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.H} (71%) rename src/finiteVolume/fvMesh/extendedStencil/{extendedStencilMeshObjects/centredCECStencilObject.C => cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.C} (92%) rename src/finiteVolume/fvMesh/extendedStencil/{extendedStencilMeshObjects/upwindCPCStencilObject.H => cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.H} (71%) rename src/finiteVolume/fvMesh/extendedStencil/{extendedStencilMeshObjects/centredCPCStencilObject.C => cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.C} (92%) rename src/finiteVolume/fvMesh/extendedStencil/{extendedStencilMeshObjects/upwindCECStencilObject.H => cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.H} (71%) rename src/finiteVolume/fvMesh/extendedStencil/{extendedStencilMeshObjects/centredCFCStencilObject.C => cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.C} (92%) rename src/finiteVolume/fvMesh/extendedStencil/{extendedStencilMeshObjects/upwindFECStencilObject.H => cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.H} (71%) rename src/finiteVolume/fvMesh/extendedStencil/{extendedStencil.C => cellToFace/extendedCellToFaceStencil.C} (93%) rename src/finiteVolume/fvMesh/extendedStencil/{extendedStencil.H => cellToFace/extendedCellToFaceStencil.H} (84%) rename src/finiteVolume/fvMesh/extendedStencil/{extendedStencilTemplates.C => cellToFace/extendedCellToFaceStencilTemplates.C} (97%) rename src/finiteVolume/fvMesh/extendedStencil/{extendedCentredStencil.C => cellToFace/extendedCentredCellToFaceStencil.C} (79%) rename src/finiteVolume/fvMesh/extendedStencil/{extendedCentredStencil.H => cellToFace/extendedCentredCellToFaceStencil.H} (79%) rename src/finiteVolume/fvMesh/extendedStencil/{extendedUpwindStencil.C => cellToFace/extendedUpwindCellToFaceStencil.C} (92%) rename src/finiteVolume/fvMesh/extendedStencil/{extendedUpwindStencil.H => cellToFace/extendedUpwindCellToFaceStencil.H} (85%) rename src/finiteVolume/fvMesh/extendedStencil/{extendedUpwindStencilTemplates.C => cellToFace/extendedUpwindCellToFaceStencilTemplates.C} (98%) create mode 100644 src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.C create mode 100644 src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.H create mode 100644 src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.C create mode 100644 src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.H create mode 100644 src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.C create mode 100644 src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.H rename src/finiteVolume/fvMesh/extendedStencil/{faceStencil/faceEdgeCellStencil.C => cellToFace/fullStencils/FECCellToFaceStencil.C} (92%) rename src/finiteVolume/fvMesh/extendedStencil/{faceStencil/faceEdgeCellStencil.H => cellToFace/fullStencils/FECCellToFaceStencil.H} (83%) rename src/finiteVolume/fvMesh/extendedStencil/{faceStencil/faceStencil.C => cellToFace/fullStencils/cellToFaceStencil.C} (95%) rename src/finiteVolume/fvMesh/extendedStencil/{faceStencil/faceStencil.H => cellToFace/fullStencils/cellToFaceStencil.H} (89%) delete mode 100644 src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCECStencilObject.C delete mode 100644 src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCFCStencilObject.C delete mode 100644 src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCPCStencilObject.C delete mode 100644 src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindFECStencilObject.C create mode 100644 src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.C create mode 100644 src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.H create mode 100644 src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.C create mode 100644 src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.H create mode 100644 src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C create mode 100644 src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.H create mode 100644 src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencilTemplates.C create mode 100644 src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.C create mode 100644 src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.H create mode 100644 src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/faceToCellStencil.C create mode 100644 src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/faceToCellStencil.H diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 6e5b476daa..a438aa25b0 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -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 diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGrad.H b/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGrad.H index bc170c1466..035bb1d6db 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGrad.H +++ b/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGrad.H @@ -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& f = qfd.fit(); tmp > sft diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGradData.H b/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGradData.H index 12d5c90f54..bedb0570cc 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGradData.H +++ b/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGradData.H @@ -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_; } diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellEdgeCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.C similarity index 91% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellEdgeCellStencil.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.C index 034106f13a..fc167a2439 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellEdgeCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.C @@ -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); } diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellEdgeCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.H similarity index 84% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellEdgeCellStencil.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.H index 2cc8b21e33..27303ffd9f 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellEdgeCellStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.H @@ -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&); }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellFaceCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.C similarity index 89% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellFaceCellStencil.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.C index 263ebf0d04..7c718cacfd 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellFaceCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.C @@ -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); } diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellFaceCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.H similarity index 82% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellFaceCellStencil.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.H index 174c4b7fee..c524b8d3ea 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellFaceCellStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.H @@ -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); }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellPointCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.C similarity index 90% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellPointCellStencil.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.C index 67b5be9a32..af6de874b6 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellPointCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.C @@ -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); } diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellPointCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.H similarity index 84% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellPointCellStencil.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.H index 6bd318338b..848e9044ab 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellPointCellStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.H @@ -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&); }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.C new file mode 100644 index 0000000000..37af71f5e4 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.C @@ -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(pp)) + { + label bFaceI = pp.start()-mesh().nInternalFaces(); + forAll(pp, i) + { + isValidBFace[bFaceI++] = false; + } + } + } +} + + +Foam::autoPtr +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 + ( + new indirectPrimitivePatch + ( + IndirectList + ( + 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()) +{} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.H new file mode 100644 index 0000000000..08b7b0fb2f --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.H @@ -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 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 + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.C new file mode 100644 index 0000000000..ddc33f39e2 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.C @@ -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); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredFECStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.H similarity index 73% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredFECStencilObject.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.H index 8ce7efcaca..7f267d643c 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredFECStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.H @@ -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, - public extendedCentredStencil + public MeshObject, + public extendedCentredCellToFaceStencil { public: - TypeName("centredCFCStencil"); + TypeName("centredCECCellToFaceStencil"); // Constructors //- Construct from uncompacted face stencil - explicit centredFECStencilObject + explicit centredCECCellToFaceStencilObject ( const fvMesh& mesh ) : - MeshObject(mesh), - extendedCentredStencil(faceEdgeCellStencil(mesh)) + MeshObject(mesh), + extendedCentredCellToFaceStencil(CECCellToFaceStencil(mesh)) {} // Destructor - virtual ~centredFECStencilObject() + virtual ~centredCECCellToFaceStencilObject() {} }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.C new file mode 100644 index 0000000000..675b929870 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.C @@ -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); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCFCStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.H similarity index 73% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCFCStencilObject.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.H index 43b87a31f0..6ae971e2a7 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCFCStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.H @@ -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, - public extendedCentredStencil + public MeshObject, + public extendedCentredCellToFaceStencil { public: - TypeName("centredCFCStencil"); + TypeName("centredCFCCellToFaceStencil"); // Constructors //- Construct from uncompacted face stencil - explicit centredCFCStencilObject + explicit centredCFCCellToFaceStencilObject ( const fvMesh& mesh ) : - MeshObject(mesh), - extendedCentredStencil(cellFaceCellStencil(mesh)) + MeshObject(mesh), + extendedCentredCellToFaceStencil(CFCCellToFaceStencil(mesh)) {} //- Destructor - virtual ~centredCFCStencilObject() + virtual ~centredCFCCellToFaceStencilObject() {} }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.C new file mode 100644 index 0000000000..cf0fc71cf4 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.C @@ -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); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCPCStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.H similarity index 73% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCPCStencilObject.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.H index 183c0808cc..392b544f40 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCPCStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.H @@ -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, - public extendedCentredStencil + public MeshObject, + public extendedCentredCellToFaceStencil { public: - TypeName("centredCFCStencil"); + TypeName("centredCFCCellToFaceStencil"); // Constructors //- Construct from uncompacted face stencil - explicit centredCPCStencilObject + explicit centredCPCCellToFaceStencilObject ( const fvMesh& mesh ) : - MeshObject(mesh), - extendedCentredStencil(cellPointCellStencil(mesh)) + MeshObject(mesh), + extendedCentredCellToFaceStencil(CPCCellToFaceStencil(mesh)) {} // Destructor - virtual ~centredCPCStencilObject() + virtual ~centredCPCCellToFaceStencilObject() {} }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.C new file mode 100644 index 0000000000..b66c40ce05 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.C @@ -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); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCECStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.H similarity index 73% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCECStencilObject.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.H index 29ece11951..d8efe704a7 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCECStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.H @@ -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, - public extendedCentredStencil + public MeshObject, + public extendedCentredCellToFaceStencil { public: - TypeName("centredCECStencil"); + TypeName("centredCFCCellToFaceStencil"); // Constructors //- Construct from uncompacted face stencil - explicit centredCECStencilObject + explicit centredFECCellToFaceStencilObject ( const fvMesh& mesh ) : - MeshObject(mesh), - extendedCentredStencil(cellEdgeCellStencil(mesh)) + MeshObject(mesh), + extendedCentredCellToFaceStencil(FECCellToFaceStencil(mesh)) {} // Destructor - virtual ~centredCECStencilObject() + virtual ~centredFECCellToFaceStencilObject() {} }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredFECStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.C similarity index 92% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredFECStencilObject.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.C index ba7351994a..1c5271b132 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredFECStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.C @@ -24,14 +24,14 @@ License \*---------------------------------------------------------------------------*/ -#include "centredFECStencilObject.H" +#include "upwindCECCellToFaceStencilObject.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(centredFECStencilObject, 0); + defineTypeNameAndDebug(upwindCECCellToFaceStencilObject, 0); } diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCFCStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.H similarity index 71% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCFCStencilObject.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.H index de8972c112..05c0c39779 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCFCStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.H @@ -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, - public extendedUpwindStencil + public MeshObject, + public extendedUpwindCellToFaceStencil { public: - TypeName("upwindCFCStencil"); + TypeName("upwindCFCCellToFaceStencil"); // Constructors //- Construct from uncompacted face stencil - explicit upwindCFCStencilObject + explicit upwindCECCellToFaceStencilObject ( const fvMesh& mesh, const scalar minOpposedness ) : - MeshObject(mesh), - extendedUpwindStencil(cellFaceCellStencil(mesh), minOpposedness) + MeshObject(mesh), + extendedUpwindCellToFaceStencil + ( + CECCellToFaceStencil(mesh), + minOpposedness + ) {} // Destructor - virtual ~upwindCFCStencilObject() + virtual ~upwindCECCellToFaceStencilObject() {} }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCECStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.C similarity index 92% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCECStencilObject.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.C index 6a1e250065..18ea213722 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCECStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.C @@ -24,14 +24,14 @@ License \*---------------------------------------------------------------------------*/ -#include "centredCECStencilObject.H" +#include "upwindCFCCellToFaceStencilObject.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(centredCECStencilObject, 0); + defineTypeNameAndDebug(upwindCFCCellToFaceStencilObject, 0); } diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCPCStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.H similarity index 71% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCPCStencilObject.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.H index b73d258205..b335d724d0 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCPCStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.H @@ -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, - public extendedUpwindStencil + public MeshObject, + public extendedUpwindCellToFaceStencil { public: - TypeName("upwindCFCStencil"); + TypeName("upwindCFCCellToFaceStencil"); // Constructors //- Construct from uncompacted face stencil - explicit upwindCPCStencilObject + explicit upwindCFCCellToFaceStencilObject ( const fvMesh& mesh, const scalar minOpposedness ) : - MeshObject(mesh), - extendedUpwindStencil(cellPointCellStencil(mesh), minOpposedness) + MeshObject(mesh), + extendedUpwindCellToFaceStencil + ( + FECCellToFaceStencil(mesh), + minOpposedness + ) {} // Destructor - virtual ~upwindCPCStencilObject() + virtual ~upwindCFCCellToFaceStencilObject() {} }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCPCStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.C similarity index 92% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCPCStencilObject.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.C index db5bf143ae..1f1e3448ca 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCPCStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.C @@ -24,14 +24,14 @@ License \*---------------------------------------------------------------------------*/ -#include "centredCPCStencilObject.H" +#include "upwindCPCCellToFaceStencilObject.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(centredCPCStencilObject, 0); + defineTypeNameAndDebug(upwindCPCCellToFaceStencilObject, 0); } diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCECStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.H similarity index 71% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCECStencilObject.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.H index dc4544e9b3..a0677af97d 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCECStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.H @@ -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, - public extendedUpwindStencil + public MeshObject, + public extendedUpwindCellToFaceStencil { public: - TypeName("upwindCFCStencil"); + TypeName("upwindCFCCellToFaceStencil"); // Constructors //- Construct from uncompacted face stencil - explicit upwindCECStencilObject + explicit upwindCPCCellToFaceStencilObject ( const fvMesh& mesh, const scalar minOpposedness ) : - MeshObject(mesh), - extendedUpwindStencil(cellEdgeCellStencil(mesh), minOpposedness) + MeshObject(mesh), + extendedUpwindCellToFaceStencil + ( + CPCCellToFaceStencil(mesh), + minOpposedness + ) {} // Destructor - virtual ~upwindCECStencilObject() + virtual ~upwindCPCCellToFaceStencilObject() {} }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCFCStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.C similarity index 92% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCFCStencilObject.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.C index e7ebaa389b..d397daf01f 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCFCStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.C @@ -24,14 +24,14 @@ License \*---------------------------------------------------------------------------*/ -#include "centredCFCStencilObject.H" +#include "upwindFECCellToFaceStencilObject.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(centredCFCStencilObject, 0); + defineTypeNameAndDebug(upwindFECCellToFaceStencilObject, 0); } diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindFECStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.H similarity index 71% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindFECStencilObject.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.H index 478774013a..84167c9be8 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindFECStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.H @@ -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, - public extendedUpwindStencil + public MeshObject, + public extendedUpwindCellToFaceStencil { public: - TypeName("upwindCFCStencil"); + TypeName("upwindCFCCellToFaceStencil"); // Constructors //- Construct from uncompacted face stencil - explicit upwindFECStencilObject + explicit upwindFECCellToFaceStencilObject ( const fvMesh& mesh, const scalar minOpposedness ) : - MeshObject(mesh), - extendedUpwindStencil(faceEdgeCellStencil(mesh), minOpposedness) + MeshObject(mesh), + extendedUpwindCellToFaceStencil + ( + FECCellToFaceStencil(mesh), + minOpposedness + ) {} // Destructor - virtual ~upwindFECStencilObject() + virtual ~upwindFECCellToFaceStencilObject() {} }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C similarity index 93% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencil.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C index 38804ccbc1..ac0f64d9ef 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C @@ -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::extendedStencil::calcDistributeMap +Foam::autoPtr +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::extendedStencil::calcDistributeMap // these are always all needed. List > 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::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::extendedStencil::calcDistributeMap { recvCompact[procI] = compactStart[procI] - + identity(mesh_.nCells()+nBnd); + + identity(globalNumbering.localSize()); } } labelListList sendCompact(Pstream::nProcs()); @@ -228,7 +227,7 @@ Foam::autoPtr Foam::extendedStencil::calcDistributeMap // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::extendedStencil::extendedStencil(const polyMesh& mesh) +Foam::extendedCellToFaceStencil::extendedCellToFaceStencil(const polyMesh& mesh) : mesh_(mesh) {} diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.H similarity index 84% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencil.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.H index a1c6d41474..269eb391ab 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.H @@ -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 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 calcDistributeMap + ( + const polyMesh& mesh, + const globalIndex& globalNumbering, + labelListList& faceStencil + ); + //- Use map to get the data into stencil order template static void collectData @@ -134,7 +136,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "extendedStencilTemplates.C" +# include "extendedCellToFaceStencilTemplates.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilTemplates.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C similarity index 97% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilTemplates.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C index 537b7520d8..8e55a5266b 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilTemplates.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C @@ -24,12 +24,12 @@ License \*---------------------------------------------------------------------------*/ -#include "extendedStencil.H" +#include "extendedCellToFaceStencil.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::extendedStencil::collectData +void Foam::extendedCellToFaceStencil::collectData ( const mapDistribute& map, const labelListList& stencil, @@ -79,7 +79,7 @@ void Foam::extendedStencil::collectData template Foam::tmp > -Foam::extendedStencil::weightedSum +Foam::extendedCellToFaceStencil::weightedSum ( const mapDistribute& map, const labelListList& stencil, diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedCentredStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.C similarity index 79% rename from src/finiteVolume/fvMesh/extendedStencil/extendedCentredStencil.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.C index 252357a5f2..acca48566f 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedCentredStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.C @@ -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); diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedCentredStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.H similarity index 79% rename from src/finiteVolume/fvMesh/extendedStencil/extendedCentredStencil.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.H index edbf5ea485..c58e81db92 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedCentredStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.H @@ -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 >& 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 >& stencilWeights ) const { - return extendedStencil::weightedSum + return extendedCellToFaceStencil::weightedSum ( map(), stencil(), diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.C similarity index 92% rename from src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencil.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.C index b7fa870cf7..11f094415d 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.C @@ -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_ ); diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.H similarity index 85% rename from src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencil.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.H index 174eb27a9d..9b9ef1fd57 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.H @@ -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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencilTemplates.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C similarity index 98% rename from src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencilTemplates.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C index 5482261df8..be9409c9f9 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencilTemplates.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C @@ -24,13 +24,13 @@ License \*---------------------------------------------------------------------------*/ -#include "extendedStencil.H" +#include "extendedCellToFaceStencil.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template Foam::tmp > -Foam::extendedUpwindStencil::weightedSum +Foam::extendedUpwindCellToFaceStencil::weightedSum ( const surfaceScalarField& phi, const GeometricField& fld, diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.C new file mode 100644 index 0000000000..d7d7797da8 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.C @@ -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); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.H new file mode 100644 index 0000000000..640c2aa4f4 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.H @@ -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 + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.C new file mode 100644 index 0000000000..9f19c90053 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.C @@ -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); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.H new file mode 100644 index 0000000000..a05b1b7aa6 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.H @@ -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 + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.C new file mode 100644 index 0000000000..3414af9932 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.C @@ -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); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.H new file mode 100644 index 0000000000..a82886e111 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.H @@ -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 + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceEdgeCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.C similarity index 92% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceEdgeCellStencil.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.C index 2d56b1b194..2d79bd2048 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceEdgeCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.C @@ -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; diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceEdgeCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.H similarity index 83% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceEdgeCellStencil.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.H index dfbb990fbc..6a00f702ea 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceEdgeCellStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.H @@ -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&); }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.C similarity index 95% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceStencil.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.C index a0dac7b004..89a2cc5fec 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.C @@ -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::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()) diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.H similarity index 89% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceStencil.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.H index a7e3105bc7..e577a857d5 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.H @@ -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 diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCECStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCECStencilObject.C deleted file mode 100644 index f27e24118f..0000000000 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCECStencilObject.C +++ /dev/null @@ -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); -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCFCStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCFCStencilObject.C deleted file mode 100644 index 81292b002e..0000000000 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCFCStencilObject.C +++ /dev/null @@ -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); -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCPCStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCPCStencilObject.C deleted file mode 100644 index 36f0c19b34..0000000000 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCPCStencilObject.C +++ /dev/null @@ -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); -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindFECStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindFECStencilObject.C deleted file mode 100644 index d9202eaa6d..0000000000 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindFECStencilObject.C +++ /dev/null @@ -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); -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.C new file mode 100644 index 0000000000..87d4a4a488 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.C @@ -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); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.H new file mode 100644 index 0000000000..4877d63a5a --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.H @@ -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, + public extendedCentredFaceToCellStencil +{ + +public: + + TypeName("centredCFCFaceToCellStencil"); + + // Constructors + + //- Construct from uncompacted face stencil + explicit centredCFCFaceToCellStencilObject + ( + const fvMesh& mesh + ) + : + MeshObject(mesh), + extendedCentredFaceToCellStencil(CFCFaceToCellStencil(mesh)) + {} + + + //- Destructor + virtual ~centredCFCFaceToCellStencilObject() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.C new file mode 100644 index 0000000000..d7dcc2a093 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.C @@ -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); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.H new file mode 100644 index 0000000000..137679f226 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.H @@ -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 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 + void collectData + ( + const GeometricField& fld, + List >& stencilFld + ) const + { + extendedFaceToCellStencil::collectData + ( + map(), + stencil(), + fld, + stencilFld + ); + } + + //- Sum surface field contributions to create cell values + template + tmp > weightedSum + ( + const GeometricField& fld, + const List >& stencilWeights + ) const + { + return extendedFaceToCellStencil::weightedSum + ( + map(), + stencil(), + fld, + stencilWeights + ); + } + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C new file mode 100644 index 0000000000..0328c27dd4 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C @@ -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) +{} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.H new file mode 100644 index 0000000000..38681d15f5 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.H @@ -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 + static void collectData + ( + const mapDistribute& map, + const labelListList& stencil, + const GeometricField& fld, + List >& stencilFld + ); + + //- Sum surface field contributions to create cell values + template + static tmp > weightedSum + ( + const mapDistribute& map, + const labelListList& stencil, + const GeometricField& fld, + const List >& stencilWeights + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "extendedFaceToCellStencilTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencilTemplates.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencilTemplates.C new file mode 100644 index 0000000000..17210c360c --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencilTemplates.C @@ -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 +void Foam::extendedFaceToCellStencil::collectData +( + const mapDistribute& map, + const labelListList& stencil, + const GeometricField& fld, + List >& stencilFld +) +{ + // 1. Construct face data in compact addressing + List compactFld(map.constructSize(), pTraits::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& 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 +Foam::tmp > +Foam::extendedFaceToCellStencil::weightedSum +( + const mapDistribute& map, + const labelListList& stencil, + const GeometricField& fld, + const List >& stencilWeights +) +{ + const fvMesh& mesh = fld.mesh(); + + // Collect internal and boundary values + List > stencilFld; + collectData(map, stencil, fld, stencilFld); + + tmp > tsfCorr + ( + new GeometricField + ( + IOobject + ( + fld.name(), + mesh.time().timeName(), + mesh + ), + mesh, + dimensioned + ( + fld.name(), + fld.dimensions(), + pTraits::zero + ) + ) + ); + GeometricField& sf = tsfCorr(); + + // cells + forAll(sf, cellI) + { + const List& stField = stencilFld[cellI]; + const List& stWeight = stencilWeights[cellI]; + + forAll(stField, i) + { + sf[cellI] += stField[i]*stWeight[i]; + } + } + + // Boundaries values? + + return tsfCorr; +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.C new file mode 100644 index 0000000000..c0d2302f0b --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.C @@ -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(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(pp)) + { + label bFaceI = pp.start()-mesh().nInternalFaces(); + forAll(pp, i) + { + validBFace[bFaceI++] = false; + } + } + } + + + // Determine faces of cellCells in global numbering + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + DynamicList