mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -206,9 +206,9 @@ int main(int argc, char *argv[])
|
||||
runTime.timeName(),
|
||||
runTime
|
||||
),
|
||||
mesh.points(),
|
||||
mesh.faces(),
|
||||
mesh.cells()
|
||||
xferCopy(mesh.points()), // could we safely re-use the data?
|
||||
xferCopy(mesh.faces()),
|
||||
xferCopy(mesh.cells())
|
||||
);
|
||||
|
||||
// Add the boundary patches
|
||||
|
||||
@ -7,14 +7,12 @@ set -x
|
||||
|
||||
|
||||
# build libccmio and create lnInclude directory
|
||||
(
|
||||
cd $WM_THIRD_PARTY_DIR && ./AllwmakeLibccmio
|
||||
)
|
||||
( cd $WM_THIRD_PARTY_DIR && ./AllwmakeLibccmio )
|
||||
|
||||
# if the library built okay, the headers should exist too
|
||||
# if the library built properly, the headers should exist too
|
||||
if [ -e $FOAM_LIBBIN/libccmio.so ]
|
||||
then
|
||||
wmake ccm26ToFoam
|
||||
wmake ccm26ToFoam
|
||||
fi
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
@ -281,7 +281,7 @@ int main(int argc, char *argv[])
|
||||
)
|
||||
{
|
||||
// Scale points for the given scale factor
|
||||
points[i++] = scaleFactor*pointIter();
|
||||
points[i++] = scaleFactor * pointIter();
|
||||
}
|
||||
|
||||
|
||||
@ -479,7 +479,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cellShapes,
|
||||
boundary,
|
||||
patchNames,
|
||||
|
||||
@ -727,7 +727,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cellShapes,
|
||||
boundary,
|
||||
patchNames,
|
||||
|
||||
@ -54,7 +54,10 @@ using namespace Foam;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Scalae factor used to scale points (optional command line argument)
|
||||
// Line number
|
||||
label lineNo = 1;
|
||||
|
||||
// Scale factor used to scale points (optional command line argument)
|
||||
scalar scaleFactor = 1.0;
|
||||
|
||||
label dimensionOfGrid = 0;
|
||||
@ -131,8 +134,6 @@ one_space [ \t\f]
|
||||
space {one_space}*
|
||||
some_space {one_space}+
|
||||
cspace ","{space}
|
||||
nl (\n|\r)
|
||||
spaceNl ({space}|{nl})*
|
||||
|
||||
alpha [_[:alpha:]]
|
||||
digit [[:digit:]]
|
||||
@ -146,7 +147,7 @@ quote \"
|
||||
dash "-"
|
||||
dotColonDash [.:-]
|
||||
|
||||
schemeSpecialInitial [!$%&*/\\:<=>?~_^#.@]
|
||||
schemeSpecialInitial [!$%&*/\\:<=>?~_^#.@']
|
||||
schemeSpecialSubsequent [.+-]
|
||||
schemeSymbol (({some_space}|{alpha}|{quote}|{schemeSpecialInitial})({alpha}|{quote}|{digit}|{schemeSpecialInitial}|{schemeSpecialSubsequent})*)
|
||||
|
||||
@ -187,23 +188,23 @@ time ({digit}{digit}":"{digit}{digit}":"{digit}{digit})
|
||||
|
||||
versionNumber ({digit}|".")*
|
||||
|
||||
header {spaceNl}"(1"{space}
|
||||
dimension {spaceNl}"(2"{space}
|
||||
points {spaceNl}"(10"{space}
|
||||
faces {spaceNl}"(13"{space}
|
||||
cells {spaceNl}"(12"{space}
|
||||
zoneVariant1 {spaceNl}"(39"{space}
|
||||
zoneVariant2 {spaceNl}"(45"{space}
|
||||
faceTree {spaceNl}"(59"{space}
|
||||
header {space}"(1"{space}
|
||||
dimension {space}"(2"{space}
|
||||
points {space}"(10"{space}
|
||||
faces {space}"(13"{space}
|
||||
cells {space}"(12"{space}
|
||||
zoneVariant1 {space}"(39"{space}
|
||||
zoneVariant2 {space}"(45"{space}
|
||||
faceTree {space}"(59"{space}
|
||||
|
||||
comment "0"{space}
|
||||
unknownPeriodicFace "17"{space}
|
||||
periodicFace "18"{space}
|
||||
cellTree "58"{space}
|
||||
faceParents "61"{space}
|
||||
ignoreBlocks ("4"|"37"|"38"|"41"|"60"|"64"){space}
|
||||
ignoreBlocks ("4"|"37"|"38"|"40"|"41"|"60"|"64"){space}
|
||||
|
||||
redundantBlock {spaceNl}({comment}|{unknownPeriodicFace}|{periodicFace}|{cellTree}|{faceParents}|{ignoreBlocks}){space}
|
||||
redundantBlock {space}({comment}|{unknownPeriodicFace}|{periodicFace}|{cellTree}|{faceParents}|{ignoreBlocks}){space}
|
||||
|
||||
endOfSection {space}")"{space}
|
||||
|
||||
@ -290,7 +291,7 @@ endOfSection {space}")"{space}
|
||||
BEGIN(readPointHeader);
|
||||
}
|
||||
|
||||
<readPointHeader>{spaceNl}{lbrac}{space}"0"{space}"1"{space} {
|
||||
<readPointHeader>{space}{lbrac}{space}"0"{space}"1"{space} {
|
||||
BEGIN(readNumberOfPoints);
|
||||
}
|
||||
|
||||
@ -302,7 +303,7 @@ endOfSection {space}")"{space}
|
||||
// Ignore rest of stream
|
||||
}
|
||||
|
||||
<readPointHeader>{spaceNl}{lbrac} {
|
||||
<readPointHeader>{space}{lbrac} {
|
||||
BEGIN(readPointGroupData);
|
||||
}
|
||||
|
||||
@ -342,7 +343,7 @@ endOfSection {space}")"{space}
|
||||
BEGIN(readPointData);
|
||||
}
|
||||
|
||||
<readPointData>{spaceNl}{lbrac}{spaceNl} {
|
||||
<readPointData>{space}{lbrac}{space} {
|
||||
Info<< ". Reading points..." << flush;
|
||||
cmpt = 0;
|
||||
yy_push_state(readScalarList);
|
||||
@ -350,19 +351,32 @@ endOfSection {space}")"{space}
|
||||
|
||||
<readScalarList>{signedInteger}{space} {
|
||||
points[pointi][cmpt++] = scaleFactor*atol(YYText());
|
||||
|
||||
if (cmpt == pointGroupNumberOfComponents)
|
||||
{
|
||||
if (pointGroupNumberOfComponents == 2)
|
||||
{
|
||||
points[pointi].z() = 0.0;
|
||||
}
|
||||
|
||||
cmpt = 0;
|
||||
pointi++;
|
||||
}
|
||||
}
|
||||
|
||||
<readScalarList>{scalar}{space} {
|
||||
points[pointi][cmpt++] = scaleFactor*atof(YYText());
|
||||
}
|
||||
|
||||
<readScalarList>{spaceNl} {
|
||||
if (pointGroupNumberOfComponents == 2)
|
||||
if (cmpt == pointGroupNumberOfComponents)
|
||||
{
|
||||
points[pointi].z() = 0.0;
|
||||
if (pointGroupNumberOfComponents == 2)
|
||||
{
|
||||
points[pointi].z() = 0.0;
|
||||
}
|
||||
|
||||
cmpt = 0;
|
||||
pointi++;
|
||||
}
|
||||
cmpt = 0;
|
||||
pointi++;
|
||||
}
|
||||
|
||||
<readScalarList>{endOfSection} {
|
||||
@ -372,12 +386,13 @@ endOfSection {space}")"{space}
|
||||
if (pointi != pointGroupEndIndex[pointGroupEndIndex.size()-1]+1)
|
||||
{
|
||||
Warning
|
||||
<< "Problem with reading points: "
|
||||
<< "start index: "
|
||||
<< "Problem with reading points: " << nl
|
||||
<< " start index: "
|
||||
<< pointGroupStartIndex[pointGroupStartIndex.size()-1]
|
||||
<< " end index: "
|
||||
<< pointGroupEndIndex[pointGroupEndIndex.size()-1]
|
||||
<< " last points read: " << pointi << endl;
|
||||
<< " last points read: " << pointi << nl
|
||||
<< " on line " << lineNo << endl;
|
||||
}
|
||||
|
||||
yy_pop_state();
|
||||
@ -387,7 +402,7 @@ endOfSection {space}")"{space}
|
||||
BEGIN(readFaceHeader);
|
||||
}
|
||||
|
||||
<readFaceHeader>{spaceNl}{lbrac}{space}"0"{space}"1"{space} {
|
||||
<readFaceHeader>{space}{lbrac}{space}"0"{space}"1"{space} {
|
||||
BEGIN(readNumberOfFaces);
|
||||
}
|
||||
|
||||
@ -403,7 +418,7 @@ endOfSection {space}")"{space}
|
||||
// Type and element type not read
|
||||
}
|
||||
|
||||
<readFaceHeader>{spaceNl}{lbrac} {
|
||||
<readFaceHeader>{space}{lbrac} {
|
||||
BEGIN(readFaceGroupData);
|
||||
}
|
||||
|
||||
@ -431,12 +446,12 @@ endOfSection {space}")"{space}
|
||||
<< faceGroupEndIndex[faceGroupEndIndex.size()-1] << flush;
|
||||
}
|
||||
|
||||
<readNumberOfFaces,readFaceGroupData>{spaceNl}{endOfSection} {
|
||||
<readNumberOfFaces,readFaceGroupData>{space}{endOfSection} {
|
||||
BEGIN(readFaceData);
|
||||
}
|
||||
|
||||
<readFaceData>{spaceNl}{lbrac} {
|
||||
if (faceGroupElementType == 0)
|
||||
<readFaceData>{space}{lbrac} {
|
||||
if (faceGroupElementType == 0 || faceGroupElementType > 4)
|
||||
{
|
||||
Info<< ". Reading mixed faces..." << flush;
|
||||
yy_push_state(readFacesMixed);
|
||||
@ -448,7 +463,7 @@ endOfSection {space}")"{space}
|
||||
}
|
||||
}
|
||||
|
||||
<readFacesMixed>{spaceNl}{hexLabelList} {
|
||||
<readFacesMixed>{space}{hexLabelList} {
|
||||
face& curFaceLabels = faces[facei];
|
||||
|
||||
// set size of label list
|
||||
@ -465,7 +480,7 @@ endOfSection {space}")"{space}
|
||||
facei++;
|
||||
}
|
||||
|
||||
<readFacesUniform>{spaceNl}{hexLabelList} {
|
||||
<readFacesUniform>{space}{hexLabelList} {
|
||||
face& curFaceLabels = faces[facei];
|
||||
|
||||
// Set size of label list.
|
||||
@ -484,19 +499,20 @@ endOfSection {space}")"{space}
|
||||
facei++;
|
||||
}
|
||||
|
||||
<readFacesMixed,readFacesUniform>{spaceNl}{endOfSection} {
|
||||
<readFacesMixed,readFacesUniform>{space}{endOfSection} {
|
||||
Info<< "done." << endl;
|
||||
|
||||
// check read of fluentFaces
|
||||
if (facei != faceGroupEndIndex[faceGroupEndIndex.size()-1]+1)
|
||||
{
|
||||
Warning
|
||||
<< "Problem with reading fluentFaces: "
|
||||
<< "start index: "
|
||||
<< "Problem with reading fluentFaces: " << nl
|
||||
<< " start index: "
|
||||
<< faceGroupStartIndex[faceGroupStartIndex.size()-1]
|
||||
<< " end index: "
|
||||
<< faceGroupEndIndex[faceGroupEndIndex.size()-1]
|
||||
<< " last fluentFaces read: " << facei << endl;
|
||||
<< " last fluentFaces read: " << facei << nl
|
||||
<< " on line " << lineNo << endl;
|
||||
}
|
||||
|
||||
yy_pop_state();
|
||||
@ -507,7 +523,7 @@ endOfSection {space}")"{space}
|
||||
BEGIN(readCellHeader);
|
||||
}
|
||||
|
||||
<readCellHeader>{spaceNl}{lbrac}{space}"0"{space}"1"{space} {
|
||||
<readCellHeader>{space}{lbrac}{space}"0"{space}"1"{space} {
|
||||
BEGIN(readNumberOfCells);
|
||||
}
|
||||
|
||||
@ -516,7 +532,7 @@ endOfSection {space}")"{space}
|
||||
Info<< "Number of cells: " << nCells << endl;
|
||||
}
|
||||
|
||||
<readCellHeader>{spaceNl}{lbrac} {
|
||||
<readCellHeader>{space}{lbrac} {
|
||||
BEGIN(readCellGroupData);
|
||||
}
|
||||
|
||||
@ -526,7 +542,8 @@ endOfSection {space}")"{space}
|
||||
// non-standard cell definition from Tgrid, which misses the type label.
|
||||
|
||||
Warning
|
||||
<< "Tgrid syntax problem: " << YYText() << endl;
|
||||
<< "Tgrid syntax problem: " << YYText() << nl
|
||||
<< " on line " << lineNo << endl;
|
||||
|
||||
// read cell zone-ID, start and end-label
|
||||
cellGroupZoneID.append(strtol(YYText(), &endPtr, 16));
|
||||
@ -580,7 +597,7 @@ endOfSection {space}")"{space}
|
||||
BEGIN(readCellData);
|
||||
}
|
||||
|
||||
<readCellData>{spaceNl}{lbrac} {
|
||||
<readCellData>{space}{lbrac} {
|
||||
// Quickly scan to the end of the cell data block and discard
|
||||
register int c;
|
||||
while ((c = yyinput()) != 0 && c != ')')
|
||||
@ -601,7 +618,7 @@ endOfSection {space}")"{space}
|
||||
BEGIN(readZoneHeader);
|
||||
}
|
||||
|
||||
<readZoneHeader>{spaceNl}{lbrac} {
|
||||
<readZoneHeader>{space}{lbrac} {
|
||||
BEGIN(readZoneGroupData);
|
||||
}
|
||||
|
||||
@ -623,17 +640,18 @@ endOfSection {space}")"{space}
|
||||
BEGIN(readZoneData);
|
||||
}
|
||||
|
||||
<readZoneData>{spaceNl}{lbrac} {
|
||||
<readZoneData>{space}{lbrac} {
|
||||
Info<< ". Reading zone data..." << flush;
|
||||
yy_push_state(readZoneBlock);
|
||||
}
|
||||
|
||||
<readZoneBlock>{spaceNl}{schemeSymbolList} {
|
||||
<readZoneBlock>{space}{schemeSymbolList} {
|
||||
}
|
||||
|
||||
<readZoneBlock>{lbrac} {
|
||||
Warning
|
||||
<< "Found unknown block in zone: " << YYText() << endl;
|
||||
//Warning
|
||||
// << "Found unknown block in zone: " << YYText() << nl
|
||||
// << " on line " << lineNo << endl;
|
||||
yy_push_state(ignoreBlock);
|
||||
}
|
||||
|
||||
@ -646,7 +664,7 @@ endOfSection {space}")"{space}
|
||||
|
||||
/* ------ Reading end of section and others ------ */
|
||||
|
||||
<readHeader,readDimension,readPointData,readFaceData,readCellData,readZoneData>{spaceNl}{endOfSection} {
|
||||
<readHeader,readDimension,readPointData,readFaceData,readCellData,readZoneData>{space}{endOfSection} {
|
||||
BEGIN(INITIAL);
|
||||
}
|
||||
|
||||
@ -655,7 +673,8 @@ endOfSection {space}")"{space}
|
||||
{lbrac}{label} {
|
||||
Warning
|
||||
<< "Found unknown block of type: "
|
||||
<< Foam::string(YYText())(1, YYLeng()-1) << endl;
|
||||
<< Foam::string(YYText())(1, YYLeng()-1) << nl
|
||||
<< " on line " << lineNo << endl;
|
||||
|
||||
yy_push_state(ignoreBlock);
|
||||
}
|
||||
@ -664,40 +683,47 @@ endOfSection {space}")"{space}
|
||||
yy_push_state(ignoreBlock);
|
||||
}
|
||||
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{spaceNl}{quote}{text}{quote} {
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{space}{quote}{text}{quote} {
|
||||
}
|
||||
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{spaceNl}{schemeSymbol} {
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{space}{schemeSymbol} {
|
||||
}
|
||||
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{spaceNl}{lbrac} {
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{space}{lbrac} {
|
||||
yy_push_state(ignoreEmbeddedBlock);
|
||||
|
||||
}
|
||||
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{spaceNl}{endOfSection} {
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{space}{endOfSection} {
|
||||
yy_pop_state();
|
||||
}
|
||||
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{spaceNl}{labelList} {
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{space}{labelList} {
|
||||
}
|
||||
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{spaceNl}{hexLabelList} {
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{space}{hexLabelList} {
|
||||
}
|
||||
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{spaceNl}{scalarList} {
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{space}{scalarList} {
|
||||
}
|
||||
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{spaceNl}{schemeSymbolList} {
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{space}{schemeSymbolList} {
|
||||
}
|
||||
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{spaceNl}{text} {
|
||||
<ignoreBlock,ignoreEmbeddedBlock>{space}{text} {
|
||||
}
|
||||
|
||||
|
||||
/* ------ Ignore remaining space and \n s. ------ */
|
||||
/* ------ Count newlines. ------ */
|
||||
|
||||
<*>{some_space}|\n|\r {
|
||||
<*>\n {
|
||||
lineNo++;
|
||||
}
|
||||
|
||||
|
||||
/* ------ Ignore remaining space. ------ */
|
||||
|
||||
<*>{some_space}|\r {
|
||||
}
|
||||
|
||||
|
||||
@ -706,7 +732,8 @@ endOfSection {space}")"{space}
|
||||
<*>. {
|
||||
// This is a catch all.
|
||||
FatalErrorIn("fluentMeshToFoam::lexer")
|
||||
<< "Do not understand characters: " << YYText()
|
||||
<< "Do not understand characters: " << YYText() << nl
|
||||
<< " on line " << lineNo
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -856,10 +883,10 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
pointField(0),
|
||||
faceList(0),
|
||||
labelList(0),
|
||||
labelList(0)
|
||||
xferCopy(pointField()),
|
||||
xferCopy(faceList()),
|
||||
xferCopy(labelList()),
|
||||
xferCopy(labelList())
|
||||
);
|
||||
|
||||
|
||||
@ -882,11 +909,8 @@ int main(int argc, char *argv[])
|
||||
// Check the face groups for boundary patches, baffles and faceZones
|
||||
// ignoring the interior zones in ignoreCellGroups
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
label nPatches = 0;
|
||||
labelList patchIDs(faceGroupZoneID.size());
|
||||
|
||||
label nFaceZones = 0;
|
||||
labelList faceZoneIDs(faceGroupZoneID.size());
|
||||
DynamicList<label> patchIDs(faceGroupZoneID.size());
|
||||
DynamicList<label> faceZoneIDs(faceGroupZoneID.size());
|
||||
|
||||
forAll(faceGroupZoneID, fgi)
|
||||
{
|
||||
@ -900,13 +924,13 @@ int main(int argc, char *argv[])
|
||||
// Check the first element of neighbour for boundary group
|
||||
if (neighbour[start] == -1 || fluentGroupToFoamPatch.found(type))
|
||||
{
|
||||
patchIDs[nPatches++] = fgi;
|
||||
patchIDs.append(fgi);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!ignoreFaceGroups.found(groupName[faceGroupZoneID[fgi] ]))
|
||||
{
|
||||
faceZoneIDs[nFaceZones++] = fgi;
|
||||
faceZoneIDs.append(fgi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -928,20 +952,32 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Unknown FaceGroup " << zoneID << " not in a zone"
|
||||
<< exit(FatalError);
|
||||
if (neighbour[start] == -1)
|
||||
{
|
||||
// Boundary face in unknown group. Create a patch for it.
|
||||
groupType.insert(zoneID, "unknown");
|
||||
groupName.insert(zoneID, "FaceGroup" + Foam::name(zoneID));
|
||||
patchIDs.append(fgi);
|
||||
Info<< "Created patch " << fgi << " for unknown FaceGroup "
|
||||
<< zoneID << '.' << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningIn(args.executable())
|
||||
<< "Unknown FaceGroup " << zoneID << " not in a zone"
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
patchIDs.setSize(nPatches);
|
||||
faceZoneIDs.setSize(nFaceZones);
|
||||
patchIDs.shrink();
|
||||
faceZoneIDs.shrink();
|
||||
|
||||
|
||||
// Add empty patches
|
||||
// ~~~~~~~~~~~~~~~~~
|
||||
|
||||
List<polyPatch*> newPatches(nPatches);
|
||||
List<polyPatch*> newPatches(patchIDs.size());
|
||||
HashSet<word> patchNames;
|
||||
|
||||
forAll(patchIDs, patchi)
|
||||
@ -1024,7 +1060,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Face zones
|
||||
mesh.faceZones().setSize(nFaceZones);
|
||||
mesh.faceZones().setSize(faceZoneIDs.size());
|
||||
HashSet<word> faceZoneNames;
|
||||
|
||||
forAll(faceZoneIDs, faceZonei)
|
||||
@ -1098,6 +1134,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
bool doneWarning = false;
|
||||
|
||||
// Add faceZone faces
|
||||
forAll(faceZoneIDs, faceZonei)
|
||||
{
|
||||
@ -1113,19 +1151,36 @@ int main(int argc, char *argv[])
|
||||
|
||||
for (label facei = start; facei <= end; facei++)
|
||||
{
|
||||
meshMod.addFace
|
||||
(
|
||||
faces[facei],
|
||||
owner[facei],
|
||||
neighbour[facei],
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
facei, // masterFace
|
||||
false, // flipFaceFlux
|
||||
-1, // patchID
|
||||
faceZonei, // zoneID
|
||||
false // zoneFlip
|
||||
);
|
||||
if (owner[facei] >= nCells || neighbour[facei] >= nCells)
|
||||
{
|
||||
if (!doneWarning)
|
||||
{
|
||||
WarningIn(args.executable())
|
||||
<< "Ignoring internal face " << facei
|
||||
<< " on FaceZone " << zoneID
|
||||
<< " since owner " << owner[facei] << " or neighbour "
|
||||
<< neighbour[facei] << " outside range of cells 0.."
|
||||
<< nCells-1 << endl
|
||||
<< " Suppressing future warnings." << endl;
|
||||
doneWarning = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
meshMod.addFace
|
||||
(
|
||||
faces[facei],
|
||||
owner[facei],
|
||||
neighbour[facei],
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
facei, // masterFace
|
||||
false, // flipFaceFlux
|
||||
-1, // patchID
|
||||
faceZonei, // zoneID
|
||||
false // zoneFlip
|
||||
);
|
||||
}
|
||||
|
||||
// Mark face as being done
|
||||
owner[facei] = -1;
|
||||
@ -1147,27 +1202,26 @@ int main(int argc, char *argv[])
|
||||
|
||||
for (label facei = start; facei <= end; facei++)
|
||||
{
|
||||
meshMod.addFace
|
||||
(
|
||||
faces[facei],
|
||||
owner[facei],
|
||||
-1,
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
facei, // masterFace
|
||||
false, // flipFaceFlux
|
||||
patchi, // patchID
|
||||
-1, // zoneID
|
||||
false // zoneFlip
|
||||
);
|
||||
|
||||
// For baffles create the opposite face
|
||||
if (neighbour[start] != -1)
|
||||
if (owner[facei] >= nCells || neighbour[facei] >= nCells)
|
||||
{
|
||||
if (!doneWarning)
|
||||
{
|
||||
WarningIn(args.executable())
|
||||
<< "Ignoring patch face " << facei
|
||||
<< " on FaceZone " << zoneID
|
||||
<< " since owner " << owner[facei] << " or neighbour "
|
||||
<< neighbour[facei] << " outside range of cells 0.."
|
||||
<< nCells-1 << endl
|
||||
<< " Suppressing future warnings." << endl;
|
||||
doneWarning = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
meshMod.addFace
|
||||
(
|
||||
faces[facei].reverseFace(),
|
||||
neighbour[facei],
|
||||
faces[facei],
|
||||
owner[facei],
|
||||
-1,
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
@ -1177,8 +1231,25 @@ int main(int argc, char *argv[])
|
||||
-1, // zoneID
|
||||
false // zoneFlip
|
||||
);
|
||||
}
|
||||
|
||||
// For baffles create the opposite face
|
||||
if (neighbour[start] != -1)
|
||||
{
|
||||
meshMod.addFace
|
||||
(
|
||||
faces[facei].reverseFace(),
|
||||
neighbour[facei],
|
||||
-1,
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
facei, // masterFace
|
||||
false, // flipFaceFlux
|
||||
patchi, // patchID
|
||||
-1, // zoneID
|
||||
false // zoneFlip
|
||||
);
|
||||
}
|
||||
}
|
||||
// Mark face as being done
|
||||
owner[facei] = -1;
|
||||
}
|
||||
@ -1198,19 +1269,35 @@ int main(int argc, char *argv[])
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
meshMod.addFace
|
||||
(
|
||||
faces[facei],
|
||||
owner[facei],
|
||||
neighbour[facei],
|
||||
-1, //masterPointID
|
||||
-1, //masterEdgeID
|
||||
facei, //masterFace
|
||||
false, //flipFaceFlux
|
||||
-1, //patchID
|
||||
-1, //zoneID
|
||||
false //zoneFlip
|
||||
);
|
||||
if (owner[facei] >= nCells || neighbour[facei] >= nCells)
|
||||
{
|
||||
if (!doneWarning)
|
||||
{
|
||||
WarningIn(args.executable())
|
||||
<< "Ignoring internal face " << facei
|
||||
<< " since owner " << owner[facei] << " or neighbour "
|
||||
<< neighbour[facei] << " outside range of cells 0.."
|
||||
<< nCells-1 << endl
|
||||
<< " Suppressing future warnings." << endl;
|
||||
doneWarning = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
meshMod.addFace
|
||||
(
|
||||
faces[facei],
|
||||
owner[facei],
|
||||
neighbour[facei],
|
||||
-1, //masterPointID
|
||||
-1, //masterEdgeID
|
||||
facei, //masterFace
|
||||
false, //flipFaceFlux
|
||||
-1, //patchID
|
||||
-1, //zoneID
|
||||
false //zoneFlip
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1158,7 +1158,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cellShapes,
|
||||
patches,
|
||||
patchNames,
|
||||
|
||||
@ -851,7 +851,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cells,
|
||||
boundary,
|
||||
patchNames,
|
||||
|
||||
@ -38,7 +38,7 @@ Description
|
||||
fluentMeshWithInternalFaces).
|
||||
|
||||
A use of the cell zone information, is for field initialization with the
|
||||
"setFields" utility. see the classes: topoSetSource, zoneToCell.
|
||||
"setFields" utility. see the classes: topoSetSource, zoneToCell.
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
@ -166,7 +166,7 @@ label findInternalFace(const primitiveMesh& mesh, const labelList& meshF)
|
||||
if (nMatched == meshF.size())
|
||||
{
|
||||
return faceI;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@ -835,7 +835,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cells,
|
||||
boundaryFaces,
|
||||
boundaryPatchNames,
|
||||
@ -951,7 +951,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
zoneName = iter();
|
||||
}
|
||||
|
||||
|
||||
Info<< "Writing zone " << zoneI << " to cellZone "
|
||||
<< zoneName << " and cellSet"
|
||||
<< endl;
|
||||
|
||||
@ -572,6 +572,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noParallel();
|
||||
argList::validArgs.append(".unv file");
|
||||
argList::validOptions.insert("dump", "");
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
@ -806,7 +807,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(dynPatchFaces, patchI)
|
||||
{
|
||||
patchFaceVerts[patchI].transfer(dynPatchFaces[patchI].shrink());
|
||||
patchFaceVerts[patchI].transfer(dynPatchFaces[patchI]);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -845,13 +846,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
pointField polyPoints;
|
||||
polyPoints.transfer(points);
|
||||
points.clear();
|
||||
|
||||
// Length scaling factor
|
||||
polyPoints /= lengthScale;
|
||||
|
||||
|
||||
// For debugging: dump boundary faces as triSurface
|
||||
if (args.options().found("dump"))
|
||||
{
|
||||
DynamicList<labelledTri> triangles(boundaryFaces.size());
|
||||
|
||||
@ -887,7 +888,6 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
|
||||
Info<< "Constructing mesh with non-default patches of size:" << nl;
|
||||
forAll(patchNames, patchI)
|
||||
{
|
||||
@ -907,14 +907,14 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
polyPoints,
|
||||
xferMove(polyPoints),
|
||||
cellVerts,
|
||||
patchFaceVerts, //boundaryFaces,
|
||||
patchNames, //boundaryPatchNames,
|
||||
wordList(patchNames.size(), polyPatch::typeName), //boundaryPatchTypes,
|
||||
"defaultFaces", //defaultFacesName
|
||||
polyPatch::typeName, //defaultFacesType,
|
||||
wordList(0) //boundaryPatchPhysicalTypes
|
||||
patchFaceVerts, // boundaryFaces,
|
||||
patchNames, // boundaryPatchNames,
|
||||
wordList(patchNames.size(), polyPatch::typeName), // boundaryPatchTypes,
|
||||
"defaultFaces", // defaultFacesName
|
||||
polyPatch::typeName, // defaultFacesType,
|
||||
wordList(0) // boundaryPatchPhysicalTypes
|
||||
);
|
||||
|
||||
mesh.write();
|
||||
|
||||
@ -576,7 +576,7 @@ polyMesh pShapeMesh
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cellShapes,
|
||||
boundary,
|
||||
patchNames,
|
||||
|
||||
@ -140,7 +140,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cells,
|
||||
faceListList(0),
|
||||
wordList(0),
|
||||
@ -153,7 +153,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "Writing mesh ..." << endl;
|
||||
|
||||
mesh.write();
|
||||
|
||||
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
|
||||
@ -306,7 +306,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cells,
|
||||
patchFaces,
|
||||
patchNames,
|
||||
|
||||
@ -232,7 +232,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
newPoints,
|
||||
xferMove(newPoints),
|
||||
cellShapes,
|
||||
boundary,
|
||||
patchNames,
|
||||
|
||||
@ -47,7 +47,7 @@ void sammMesh::writeMesh()
|
||||
runTime_.constant(),
|
||||
runTime_
|
||||
),
|
||||
points_,
|
||||
xferCopy(points_), // we could probably re-use the data
|
||||
cellShapes_,
|
||||
boundary_,
|
||||
patchNames_,
|
||||
@ -76,9 +76,9 @@ void sammMesh::writeMesh()
|
||||
runTime_.constant(),
|
||||
runTime_
|
||||
),
|
||||
points_,
|
||||
meshFaces_,
|
||||
cellPolys_
|
||||
xferCopy(points_), // we could probably re-use the data
|
||||
xferCopy(meshFaces_),
|
||||
xferCopy(cellPolys_)
|
||||
);
|
||||
|
||||
pMesh.addPatches(polyBoundaryPatches(pMesh));
|
||||
|
||||
@ -51,7 +51,7 @@ void starMesh::writeMesh()
|
||||
runTime_.constant(),
|
||||
runTime_
|
||||
),
|
||||
points_,
|
||||
xferCopy(points_), // we could probably re-use the data
|
||||
cellShapes_,
|
||||
boundary_,
|
||||
patchNames_,
|
||||
@ -82,9 +82,9 @@ void starMesh::writeMesh()
|
||||
runTime_.constant(),
|
||||
runTime_
|
||||
),
|
||||
points_,
|
||||
meshFaces_,
|
||||
cellPolys_
|
||||
xferCopy(points_), // we could probably re-use the data
|
||||
xferCopy(meshFaces_),
|
||||
xferCopy(cellPolys_)
|
||||
);
|
||||
|
||||
// adding patches also checks the mesh
|
||||
|
||||
@ -322,11 +322,11 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferCopy(points),
|
||||
cells,
|
||||
faceListList(0),
|
||||
wordList(0), //boundaryPatchNames
|
||||
wordList(0), //boundaryPatchTypes
|
||||
wordList(0), // boundaryPatchNames
|
||||
wordList(0), // boundaryPatchTypes
|
||||
"defaultFaces",
|
||||
polyPatch::typeName,
|
||||
wordList(0)
|
||||
@ -531,7 +531,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cells,
|
||||
patchFaces,
|
||||
patchNames,
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
argList::noParallel();
|
||||
argList::validOptions.insert("blockTopology", "");
|
||||
argList::validOptions.insert("dict", "dictionary");
|
||||
# include "addRegionOption.H"
|
||||
@ -27,7 +27,6 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "error.H"
|
||||
|
||||
#include "block.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -28,18 +28,12 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "error.H"
|
||||
|
||||
#include "block.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
void block::blockBoundary()
|
||||
void Foam::block::blockBoundary()
|
||||
{
|
||||
label ni = blockDef_.n().x();
|
||||
label nj = blockDef_.n().y();
|
||||
@ -212,9 +206,4 @@ void block::blockBoundary()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -28,18 +28,11 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "error.H"
|
||||
|
||||
#include "block.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
void block::blockCells()
|
||||
void Foam::block::blockCells()
|
||||
{
|
||||
label ni = blockDef_.n().x();
|
||||
label nj = blockDef_.n().y();
|
||||
@ -69,9 +62,4 @@ void block::blockCells()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -32,21 +32,16 @@ Description
|
||||
|
||||
#include "blockMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// Construct from IOdictionary
|
||||
blockMesh::blockMesh(IOdictionary& meshDescription)
|
||||
Foam::blockMesh::blockMesh(IOdictionary& meshDescription)
|
||||
:
|
||||
topologyPtr_(createTopology(meshDescription)),
|
||||
scale_(readScalar(meshDescription.lookup("convertToMeters"))),
|
||||
blockOffsets_(createBlockOffsets()),
|
||||
mergeList_(createMergeList()),
|
||||
points_(createPoints()),
|
||||
points_(createPoints(meshDescription)),
|
||||
cells_(createCells()),
|
||||
patches_(createPatches())
|
||||
{}
|
||||
@ -54,7 +49,7 @@ blockMesh::blockMesh(IOdictionary& meshDescription)
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
blockMesh::~blockMesh()
|
||||
Foam::blockMesh::~blockMesh()
|
||||
{
|
||||
delete topologyPtr_;
|
||||
}
|
||||
@ -62,7 +57,7 @@ blockMesh::~blockMesh()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
const polyMesh& blockMesh::topology() const
|
||||
const Foam::polyMesh& Foam::blockMesh::topology() const
|
||||
{
|
||||
if (!topologyPtr_)
|
||||
{
|
||||
@ -75,13 +70,7 @@ const polyMesh& blockMesh::topology() const
|
||||
}
|
||||
|
||||
|
||||
const curvedEdgeList& blockMesh::edges() const
|
||||
{
|
||||
return edges_;
|
||||
}
|
||||
|
||||
|
||||
wordList blockMesh::patchNames() const
|
||||
Foam::wordList Foam::blockMesh::patchNames() const
|
||||
{
|
||||
const polyPatchList& patchTopologies = topology().boundaryMesh();
|
||||
wordList names(patchTopologies.size());
|
||||
@ -95,7 +84,7 @@ wordList blockMesh::patchNames() const
|
||||
}
|
||||
|
||||
|
||||
wordList blockMesh::patchTypes() const
|
||||
Foam::wordList Foam::blockMesh::patchTypes() const
|
||||
{
|
||||
const polyPatchList& patchTopologies = topology().boundaryMesh();
|
||||
wordList types(patchTopologies.size());
|
||||
@ -109,7 +98,7 @@ wordList blockMesh::patchTypes() const
|
||||
}
|
||||
|
||||
|
||||
wordList blockMesh::patchPhysicalTypes() const
|
||||
Foam::wordList Foam::blockMesh::patchPhysicalTypes() const
|
||||
{
|
||||
const polyPatchList& patchTopologies = topology().boundaryMesh();
|
||||
wordList physicalTypes(patchTopologies.size());
|
||||
@ -123,7 +112,7 @@ wordList blockMesh::patchPhysicalTypes() const
|
||||
}
|
||||
|
||||
|
||||
label blockMesh::numZonedBlocks() const
|
||||
Foam::label Foam::blockMesh::numZonedBlocks() const
|
||||
{
|
||||
label num = 0;
|
||||
|
||||
@ -139,7 +128,7 @@ label blockMesh::numZonedBlocks() const
|
||||
}
|
||||
|
||||
|
||||
void blockMesh::writeTopology(Ostream& os) const
|
||||
void Foam::blockMesh::writeTopology(Ostream& os) const
|
||||
{
|
||||
const pointField& pts = topology().points();
|
||||
|
||||
@ -160,9 +149,4 @@ void blockMesh::writeTopology(Ostream& os) const
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -62,8 +62,6 @@ class blockMesh
|
||||
|
||||
polyMesh* topologyPtr_;
|
||||
|
||||
scalar scale_;
|
||||
|
||||
labelList blockOffsets_;
|
||||
labelList mergeList_;
|
||||
|
||||
@ -94,7 +92,7 @@ class blockMesh
|
||||
labelList createBlockOffsets();
|
||||
labelList createMergeList();
|
||||
|
||||
pointField createPoints();
|
||||
pointField createPoints(const dictionary&);
|
||||
cellShapeList createCells();
|
||||
|
||||
faceList createPatchFaces(const polyPatch& patchTopologyFaces);
|
||||
@ -123,7 +121,10 @@ public:
|
||||
|
||||
const polyMesh& topology() const;
|
||||
|
||||
const curvedEdgeList& edges() const;
|
||||
const curvedEdgeList& edges() const
|
||||
{
|
||||
return edges_;
|
||||
}
|
||||
|
||||
const pointField& points() const
|
||||
{
|
||||
|
||||
@ -72,11 +72,11 @@ using namespace Foam;
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noParallel();
|
||||
|
||||
# include "addOptions.H"
|
||||
argList::validOptions.insert("blockTopology", "");
|
||||
argList::validOptions.insert("dict", "dictionary");
|
||||
# include "addRegionOption.H"
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
# include "checkOptions.H"
|
||||
|
||||
word regionName;
|
||||
fileName polyMeshDir;
|
||||
@ -117,6 +117,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
bool writeTopo = args.options().found("blockTopology");
|
||||
|
||||
IOobject meshDictIo
|
||||
(
|
||||
@ -139,7 +140,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
Info<< nl << "Creating block mesh from\n "
|
||||
<< meshDictIo.objectPath() << endl;
|
||||
<< meshDictIo.objectPath() << nl << endl;
|
||||
|
||||
IOdictionary meshDict(meshDictIo);
|
||||
|
||||
@ -216,7 +217,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
blocks.points(),
|
||||
xferCopy(blocks.points()), // could we re-use space?
|
||||
blocks.cells(),
|
||||
blocks.patches(),
|
||||
patchNames,
|
||||
@ -242,7 +243,7 @@ int main(int argc, char *argv[])
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
//#include "mergePatchPairs.H"
|
||||
//// #include "mergePatchPairs.H"
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -316,7 +317,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
label zoneI = iter();
|
||||
|
||||
cz[zoneI]= new cellZone
|
||||
cz[zoneI] = new cellZone
|
||||
(
|
||||
iter.key(),
|
||||
zoneCells[zoneI].shrink(),
|
||||
@ -339,7 +340,7 @@ int main(int argc, char *argv[])
|
||||
IOstream::defaultPrecision(10);
|
||||
|
||||
Info << nl << "Writing polyMesh" << endl;
|
||||
mesh.removeFiles(mesh.instance());
|
||||
mesh.removeFiles();
|
||||
if (!mesh.write())
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
|
||||
@ -28,17 +28,11 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "error.H"
|
||||
|
||||
#include "block.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void block::blockPoints()
|
||||
void Foam::block::blockPoints()
|
||||
{
|
||||
// set local variables for mesh specification
|
||||
const label ni = blockDef_.n().x();
|
||||
@ -235,9 +229,4 @@ void block::blockPoints()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -28,16 +28,10 @@ Description
|
||||
|
||||
#include "blockMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
// Check the blockMesh topology
|
||||
|
||||
void blockMesh::checkBlockMesh(const polyMesh& bm)
|
||||
void Foam::blockMesh::checkBlockMesh(const polyMesh& bm)
|
||||
{
|
||||
Info<< nl << "Check block mesh topology" << endl;
|
||||
|
||||
@ -148,9 +142,4 @@ void blockMesh::checkBlockMesh(const polyMesh& bm)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -1 +0,0 @@
|
||||
bool writeTopo = args.options().found("blockTopology");
|
||||
@ -27,17 +27,11 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "error.H"
|
||||
|
||||
#include "blockMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
labelList blockMesh::createBlockOffsets()
|
||||
Foam::labelList Foam::blockMesh::createBlockOffsets()
|
||||
{
|
||||
Info<< nl << "Creating block offsets" << endl;
|
||||
|
||||
@ -63,10 +57,4 @@ labelList blockMesh::createBlockOffsets()
|
||||
return BlockOffsets;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
|
||||
@ -29,14 +29,9 @@ License
|
||||
#include "blockMesh.H"
|
||||
#include "cellModeller.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
cellShapeList blockMesh::createCells()
|
||||
Foam::cellShapeList Foam::blockMesh::createCells()
|
||||
{
|
||||
Info<< nl << "Creating cells" << endl;
|
||||
|
||||
@ -76,10 +71,4 @@ cellShapeList blockMesh::createCells()
|
||||
return cells;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
|
||||
@ -26,14 +26,9 @@ License
|
||||
|
||||
#include "blockMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
labelList blockMesh::createMergeList()
|
||||
Foam::labelList Foam::blockMesh::createMergeList()
|
||||
{
|
||||
Info<< nl << "Creating merge list " << flush;
|
||||
|
||||
@ -277,7 +272,7 @@ labelList blockMesh::createMergeList()
|
||||
if (cp[blockPfaceFacePointLabel] == -1)
|
||||
{
|
||||
FatalErrorIn("blockMesh::createMergeList()")
|
||||
<< "Inconsistent point locations between block pair "
|
||||
<< "Inconsistent point locations between block pair "
|
||||
<< blockPlabel << " and " << blockNlabel << nl
|
||||
<< " probably due to inconsistent grading."
|
||||
<< exit(FatalError);
|
||||
@ -561,9 +556,4 @@ labelList blockMesh::createMergeList()
|
||||
return MergeList;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -29,14 +29,9 @@ Description
|
||||
|
||||
#include "blockMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
faceList blockMesh::createPatchFaces
|
||||
Foam::faceList Foam::blockMesh::createPatchFaces
|
||||
(
|
||||
const polyPatch& patchTopologyFaces
|
||||
)
|
||||
@ -157,7 +152,7 @@ faceList blockMesh::createPatchFaces
|
||||
}
|
||||
|
||||
|
||||
faceListList blockMesh::createPatches()
|
||||
Foam::faceListList Foam::blockMesh::createPatches()
|
||||
{
|
||||
Info<< "\nCreating patches\n";
|
||||
|
||||
@ -173,9 +168,4 @@ faceListList blockMesh::createPatches()
|
||||
return patches;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -28,24 +28,26 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "error.H"
|
||||
|
||||
#include "blockMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
pointField blockMesh::createPoints()
|
||||
Foam::pointField Foam::blockMesh::createPoints(const dictionary& dict)
|
||||
{
|
||||
Info<< nl << "Creating points" << endl;
|
||||
blockMesh& blocks = *this;
|
||||
|
||||
scalar scaleFactor = 1.0;
|
||||
|
||||
// optional 'convertToMeters' (or 'scale'?)
|
||||
if (!dict.readIfPresent("convertToMeters", scaleFactor))
|
||||
{
|
||||
dict.readIfPresent("scale", scaleFactor);
|
||||
}
|
||||
|
||||
Info<< nl << "Creating points with scale " << scaleFactor << endl;
|
||||
|
||||
pointField points(nPoints_);
|
||||
|
||||
blockMesh& blocks = *this;
|
||||
|
||||
forAll(blocks, blockLabel)
|
||||
{
|
||||
const pointField& blockPoints = blocks[blockLabel].points();
|
||||
@ -59,17 +61,11 @@ pointField blockMesh::createPoints()
|
||||
blockPointLabel
|
||||
+ blockOffsets_[blockLabel]
|
||||
]
|
||||
] = scale_*blockPoints[blockPointLabel];
|
||||
] = scaleFactor * blockPoints[blockPointLabel];
|
||||
}
|
||||
}
|
||||
|
||||
return points;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
|
||||
@ -40,9 +40,9 @@ bool Foam::blockMesh::blockLabelsOK
|
||||
{
|
||||
bool ok = true;
|
||||
|
||||
for (int i=0; i<blockShape.size(); i++)
|
||||
forAll(blockShape, blockI)
|
||||
{
|
||||
if (blockShape[i] < 0)
|
||||
if (blockShape[blockI] < 0)
|
||||
{
|
||||
ok = false;
|
||||
|
||||
@ -52,10 +52,10 @@ bool Foam::blockMesh::blockLabelsOK
|
||||
"(const label blockLabel, const pointField& points, "
|
||||
"const cellShape& blockShape)"
|
||||
) << "block " << blockLabel
|
||||
<< " point label " << blockShape[i]
|
||||
<< " point label " << blockShape[blockI]
|
||||
<< " less than zero" << endl;
|
||||
}
|
||||
else if (blockShape[i] >= points.size())
|
||||
else if (blockShape[blockI] >= points.size())
|
||||
{
|
||||
ok = false;
|
||||
|
||||
@ -65,7 +65,7 @@ bool Foam::blockMesh::blockLabelsOK
|
||||
"(const label blockLabel, const pointField& points, "
|
||||
"const cellShape& blockShape)"
|
||||
) << "block " << blockLabel
|
||||
<< " point label " << blockShape[i]
|
||||
<< " point label " << blockShape[blockI]
|
||||
<< " larger than " << points.size() - 1
|
||||
<< " the largest defined point label" << endl;
|
||||
}
|
||||
@ -84,38 +84,34 @@ bool Foam::blockMesh::patchLabelsOK
|
||||
{
|
||||
bool ok = true;
|
||||
|
||||
for (label facei=0; facei<patchFaces.size(); facei++)
|
||||
forAll(patchFaces, faceI)
|
||||
{
|
||||
const labelList& labels = patchFaces[facei];
|
||||
const labelList& f = patchFaces[faceI];
|
||||
|
||||
for (int i=0; i<labels.size(); i++)
|
||||
forAll(f, fp)
|
||||
{
|
||||
if (labels[i] < 0)
|
||||
if (f[fp] < 0)
|
||||
{
|
||||
ok = false;
|
||||
|
||||
WarningIn
|
||||
(
|
||||
"bool Foam::blockMesh::patchLabelsOK"
|
||||
"(const label patchLabel, const pointField& points, "
|
||||
"const faceList& patchFaces)"
|
||||
"bool Foam::blockMesh::patchLabelsOK(...)"
|
||||
) << "patch " << patchLabel
|
||||
<< " face " << facei
|
||||
<< " point label " << labels[i]
|
||||
<< " face " << faceI
|
||||
<< " point label " << f[fp]
|
||||
<< " less than zero" << endl;
|
||||
}
|
||||
else if (labels[i] >= points.size())
|
||||
else if (f[fp] >= points.size())
|
||||
{
|
||||
ok = false;
|
||||
|
||||
WarningIn
|
||||
(
|
||||
"bool Foam::blockMesh::patchLabelsOK"
|
||||
"(const label patchLabel, const pointField& points, "
|
||||
"const faceList& patchFaces)"
|
||||
"bool Foam::blockMesh::patchLabelsOK(...)"
|
||||
) << "patch " << patchLabel
|
||||
<< " face " << facei
|
||||
<< " point label " << labels[i]
|
||||
<< " face " << faceI
|
||||
<< " point label " << f[fp]
|
||||
<< " larger than " << points.size() - 1
|
||||
<< " the largest defined point label" << endl;
|
||||
}
|
||||
@ -137,23 +133,13 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
|
||||
word defaultPatchName = "defaultFaces";
|
||||
word defaultPatchType = emptyPolyPatch::typeName;
|
||||
|
||||
// get names and types for the unassigned patch faces
|
||||
if (meshDescription.found("defaultPatch"))
|
||||
// get names/types for the unassigned patch faces
|
||||
// this is a bit heavy handed (and ugly), but there is currently
|
||||
// no easy way to rename polyMesh patches subsequently
|
||||
if (const dictionary* dictPtr = meshDescription.subDictPtr("defaultPatch"))
|
||||
{
|
||||
const dictionary& defaultPatch =
|
||||
meshDescription.subDict("defaultPatch");
|
||||
|
||||
// this is a bit heavy handed (and ugly), but there is currently
|
||||
// no easy way to rename polyMesh patches subsequently
|
||||
if (defaultPatch.found("name"))
|
||||
{
|
||||
defaultPatch.lookup("name") >> defaultPatchName;
|
||||
}
|
||||
|
||||
if (defaultPatch.found("type"))
|
||||
{
|
||||
defaultPatch.lookup("type") >> defaultPatchType;
|
||||
}
|
||||
dictPtr->readIfPresent("name", defaultPatchName);
|
||||
dictPtr->readIfPresent("type", defaultPatchType);
|
||||
}
|
||||
|
||||
Info<< nl << "Creating blockCorners" << endl;
|
||||
@ -439,7 +425,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
tmpBlockPoints,
|
||||
xferMove(tmpBlockPoints),
|
||||
tmpBlockCells,
|
||||
tmpBlocksPatches,
|
||||
patchNames,
|
||||
@ -456,4 +442,3 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
Info<< nl << "Creating merge patch pairs" << nl << endl;
|
||||
Info<< "Creating merge patch pairs" << nl << endl;
|
||||
|
||||
if (mergePatchPairs.size() > 0)
|
||||
{
|
||||
|
||||
@ -48,7 +48,7 @@ template
|
||||
template<class> class FaceList,
|
||||
class PointField
|
||||
>
|
||||
Foam::pointField Foam::extrudedMesh::extrudedPoints
|
||||
Foam::xfer<Foam::pointField> Foam::extrudedMesh::extrudedPoints
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel& model
|
||||
@ -76,12 +76,13 @@ Foam::pointField Foam::extrudedMesh::extrudedPoints
|
||||
}
|
||||
}
|
||||
|
||||
return ePoints;
|
||||
// return points for transferring
|
||||
return xferMove(ePoints);
|
||||
}
|
||||
|
||||
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
Foam::faceList Foam::extrudedMesh::extrudedFaces
|
||||
Foam::xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel& model
|
||||
@ -177,12 +178,13 @@ Foam::faceList Foam::extrudedMesh::extrudedFaces
|
||||
);
|
||||
}
|
||||
|
||||
return eFaces;
|
||||
// return points for transferring
|
||||
return xferMove(eFaces);
|
||||
}
|
||||
|
||||
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
Foam::cellList Foam::extrudedMesh::extrudedCells
|
||||
Foam::xfer<Foam::cellList> Foam::extrudedMesh::extrudedCells
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel& model
|
||||
@ -283,7 +285,8 @@ Foam::cellList Foam::extrudedMesh::extrudedCells
|
||||
facei++;
|
||||
}
|
||||
|
||||
return eCells;
|
||||
// return points for transferring
|
||||
return xferMove(eCells);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -63,26 +63,26 @@ class extrudedMesh
|
||||
|
||||
//- Construct and return the extruded mesh points
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
pointField extrudedPoints
|
||||
xfer<pointField> extrudedPoints
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel& model
|
||||
const extrudeModel&
|
||||
);
|
||||
|
||||
//- Construct and return the extruded mesh faces
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
faceList extrudedFaces
|
||||
xfer<faceList> extrudedFaces
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel& model
|
||||
const extrudeModel&
|
||||
);
|
||||
|
||||
//- Construct and return the extruded mesh cells
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
cellList extrudedCells
|
||||
xfer<cellList> extrudedCells
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel& model
|
||||
const extrudeModel&
|
||||
);
|
||||
|
||||
|
||||
@ -101,9 +101,9 @@ public:
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
extrudedMesh
|
||||
(
|
||||
const IOobject& io,
|
||||
const IOobject&,
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel& model
|
||||
const extrudeModel&
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@ -374,9 +374,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
mirrorMeshPtr_ = new fvMesh
|
||||
(
|
||||
io,
|
||||
newPoints,
|
||||
newFaces,
|
||||
newCells
|
||||
xferMove(newPoints),
|
||||
xferMove(newFaces),
|
||||
xferMove(newCells)
|
||||
);
|
||||
|
||||
fvMesh& pMesh = *mirrorMeshPtr_;
|
||||
|
||||
@ -2,8 +2,9 @@
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
READLINE=0
|
||||
if [ -f /usr/include/readline/readline.h ]; then
|
||||
echo "Found readline/readline.h include file. Enabling readline support."
|
||||
if [ -f /usr/include/readline/readline.h ]
|
||||
then
|
||||
echo "Found readline/readline.h -- enabling readline support."
|
||||
READLINE=1
|
||||
export READLINELINK="-lreadline -lncurses"
|
||||
break
|
||||
|
||||
@ -45,7 +45,7 @@ SourceFiles
|
||||
#ifndef regionSide_H
|
||||
#define regionSide_H
|
||||
|
||||
#include "labelHashSet.H"
|
||||
#include "HashSet.H"
|
||||
#include "typeInfo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Reference in New Issue
Block a user