mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
replacing isType with isA to enable directMappedWall to work
This commit is contained in:
@ -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)
|
||||
)
|
||||
{
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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()
|
||||
<< " "
|
||||
|
||||
@ -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]
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
(
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user