Commit 791b5aae authored by mattijs's avatar mattijs
Browse files

replacing isType with isA to enable directMappedWall to work

parent 2cee56ee
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -37,7 +37,7 @@ Description
{
const fvPatch& p = patches[patchi];
if (isType<wallFvPatch>(p))
if (isA<wallFvPatch>(p))
{
epsEqn.setValues
(
......
......@@ -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)
{
......
......@@ -10,7 +10,7 @@
{
const fvPatch& currPatch = patches[patchi];
if (isType<wallFvPatch>(currPatch))
if (isA<wallFvPatch>(currPatch))
{
scalarField& nutw = nutb.boundaryField()[patchi];
......
......@@ -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]);
......
......@@ -37,7 +37,7 @@ Description
{
const fvPatch& p = patches[patchi];
if (isType<wallFvPatch>(p))
if (isA<wallFvPatch>(p))
{
epsEqn.setValues
(
......
......@@ -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)
{
......
......@@ -9,7 +9,7 @@
{
const fvPatch& curPatch = patches[patchi];
if (isType<wallFvPatch>(curPatch))
if (isA<wallFvPatch>(curPatch))
{
const scalarField& rhow = rho.boundaryField()[patchi];
......
......@@ -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;
}
......
......@@ -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)
{
......
......@@ -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];
......
......@@ -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];
......
......@@ -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];
......
......@@ -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 ";
}
......
......@@ -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();
......
......@@ -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
(
......
......@@ -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,
......
......@@ -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
......
......@@ -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)
)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment