Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
Henry
2010-10-13 13:09:29 +01:00
22 changed files with 205 additions and 155 deletions

View File

@ -569,21 +569,31 @@ int main(int argc, char *argv[])
<< "as type patch. Please reset after mesh conversion as necessary." << "as type patch. Please reset after mesh conversion as necessary."
<< endl; << endl;
wordList patchTypes(patchFaces.size(), polyPatch::typeName); PtrList<dictionary> patchDicts;
wordList patchPhysicalTypes(patchFaces.size());
preservePatchTypes preservePatchTypes
( (
runTime, runTime,
runTime.constant(), runTime.constant(),
polyMesh::defaultRegion, polyMesh::meshSubDir,
patchNames, patchNames,
patchTypes, patchDicts,
defaultFacesName, defaultFacesName,
defaultFacesType, defaultFacesType
patchPhysicalTypes
); );
// Add information to dictionary
forAll(patchNames, patchI)
{
if (!patchDicts.set(patchI))
{
patchDicts.set(patchI, new dictionary());
}
// Add but not overwrite
patchDicts[patchI].add("type", polyPatch::typeName, false);
}
polyMesh pShapeMesh polyMesh pShapeMesh
( (
IOobject IOobject
@ -596,10 +606,9 @@ int main(int argc, char *argv[])
cellShapes, cellShapes,
patchFaces, patchFaces,
patchNames, patchNames,
patchTypes, patchDicts,
defaultFacesName, defaultFacesName,
defaultFacesType, defaultFacesType
patchPhysicalTypes
); );

View File

@ -578,7 +578,6 @@ int main(int argc, char *argv[])
wordList patchTypes(npatch); wordList patchTypes(npatch);
word defaultFacesName = "defaultFaces"; word defaultFacesName = "defaultFaces";
word defaultFacesType = wallPolyPatch::typeName; word defaultFacesType = wallPolyPatch::typeName;
wordList patchPhysicalTypes(npatch);
label nCreatedPatches = 0; label nCreatedPatches = 0;
@ -707,18 +706,30 @@ int main(int argc, char *argv[])
patchTypes.setSize(nCreatedPatches); patchTypes.setSize(nCreatedPatches);
patchNames.setSize(nCreatedPatches); patchNames.setSize(nCreatedPatches);
PtrList<dictionary> patchDicts;
preservePatchTypes preservePatchTypes
( (
runTime, runTime,
runTime.constant(), runTime.constant(),
polyMesh::defaultRegion, polyMesh::meshSubDir,
patchNames, patchNames,
patchTypes, patchDicts,
defaultFacesName, defaultFacesName,
defaultFacesType, defaultFacesType
patchPhysicalTypes
); );
// Add information to dictionary
forAll(patchNames, patchI)
{
if (!patchDicts.set(patchI))
{
patchDicts.set(patchI, new dictionary());
}
// Add but not overwrite
patchDicts[patchI].add("type", patchTypes[patchI], false);
}
polyMesh pShapeMesh polyMesh pShapeMesh
( (
IOobject IOobject
@ -731,10 +742,9 @@ int main(int argc, char *argv[])
cellShapes, cellShapes,
boundary, boundary,
patchNames, patchNames,
patchTypes, patchDicts,
defaultFacesName, defaultFacesName,
defaultFacesType, defaultFacesType
patchPhysicalTypes
); );
// Set the precision of the points data to 10 // Set the precision of the points data to 10

View File

@ -45,7 +45,6 @@ Description
#include "emptyPolyPatch.H" #include "emptyPolyPatch.H"
#include "wallPolyPatch.H" #include "wallPolyPatch.H"
#include "symmetryPolyPatch.H" #include "symmetryPolyPatch.H"
#include "preservePatchTypes.H"
#include "cellShape.H" #include "cellShape.H"
#include "faceSet.H" #include "faceSet.H"
#include "cellSet.H" #include "cellSet.H"
@ -1542,17 +1541,6 @@ int main(int argc, char *argv[])
} }
repatcher.repatch(); repatcher.repatch();
preservePatchTypes
(
runTime,
runTime.constant(),
polyMesh::defaultRegion,
patchNames,
patchTypes,
defaultFacesName,
defaultFacesType,
patchPhysicalTypes
);
// Set the precision of the points data to 10 // Set the precision of the points data to 10
IOstream::defaultPrecision(10); IOstream::defaultPrecision(10);

