STYLE: Code conformance tweaks

This commit is contained in:
andy
2011-06-14 13:23:45 +01:00
parent 2d2ecac7e5
commit cb684c42ba
2 changed files with 50 additions and 56 deletions

View File

@ -24,7 +24,7 @@ dict.add
dict.add("mergeDistance", SMALL); dict.add("mergeDistance", SMALL);
labelHashSet includePatches; labelHashSet includePatches;
forAll(patches, patchI) // forAll(patches, patchI)
{ {
if (!isA<processorPolyPatch>(patches[patchI])) if (!isA<processorPolyPatch>(patches[patchI]))
{ {

View File

@ -125,7 +125,6 @@ scalar calculateViewFactorFij
(cosThetaI*cosThetaJ*dAjMag*dAiMag) (cosThetaI*cosThetaJ*dAjMag*dAiMag)
/(sqr(rMag)*constant::mathematical::pi) /(sqr(rMag)*constant::mathematical::pi)
); );
} }
@ -152,7 +151,7 @@ void insertMatrixElements
} }
// Main program: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
@ -180,8 +179,6 @@ int main(int argc, char *argv[])
const bool dumpRays = const bool dumpRays =
viewFactorDict.lookupOrDefault<bool>("dumpRays", false); viewFactorDict.lookupOrDefault<bool>("dumpRays", false);
// Debug
// ~~~~~
const label debug = viewFactorDict.lookupOrDefault<label>("debug", 0); const label debug = viewFactorDict.lookupOrDefault<label>("debug", 0);
volScalarField Qr volScalarField Qr
@ -211,8 +208,8 @@ int main(int argc, char *argv[])
) )
); );
// - Create the coarse mesh using agglomeration // // Create the coarse mesh using agglomeration
//-----------------------------------------------// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (debug) if (debug)
{ {
@ -234,8 +231,8 @@ int main(int argc, char *argv[])
); );
// - Calculate total number of fine and coarse faces // // Calculate total number of fine and coarse faces
//---------------------------------------------------// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
label nCoarseFaces = 0; //total number of coarse faces label nCoarseFaces = 0; //total number of coarse faces
label nFineFaces = 0; //total number of fine faces label nFineFaces = 0; //total number of fine faces
@ -280,8 +277,8 @@ int main(int argc, char *argv[])
<< viewFactorsPatches << endl; << viewFactorsPatches << endl;
} }
// - Collect local Cf and Sf on coarse mesh //. // Collect local Cf and Sf on coarse mesh
//------------------------------------------// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DynamicList<point> localCoarseCf(nCoarseFaces); DynamicList<point> localCoarseCf(nCoarseFaces);
DynamicList<point> localCoarseSf(nCoarseFaces); DynamicList<point> localCoarseSf(nCoarseFaces);
@ -348,8 +345,8 @@ int main(int argc, char *argv[])
} }
} }
// - Collect remote Cf and Sf on coarse mesh //. // Collect remote Cf and Sf on coarse mesh
//------------------------------------------// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
List<pointField> remoteCoarseCf(Pstream::nProcs()); List<pointField> remoteCoarseCf(Pstream::nProcs());
List<pointField> remoteCoarseSf(Pstream::nProcs()); List<pointField> remoteCoarseSf(Pstream::nProcs());
@ -357,8 +354,8 @@ int main(int argc, char *argv[])
remoteCoarseCf[Pstream::myProcNo()] = localCoarseCf; remoteCoarseCf[Pstream::myProcNo()] = localCoarseCf;
remoteCoarseSf[Pstream::myProcNo()] = localCoarseSf; remoteCoarseSf[Pstream::myProcNo()] = localCoarseSf;
// - Collect remote Cf and Sf on fine mesh //. // Collect remote Cf and Sf on fine mesh
//------------------------------------------// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
List<pointField> remoteFineCf(Pstream::nProcs()); List<pointField> remoteFineCf(Pstream::nProcs());
List<pointField> remoteFineSf(Pstream::nProcs()); List<pointField> remoteFineSf(Pstream::nProcs());
@ -367,7 +364,7 @@ int main(int argc, char *argv[])
remoteCoarseSf[Pstream::myProcNo()] = localCoarseSf; remoteCoarseSf[Pstream::myProcNo()] = localCoarseSf;
// Distribute local coarse Cf and Sf for shooting rays // Distribute local coarse Cf and Sf for shooting rays
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pstream::gatherList(remoteCoarseCf); Pstream::gatherList(remoteCoarseCf);
Pstream::scatterList(remoteCoarseCf); Pstream::scatterList(remoteCoarseCf);
@ -382,19 +379,15 @@ int main(int argc, char *argv[])
// Determine rays between coarse face centres // Determine rays between coarse face centres
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DynamicList<label> rayStartFace DynamicList<label> rayStartFace(nCoarseFaces + 0.01*nCoarseFaces);
(
nCoarseFaces
+ 0.01*nCoarseFaces
);
DynamicList<label> rayEndFace(rayStartFace.size()); DynamicList<label> rayEndFace(rayStartFace.size());
globalIndex globalNumbering(nCoarseFaces); globalIndex globalNumbering(nCoarseFaces);
//- Return rayStartFace in local index andrayEndFace in global index // // Return rayStartFace in local index andrayEndFace in global index
// ------------------------------------------------------------------// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include "shootRays.H" #include "shootRays.H"
@ -476,7 +469,7 @@ int main(int argc, char *argv[])
// visibleFaceFaces has: // visibleFaceFaces has:
// (local face, local viewed face) = compact viewed face // (local face, local viewed face) = compact viewed face
//------------------------------------------------------------// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nVisibleFaceFaces = 0; nVisibleFaceFaces = 0;
forAll(rayStartFace, i) forAll(rayStartFace, i)
@ -489,7 +482,7 @@ int main(int argc, char *argv[])
// Construct data in compact addressing // Construct data in compact addressing
// I need coarse Sf (Ai), fine Sf (dAi) and fine Cf(r) to calculate Fij // I need coarse Sf (Ai), fine Sf (dAi) and fine Cf(r) to calculate Fij
// --------------------------------------------------------------------// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pointField compactCoarseCf(map.constructSize(), pTraits<vector>::zero); pointField compactCoarseCf(map.constructSize(), pTraits<vector>::zero);
pointField compactCoarseSf(map.constructSize(), pTraits<vector>::zero); pointField compactCoarseSf(map.constructSize(), pTraits<vector>::zero);
@ -560,7 +553,7 @@ int main(int argc, char *argv[])
// Fill local view factor matrix // Fill local view factor matrix
//----------------------------- // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scalarListIOList F scalarListIOList F
( (
@ -858,4 +851,5 @@ int main(int argc, char *argv[])
return 0; return 0;
} }
// ************************************************************************* // // ************************************************************************* //