CECCellToCellStencil.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 "CECCellToCellStencil.H"
00028 #include "syncTools.H"
00029
00030
00031
00032
00033 void Foam::CECCellToCellStencil::calcEdgeBoundaryData
00034 (
00035 const boolList& isValidBFace,
00036 const labelList& boundaryEdges,
00037 EdgeMap<labelList>& neiGlobal
00038 ) const
00039 {
00040 neiGlobal.resize(2*boundaryEdges.size());
00041
00042 labelHashSet edgeGlobals;
00043
00044 forAll(boundaryEdges, i)
00045 {
00046 label edgeI = boundaryEdges[i];
00047
00048 neiGlobal.insert
00049 (
00050 mesh().edges()[edgeI],
00051 calcFaceCells
00052 (
00053 isValidBFace,
00054 mesh().edgeFaces(edgeI),
00055 edgeGlobals
00056 )
00057 );
00058 }
00059
00060 syncTools::syncEdgeMap
00061 (
00062 mesh(),
00063 neiGlobal,
00064 unionEqOp(),
00065 false
00066 );
00067 }
00068
00069
00070
00071
00072 void Foam::CECCellToCellStencil::calcCellStencil
00073 (
00074 labelListList& globalCellCells
00075 ) const
00076 {
00077
00078 labelList boundaryEdges
00079 (
00080 allCoupledFacesPatch()().meshEdges
00081 (
00082 mesh().edges(),
00083 mesh().pointEdges()
00084 )
00085 );
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112 boolList isValidBFace;
00113 validBoundaryFaces(isValidBFace);
00114
00115
00116
00117
00118
00119 EdgeMap<labelList> neiGlobal;
00120 calcEdgeBoundaryData
00121 (
00122 isValidBFace,
00123 boundaryEdges,
00124 neiGlobal
00125 );
00126
00127 globalCellCells.setSize(mesh().nCells());
00128
00129
00130
00131 forAll(boundaryEdges, i)
00132 {
00133 label edgeI = boundaryEdges[i];
00134
00135 const labelList& eGlobals = neiGlobal[mesh().edges()[edgeI]];
00136
00137
00138 const labelList& eCells = mesh().edgeCells(edgeI);
00139
00140 forAll(eCells, j)
00141 {
00142 label cellI = eCells[j];
00143
00144
00145 merge
00146 (
00147 globalNumbering().toGlobal(cellI),
00148 eGlobals,
00149 globalCellCells[cellI]
00150 );
00151 }
00152 }
00153 neiGlobal.clear();
00154
00155
00156 labelHashSet edgeGlobals;
00157
00158 for (label edgeI = 0; edgeI < mesh().nEdges(); edgeI++)
00159 {
00160 labelList eGlobals
00161 (
00162 calcFaceCells
00163 (
00164 isValidBFace,
00165 mesh().edgeFaces(edgeI),
00166 edgeGlobals
00167 )
00168 );
00169
00170 const labelList& eCells = mesh().edgeCells(edgeI);
00171
00172 forAll(eCells, j)
00173 {
00174 label cellI = eCells[j];
00175
00176 merge
00177 (
00178 globalNumbering().toGlobal(cellI),
00179 eGlobals,
00180 globalCellCells[cellI]
00181 );
00182 }
00183 }
00184 }
00185
00186
00187
00188
00189 Foam::CECCellToCellStencil::CECCellToCellStencil(const polyMesh& mesh)
00190 :
00191 cellToCellStencil(mesh)
00192 {
00193
00194 calcCellStencil(*this);
00195 }
00196
00197
00198
Copyright © 2000-2009 OpenCFD Ltd