View File

@ -818,24 +818,32 @@ int main(int argc, char *argv[])
// Scale points // Scale points
points *= scaleFactor; points *= scaleFactor;
wordList patchTypes(boundary.size(), polyPatch::typeName); PtrList<dictionary> patchDicts(boundary.size());
word defaultFacesName = "defaultFaces"; word defaultFacesName = "defaultFaces";
word defaultFacesType = emptyPolyPatch::typeName; word defaultFacesType = emptyPolyPatch::typeName;
wordList patchPhysicalTypes(boundary.size());
preservePatchTypes preservePatchTypes
( (
runTime, runTime,
runTime.constant(), runTime.constant(),
polyMesh::defaultRegion, polyMesh::meshSubDir,
patchNames, patchNames,
patchTypes, patchDicts,
defaultFacesName, defaultFacesName,
defaultFacesType, defaultFacesType
patchPhysicalTypes
); );
// Mesh will auto-write on construction // Add information to dictionary
forAll(patchNames, patchI)
{
if (!patchDicts.set(patchI))
{
patchDicts.set(patchI, new dictionary());
}
// Add but not overwrite
patchDicts[patchI].add("type", polyPatch::typeName, false);
}
polyMesh pShapeMesh polyMesh pShapeMesh
( (
IOobject IOobject
@ -848,10 +856,9 @@ int main(int argc, char *argv[])
cells, cells,
boundary, boundary,
patchNames, patchNames,
patchTypes, patchDicts,
defaultFacesName, defaultFacesName,
defaultFacesType, defaultFacesType
patchPhysicalTypes
); );
// Set the precision of the points data to 10 // Set the precision of the points data to 10

View File

@ -459,7 +459,6 @@ wordList patchNames(nPatches);
wordList patchTypes(nPatches); wordList patchTypes(nPatches);
word defaultFacesName = "defaultFaces"; word defaultFacesName = "defaultFaces";
word defaultFacesType = emptyPolyPatch::typeName; word defaultFacesType = emptyPolyPatch::typeName;
wordList patchPhysicalTypes(nPatches);
label nAddedPatches = 0; label nAddedPatches = 0;
@ -535,17 +534,27 @@ forAll(boundary, patchi)
} }
} }
PtrList<dictionary> patchDicts;
preservePatchTypes preservePatchTypes
( (
runTime, runTime,
runTime.constant(), runTime.constant(),
polyMesh::defaultRegion, polyMesh::meshSubDir,
patchNames, patchNames,
patchTypes, patchDicts,
defaultFacesName, defaultFacesName,
defaultFacesType, defaultFacesType
patchPhysicalTypes
); );
// Add information to dictionary
forAll(patchNames, patchI)
{
if (!patchDicts.set(patchI))
{
patchDicts.set(patchI, new dictionary());
}
// Add but not overwrite
patchDicts[patchI].add("type", patchTypes[patchI], false);
}
// Build the mesh and write it out // Build the mesh and write it out
polyMesh pShapeMesh polyMesh pShapeMesh
@ -560,10 +569,9 @@ polyMesh pShapeMesh
cellShapes, cellShapes,
boundary, boundary,
patchNames, patchNames,
patchTypes, patchDicts,
defaultFacesName, defaultFacesName,
defaultFacesType, defaultFacesType
patchPhysicalTypes
); );
Info << "Writing polyMesh" << endl; Info << "Writing polyMesh" << endl;

View File

@ -43,7 +43,6 @@ Description
#include "polyMesh.H" #include "polyMesh.H"
#include "wallPolyPatch.H" #include "wallPolyPatch.H"
#include "symmetryPolyPatch.H" #include "symmetryPolyPatch.H"
#include "preservePatchTypes.H"
#include "cellShape.H" #include "cellShape.H"
#include "cellModeller.H" #include "cellModeller.H"
#include "mergePoints.H" #include "mergePoints.H"

View File

