mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: return old file handler on change
- intended for the following type of use:
auto oldHandler = fileHandler(fileOperation::NewUncollated());
... do something that only works with uncollated
// Restore previous (if any)
if (oldHandler)
{
fileHandler(std::move(oldHandler));
}
ENH: make fileOperation distributed(bool) mutable
- use is "static-like" and akin to Pstream::parRun(bool),
thus allow toggling of the switch without a const_cast
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -116,7 +116,7 @@ int main(int argc, char *argv[])
|
||||
#include "setRootCase.H"
|
||||
|
||||
// As much as possible avoid synchronised operation
|
||||
const_cast<fileOperation&>(fileHandler()).distributed(true);
|
||||
fileHandler().distributed(true);
|
||||
|
||||
#include "createTime.H"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user