mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: renumberMesh: make frontwidth calculation an option
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-DFULLDEBUG -g -O0 \
|
/* -DFULLDEBUG -g -O0 */ \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
|||||||
@ -108,6 +108,7 @@ label getBand(const labelList& owner, const labelList& neighbour)
|
|||||||
// Calculate band of matrix
|
// Calculate band of matrix
|
||||||
void getBand
|
void getBand
|
||||||
(
|
(
|
||||||
|
const bool calculateIntersect,
|
||||||
const label nCells,
|
const label nCells,
|
||||||
const labelList& owner,
|
const labelList& owner,
|
||||||
const labelList& neighbour,
|
const labelList& neighbour,
|
||||||
@ -129,17 +130,22 @@ void getBand
|
|||||||
cellBandwidth[nei] = max(cellBandwidth[nei], diff);
|
cellBandwidth[nei] = max(cellBandwidth[nei], diff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bandwidth = max(cellBandwidth);
|
||||||
|
profile = sum(1.0*cellBandwidth);
|
||||||
|
|
||||||
|
sumSqrIntersect = 0.0;
|
||||||
|
if (calculateIntersect)
|
||||||
|
{
|
||||||
forAll(nIntersect, cellI)
|
forAll(nIntersect, cellI)
|
||||||
{
|
{
|
||||||
for (label colI = cellI-cellBandwidth[cellI]; colI <= cellI; colI++)
|
for (label colI = cellI-cellBandwidth[cellI]; colI <= cellI; colI++)
|
||||||
{
|
{
|
||||||
nIntersect[colI]++;
|
nIntersect[colI] += 1.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bandwidth = max(cellBandwidth);
|
|
||||||
profile = sum(cellBandwidth);
|
|
||||||
sumSqrIntersect = sum(Foam::sqr(nIntersect));
|
sumSqrIntersect = sum(Foam::sqr(nIntersect));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -565,6 +571,11 @@ int main(int argc, char *argv[])
|
|||||||
"dict",
|
"dict",
|
||||||
"renumber according to system/renumberMeshDict"
|
"renumber according to system/renumberMeshDict"
|
||||||
);
|
);
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"frontWidth",
|
||||||
|
"calculate the rms of the frontwidth"
|
||||||
|
);
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
@ -582,7 +593,7 @@ int main(int argc, char *argv[])
|
|||||||
const word oldInstance = mesh.pointsInstance();
|
const word oldInstance = mesh.pointsInstance();
|
||||||
|
|
||||||
const bool readDict = args.optionFound("dict");
|
const bool readDict = args.optionFound("dict");
|
||||||
|
const bool doFrontWidth = args.optionFound("frontWidth");
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.optionFound("overwrite");
|
||||||
|
|
||||||
label band;
|
label band;
|
||||||
@ -590,6 +601,7 @@ int main(int argc, char *argv[])
|
|||||||
scalar sumSqrIntersect;
|
scalar sumSqrIntersect;
|
||||||
getBand
|
getBand
|
||||||
(
|
(
|
||||||
|
doFrontWidth,
|
||||||
mesh.nCells(),
|
mesh.nCells(),
|
||||||
mesh.faceOwner(),
|
mesh.faceOwner(),
|
||||||
mesh.faceNeighbour(),
|
mesh.faceNeighbour(),
|
||||||
@ -1028,6 +1040,7 @@ int main(int argc, char *argv[])
|
|||||||
scalar sumSqrIntersect;
|
scalar sumSqrIntersect;
|
||||||
getBand
|
getBand
|
||||||
(
|
(
|
||||||
|
doFrontWidth,
|
||||||
mesh.nCells(),
|
mesh.nCells(),
|
||||||
mesh.faceOwner(),
|
mesh.faceOwner(),
|
||||||
mesh.faceNeighbour(),
|
mesh.faceNeighbour(),
|
||||||
|
|||||||
@ -41,6 +41,7 @@ method CuthillMcKee;
|
|||||||
//method manual;
|
//method manual;
|
||||||
//method random;
|
//method random;
|
||||||
//method spring;
|
//method spring;
|
||||||
|
//method boundaryFirst;
|
||||||
|
|
||||||
//CuthillMcKeeCoeffs
|
//CuthillMcKeeCoeffs
|
||||||
//{
|
//{
|
||||||
|
|||||||
Reference in New Issue
Block a user