@ -230,17 +230,28 @@ void sammMesh::readBoundary()
patchPhysicalTypes_.setSize(patchTypes_.size()); patchPhysicalTypes_.setSize(patchTypes_.size());
PtrList<dictionary> patchDicts;
preservePatchTypes preservePatchTypes
( (
runTime_, runTime_,
runTime_.constant(), runTime_.constant(),
polyMesh::defaultRegion, polyMesh::meshSubDir,
patchNames_, patchNames_,
patchTypes_, patchDicts,
defaultFacesName_, defaultFacesName_,
defaultFacesType_, defaultFacesType_
patchPhysicalTypes_
); );
forAll(patchDicts, patchI)
{
if (patchDicts.set(patchI))
{
const dictionary& dict = patchDicts[patchI];
dict.readIfPresent("type", patchTypes_[patchI]);
dict.readIfPresent("physicalType", patchPhysicalTypes_[patchI]);
}
}
} }

View File

@ -228,17 +228,28 @@ void starMesh::readBoundary()
patchPhysicalTypes_.setSize(patchTypes_.size()); patchPhysicalTypes_.setSize(patchTypes_.size());
PtrList<dictionary> patchDicts;
preservePatchTypes preservePatchTypes
( (
runTime_, runTime_,
runTime_.constant(), runTime_.constant(),
polyMesh::defaultRegion, polyMesh::meshSubDir,
patchNames_, patchNames_,
patchTypes_, patchDicts,
defaultFacesName_, defaultFacesName_,
defaultFacesType_, defaultFacesType_
patchPhysicalTypes_
); );
forAll(patchDicts, patchI)
{
if (patchDicts.set(patchI))
{
const dictionary& dict = patchDicts[patchI];
dict.readIfPresent("type", patchTypes_[patchI]);
dict.readIfPresent("physicalType", patchPhysicalTypes_[patchI]);
}
}
} }

View File

@ -52,7 +52,6 @@ Usage
#include "blockMesh.H" #include "blockMesh.H"
#include "attachPolyTopoChanger.H" #include "attachPolyTopoChanger.H"
#include "preservePatchTypes.H"
#include "emptyPolyPatch.H" #include "emptyPolyPatch.H"
#include "cellSet.H" #include "cellSet.H"
@ -219,6 +218,7 @@ int main(int argc, char *argv[])
xferCopy(blocks.points()), // could we re-use space? xferCopy(blocks.points()), // could we re-use space?
blocks.cells(), blocks.cells(),
blocks.patches(), blocks.patches(),
blocks.patchNames(),
blocks.patchDicts(), blocks.patchDicts(),
defaultFacesName, defaultFacesName,
defaultFacesType defaultFacesType

View File

@ -163,6 +163,7 @@ void Foam::ensightMesh::correct()
prisms.setSize(nPrisms); prisms.setSize(nPrisms);
wedges.setSize(nWedges); wedges.setSize(nWedges);
hexes.setSize(nHexes); hexes.setSize(nHexes);
hexesWedges.setSize(nHexesWedges);
polys.setSize(nPolys); polys.setSize(nPolys);
meshCellSets_.nTets = nTets; meshCellSets_.nTets = nTets;

View File

@ -280,6 +280,7 @@ public:
const Xfer<pointField>& points, const Xfer<pointField>& points,
const cellShapeList& shapes, const cellShapeList& shapes,
const faceListList& boundaryFaces, const faceListList& boundaryFaces,
const wordList& boundaryPatchNames,
const PtrList<dictionary>& boundaryDicts, const PtrList<dictionary>& boundaryDicts,
const word& defaultBoundaryPatchName, const word& defaultBoundaryPatchName,
const word& defaultBoundaryPatchType, const word& defaultBoundaryPatchType,

View File

