replacing isType with isA to enable directMappedWall to work

This commit is contained in:
mattijs
2009-09-15 17:51:59 +01:00
parent 2cee56ee01
commit 791b5aaeaa
87 changed files with 990 additions and 231 deletions

View File

@ -38,7 +38,7 @@
for (label i=0; i<Ua.boundaryField().size(); i++)
{
if (isType<fixedValueFvPatchVectorField>(Ua.boundaryField()[i]))
if (isA<fixedValueFvPatchVectorField>(Ua.boundaryField()[i]))
{
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
}

View File

@ -38,7 +38,7 @@
for (label i=0; i<Ub.boundaryField().size(); i++)
{
if (isType<fixedValueFvPatchVectorField>(Ub.boundaryField()[i]))
if (isA<fixedValueFvPatchVectorField>(Ub.boundaryField()[i]))
{
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
}

View File

@ -37,7 +37,7 @@ Description
{
const fvPatch& p = patches[patchi];
if (isType<wallFvPatch>(p))
if (isA<wallFvPatch>(p))
{
epsEqn.setValues
(

View File

@ -12,7 +12,7 @@
{
const fvPatch& currPatch = patches[patchi];
if (isType<wallFvPatch>(currPatch))
if (isA<wallFvPatch>(currPatch))
{
forAll(currPatch, facei)
{
@ -30,7 +30,7 @@
{
const fvPatch& currPatch = patches[patchi];
if (isType<wallFvPatch>(currPatch))
if (isA<wallFvPatch>(currPatch))
{
const scalarField& nuw = nutb.boundaryField()[patchi];
@ -74,7 +74,7 @@
{
const fvPatch& curPatch = patches[patchi];
if (isType<wallFvPatch>(curPatch))
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{

View File

@ -10,7 +10,7 @@
{
const fvPatch& currPatch = patches[patchi];
if (isType<wallFvPatch>(currPatch))
if (isA<wallFvPatch>(currPatch))
{
scalarField& nutw = nutb.boundaryField()[patchi];

View File

@ -352,7 +352,7 @@ void Foam::multiphaseMixture::correctContactAngle
forAll(boundary, patchi)
{
if (typeid(gbf[patchi]) == typeid(alphaContactAngleFvPatchScalarField))
if (isA<alphaContactAngleFvPatchScalarField>(gbf[patchi]))
{
const alphaContactAngleFvPatchScalarField& acap =
refCast<const alphaContactAngleFvPatchScalarField>(gbf[patchi]);

View File

@ -37,7 +37,7 @@ Description
{
const fvPatch& p = patches[patchi];
if (isType<wallFvPatch>(p))
if (isA<wallFvPatch>(p))
{
epsEqn.setValues
(

View File

@ -12,7 +12,7 @@
{
const fvPatch& curPatch = patches[patchi];
if (isType<wallFvPatch>(curPatch))
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
@ -30,7 +30,7 @@
{
const fvPatch& curPatch = patches[patchi];
if (isType<wallFvPatch>(curPatch))
if (isA<wallFvPatch>(curPatch))
{
const scalarField& rhow = rho.boundaryField()[patchi];
@ -76,7 +76,7 @@
{
const fvPatch& curPatch = patches[patchi];
if (isType<wallFvPatch>(curPatch))
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{

View File

@ -9,7 +9,7 @@
{
const fvPatch& curPatch = patches[patchi];
if (isType<wallFvPatch>(curPatch))
if (isA<wallFvPatch>(curPatch))
{
const scalarField& rhow = rho.boundaryField()[patchi];

View File

@ -109,7 +109,7 @@ Foam::phaseModel::phaseModel
for (label i=0; i<U_.boundaryField().size(); i++)
{
if (isType<fixedValueFvPatchVectorField>(U_.boundaryField()[i]))
if (isA<fixedValueFvPatchVectorField>(U_.boundaryField()[i]))
{
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
}

View File

@ -77,7 +77,7 @@ int main(int argc, char *argv[])
{
const fvPatch& patch = mesh.boundary()[patchI];
if (typeid(patch) == typeid(wallFvPatch))
if (isA<wallFvPatch>(patch))
{
nWalls += patch.size();
}
@ -91,7 +91,7 @@ int main(int argc, char *argv[])
{
const fvPatch& patch = mesh.boundary()[patchI];
if (typeid(patch) == typeid(wallFvPatch))
if (isA<wallFvPatch>(patch))
{
forAll (patch.Cf(), patchFaceI)
{

View File

@ -66,7 +66,7 @@ int main(int argc, char *argv[])
{
const fvPatch& patch = mesh.boundary()[patchI];
if (typeid(patch) == typeid(wallFvPatch))
if (isA<wallFvPatch>(patch))
{
fvPatchVectorField& wallData = n.boundaryField()[patchI];

View File

@ -66,7 +66,7 @@ int main(int argc, char *argv[])
{
const fvPatch& patch = mesh.boundary()[patchI];
if (typeid(patch) == typeid(wallFvPatch))
if (isA<wallFvPatch>(patch))
{
fvPatchScalarField& wallData = yStar.boundaryField()[patchI];

View File

@ -55,7 +55,7 @@ labelList procNeighbours(const polyMesh& mesh)
forAll (mesh.boundaryMesh(), patchI)
{
if (typeid(mesh.boundaryMesh()[patchI]) == typeid(processorPolyPatch))
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchI]))
{
nNeighbours++;
}
@ -67,7 +67,7 @@ labelList procNeighbours(const polyMesh& mesh)
forAll (mesh.boundaryMesh(), patchI)
{
if (typeid(mesh.boundaryMesh()[patchI]) == typeid(processorPolyPatch))
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchI]))
{
const polyPatch& patch = mesh.boundaryMesh()[patchI];

View File

@ -174,17 +174,11 @@ void Foam::fluentFvMesh::writeFluentMesh() const
nWrittenFaces += patchFaces.size();
// Write patch type
if
(
typeid(boundary()[patchI]) == typeid(wallFvPatch)
)
if (isA<wallFvPatch>(boundary()[patchI]))
{
fluentMeshFile << 3;
}
else if
(
typeid(boundary()[patchI]) == typeid(symmetryFvPatch)
)
else if (isA<symmetryFvPatch>(boundary()[patchI]))
{
fluentMeshFile << 7;
}
@ -282,17 +276,11 @@ void Foam::fluentFvMesh::writeFluentMesh() const
<< "(39 (" << patchI + 10 << " ";
// Write patch type
if
(
typeid(boundary()[patchI]) == typeid(wallFvPatch)
)
if (isA<wallFvPatch>(boundary()[patchI]))
{
fluentMeshFile << "wall ";
}
else if
(
typeid(boundary()[patchI]) == typeid(symmetryFvPatch)
)
else if (isA<symmetryFvPatch>(boundary()[patchI]))
{
fluentMeshFile << "symmetry ";
}

View File

@ -268,10 +268,7 @@ label twoDNess(const polyMesh& mesh)
{
const polyPatch& patch = patches[patchI];
if
(
typeid(patch) != typeid(wedgePolyPatch)
)
if (!isA<wedgePolyPatch>(patch))
{
const vectorField& n = patch.faceAreas();

View File

@ -121,7 +121,7 @@ void writeVTK
const fileName& vtkName
)
{
if (typeid(currentSet) == typeid(faceSet))
if (isA<faceSet>(currentSet))
{
// Faces of set with OpenFOAM faceID as value
@ -148,7 +148,7 @@ void writeVTK
mesh.time().path()/vtkName
);
}
else if (typeid(currentSet) == typeid(cellSet))
else if (isA<cellSet>(currentSet))
{
// External faces of cellset with OpenFOAM cellID as value
@ -208,7 +208,7 @@ void writeVTK
mesh.time().path()/vtkName
);
}
else if (typeid(currentSet) == typeid(pointSet))
else if (isA<pointSet>(currentSet))
{
writePointSet
(

View File

@ -160,12 +160,8 @@ void reorderPatchFields(fvMesh& mesh, const labelList& oldToNew)
// Adds patch if not yet there. Returns patchID.
label addPatch
(
fvMesh& mesh,
const word& patchName,
const word& patchType
)
template<class PatchType>
label addPatch(fvMesh& mesh, const word& patchName)
{
polyBoundaryMesh& polyPatches =
const_cast<polyBoundaryMesh&>(mesh.boundaryMesh());
@ -173,11 +169,18 @@ label addPatch
label patchI = polyPatches.findPatchID(patchName);
if (patchI != -1)
{
if (polyPatches[patchI].type() == patchType)
if (isA<PatchType>(polyPatches[patchI]))
{
// Already there
return patchI;
}
else
{
FatalErrorIn("addPatch<PatchType>(fvMesh&, const word&)")
<< "Already have patch " << patchName
<< " but of type " << PatchType::typeName
<< exit(FatalError);
}
}
@ -214,7 +217,7 @@ label addPatch
sz,
polyPatch::New
(
patchType,
PatchType::typeName,
patchName,
0, // size
startFaceI,
@ -1021,17 +1024,15 @@ EdgeMap<label> addRegionPatches
if (interfaceSizes[e] > 0)
{
label patchI = addPatch
label patchI = addPatch<directMappedWallPolyPatch>
(
mesh,
regionNames[e[0]] + "_to_" + regionNames[e[1]],
directMappedWallPolyPatch::typeName
regionNames[e[0]] + "_to_" + regionNames[e[1]]
);
addPatch
addPatch<directMappedWallPolyPatch>
(
mesh,
regionNames[e[1]] + "_to_" + regionNames[e[0]],
directMappedWallPolyPatch::typeName
regionNames[e[1]] + "_to_" + regionNames[e[0]]
);
Info<< "For interface between region " << e[0]
@ -1405,7 +1406,7 @@ int main(int argc, char *argv[])
IOobject
(
"cellToRegion",
mesh.facesInstance(),
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,

View File

@ -243,7 +243,7 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
const label patchStart = patches[patchi].start();
if (typeid(patches[patchi]) != typeid(cyclicPolyPatch))
if (!isA<cyclicPolyPatch>(patches[patchi]))
{
// Normal patch. Add faces to processor where the cell
// next to the face lives

View File

@ -191,7 +191,7 @@ Foam::fvFieldReconstructor::reconstructFvVolumeField
// add empty patches
if
(
typeid(mesh_.boundary()[patchI]) == typeid(emptyFvPatch)
isType<emptyFvPatch>(mesh_.boundary()[patchI])
&& !patchFields(patchI)
)
{
@ -411,7 +411,7 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
// add empty patches
if
(
typeid(mesh_.boundary()[patchI]) == typeid(emptyFvPatch)
isType<emptyFvPatch>(mesh_.boundary()[patchI])
&& !patchFields(patchI)
)
{

View File

@ -127,8 +127,8 @@ Foam::fieldviewTopology::fieldviewTopology
const polyPatch& currPatch = mesh.boundaryMesh()[patchI];
if
(
isType<wallPolyPatch>(currPatch)
|| isType<symmetryPolyPatch>(currPatch)
isA<wallPolyPatch>(currPatch)
|| isA<symmetryPolyPatch>(currPatch)
)
{
forAll(currPatch, patchFaceI)

View File

@ -205,8 +205,8 @@ labelList getSelectedPatches
if
(
isType<emptyPolyPatch>(pp)
|| (Pstream::parRun() && isType<processorPolyPatch>(pp))
isA<emptyPolyPatch>(pp)
|| (Pstream::parRun() && isA<processorPolyPatch>(pp))
)
{
Info<< " discarding empty/processor patch " << patchI
@ -805,7 +805,7 @@ int main(int argc, char *argv[])
labelList(1, patchI)
);
if (!isType<emptyPolyPatch>(pp))
if (!isA<emptyPolyPatch>(pp))
{
// VolFields + patchID
writeFuns::writeCellDataHeader

View File

@ -152,7 +152,7 @@ void Foam::patchWriter::writePatchIDs()
const polyPatch& pp = mesh.boundaryMesh()[patchI];
if (!isType<emptyPolyPatch>(pp))
if (!isA<emptyPolyPatch>(pp))
{
writeFuns::insert(scalarField(pp.size(), patchI), fField);
}

View File

@ -609,7 +609,7 @@ void user_query_file_function
strcpy(face_type_names[patchI], patch.name().c_str());
if (isType<wallPolyPatch>(patch))
if (isA<wallPolyPatch>(patch))
{
wall_flags[patchI] = 1;
}

View File

@ -76,7 +76,7 @@ int main(int argc, char *argv[])
}
// Give patch area
if (isType<cyclicPolyPatch>(mesh.boundaryMesh()[patchi]))
if (isA<cyclicPolyPatch>(mesh.boundaryMesh()[patchi]))
{
Info<< " Cyclic patch vector area: " << nl;
label nFaces = mesh.boundaryMesh()[patchi].size();

View File

@ -64,7 +64,7 @@ int main(int argc, char *argv[])
Info<< "\nWall heat fluxes [W]" << endl;
forAll(patchHeatFlux, patchi)
{
if (typeid(mesh.boundary()[patchi]) == typeid(wallFvPatch))
if (isA<wallFvPatch>(mesh.boundary()[patchi]))
{
Info<< mesh.boundary()[patchi].name()
<< " "

View File

@ -109,7 +109,7 @@ int main(int argc, char *argv[])
{
const fvPatch& currPatch = patches[patchi];
if (typeid(currPatch) == typeid(wallFvPatch))
if (isA<wallFvPatch>(currPatch))
{
yPlus.boundaryField()[patchi] =
d[patchi]

View File

@ -202,7 +202,7 @@ void replaceBoundaryType
dictionary& boundaryDict = dict.subDict("boundaryField");
forAll(bMesh, patchI)
{
if (isType<wallPolyPatch>(bMesh[patchI]))
if (isA<wallPolyPatch>(bMesh[patchI]))
{
word patchName = bMesh[patchI].name();
dictionary& oldPatch = boundaryDict.subDict(patchName);

View File

@ -164,7 +164,7 @@ void mapConsistentSubMesh
forAll(meshTarget.boundary(), patchi)
{
if (typeid(meshTarget.boundary()[patchi]) != typeid(processorFvPatch))
if (!isA<processorFvPatch>(meshTarget.boundary()[patchi]))
{
patchMap.insert
(
@ -201,7 +201,7 @@ wordList addProcessorPatches
forAll (meshTarget.boundary(), patchi)
{
if (typeid(meshTarget.boundary()[patchi]) == typeid(processorFvPatch))
if (isA<processorFvPatch>(meshTarget.boundary()[patchi]))
{
if
(

View File

@ -108,11 +108,7 @@ int main(int argc, char *argv[])
{
const polyPatch& patch = bMesh[patchI];
if
(
includeProcPatches
|| (patch.type() != processorPolyPatch::typeName)
)
if (includeProcPatches || !isA<processorPolyPatch>(patch))
{
includePatches.insert(patchI);
}