CPCCellToCellStencil.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "CPCCellToCellStencil.H"
00028 #include "syncTools.H"
00029
00030
00031
00032
00033 void Foam::CPCCellToCellStencil::calcPointBoundaryData
00034 (
00035 const boolList& isValidBFace,
00036 const labelList& boundaryPoints,
00037 Map<labelList>& neiGlobal
00038 ) const
00039 {
00040 neiGlobal.resize(2*boundaryPoints.size());
00041
00042 labelHashSet pointGlobals;
00043
00044 forAll(boundaryPoints, i)
00045 {
00046 label pointI = boundaryPoints[i];
00047
00048 neiGlobal.insert
00049 (
00050 pointI,
00051 calcFaceCells
00052 (
00053 isValidBFace,
00054 mesh().pointFaces()[pointI],
00055 pointGlobals
00056 )
00057 );
00058 }
00059
00060 syncTools::syncPointMap
00061 (
00062 mesh(),
00063 neiGlobal,
00064 unionEqOp(),
00065 false
00066 );
00067 }
00068
00069
00070
00071
00072 void Foam::CPCCellToCellStencil::calcCellStencil
00073 (
00074 labelListList& globalCellCells
00075 ) const
00076 {
00077
00078 labelList boundaryPoints(allCoupledFacesPatch()().meshPoints());
00079
00080
00081
00082 boolList isValidBFace;
00083 validBoundaryFaces(isValidBFace);
00084
00085
00086
00087 Map<labelList> neiGlobal;
00088 calcPointBoundaryData
00089 (
00090 isValidBFace,
00091 boundaryPoints,
00092 neiGlobal
00093 );
00094
00095 globalCellCells.setSize(mesh().nCells());
00096
00097
00098
00099 forAll(boundaryPoints, i)
00100 {
00101 label pointI = boundaryPoints[i];
00102
00103 const labelList& pGlobals = neiGlobal[pointI];
00104
00105
00106 const labelList& pCells = mesh().pointCells(pointI);
00107
00108 forAll(pCells, j)
00109 {
00110 label cellI = pCells[j];
00111
00112
00113 merge
00114 (
00115 globalNumbering().toGlobal(cellI),
00116 pGlobals,
00117 globalCellCells[cellI]
00118 );
00119 }
00120 }
00121 neiGlobal.clear();
00122
00123
00124 labelHashSet pointGlobals;
00125
00126 for (label pointI = 0; pointI < mesh().nPoints(); pointI++)
00127 {
00128 labelList pGlobals
00129 (
00130 calcFaceCells
00131 (
00132 isValidBFace,
00133 mesh().pointFaces()[pointI],
00134 pointGlobals
00135 )
00136 );
00137
00138 const labelList& pCells = mesh().pointCells(pointI);
00139
00140 forAll(pCells, j)
00141 {
00142 label cellI = pCells[j];
00143
00144 merge
00145 (
00146 globalNumbering().toGlobal(cellI),
00147 pGlobals,
00148 globalCellCells[cellI]
00149 );
00150 }
00151 }
00152 }
00153
00154
00155
00156
00157 Foam::CPCCellToCellStencil::CPCCellToCellStencil(const polyMesh& mesh)
00158 :
00159 cellToCellStencil(mesh)
00160 {
00161
00162 labelListList globalCellCells;
00163 calcCellStencil(*this);
00164 }
00165
00166
00167
Copyright © 2000-2009 OpenCFD Ltd