@ -698,6 +698,7 @@ Foam::polyMesh::polyMesh
const Xfer<pointField>& points, const Xfer<pointField>& points,
const cellShapeList& cellsAsShapes, const cellShapeList& cellsAsShapes,
const faceListList& boundaryFaces, const faceListList& boundaryFaces,
const wordList& boundaryPatchNames,
const PtrList<dictionary>& boundaryDicts, const PtrList<dictionary>& boundaryDicts,
const word& defaultBoundaryPatchName, const word& defaultBoundaryPatchName,
const word& defaultBoundaryPatchType, const word& defaultBoundaryPatchType,
@ -832,12 +833,6 @@ Foam::polyMesh::polyMesh
// Remove all of the old mesh files if they exist // Remove all of the old mesh files if they exist
removeFiles(instance()); removeFiles(instance());
wordList boundaryPatchNames(boundaryDicts.size());
forAll(boundaryDicts, patchI)
{
boundaryDicts[patchI].lookup("name") >> boundaryPatchNames[patchI];
}
// Calculate faces and cells // Calculate faces and cells
labelList patchSizes; labelList patchSizes;
labelList patchStarts; labelList patchStarts;
@ -858,7 +853,7 @@ Foam::polyMesh::polyMesh
// Warning: Patches can only be added once the face list is // Warning: Patches can only be added once the face list is
// completed, as they hold a subList of the face list // completed, as they hold a subList of the face list
forAll(boundaryFaces, patchI) forAll(boundaryDicts, patchI)
{ {
dictionary patchDict(boundaryDicts[patchI]); dictionary patchDict(boundaryDicts[patchI]);

View File

@ -25,7 +25,6 @@ License
#include "preservePatchTypes.H" #include "preservePatchTypes.H"
#include "polyBoundaryMeshEntries.H" #include "polyBoundaryMeshEntries.H"
#include "dictionary.H"
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
@ -35,14 +34,16 @@ void Foam::preservePatchTypes
const word& meshInstance, const word& meshInstance,
const fileName& meshDir, const fileName& meshDir,
const wordList& patchNames, const wordList& patchNames,
wordList& patchTypes, PtrList<dictionary>& patchDicts,
const word& defaultFacesName, const word& defaultFacesName,
word& defaultFacesType, word& defaultFacesType
wordList& patchPhysicalTypes
) )
{ {
patchDicts.setSize(patchNames.size());
dictionary patchDictionary; dictionary patchDictionary;
// Read boundary file as single dictionary
{ {
IOobject patchEntriesHeader IOobject patchEntriesHeader
( (
@ -67,35 +68,27 @@ void Foam::preservePatchTypes
} }
} }
if (patchDictionary.size()) forAll(patchNames, patchi)
{ {
forAll(patchNames, patchi) if (patchDictionary.found(patchNames[patchi]))
{
if (patchDictionary.found(patchNames[patchi]))
{
const dictionary& patchDict =
patchDictionary.subDict(patchNames[patchi]);
patchDict.lookup("type") >> patchTypes[patchi];
patchDict.readIfPresent("geometricType", patchTypes[patchi]);
patchDict.readIfPresent
(
"physicalType",
patchPhysicalTypes[patchi]
);
}
}
if (patchDictionary.found(defaultFacesName))
{ {
const dictionary& patchDict = const dictionary& patchDict =
patchDictionary.subDict(defaultFacesName); patchDictionary.subDict(patchNames[patchi]);
patchDict.readIfPresent("geometricType", defaultFacesType); patchDicts.set(patchi, patchDict.clone());
patchDicts[patchi].remove("nFaces");
patchDicts[patchi].remove("startFace");
} }
} }
if (patchDictionary.found(defaultFacesName))
{
const dictionary& patchDict =
patchDictionary.subDict(defaultFacesName);
patchDict.readIfPresent("geometricType", defaultFacesType);
}
Info<< nl << "Default patch type set to " << defaultFacesType << endl; Info<< nl << "Default patch type set to " << defaultFacesType << endl;
} }

View File

@ -37,6 +37,7 @@ SourceFiles
#include "fileName.H" #include "fileName.H"
#include "wordList.H" #include "wordList.H"
#include "dictionary.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -52,10 +53,9 @@ void preservePatchTypes
const word& meshInstance, const word& meshInstance,
const fileName& meshDir, const fileName& meshDir,
const wordList& patchNames, const wordList& patchNames,
wordList& patchTypes, PtrList<dictionary>& patchDicts,
const word& defaultFacesName, const word& defaultFacesName,
word& defaultFacesType, word& defaultFacesType
wordList& patchPhysicalTypes
); );
} // End namespace Foam } // End namespace Foam

View File

