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:
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user