BUG: PDRsetFields fails with non-orthogonal outer region (fixes #1907)

- first sort the cells into their ijk bins, and restrict testing for
  face orientation to those faces with an owner or neighbour that has
  an ijk bin.

ENH: ensure polyMesh from PDRblockMesh is marked as AUTO_WRITE

- the particular polyMesh constructor inherits the writeOpt, which
  makes is dependent on the caller and thus somewhat fragile for the
  top level caller.
This commit is contained in:
Mark Olesen
2020-10-28 19:56:36 +01:00
parent 043419f30a
commit 3b7100a9a1
4 changed files with 135 additions and 91 deletions

View File

@ -328,14 +328,19 @@ Foam::autoPtr<Foam::polyMesh> Foam::PDRblock::mesh(const IOobject& io) const
}
}
IOobject iomesh(io);
iomesh.writeOpt() = IOobject::AUTO_WRITE;
auto meshPtr = autoPtr<polyMesh>::New
(
io,
iomesh,
std::move(pts),
std::move(faces),
std::move(own),
std::move(nei)
);
polyMesh& pmesh = *meshPtr;
PtrList<polyPatch> patches(patches_.size());
@ -355,7 +360,7 @@ Foam::autoPtr<Foam::polyMesh> Foam::PDRblock::mesh(const IOobject& io) const
bentry.size_,
startFace,
patchi, // index
meshPtr->boundaryMesh()
pmesh.boundaryMesh()
)
);
@ -365,7 +370,7 @@ Foam::autoPtr<Foam::polyMesh> Foam::PDRblock::mesh(const IOobject& io) const
++patchi;
}
meshPtr->addPatches(patches);
pmesh.addPatches(patches);
return meshPtr;
}