mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: extrudeMesh: revert previous fix. see #1964
The polyMesh construct-from-components will now ignore the readOpt for the supplied primitives as before. This again re-allows READ_IF_PRESENT for fv* in combination with supplied primitives.
This commit is contained in:
@ -704,7 +704,7 @@ int main(int argc, char *argv[])
|
||||
regionName,
|
||||
runTimeExtruded.constant(),
|
||||
runTimeExtruded,
|
||||
IOobject::NO_READ, // Do not read primitives, do read fv*
|
||||
IOobject::READ_IF_PRESENT, // Read fv* if present
|
||||
IOobject::AUTO_WRITE,
|
||||
false
|
||||
),
|
||||
|
||||
@ -404,7 +404,7 @@ Foam::polyMesh::polyMesh
|
||||
instance(),
|
||||
meshSubDir,
|
||||
*this,
|
||||
io.readOpt(),
|
||||
IOobject::NO_READ, //io.readOpt(),
|
||||
io.writeOpt()
|
||||
),
|
||||
std::move(points)
|
||||
@ -417,7 +417,7 @@ Foam::polyMesh::polyMesh
|
||||
instance(),
|
||||
meshSubDir,
|
||||
*this,
|
||||
io.readOpt(),
|
||||
IOobject::NO_READ, //io.readOpt(),
|
||||
io.writeOpt()
|
||||
),
|
||||
std::move(faces)
|
||||
@ -430,7 +430,7 @@ Foam::polyMesh::polyMesh
|
||||
instance(),
|
||||
meshSubDir,
|
||||
*this,
|
||||
io.readOpt(),
|
||||
IOobject::NO_READ, //io.readOpt(),
|
||||
io.writeOpt()
|
||||
),
|
||||
std::move(owner)
|
||||
@ -443,7 +443,7 @@ Foam::polyMesh::polyMesh
|
||||
instance(),
|
||||
meshSubDir,
|
||||
*this,
|
||||
io.readOpt(),
|
||||
IOobject::NO_READ, //io.readOpt(),
|
||||
io.writeOpt()
|
||||
),
|
||||
std::move(neighbour)
|
||||
@ -519,11 +519,6 @@ Foam::polyMesh::polyMesh
|
||||
oldPointsPtr_(nullptr),
|
||||
oldCellCentresPtr_(nullptr)
|
||||
{
|
||||
// Note: changed that the constructors where values can be supplied
|
||||
// (points, faces, owner/neighbour) use the readOpt. All others
|
||||
// (boundary, *zones) ignore readOpt. To be reviewed as with
|
||||
// constructor below
|
||||
|
||||
// Check if the faces and cells are valid
|
||||
forAll(faces_, facei)
|
||||
{
|
||||
@ -677,9 +672,6 @@ Foam::polyMesh::polyMesh
|
||||
oldPointsPtr_(nullptr),
|
||||
oldCellCentresPtr_(nullptr)
|
||||
{
|
||||
// Note: probably needs io.readOpt() for points/faces/cells etc so
|
||||
// we can run with READ_IF_PRESENT. See constructor above.
|
||||
|
||||
// Check if faces are valid
|
||||
forAll(faces_, facei)
|
||||
{
|
||||
|
||||
@ -331,7 +331,7 @@ public:
|
||||
// Boundary is added using addPatches() member function
|
||||
polyMesh(const IOobject& io, const zero, const bool syncPar=true);
|
||||
|
||||
//- Construct from IOobject or from components.
|
||||
//- Construct from IOobject and components.
|
||||
// Boundary is added using addPatches() member function
|
||||
polyMesh
|
||||
(
|
||||
|
||||
@ -442,6 +442,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshTools::newMesh
|
||||
|
||||
|
||||
fileName facesInstance;
|
||||
fileName pointsInstance;
|
||||
|
||||
// Patch types
|
||||
// ~~~~~~~~~~~
|
||||
@ -457,7 +458,12 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshTools::newMesh
|
||||
"faces",
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
pointsInstance = io.time().findInstance
|
||||
(
|
||||
meshSubDir,
|
||||
"points",
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
patchEntries = polyBoundaryMeshEntries
|
||||
(
|
||||
IOobject
|
||||
@ -491,8 +497,9 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshTools::newMesh
|
||||
fromMaster >> patchEntries;
|
||||
}
|
||||
|
||||
|
||||
Pstream::scatter(facesInstance);
|
||||
Pstream::scatter(pointsInstance);
|
||||
|
||||
|
||||
// Dummy meshes
|
||||
// ~~~~~~~~~~~~
|
||||
@ -522,8 +529,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshTools::newMesh
|
||||
|
||||
// Read mesh
|
||||
// ~~~~~~~~~
|
||||
// Now all processors read a mesh or use supplied points,faces etc
|
||||
// if there is none.
|
||||
// Now all processors use supplied points,faces etc
|
||||
// Note: fvSolution, fvSchemes are also using the supplied IOobject so
|
||||
// on slave will be NO_READ, on master READ_IF_PRESENT. This will
|
||||
// conflict with e.g. timeStampMaster reading so switch off.
|
||||
@ -535,7 +541,75 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshTools::newMesh
|
||||
regIOobject::fileModificationChecking;
|
||||
regIOobject::fileModificationChecking = regIOobject::timeStamp;
|
||||
|
||||
auto meshPtr = autoPtr<fvMesh>::New(meshIO, Zero);
|
||||
|
||||
//- Points
|
||||
pointIOField points
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"points",
|
||||
pointsInstance, //meshIO.instance(),
|
||||
meshSubDir,
|
||||
meshIO.db(),
|
||||
(haveMesh ? IOobject::MUST_READ : IOobject::NO_READ),
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
//- Faces
|
||||
faceCompactIOList faces
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"faces",
|
||||
meshIO.instance(),
|
||||
meshSubDir,
|
||||
meshIO.db(),
|
||||
(haveMesh ? IOobject::MUST_READ : IOobject::NO_READ),
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
//- Face owner
|
||||
labelIOList owner
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"owner",
|
||||
meshIO.instance(),
|
||||
meshSubDir,
|
||||
meshIO.db(),
|
||||
(haveMesh ? IOobject::MUST_READ : IOobject::NO_READ),
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
//- Face neighbour
|
||||
labelIOList neighbour
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"neighbour",
|
||||
meshIO.instance(),
|
||||
meshSubDir,
|
||||
meshIO.db(),
|
||||
(haveMesh ? IOobject::MUST_READ : IOobject::NO_READ),
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
auto meshPtr = autoPtr<fvMesh>::New
|
||||
(
|
||||
meshIO,
|
||||
std::move(points),
|
||||
std::move(faces),
|
||||
std::move(owner),
|
||||
std::move(neighbour)
|
||||
);
|
||||
fvMesh& mesh = *meshPtr;
|
||||
|
||||
regIOobject::fileModificationChecking = oldCheckType;
|
||||
|
||||
Reference in New Issue
Block a user