@ -272,10 +272,10 @@ const Foam::point& Foam::plane::refPoint() const
} }
// Return coefficcients for plane equation: ax + by + cz + d = 0 // Return coefficients for plane equation: ax + by + cz + d = 0
Foam::scalarList Foam::plane::planeCoeffs() const Foam::FixedList<Foam::scalar, 4> Foam::plane::planeCoeffs() const
{ {
scalarList C(4); FixedList<scalar, 4> C(4);
scalar magX = mag(unitVector_.x()); scalar magX = mag(unitVector_.x());
scalar magY = mag(unitVector_.y()); scalar magY = mag(unitVector_.y());
@ -291,8 +291,8 @@ Foam::scalarList Foam::plane::planeCoeffs() const
} }
else else
{ {
C[0] = 0; C[0] = unitVector_.x()/unitVector_.z();
C[1] = 0; C[1] = unitVector_.y()/unitVector_.z();
C[2] = 1; C[2] = 1;
} }
} }
@ -300,14 +300,14 @@ Foam::scalarList Foam::plane::planeCoeffs() const
{ {
if (magY > magZ) if (magY > magZ)
{ {
C[0] = 0; C[0] = unitVector_.x()/unitVector_.y();
C[1] = 1; C[1] = 1;
C[2] = unitVector_.z()/unitVector_.y(); C[2] = unitVector_.z()/unitVector_.y();
} }
else else
{ {
C[0] = 0; C[0] = unitVector_.x()/unitVector_.z();
C[1] = 0; C[1] = unitVector_.y()/unitVector_.z();
C[2] = 1; C[2] = 1;
} }
} }
@ -422,19 +422,18 @@ Foam::point Foam::plane::planePlaneIntersect
const plane& plane3 const plane& plane3
) const ) const
{ {
List<scalarList> pcs(3); FixedList<scalar, 4> coeffs1(planeCoeffs());
pcs[0]= planeCoeffs(); FixedList<scalar, 4> coeffs2(plane2.planeCoeffs());
pcs[1]= plane2.planeCoeffs(); FixedList<scalar, 4> coeffs3(plane3.planeCoeffs());
pcs[2]= plane3.planeCoeffs();
tensor a tensor a
( (
pcs[0][0],pcs[0][1],pcs[0][2], coeffs1[0],coeffs1[1],coeffs1[2],
pcs[1][0],pcs[1][1],pcs[1][2], coeffs2[0],coeffs2[1],coeffs2[2],
pcs[2][0],pcs[2][1],pcs[2][2] coeffs3[0],coeffs3[1],coeffs3[2]
); );
vector b(pcs[0][3],pcs[1][3],pcs[2][3]); vector b(coeffs1[3],coeffs2[3],coeffs3[3]);
return (inv(a) & (-b)); return (inv(a) & (-b));
} }

View File

@ -149,7 +149,7 @@ public:
//- Return coefficients for the //- Return coefficients for the
// plane equation: ax + by + cz + d = 0 // plane equation: ax + by + cz + d = 0
scalarList planeCoeffs() const; FixedList<scalar, 4> planeCoeffs() const;
//- Return nearest point in the plane for the given point //- Return nearest point in the plane for the given point
point nearestPoint(const point& p) const; point nearestPoint(const point& p) const;

View File

@ -412,6 +412,8 @@ Foam::meshReader::polyBoundaryPatches(const polyMesh& mesh)
List<polyPatch*> p(nPatches); List<polyPatch*> p(nPatches);
// All patch dictionaries
PtrList<dictionary> patchDicts(patchNames_.size());
// Default boundary patch types // Default boundary patch types
word defaultFacesType(emptyPolyPatch::typeName); word defaultFacesType(emptyPolyPatch::typeName);
@ -422,20 +424,37 @@ Foam::meshReader::polyBoundaryPatches(const polyMesh& mesh)
mesh.instance(), mesh.instance(),
mesh.meshDir(), mesh.meshDir(),
patchNames_, patchNames_,
patchTypes_, patchDicts,
"defaultFaces", "defaultFaces",
defaultFacesType, defaultFacesType
patchPhysicalTypes_
); );
forAll(patchDicts, patchI)
{
if (!patchDicts.set(patchI))
{
patchDicts.set(patchI, new dictionary());
}
dictionary& patchDict = patchDicts[patchI];
// add but not overwrite type
patchDict.add("type", patchTypes_[patchI], false);
if (patchPhysicalTypes_.size() && patchPhysicalTypes_[patchI].size())
{
patchDict.add("startFace", patchPhysicalTypes_[patchI], false);
}
// overwrite sizes and start
patchDict.add("nFaces", patchSizes_[patchI], true);
patchDict.add("startFace", patchStarts_[patchI], true);
}
forAll(patchStarts_, patchI) forAll(patchStarts_, patchI)
{ {
p[patchI] = polyPatch::New p[patchI] = polyPatch::New
( (
patchTypes_[patchI],
patchNames_[patchI], patchNames_[patchI],
patchSizes_[patchI], patchDicts[patchI],
patchStarts_[patchI],
patchI, patchI,
mesh.boundaryMesh() mesh.boundaryMesh()
).ptr(); ).ptr();

View File

@ -89,7 +89,6 @@ Foam::PtrList<Foam::dictionary> Foam::blockMesh::patchDicts() const
patchTopologies[patchI].write(os); patchTopologies[patchI].write(os);
IStringStream is(os.str()); IStringStream is(os.str());
patchDicts.set(patchI, new dictionary(is)); patchDicts.set(patchI, new dictionary(is));
patchDicts[patchI].set("name", patchTopologies[patchI].name());
} }
return patchDicts; return patchDicts;
} }
@ -134,12 +133,12 @@ const Foam::faceListList& Foam::blockMesh::patches() const
} }
//Foam::wordList Foam::blockMesh::patchNames() const Foam::wordList Foam::blockMesh::patchNames() const
//{ {
// return topology().boundaryMesh().names(); return topology().boundaryMesh().names();
//} }
//
//
//Foam::wordList Foam::blockMesh::patchTypes() const //Foam::wordList Foam::blockMesh::patchTypes() const
//{ //{
// return topology().boundaryMesh().types(); // return topology().boundaryMesh().types();

