mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: redistributePar: cell/face/pointProcAddressing written to incorrect dir
This commit is contained in:
@ -1040,7 +1040,8 @@ autoPtr<mapDistributePolyMesh> redistributeAndWrite
|
|||||||
mesh,
|
mesh,
|
||||||
distMap(),
|
distMap(),
|
||||||
decompose,
|
decompose,
|
||||||
writeHandler
|
mesh.facesInstance(), //oldFacesInstance,
|
||||||
|
writeHandler // to write *ProcAddressing
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (reconstruct)
|
else if (reconstruct)
|
||||||
@ -1054,6 +1055,7 @@ autoPtr<mapDistributePolyMesh> redistributeAndWrite
|
|||||||
mesh,
|
mesh,
|
||||||
distMap(),
|
distMap(),
|
||||||
decompose,
|
decompose,
|
||||||
|
volMeshInstance, //oldFacesInstance,
|
||||||
readHandler //writeHandler
|
readHandler //writeHandler
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -760,12 +760,19 @@ Foam::fvMeshTools::loadOrCreateMeshImpl
|
|||||||
const label oldNumProcs = fileHandler().nProcs();
|
const label oldNumProcs = fileHandler().nProcs();
|
||||||
const int oldCache = fileOperation::cacheLevel(0);
|
const int oldCache = fileOperation::cacheLevel(0);
|
||||||
|
|
||||||
|
const fileName facesInstance = io.time().findInstance
|
||||||
|
(
|
||||||
|
meshSubDir,
|
||||||
|
"faces",
|
||||||
|
IOobject::MUST_READ
|
||||||
|
);
|
||||||
|
|
||||||
patchEntries = polyBoundaryMeshEntries
|
patchEntries = polyBoundaryMeshEntries
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"boundary",
|
"boundary",
|
||||||
io.instance(),
|
facesInstance,
|
||||||
meshSubDir,
|
meshSubDir,
|
||||||
io.db(),
|
io.db(),
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
|
|||||||
@ -220,6 +220,7 @@ public:
|
|||||||
const fvMesh& procMesh,
|
const fvMesh& procMesh,
|
||||||
const mapDistributePolyMesh& map,
|
const mapDistributePolyMesh& map,
|
||||||
const bool decompose,
|
const bool decompose,
|
||||||
|
const fileName& writeHandlerInstance,
|
||||||
refPtr<fileOperation>& writeHandler
|
refPtr<fileOperation>& writeHandler
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -303,6 +303,7 @@ void Foam::fvMeshTools::writeProcAddressing
|
|||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const mapDistributePolyMesh& map,
|
const mapDistributePolyMesh& map,
|
||||||
const bool decompose,
|
const bool decompose,
|
||||||
|
const fileName& writeHandlerInstance,
|
||||||
refPtr<fileOperation>& writeHandler
|
refPtr<fileOperation>& writeHandler
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -317,7 +318,7 @@ void Foam::fvMeshTools::writeProcAddressing
|
|||||||
// been done independently (as a registered object)
|
// been done independently (as a registered object)
|
||||||
IOobject ioAddr
|
IOobject ioAddr
|
||||||
(
|
(
|
||||||
"procAddressing",
|
"proc-addressing",
|
||||||
mesh.facesInstance(),
|
mesh.facesInstance(),
|
||||||
polyMesh::meshSubDir,
|
polyMesh::meshSubDir,
|
||||||
mesh.thisDb(),
|
mesh.thisDb(),
|
||||||
@ -421,12 +422,31 @@ void Foam::fvMeshTools::writeProcAddressing
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Switch to using the correct
|
||||||
|
// - fileHandler
|
||||||
|
// - instance
|
||||||
|
// to write to the original mesh/time in the original format. Clunky!
|
||||||
|
// Bypass regIOobject writing to avoid taking over the current time
|
||||||
|
// as instance so instead of e.g. 'celllMap.write()' directly call
|
||||||
|
// the chosen file-handler.
|
||||||
|
|
||||||
|
const auto& tm = cellMap.time();
|
||||||
|
const IOstreamOption opt(tm.writeFormat(), tm.writeCompression());
|
||||||
|
{
|
||||||
auto oldHandler = fileOperation::fileHandler(writeHandler);
|
auto oldHandler = fileOperation::fileHandler(writeHandler);
|
||||||
|
|
||||||
const bool cellOk = cellMap.write();
|
cellMap.instance() = writeHandlerInstance;
|
||||||
const bool faceOk = faceMap.write();
|
const bool cellOk = fileHandler().writeObject(cellMap, opt, true);
|
||||||
const bool pointOk = pointMap.write();
|
|
||||||
const bool patchOk = patchMap.write();
|
faceMap.instance() = writeHandlerInstance;
|
||||||
|
const bool faceOk = fileHandler().writeObject(faceMap, opt, true);
|
||||||
|
|
||||||
|
pointMap.instance() = writeHandlerInstance;
|
||||||
|
const bool pointOk = fileHandler().writeObject(pointMap, opt, true);
|
||||||
|
|
||||||
|
patchMap.instance() = writeHandlerInstance;
|
||||||
|
const bool patchOk = fileHandler().writeObject(patchMap, opt, true);
|
||||||
|
|
||||||
writeHandler = fileOperation::fileHandler(oldHandler);
|
writeHandler = fileOperation::fileHandler(oldHandler);
|
||||||
|
|
||||||
@ -439,6 +459,7 @@ void Foam::fvMeshTools::writeProcAddressing
|
|||||||
<< pointMap.objectRelPath() << ", "
|
<< pointMap.objectRelPath() << ", "
|
||||||
<< patchMap.objectRelPath() << endl;
|
<< patchMap.objectRelPath() << endl;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user