View File

@ -121,6 +121,7 @@ class blockMesh
bool readBoundary bool readBoundary
( (
const dictionary& meshDescription, const dictionary& meshDescription,
wordList& patchNames,
faceListList& tmpBlocksPatches, faceListList& tmpBlocksPatches,
PtrList<dictionary>& patchDicts PtrList<dictionary>& patchDicts
); );
@ -185,8 +186,8 @@ public:
//- Get patch information from the topology mesh //- Get patch information from the topology mesh
PtrList<dictionary> patchDicts() const; PtrList<dictionary> patchDicts() const;
// wordList patchNames() const; wordList patchNames() const;
//
// wordList patchTypes() const; // wordList patchTypes() const;
// //
// wordList patchPhysicalTypes() const; // wordList patchPhysicalTypes() const;

View File

@ -189,6 +189,7 @@ bool Foam::blockMesh::readPatches
bool Foam::blockMesh::readBoundary bool Foam::blockMesh::readBoundary
( (
const dictionary& meshDescription, const dictionary& meshDescription,
wordList& patchNames,
faceListList& tmpBlocksPatches, faceListList& tmpBlocksPatches,
PtrList<dictionary>& patchDicts PtrList<dictionary>& patchDicts
) )
@ -201,6 +202,7 @@ bool Foam::blockMesh::readBoundary
meshDescription.lookup("boundary") meshDescription.lookup("boundary")
); );
patchNames.setSize(patchesInfo.size());
tmpBlocksPatches.setSize(patchesInfo.size()); tmpBlocksPatches.setSize(patchesInfo.size());
patchDicts.setSize(patchesInfo.size()); patchDicts.setSize(patchesInfo.size());
@ -215,9 +217,9 @@ bool Foam::blockMesh::readBoundary
<< " valid dictionary." << exit(FatalIOError); << " valid dictionary." << exit(FatalIOError);
} }
// Construct dictionary and add name patchNames[patchI] = patchInfo.keyword();
// Construct dictionary
patchDicts.set(patchI, new dictionary(patchInfo.dict())); patchDicts.set(patchI, new dictionary(patchInfo.dict()));
patchDicts[patchI].set("name", patchInfo.keyword());
// Read block faces // Read block faces
patchDicts[patchI].lookup("faces") >> tmpBlocksPatches[patchI]; patchDicts[patchI].lookup("faces") >> tmpBlocksPatches[patchI];
@ -472,7 +474,8 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
Info<< nl << "Reading physicalType from existing boundary file" << endl; Info<< nl << "Reading physicalType from existing boundary file" << endl;
wordList patchPhysicalTypes(tmpBlocksPatches.size()); PtrList<dictionary> patchDicts(patchNames.size());
word defaultFacesType;
preservePatchTypes preservePatchTypes
( (
@ -480,31 +483,29 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
meshDescription.time().constant(), meshDescription.time().constant(),
polyMesh::meshSubDir, polyMesh::meshSubDir,
patchNames, patchNames,
patchTypes, patchDicts,
defaultPatchName, defaultPatchName,
defaultPatchType, defaultPatchType
patchPhysicalTypes
); );
// Convert into dictionary // Add cyclic info (might not be present from older file)
PtrList<dictionary> patchDicts(patchNames.size());
forAll(patchDicts, patchI) forAll(patchDicts, patchI)
{ {
patchDicts.set(patchI, new dictionary()); if (!patchDicts.set(patchI))
patchDicts[patchI].set("name", patchNames[patchI]); {
patchDicts[patchI].set("type", patchTypes[patchI]); patchDicts.set(patchI, new dictionary());
}
dictionary& dict = patchDicts[patchI];
// Add but not override type
dict.add("type", patchTypes[patchI], false);
// Override neighbourpatch name
if (nbrPatchNames[patchI] != word::null) if (nbrPatchNames[patchI] != word::null)
{ {
patchDicts[patchI].set("neighbourPatch", nbrPatchNames[patchI]); dict.set("neighbourPatch", nbrPatchNames[patchI]);
}
if (patchPhysicalTypes[patchI] != word::null)
{
patchDicts[patchI].set
(
"physicalType",
patchPhysicalTypes[patchI]
);
} }
} }
@ -523,6 +524,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
xferCopy(blockPointField_), // copy these points, do NOT move xferCopy(blockPointField_), // copy these points, do NOT move
tmpBlockCells, tmpBlockCells,
tmpBlocksPatches, tmpBlocksPatches,
patchNames,
patchDicts, patchDicts,
defaultPatchName, defaultPatchName,
defaultPatchType defaultPatchType
@ -530,12 +532,14 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
} }
else if (meshDescription.found("boundary")) else if (meshDescription.found("boundary"))
{ {
wordList patchNames;
faceListList tmpBlocksPatches; faceListList tmpBlocksPatches;
PtrList<dictionary> patchDicts; PtrList<dictionary> patchDicts;
topologyOK = topologyOK && readBoundary topologyOK = topologyOK && readBoundary
( (
meshDescription, meshDescription,
patchNames,
tmpBlocksPatches, tmpBlocksPatches,
patchDicts patchDicts
); );
@ -553,6 +557,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
cellShapeList tmpBlockCells(blocks.size()); cellShapeList tmpBlockCells(blocks.size());
createCellShapes(tmpBlockCells); createCellShapes(tmpBlockCells);
// Extract
blockMeshPtr = new polyMesh blockMeshPtr = new polyMesh
( (
@ -568,6 +573,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
xferCopy(blockPointField_), // copy these points, do NOT move xferCopy(blockPointField_), // copy these points, do NOT move
tmpBlockCells, tmpBlockCells,
tmpBlocksPatches, tmpBlocksPatches,
patchNames,
patchDicts, patchDicts,
defaultPatchName, defaultPatchName,
defaultPatchType defaultPatchType

View File

@ -34,14 +34,7 @@ Description
#include "Time.H" #include "Time.H"
#include "IFstream.H" #include "IFstream.H"
#include "OFstream.H" #include "OFstream.H"
#include "meshTools.H" #include "pointField.H"
#include "polyMesh.H"
#include "wallPolyPatch.H"
#include "symmetryPolyPatch.H"
#include "preservePatchTypes.H"
#include "cellShape.H"
#include "cellModeller.H"
#include "mergePoints.H"
#include "unitConversion.H" #include "unitConversion.H"
using namespace Foam; using namespace Foam;

View File

@ -184,14 +184,14 @@ do
# Set colour # Set colour
colour="${colourList[$colourIndex]}" colour="${colourList[$colourIndex]}"
if [ "$host" = "$HOST" ]; then if [ "$host" = "$HOSTNAME" ]; then
eval $* 2>&1 | colourPipe "$colour" eval $* 2>&1 | colourPipe "$colour"
else else
ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" 2>&1 | colourPipe "$colour" ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" 2>&1 | colourPipe "$colour"
fi fi
retval=$? retval=$?
else else
if [ "$host" = "$HOST" ]; then if [ "$host" = "$HOSTNAME" ]; then
eval $* 2>&1 eval $* 2>&1
else else
ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" 2>&1 ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" 2>&1