Compare commits

...

24 Commits

Author SHA1 Message Date
622f476b32 ENH: additional SHA1Digest constructors and methods
- data_bytes(), size_bytes() methods to support broadcasting or
  gather/scatter content. Additional construct from raw bytes
  to support transmitted content.
2023-03-20 11:36:50 +01:00
7389ce15ce STYLE: readOnProc/writeOnProc instead of 'valid' for IO 2023-03-16 11:20:09 +01:00
f801e99f9e STYLE: use readValueEntry in BCs. Assign Zero for refValue/refGrad 2023-03-16 11:20:08 +01:00
34e36b83ab ENH: initEvaluate()/evaluate() for faePatchField, fvsPatchField
- no-op implementations, but makes the call to
  GeometricBoundaryField::evaluate() less dependent on PatchField type

- add updated()/manipulatedMatrix() methods to faePatchField,
  fvsPatchField etc. These are mostly no-ops, but provide name
  compatible with fvPatchField etc.
2023-03-16 11:15:35 +01:00
1d81190881 ENH: consistent reported topoSet counts (#2719) 2023-03-10 17:02:19 +00:00
25bc7d65f7 STYLE: prefer REGISTER/NO_REGISTER instead of true/false for IOobject
- self-documenting
2023-03-10 14:16:32 +00:00
20566a87f5 ENH: provide getter/setter interface to standard communicators
- similar to UPstream::parRun(), the setter returns the previous value.

  The accessors are prefixed with 'comm':
  Eg, commGlobal(), commWarn(), commWorld(), commSelf().
  This distinguishes them from any existing variables (eg, worldComm)
  and arguably more similar to MPI_COMM_WORLD etc...

  If demand-driven communicators are added in the future, the function
  call syntax can help encapsulate that.

  Previously:

      const label oldWarnComm = UPstream::warnComm;
      const label oldWorldComm = UPstream::worldComm;
      UPstream::warnComm = myComm;
      UPstream::worldComm = myComm;
      ...

      UPstream::warnComm = oldWarnComm;
      UPstream::worldComm = oldWorldComm;

  Now:
      const label oldWarnComm = UPstream::commWarn(myComm);
      const label oldWorldComm = UPstream::commWorld(myComm);
      ...

      UPstream::commWarn(oldWarnComm);
      UPstream::commWorld(oldWorldComm);

STYLE: check (warnComm >= 0) instead of (warnComm != -1)
2023-03-09 16:01:04 +00:00
06df44a588 COMP: protect against null tmp field (freestream BC) 2023-03-09 09:43:29 +00:00
b519a8e128 ENH: add finite-area uniformFixedValue
- deprecate timeVaryingUniformFixed (now redundant)
2023-03-08 15:32:34 +00:00
26400d7534 ENH: add finite-area extrapolatedCalculated BC 2023-03-08 15:31:01 +00:00
b17422ef1a ENH: use readValueEntry, readMixedEntries for simpler program control 2023-03-08 15:30:04 +00:00
42dba36832 ENH: consistent handling of "value" for faePatchField
- base level now explicity equivalent to LAZY_READ with overriding as
  required

- clearer documentation for reading of "value" for faPatchField
2023-03-08 12:02:41 +00:00
063227baed ENH: support readOption handling for patch fields (base level)
- constructing with valueRequired as a bool is still supported,
  but now also support more refined requirements
  (eg, NO_READ, MUST_READ, LAZY_READ)

- continue with LAZY_READ for finite-area fields
2023-03-07 17:24:28 +00:00
7e9b5dbc78 TUT: adjust height limiter and outflow BC for drippingChair 2023-03-03 20:55:10 +01:00
94df19a93a ENH: add finiteArea outletInlet patch type
STYLE: use readValueEntry and Field assign to simplify code
2023-03-03 18:53:58 +01:00
2ef89bf9d3 Merge branch 'primitiveMeshOptimization' into 'develop'
ENH: improved point-cell and cell-point topology methods (#2715)

See merge request Development/openfoam!597
2023-03-03 16:36:55 +00:00
074749a722 ENH: improved point-cell and cell-point topology methods (#2715) 2023-03-03 16:36:54 +00:00
820f93c3b4 ENH: simplify box mesh construction (PDRblockMesh)
ENH: construct or reset boundBox from zero_one for a 0-1 unit cube

ENH: add some testing timings (for !596 and #2715)
2023-03-03 16:23:42 +01:00
4dff2bfad1 STYLE: PtrList emplace_set for symmetry with HashPtrTable method naming 2023-03-03 12:17:25 +01:00
d5c0852de1 ENH: improve diagnostic fields for checkFaMesh -write-vtk
ENH: support VTK output of procIDs for point data for some writers

TUT: areaWrite for drippingChair
2023-03-02 20:50:52 +01:00
4284d02c99 CONFIG: accept -decompose-dict=xyz for Run functions and mpirunDebug
- interpret as '-decomposeParDict xyz' for simpler scripting:
  A empty value ("") as well as "none" or "false" values are ignored.

  Eg,
      unset decompDict
      if some_condition; then decompDict=decomposeParDict-12; fi

      runParallel -decompose-dict=$decompDict ...

ENH: more generous when scanning decomposeParDict for numberOfSubdomains

- assume file is in system/ directory if not otherwise found
2023-03-02 20:50:52 +01:00
82c0b360c6 ENH: support run-time PstreamBuffers algorithm selection (advanced option)
- this helps isolate selection of PEX vs NBX, for potential migration
  to a hybrid PEX
2023-03-02 20:50:48 +01:00
99bf27cbee STYLE: use PstreamBuffers allProcs() addressing in zoneDistribute
STYLE: more generous handling of procIDs on non-master (globalIndex)
2023-03-02 15:31:50 +01:00
d3867a2d34 SUBMODULE: minor updates for external-solver 2023-03-02 12:37:06 +01:00
746 changed files with 5532 additions and 3144 deletions

View File

@ -109,7 +109,7 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(Nv.dimensions(), Zero) dimensionedScalar(Nv.dimensions(), Zero)

View File

@ -12,7 +12,7 @@ Info<< "Creating base fields for time " << runTime.timeName() << endl;
mesh, mesh,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar("Ydefault", dimless, 1) dimensionedScalar("Ydefault", dimless, 1)
@ -29,7 +29,7 @@ Info<< "Creating base fields for time " << runTime.timeName() << endl;
mesh, mesh,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar("p", dimPressure, p0) dimensionedScalar("p", dimPressure, p0)
@ -46,7 +46,7 @@ Info<< "Creating base fields for time " << runTime.timeName() << endl;
mesh, mesh,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar("T", dimTemperature, T0) dimensionedScalar("T", dimTemperature, T0)

View File

@ -103,14 +103,7 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
<< exit(FatalIOError); << exit(FatalIOError);
} }
if (dict.found("value")) if (!this->readValueEntry(dict))
{
fvPatchField<scalar>::operator=
(
scalarField("value", dict, p.size())
);
}
else
{ {
fvPatchField<scalar>::operator=(patchInternalField()); fvPatchField<scalar>::operator=(patchInternalField());
} }

View File

@ -105,18 +105,15 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
<< exit(FatalIOError); << exit(FatalIOError);
} }
if (dict.found("value")) if (this->readValueEntry(dict))
{ {
fvPatchField<vector>::operator= const auto* hasRefValue = dict.findEntry("refValue", keyType::LITERAL);
( const auto* hasFrac = dict.findEntry("valueFraction", keyType::LITERAL);
vectorField("value", dict, p.size())
);
if (dict.found("refValue") && dict.found("valueFraction")) if (hasRefValue && hasFrac)
{ {
this->refValue() = vectorField("refValue", dict, p.size()); this->refValue().assign(*hasRefValue, p.size());
this->valueFraction() = this->valueFraction().assign(*hasFrac, p.size());
scalarField("valueFraction", dict, p.size());
} }
else else
{ {

View File

@ -243,14 +243,12 @@ turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
<< exit(FatalError); << exit(FatalError);
} }
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
if (dict.found("refValue")) this->readValueEntry(dict, IOobjectOption::MUST_READ);
if (this->readMixedEntries(dict))
{ {
// Full restart // Full restart
refValue() = scalarField("refValue", dict, p.size());
refGrad() = scalarField("refGradient", dict, p.size());
valueFraction() = scalarField("valueFraction", dict, p.size());
} }
else else
{ {

View File

@ -44,7 +44,7 @@ IOobject turbulencePropertiesHeader
mesh, mesh,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
if (turbulencePropertiesHeader.typeHeaderOk<IOdictionary>(false)) if (turbulencePropertiesHeader.typeHeaderOk<IOdictionary>(false))

View File

@ -9,7 +9,7 @@ IOobject io
mesh, mesh,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
if (io.typeHeaderOk<IOdictionary>()) if (io.typeHeaderOk<IOdictionary>())
@ -32,4 +32,4 @@ if (io.typeHeaderOk<IOdictionary>())
); );
} }
// ************************************************************************* //

View File

@ -84,7 +84,7 @@ Foam::surfaceTensionModels::liquidProperties::sigma() const
mesh_, mesh_,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh_, mesh_,
dimSigma dimSigma

View File

@ -724,7 +724,7 @@ Foam::tmp<Foam::volScalarField> Foam::radiation::laserDTRM::Rp() const
mesh_, mesh_,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh_, mesh_,
dimensionedScalar(dimPower/dimVolume/pow4(dimTemperature), Zero) dimensionedScalar(dimPower/dimVolume/pow4(dimTemperature), Zero)

View File

@ -97,7 +97,7 @@ Foam::radiation::localDensityAbsorptionEmission::aCont(const label bandI) const
mesh_, mesh_,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh_, mesh_,
dimensionedScalar(inv(dimLength), Zero) dimensionedScalar(inv(dimLength), Zero)
@ -130,7 +130,7 @@ Foam::radiation::localDensityAbsorptionEmission::eCont(const label bandI) const
mesh_, mesh_,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh_, mesh_,
dimensionedScalar(inv(dimLength), Zero) dimensionedScalar(inv(dimLength), Zero)
@ -163,7 +163,7 @@ Foam::radiation::localDensityAbsorptionEmission::ECont(const label bandI) const
mesh_, mesh_,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh_, mesh_,
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero) dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)

View File

@ -46,7 +46,7 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // Do not register IOobject::NO_REGISTER
) )
); );

View File

@ -30,7 +30,7 @@
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimless, dimless,

View File

@ -48,7 +48,7 @@ Foam::phaseChangeTwoPhaseMixture::New
U.db(), U.db(),
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // Do not register IOobject::NO_REGISTER
) )
); );

View File

@ -69,7 +69,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
size size
); );
@ -101,7 +101,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );
@ -125,7 +125,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
size size
); );
@ -157,7 +157,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );

View File

@ -46,35 +46,39 @@ using namespace Foam;
template<class Type> template<class Type>
void doWrite(const IOobject& io, const label sz) void doWrite(const IOobject& io, const label sz)
{ {
const bool writeOnProc = (sz > 0);
IOField<Type> fld(io, sz); IOField<Type> fld(io, sz);
forAll(fld, i) forAll(fld, i)
{ {
fld[i] = i + 1000.25 + (0.25 * i); fld[i] = i + 1000.25 + (0.25 * i);
} }
Pout<< "writing:" << fld << endl; Pout<< "writing:" << fld << endl;
fld.write(sz > 0); fld.write(writeOnProc);
} }
template<> template<>
void doWrite<bool>(const IOobject& io, const label sz) void doWrite<bool>(const IOobject& io, const label sz)
{ {
const bool writeOnProc = (sz > 0);
IOField<bool> fld(io, sz); IOField<bool> fld(io, sz);
forAll(fld, i) forAll(fld, i)
{ {
fld[i] = i % 2; fld[i] = i % 2;
} }
Pout<< "writing:" << fld << endl; Pout<< "writing:" << fld << endl;
fld.write(sz > 0); fld.write(writeOnProc);
} }
template<class Type> template<class Type>
void doRead(const IOobject& io, const label sz) void doRead(const IOobject& io, const label sz)
{ {
bool valid = (sz > 0); const bool readOnProc = (sz > 0);
Pout<< " valid:" << valid << endl; Pout<< " readOnProc:" << readOnProc << endl;
IOField<Type> fld(io, valid); IOField<Type> fld(io, readOnProc);
Pout<< " wanted:" << sz << " actually read:" << fld.size() << endl; Pout<< " wanted:" << sz << " actually read:" << fld.size() << endl;
if (fld.size() != sz) if (fld.size() != sz)

View File

@ -92,8 +92,8 @@ int main(int argc, char *argv[])
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedVector(Zero) dimensionedVector(Zero)

View File

@ -143,7 +143,7 @@ int main(int argc, char *argv[])
{ {
#include "setRootCase.H" #include "setRootCase.H"
treeBoundBox bb(cube(0, 1)); treeBoundBox bb(zero_one{});
treeBoundBox sub(cube(0.1, 0.8)); treeBoundBox sub(cube(0.1, 0.8));
Info<< nl Info<< nl

View File

@ -103,7 +103,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );

View File

@ -67,7 +67,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );

View File

@ -116,7 +116,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );

View File

@ -63,7 +63,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2022 OpenCFD Ltd. Copyright (C) 2022-2023 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -51,7 +51,7 @@ void printInfo(const label comm)
<< " sub:" << UPstream::subProcs(comm) << nl; << " sub:" << UPstream::subProcs(comm) << nl;
if (UPstream::selfComm == comm) if (UPstream::commSelf() == comm)
{ {
Pout<< "self all:" << UPstream::allProcs(comm) Pout<< "self all:" << UPstream::allProcs(comm)
<< " sub:" << UPstream::subProcs(comm) << nl; << " sub:" << UPstream::subProcs(comm) << nl;
@ -86,32 +86,32 @@ int main(int argc, char *argv[])
<< "nProcs = " << UPstream::nProcs() << "nProcs = " << UPstream::nProcs()
<< " with " << UPstream::nComms() << " predefined comm(s)" << nl; << " with " << UPstream::nComms() << " predefined comm(s)" << nl;
Info<< "worldComm : "; Info<< "comm-world : ";
printInfo(UPstream::worldComm); printInfo(UPstream::commWorld());
Info<< "selfComm : "; Info<< "comm-self : ";
printInfo(UPstream::selfComm); printInfo(UPstream::commSelf());
Info<< nl; Info<< nl;
// Reductions (using MPI intrinsics) // Reductions (using MPI intrinsics)
{ {
label val = Pstream::myProcNo(UPstream::worldComm); label val = Pstream::myProcNo(UPstream::commWorld());
label worldVal = returnReduce label worldVal = returnReduce
( (
val, val,
sumOp<label>(), sumOp<label>(),
Pstream::msgType(), UPstream::msgType(),
UPstream::worldComm UPstream::commWorld()
); );
label selfVal = returnReduce label selfVal = returnReduce
( (
val, val,
sumOp<label>(), sumOp<label>(),
Pstream::msgType(), UPstream::msgType(),
UPstream::selfComm UPstream::commSelf()
); );
Pout<< "value " << val Pout<< "value " << val
@ -123,8 +123,8 @@ int main(int argc, char *argv[])
{ {
Pair<label> val Pair<label> val
( (
Pstream::myProcNo(UPstream::worldComm), Pstream::myProcNo(UPstream::commWorld()),
Pstream::myProcNo(UPstream::worldComm) Pstream::myProcNo(UPstream::commWorld())
); );
Pair<label> worldVal = val; Pair<label> worldVal = val;
@ -133,8 +133,8 @@ int main(int argc, char *argv[])
( (
worldVal, worldVal,
minFirstEqOp<label>(), minFirstEqOp<label>(),
Pstream::msgType(), UPstream::msgType(),
UPstream::worldComm UPstream::commWorld()
); );
Pair<label> selfVal = val; Pair<label> selfVal = val;
@ -143,8 +143,8 @@ int main(int argc, char *argv[])
( (
worldVal, worldVal,
minFirstEqOp<label>(), minFirstEqOp<label>(),
Pstream::msgType(), UPstream::msgType(),
UPstream::selfComm UPstream::commSelf()
); );
Pout<< "value " << val Pout<< "value " << val

View File

@ -150,11 +150,7 @@ int main(int argc, char *argv[])
Pout<< "localValue :" << localValue << endl; Pout<< "localValue :" << localValue << endl;
label comm = Pstream::allocateCommunicator label comm = UPstream::allocateCommunicator(UPstream::worldComm, top);
(
UPstream::worldComm,
top
);
Pout<< "allocated comm :" << comm << endl; Pout<< "allocated comm :" << comm << endl;
Pout<< "comm myproc :" << Pstream::myProcNo(comm) Pout<< "comm myproc :" << Pstream::myProcNo(comm)
@ -173,7 +169,7 @@ int main(int argc, char *argv[])
Pout<< "sum :" << sum << endl; Pout<< "sum :" << sum << endl;
} }
Pstream::freeCommunicator(comm); UPstream::freeCommunicator(comm);
Pout<< "End\n" << endl; Pout<< "End\n" << endl;

View File

@ -88,12 +88,12 @@ int main(int argc, char *argv[])
//- Process IDs within a given communicator //- Process IDs within a given communicator
Info<< "procIDs: " Info<< "procIDs: "
<< flatOutput(UPstream::procID(UPstream::worldComm)) << endl; << flatOutput(UPstream::procID(UPstream::commWorld())) << endl;
rankInfo(UPstream::worldComm); rankInfo(UPstream::commWorld());
Pout<< endl; Pout<< endl;
const int myProci = UPstream::myProcNo(UPstream::worldComm); const int myProci = UPstream::myProcNo(UPstream::commWorld());
int localRanki = myProci; int localRanki = myProci;
labelList subRanks; labelList subRanks;
@ -101,9 +101,9 @@ int main(int argc, char *argv[])
#if 1 #if 1
// With first ranks // With first ranks
subRanks = identity(UPstream::nProcs(UPstream::worldComm) / 2); subRanks = identity(UPstream::nProcs(UPstream::commWorld()) / 2);
newComm.reset(UPstream::worldComm, subRanks); newComm.reset(UPstream::commWorld(), subRanks);
localRanki = UPstream::myProcNo(newComm); localRanki = UPstream::myProcNo(newComm);
Pout.prefix() = Pout.prefix() =
@ -120,14 +120,14 @@ int main(int argc, char *argv[])
#if 1 #if 1
// With every other rank // With every other rank
subRanks = identity(UPstream::nProcs(UPstream::worldComm)); subRanks = identity(UPstream::nProcs(UPstream::commWorld()));
for (label& val : subRanks) for (label& val : subRanks)
{ {
if (val % 2) val = -1; if (val % 2) val = -1;
} }
newComm.reset(UPstream::worldComm, subRanks); newComm.reset(UPstream::commWorld(), subRanks);
localRanki = UPstream::myProcNo(newComm); localRanki = UPstream::myProcNo(newComm);
Pout.prefix() = Pout.prefix() =
@ -165,19 +165,19 @@ int main(int argc, char *argv[])
} }
if (Pstream::parRun() && args.found("host-comm")) if (Pstream::parRun() && args.found("host-comm"))
{ {
// Host communicator, based on the current worldComm // Host communicator, based on the current world communicator
// Use hostname // Use hostname
// Lowest rank per hostname is the IO rank // Lowest rank per hostname is the IO rank
label numprocs = UPstream::nProcs(UPstream::globalComm); label numprocs = UPstream::nProcs(UPstream::commGlobal());
stringList hosts(numprocs); stringList hosts(numprocs);
hosts[Pstream::myProcNo(UPstream::globalComm)] = hostName(); hosts[Pstream::myProcNo(UPstream::commGlobal())] = hostName();
labelList hostIDs_; labelList hostIDs_;
// Compact // Compact
if (Pstream::master(UPstream::globalComm)) if (Pstream::master(UPstream::commGlobal()))
{ {
DynamicList<word> hostNames(numprocs); DynamicList<word> hostNames(numprocs);
hostIDs_.resize_nocopy(numprocs); hostIDs_.resize_nocopy(numprocs);
@ -196,10 +196,10 @@ int main(int argc, char *argv[])
} }
} }
Pstream::broadcasts(UPstream::globalComm, hostIDs_); Pstream::broadcasts(UPstream::commGlobal(), hostIDs_);
const label myHostId = const label myHostId =
hostIDs_[Pstream::myProcNo(UPstream::globalComm)]; hostIDs_[Pstream::myProcNo(UPstream::commGlobal())];
DynamicList<label> subRanks; DynamicList<label> subRanks;
forAll(hostIDs_, proci) forAll(hostIDs_, proci)
@ -210,11 +210,11 @@ int main(int argc, char *argv[])
} }
} }
// Allocate new communicator with globalComm as its parent // Allocate new communicator with global communicator as its parent
const label hostComm = const label hostComm =
UPstream::allocateCommunicator UPstream::allocateCommunicator
( (
UPstream::globalComm, // parent UPstream::commGlobal(),
subRanks, subRanks,
true true
); );

View File

@ -0,0 +1,3 @@
Test-polyMeshGeom-speed1.C
EXE = $(FOAM_USER_APPBIN)/Test-polyMeshGeom-speed1

View File

@ -0,0 +1,5 @@
EXE_INC = \
-I$(LIB_SRC)/mesh/blockMesh/lnInclude
EXE_LIBS = \
-lblockMesh

View File

@ -0,0 +1,804 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Simple timing tests for some polyMesh primitives
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "clockTime.H"
#include "Time.H"
#include "PDRblock.H"
#include "polyMesh.H"
#include "ListOps.H"
using namespace Foam;
void printAlloc(const polyMesh& mesh)
{
Info<< "memory"
<< " hasCellPoints:" << mesh.hasCellPoints()
<< " hasPointCells:" << mesh.hasPointCells() << endl;
}
void printInfo(const polyMesh& mesh)
{
Info<< "polyMesh"
<< " nPoints:" << mesh.nPoints()
<< " nInternalFaces:" << mesh.nInternalFaces()
<< " nFaces:" << mesh.nFaces()
<< " nCells:" << mesh.nCells() << endl;
}
// How point cells are calculated in OpenFOAM-v2212 and earlier
autoPtr<labelListList> pointCells_2212(const polyMesh& mesh)
{
const cellList& cf = mesh.cells();
// Count number of cells per point
labelList npc(mesh.nPoints(), Zero);
forAll(cf, celli)
{
const labelList curPoints = cf[celli].labels(mesh.faces());
for (const label pointi : curPoints)
{
++npc[pointi];
}
}
// Size and fill cells per point
auto pcPtr_ = autoPtr<labelListList>::New(npc.size());
labelListList& pointCellAddr = *pcPtr_;
forAll(pointCellAddr, pointi)
{
pointCellAddr[pointi].setSize(npc[pointi]);
npc[pointi] = 0;
}
forAll(cf, celli)
{
const labelList curPoints = cf[celli].labels(mesh.faces());
for (const label pointi : curPoints)
{
pointCellAddr[pointi][npc[pointi]++] = celli;
}
}
return pcPtr_;
}
// Line cell::labels but with persistent storage
void cell_labels
(
const cell& cFaces,
const faceUList& meshFaces,
DynamicList<label>& pointLabels
)
{
// const labelList& cFaces = *this;
label nVerts = 0;
for (const label facei : cFaces)
{
nVerts += meshFaces[facei].size();
}
// pointLabels.clear();
pointLabels.expandStorage();
// The first face has no duplicates, can copy in values
const labelList& firstFace = meshFaces[cFaces[0]];
std::copy(firstFace.cbegin(), firstFace.cend(), pointLabels.begin());
// Now already contains some vertices
nVerts = firstFace.size();
// For the rest of the faces. For each vertex, check if the point is
// already inserted (up to nVerts, which now carries the number of real
// points. If not, add it at the end of the list.
for (label facei = 1; facei < cFaces.size(); ++facei)
{
for (const label curPoint : meshFaces[cFaces[facei]])
{
bool pointFound = false;
for (label checki = 0; checki < nVerts; ++checki)
{
if (curPoint == pointLabels[checki])
{
pointFound = true;
break;
}
}
if (!pointFound)
{
pointLabels[nVerts] = curPoint;
++nVerts;
}
}
}
pointLabels.resize(nVerts);
}
// Like OpenFOAM-v2212, but with cell::labels unrolled to avoid allocations
autoPtr<labelListList> pointCells_2212mod(const polyMesh& mesh)
{
const cellList& cf = mesh.cells();
// Vertex labels for the current cell
DynamicList<label> vertices(256);
// Count number of cells per point
labelList npc(mesh.nPoints(), Zero);
for (const cell& c : cf)
{
cell_labels(c, mesh.faces(), vertices);
for (const label pointi : vertices)
{
++npc[pointi];
}
}
// Size and fill cells per point
auto pcPtr_ = autoPtr<labelListList>::New(npc.size());
labelListList& pointCellAddr = *pcPtr_;
forAll(pointCellAddr, pointi)
{
pointCellAddr[pointi].resize(npc[pointi]);
npc[pointi] = 0;
}
forAll(cf, celli)
{
cell_labels(cf[celli], mesh.faces(), vertices);
for (const label pointi : vertices)
{
pointCellAddr[pointi][npc[pointi]++] = celli;
}
}
return pcPtr_;
}
// How cells points are calculated in OpenFOAM-v2212 and earlier
autoPtr<labelListList> cellPoints_2212(const polyMesh& mesh)
{
autoPtr<labelListList> pointCells = pointCells_2212(mesh);
auto cpPtr_ = autoPtr<labelListList>::New(mesh.nCells());
invertManyToMany(mesh.nCells(), pointCells(), *cpPtr_);
return cpPtr_;
}
// Calculate with bitSet tracking and avoid cells::labels
autoPtr<labelListList> pointCells_bitSet(const polyMesh& mesh)
{
// Calculate point-cell topology
const cellList& cellLst = mesh.cells();
const faceList& faceLst = mesh.faces();
// For tracking (only use each point id once)
bitSet usedPoints(mesh.nPoints());
// Vertex labels for the current cell
DynamicList<label> vertices(256);
const label loopLen = mesh.nCells();
// Step 1: count number of cells per point
labelList pointCount(mesh.nPoints(), Zero);
for (label celli = 0; celli < loopLen; ++celli)
{
// Clear any previous contents
usedPoints.unset(vertices);
vertices.clear();
for (const label facei : cellLst[celli])
{
for (const label pointi : faceLst[facei])
{
// Only once for each point id
if (usedPoints.set(pointi))
{
vertices.push_back(pointi);
++pointCount[pointi];
}
}
}
}
// Step 2: set sizing, reset counters
auto pcPtr_ = autoPtr<labelListList>::New(mesh.nPoints());
auto& pointCellAddr = *pcPtr_;
forAll(pointCellAddr, pointi)
{
pointCellAddr[pointi].resize_nocopy(pointCount[pointi]);
pointCount[pointi] = 0;
}
// Step 3: fill in values. Logic as per step 1
for (label celli = 0; celli < loopLen; ++celli)
{
// Clear any previous contents
usedPoints.unset(vertices);
vertices.clear();
for (const label facei : cellLst[celli])
{
for (const label pointi : faceLst[facei])
{
// Only once for each point id
if (usedPoints.set(pointi))
{
vertices.push_back(pointi);
pointCellAddr[pointi][pointCount[pointi]++] = celli;
}
}
}
}
return pcPtr_;
}
// Calculate with bitSet tracking and avoid cells::labels
autoPtr<labelListList> cellPoints_bitSet(const polyMesh& mesh)
{
// Calculate cell-point topology
auto cpPtr_ = autoPtr<labelListList>::New(mesh.nCells());
auto& cellPointAddr = *cpPtr_;
const cellList& cellLst = mesh.cells();
const faceList& faceLst = mesh.faces();
// For tracking (only use each point id once)
bitSet usedPoints(mesh.nPoints());
// Vertex labels for the current cell
DynamicList<label> vertices(256);
const label loopLen = mesh.nCells();
for (label celli = 0; celli < loopLen; ++celli)
{
// Clear any previous contents
usedPoints.unset(vertices);
vertices.clear();
for (const label facei : cellLst[celli])
{
for (const label pointi : faceLst[facei])
{
// Only once for each point id
if (usedPoints.set(pointi))
{
vertices.push_back(pointi);
}
}
}
cellPointAddr[celli] = vertices; // unsorted
}
return cpPtr_;
}
// Calculate with linear lookup and avoid cells::labels
autoPtr<labelListList> pointCells_linear(const polyMesh& mesh)
{
// Calculate point-cell topology
const cellList& cellLst = mesh.cells();
const faceList& faceLst = mesh.faces();
// Vertex labels for the current cell
DynamicList<label> vertices(256);
const label loopLen = mesh.nCells();
// Step 1: count number of cells per point
labelList pointCount(mesh.nPoints(), Zero);
for (label celli = 0; celli < loopLen; ++celli)
{
// Clear any previous contents
vertices.clear();
for (const label facei : cellLst[celli])
{
for (const label pointi : faceLst[facei])
{
// Only once for each point id
if (!vertices.contains(pointi))
{
vertices.push_back(pointi);
++pointCount[pointi];
}
}
}
}
// Step 2: set sizing, reset counters
auto pcPtr_ = autoPtr<labelListList>::New(mesh.nPoints());
auto& pointCellAddr = *pcPtr_;
forAll(pointCellAddr, pointi)
{
pointCellAddr[pointi].resize_nocopy(pointCount[pointi]);
pointCount[pointi] = 0;
}
// Step 3: fill in values. Logic as per step 1
for (label celli = 0; celli < loopLen; ++celli)
{
// Clear any previous contents
vertices.clear();
for (const label facei : cellLst[celli])
{
for (const label pointi : faceLst[facei])
{
// Only once for each point id
if (!vertices.contains(pointi))
{
vertices.push_back(pointi);
pointCellAddr[pointi][pointCount[pointi]++] = celli;
}
}
}
}
return pcPtr_;
}
// Calculate with linear lookup and avoid cells::labels
autoPtr<labelListList> cellPoints_linear(const polyMesh& mesh)
{
// Calculate cell-point topology
auto cpPtr_ = autoPtr<labelListList>::New(mesh.nCells());
auto& cellPointAddr = *cpPtr_;
const cellList& cellLst = mesh.cells();
const faceList& faceLst = mesh.faces();
// Vertex labels for the current cell
DynamicList<label> vertices(256);
const label loopLen = mesh.nCells();
for (label celli = 0; celli < loopLen; ++celli)
{
// Clear any previous contents
vertices.clear();
for (const label facei : cellLst[celli])
{
for (const label pointi : faceLst[facei])
{
// Only once for each point id
if (!vertices.contains(pointi))
{
vertices.push_back(pointi);
}
}
}
cellPointAddr[celli] = vertices; // unsorted
}
return cpPtr_;
}
// Calculate point-cell from point-face information
autoPtr<labelListList> pointCells_faces(const polyMesh& mesh)
{
const labelList& own = mesh.faceOwner();
const labelList& nei = mesh.faceNeighbour();
const labelListList& pFaces = mesh.pointFaces();
const label loopLen = mesh.nPoints();
auto pcPtr_ = autoPtr<labelListList>::New(mesh.nPoints());
auto& pointCellAddr = *pcPtr_;
DynamicList<label> storage(256);
for (label pointi = 0; pointi < loopLen; ++pointi)
{
// Clear any previous contents
storage.clear();
for (const label facei : pFaces[pointi])
{
// Owner cell
storage.push_back(own[facei]);
// Neighbour cell
if (facei < mesh.nInternalFaces())
{
storage.push_back(nei[facei]);
}
}
// Sort + unique to eliminate duplicates
std::sort(storage.begin(), storage.end());
auto last = std::unique(storage.begin(), storage.end());
storage.resize(label(last - storage.begin()));
pointCellAddr[pointi] = storage;
}
return pcPtr_;
}
// Calculate point-cell from point-face information
autoPtr<labelListList> pointCells_bitSet_faces(const polyMesh& mesh)
{
const labelList& own = mesh.faceOwner();
const labelList& nei = mesh.faceNeighbour();
const labelListList& pFaces = mesh.pointFaces();
const label loopLen = mesh.nPoints();
auto pcPtr_ = autoPtr<labelListList>::New(mesh.nPoints());
auto& pointCellAddr = *pcPtr_;
// For tracking (only use each cell id once)
bitSet usedCells(mesh.nCells());
DynamicList<label> storage(256);
for (label pointi = 0; pointi < loopLen; ++pointi)
{
// Clear any previous contents
usedCells.unset(storage);
storage.clear();
for (const label facei : pFaces[pointi])
{
// Owner cell - only once
if (usedCells.set(own[facei]))
{
storage.push_back(own[facei]);
}
// Neighbour cell
if (facei < mesh.nInternalFaces() && usedCells.set(nei[facei]))
{
storage.push_back(nei[facei]);
}
}
pointCellAddr[pointi] = storage;
}
return pcPtr_;
}
// Calculate point-cell from cell-point information
autoPtr<labelListList> pointCells_bitSet_alon(const polyMesh& mesh)
{
autoPtr<labelListList> cellPoints = cellPoints_bitSet(mesh);
auto pcPtr_ = autoPtr<labelListList>::New(mesh.nPoints());
invertManyToMany(mesh.nPoints(), cellPoints(), *pcPtr_);
return pcPtr_;
}
// Eliminate duplicates with sort+unique
autoPtr<labelListList> cellPoints_sorted(const polyMesh& mesh)
{
// Calculate cell-point topology
auto cpPtr_ = autoPtr<labelListList>::New(mesh.nCells());
auto& cellPointAddr = *cpPtr_;
const cellList& cellLst = mesh.cells();
const faceList& faceLst = mesh.faces();
// Vertex labels for the current cell
DynamicList<label> vertices(256);
const label loopLen = mesh.nCells();
for (label celli = 0; celli < loopLen; ++celli)
{
// Clear any previous contents
vertices.clear();
for (const label facei : cellLst[celli])
{
for (const label pointi : faceLst[facei])
{
vertices.push_back(pointi);
}
}
// Sort + unique to eliminate duplicates
std::sort(vertices.begin(), vertices.end());
auto last = std::unique(vertices.begin(), vertices.end());
vertices.resize(label(last - vertices.begin()));
cellPointAddr[celli] = vertices;
}
return cpPtr_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
argList::noBanner();
argList::noParallel();
argList::noFunctionObjects();
argList::addOption("nCells", "number", "The number of cells");
#include "setRootCase.H"
const scalar cellCount(args.getOrDefault<scalar>("nCells", 1000));
const label nDivs(::round(::cbrt(cellCount)));
PDRblock blkMesh(boundBox(zero_one{}), labelVector::uniform(nDivs));
autoPtr<Time> dummyTimePtr(Time::New());
Info<< "Requested " << cellCount
<< " cells, blockMesh with " << blkMesh.nCells() << " cells" << nl;
autoPtr<polyMesh> meshPtr = blkMesh.innerMesh
(
IOobject
(
"Testing",
dummyTimePtr->system(),
*dummyTimePtr,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
)
);
auto& mesh = meshPtr();
printInfo(mesh);
printAlloc(mesh);
clockTime timing;
// pointCells
{
mesh.clearOut();
timing.resetTime();
(void) mesh.pointCells();
Info<< "pointCells (builtin): " << timing.elapsedTime() << " s" << nl;
}
// cellPoints
{
mesh.clearOut();
timing.resetTime();
(void) mesh.cellPoints();
Info<< "cellPoints (builtin): " << timing.elapsedTime() << " s" << nl;
}
Info<< nl;
// pointCells
{
mesh.clearOut();
timing.resetTime();
(void) pointCells_2212(mesh);
Info<< "pointCells (2212): " << timing.elapsedTime() << " s" << nl;
}
{
mesh.clearOut();
timing.resetTime();
(void) pointCells_2212mod(mesh);
Info<< "pointCells (2212mod): " << timing.elapsedTime() << " s" << nl;
}
{
mesh.clearOut();
timing.resetTime();
(void) pointCells_bitSet(mesh);
Info<< "pointCells (bitSet): " << timing.elapsedTime() << " s" << nl;
}
{
mesh.clearOut();
timing.resetTime();
(void) pointCells_linear(mesh);
Info<< "pointCells (linear): " << timing.elapsedTime() << " s" << nl;
}
{
mesh.clearOut();
timing.resetTime();
(void) pointCells_faces(mesh);
Info<< "pointCells (faces): " << timing.elapsedTime() << " s" << nl;
}
{
mesh.clearOut();
timing.resetTime();
(void) pointCells_bitSet_faces(mesh);
Info<< "pointCells (bitSet faces): " << timing.elapsedTime() << " s" << nl;
}
{
mesh.clearOut();
timing.resetTime();
(void) pointCells_bitSet_alon(mesh);
Info<< "pointCells (bitSet alon): " << timing.elapsedTime() << " s" << nl;
}
// cellPoints
{
mesh.clearOut();
timing.resetTime();
(void) cellPoints_2212(mesh);
Info<< "cellPoints (2212): " << timing.elapsedTime() << " s" << nl;
}
{
mesh.clearOut();
timing.resetTime();
(void) cellPoints_bitSet(mesh);
Info<< "cellPoints (bitSet): " << timing.elapsedTime() << " s" << nl;
}
{
mesh.clearOut();
timing.resetTime();
(void) cellPoints_linear(mesh);
Info<< "cellPoints (linear): " << timing.elapsedTime() << " s" << nl;
}
{
mesh.clearOut();
timing.resetTime();
(void) cellPoints_sorted(mesh);
Info<< "cellPoints (sorted): " << timing.elapsedTime() << " s" << nl;
}
// With precalculated values
{
mesh.clearOut();
const auto& cp = mesh.cellPoints();
timing.resetTime();
auto pcPtr_ = autoPtr<labelListList>::New(mesh.nPoints());
invertManyToMany(mesh.nPoints(), cp, *pcPtr_);
Info<< "pointCells (from cached cellPoints): " << timing.elapsedTime() << " s" << nl;
}
// With precalculated values
{
mesh.clearOut();
(void)mesh.pointFaces();
timing.resetTime();
(void) pointCells_bitSet_faces(mesh);
Info<< "pointCells (bitSet from cached pointFaces): " << timing.elapsedTime() << " s" << nl;
}
// With precalculated values
{
mesh.clearOut();
const auto& pc = mesh.pointCells();
timing.resetTime();
auto cpPtr_ = autoPtr<labelListList>::New(mesh.nCells());
invertManyToMany(mesh.nCells(), pc, *cpPtr_);
Info<< "cellPoints (from cached pointCells): " << timing.elapsedTime() << " s" << nl;
}
// Re-measure timings
Info<< nl;
{
mesh.clearOut();
timing.resetTime();
(void) mesh.pointCells();
Info<< "pointCells (builtin): " << timing.elapsedTime() << " s" << nl;
}
{
mesh.clearOut();
timing.resetTime();
(void) mesh.cellPoints();
Info<< "cellPoints (builtin): " << timing.elapsedTime() << " s" << nl;
}
Info<< "\nEnd\n" << nl;
return 0;
}
// ************************************************************************* //

View File

@ -204,7 +204,7 @@ int main(int argc, char *argv[])
*dummyTimePtr, *dummyTimePtr,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // do not register IOobject::NO_REGISTER
); );
Info<< "Testing searchable sphere" << endl; Info<< "Testing searchable sphere" << endl;

View File

@ -510,7 +510,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
std::move(surf) std::move(surf)
); );

View File

@ -88,8 +88,7 @@ int main(int argc, char *argv[])
// Info<<"tree-bb faces: " << treeBoundBox::faces << nl // Info<<"tree-bb faces: " << treeBoundBox::faces << nl
// <<"tree-bb edges: " << treeBoundBox::edges << endl; // <<"tree-bb edges: " << treeBoundBox::edges << endl;
treeBoundBox bb; treeBoundBox bb(zero_one{});
bb = cube(0, 1);
triPoints tri; triPoints tri;
tri.a() = point(-0.1, 0.5, 0.5); tri.a() = point(-0.1, 0.5, 0.5);

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2021-2022 OpenCFD Ltd. Copyright (C) 2021-2023 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM, distributed under GPL-3.0-or-later. This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -76,9 +76,9 @@ Description
writer.beginCellData(4); writer.beginCellData(4);
writer.writeProcIDs(); writer.writeProcIDs();
{ {
// Use primitive patch order
Field<scalar> fld Field<scalar> fld
( (
// Use primitive patch order
faMeshTools::flattenEdgeField(aMesh.magLe(), true) faMeshTools::flattenEdgeField(aMesh.magLe(), true)
); );
writer.write("magLe", fld); writer.write("magLe", fld);
@ -93,11 +93,17 @@ Description
} }
{ {
const Field<vector> edgeCentres
(
// Use primitive patch order
faMeshTools::flattenEdgeField(aMesh.edgeCentres(), true)
);
// finiteArea - edgeCentres // finiteArea - edgeCentres
// (no other convenient way to display vectors on the edges) // (no other convenient way to display vectors on the edges)
vtk::lineWriter writer vtk::lineWriter writer
( (
aMesh.edgeCentres(), edgeCentres,
edgeList::null(), edgeList::null(),
// vtk::formatType::INLINE_ASCII, // vtk::formatType::INLINE_ASCII,
fileName fileName
@ -109,19 +115,20 @@ Description
writer.writeGeometry(); writer.writeGeometry();
// PointData // PointData
writer.beginPointData(4); writer.beginPointData(3);
writer.writeProcIDs(); // Unfortunately cannot threshold on points
{ {
// Use primitive patch order
Field<vector> fld Field<vector> fld
( (
// Use primitive patch order
faMeshTools::flattenEdgeField(aMesh.Le(), true) faMeshTools::flattenEdgeField(aMesh.Le(), true)
); );
writer.write("Le", fld); writer.write("Le", fld);
} }
{ {
// Use primitive patch order
Field<vector> fld Field<vector> fld
( (
// Use primitive patch order
faMeshTools::flattenEdgeField(aMesh.edgeAreaNormals(), true) faMeshTools::flattenEdgeField(aMesh.edgeAreaNormals(), true)
); );
writer.write("normal", fld); writer.write("normal", fld);

View File

@ -74,7 +74,7 @@ autoPtr<IOdictionary> meshDictPtr;
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false, // no registerObject IOobject::NO_REGISTER,
true // is globalObject true // is globalObject
); );

View File

@ -16,7 +16,7 @@
runTime, runTime,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
if (io.typeHeaderOk<IOdictionary>(true)) if (io.typeHeaderOk<IOdictionary>(true))

View File

@ -16,7 +16,7 @@
runTime, runTime,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
if (io.typeHeaderOk<IOdictionary>(true)) if (io.typeHeaderOk<IOdictionary>(true))

View File

@ -16,7 +16,7 @@
runTime, runTime,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
if (io.typeHeaderOk<IOdictionary>(true)) if (io.typeHeaderOk<IOdictionary>(true))

View File

@ -16,7 +16,7 @@
runTime, runTime,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
if (io.typeHeaderOk<IOdictionary>(true)) if (io.typeHeaderOk<IOdictionary>(true))

View File

@ -191,7 +191,7 @@ int main(int argc, char *argv[])
runTime, // registry runTime, // registry
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // Do not register IOobject::NO_REGISTER
) )
); );

View File

@ -73,7 +73,7 @@ autoPtr<IOdictionary> meshDictPtr;
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
if (!meshDictIO.typeHeaderOk<IOdictionary>(true)) if (!meshDictIO.typeHeaderOk<IOdictionary>(true))

View File

@ -679,7 +679,7 @@ int main(int argc, char *argv[])
runTimeExtruded, //mesh, runTimeExtruded, //mesh,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
) )
); );
@ -774,7 +774,7 @@ int main(int argc, char *argv[])
runTimeExtruded, runTimeExtruded,
IOobject::READ_IF_PRESENT, // Read fv* if present IOobject::READ_IF_PRESENT, // Read fv* if present
IOobject::AUTO_WRITE, IOobject::AUTO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh mesh
); );

View File

@ -1272,7 +1272,7 @@ void extrudeGeometricProperties
regionMesh, regionMesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
regionMesh.nFaces() regionMesh.nFaces()
); );
@ -1356,7 +1356,7 @@ void extrudeGeometricProperties
regionMesh, regionMesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
regionMesh.nCells() regionMesh.nCells()
); );
@ -2389,10 +2389,10 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::AUTO_WRITE,
false IOobject::NO_REGISTER
), ),
Zero, Foam::zero{},
false false // syncPar
); );
// Add the new patches // Add the new patches
@ -2559,7 +2559,7 @@ int main(int argc, char *argv[])
regionMesh, regionMesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
extruder.cellToFaceMap() extruder.cellToFaceMap()
); );
@ -2575,7 +2575,7 @@ int main(int argc, char *argv[])
regionMesh, regionMesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
extruder.faceToFaceMap() extruder.faceToFaceMap()
); );
@ -2592,7 +2592,7 @@ int main(int argc, char *argv[])
regionMesh, regionMesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
extruder.faceToEdgeMap() extruder.faceToEdgeMap()
); );
@ -2609,7 +2609,7 @@ int main(int argc, char *argv[])
regionMesh, regionMesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
extruder.pointToPointMap() extruder.pointToPointMap()
); );

View File

@ -153,7 +153,7 @@ int main(int argc, char *argv[])
runTimeExtruded, runTimeExtruded,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );
@ -204,7 +204,7 @@ int main(int argc, char *argv[])
runTimeExtruded, runTimeExtruded,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
std::move(poly2DMesh.points()), std::move(poly2DMesh.points()),
std::move(poly2DMesh.faces()), std::move(poly2DMesh.faces()),

View File

@ -726,7 +726,7 @@ Foam::backgroundMeshDecomposition::backgroundMeshDecomposition
runTime_, runTime_,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::AUTO_WRITE, IOobject::AUTO_WRITE,
false IOobject::NO_REGISTER
) )
), ),
meshCutter_ meshCutter_

View File

@ -387,7 +387,7 @@ Foam::cellShapeControlMesh::cellShapeControlMesh(const Time& runTime)
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
if (io.typeHeaderOk<pointScalarField>(true)) if (io.typeHeaderOk<pointScalarField>(true))
@ -404,7 +404,7 @@ Foam::cellShapeControlMesh::cellShapeControlMesh(const Time& runTime)
mesh.time(), mesh.time(),
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );

View File

@ -176,55 +176,43 @@ void Foam::fileControl::initialVertices
{ {
Info<< " Reading points from file : " << pointsFile_ << endl; Info<< " Reading points from file : " << pointsFile_ << endl;
pointIOField pointsTmp pts = pointIOField::readContents
( (
IOobject IOobject
( (
pointsFile_, pointsFile_,
runTime_.constant(), runTime_.constant(),
runTime_, runTime_,
IOobject::MUST_READ, IOobject::MUST_READ
IOobject::NO_WRITE,
false
) )
); );
pts.transfer(pointsTmp);
Info<< " Reading sizes from file : " << sizesFile_ << endl; Info<< " Reading sizes from file : " << sizesFile_ << endl;
scalarIOField sizesTmp sizes = scalarIOField::readContents
( (
IOobject IOobject
( (
sizesFile_, sizesFile_,
runTime_.constant(), runTime_.constant(),
runTime_, runTime_,
IOobject::MUST_READ, IOobject::MUST_READ
IOobject::NO_WRITE,
false
) )
); );
sizes.transfer(sizesTmp);
Info<< " Reading alignments from file : " << alignmentsFile_ << endl; Info<< " Reading alignments from file : " << alignmentsFile_ << endl;
triadIOField alignmentsTmp alignments = triadIOField::readContents
( (
IOobject IOobject
( (
alignmentsFile_, alignmentsFile_,
runTime_.constant(), runTime_.constant(),
runTime_, runTime_,
IOobject::MUST_READ, IOobject::MUST_READ
IOobject::NO_WRITE,
false
) )
); );
alignments.transfer(alignmentsTmp);
if ((pts.size() != sizes.size()) || (pts.size() != alignments.size())) if ((pts.size() != sizes.size()) || (pts.size() != alignments.size()))
{ {
FatalErrorInFunction FatalErrorInFunction

View File

@ -299,8 +299,8 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
// "tetDualMesh"/polyMesh::meshSubDir, // "tetDualMesh"/polyMesh::meshSubDir,
// runTime_, // runTime_,
// IOobject::NO_READ, // IOobject::NO_READ,
// IOobject::AUTO_WRITE, // IOobject::NO_WRITE,
// false // IOobject::NO_REGISTER
// ), // ),
// labelUIndList // labelUIndList
// ( // (
@ -346,8 +346,8 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
// "tetDualMesh"/polyMesh::meshSubDir, // "tetDualMesh"/polyMesh::meshSubDir,
// runTime_, // runTime_,
// IOobject::NO_READ, // IOobject::NO_READ,
// IOobject::AUTO_WRITE, // IOobject::NO_WRITE,
// false // IOobject::NO_REGISTER
// ), // ),
// points // points
// ); // );
@ -605,7 +605,7 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
runTime_, runTime_,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
patchNames, patchNames,
patchDicts patchDicts

View File

@ -603,7 +603,7 @@ int main(int argc, char *argv[])
fvm.time(), fvm.time(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
fvm, fvm,
dimensionedScalar(dimLength, Zero) dimensionedScalar(dimLength, Zero)
@ -668,7 +668,7 @@ int main(int argc, char *argv[])
fvm.time(), fvm.time(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
pointMesh::New(fvm), pointMesh::New(fvm),
dimensionedScalar(dimLength, Zero) dimensionedScalar(dimLength, Zero)

View File

@ -619,8 +619,8 @@ int main(int argc, char *argv[])
"triSurface", "triSurface",
runTime, // registry runTime, // registry
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
s s
); );

View File

@ -327,8 +327,8 @@ int main(int argc, char *argv[])
"triSurface", "triSurface",
runTime, // registry runTime, // registry
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
s s
); );

View File

@ -158,7 +158,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
std::move(poly2DMesh.points()), std::move(poly2DMesh.points()),
std::move(poly2DMesh.faces()), std::move(poly2DMesh.faces()),

View File

@ -134,8 +134,8 @@ void writeSurfaceField
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(dimless, Zero), dimensionedScalar(dimless, Zero),
@ -193,8 +193,8 @@ void Foam::writeFields
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(dimless, Zero), dimensionedScalar(dimless, Zero),
@ -227,8 +227,8 @@ void Foam::writeFields
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(dimless, Zero), dimensionedScalar(dimless, Zero),
@ -279,8 +279,8 @@ void Foam::writeFields
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(dimless, Zero), dimensionedScalar(dimless, Zero),
@ -316,8 +316,8 @@ void Foam::writeFields
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(dimless, Zero), dimensionedScalar(dimless, Zero),
@ -351,8 +351,8 @@ void Foam::writeFields
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(dimless, Zero), dimensionedScalar(dimless, Zero),
@ -386,8 +386,8 @@ void Foam::writeFields
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(dimless, Zero), dimensionedScalar(dimless, Zero),
@ -416,8 +416,8 @@ void Foam::writeFields
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(dimless, Zero), dimensionedScalar(dimless, Zero),
@ -445,8 +445,8 @@ void Foam::writeFields
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(dimVolume, Zero), dimensionedScalar(dimVolume, Zero),
@ -476,8 +476,8 @@ void Foam::writeFields
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(dimless, Zero), dimensionedScalar(dimless, Zero),
@ -511,8 +511,8 @@ void Foam::writeFields
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar("minTetVolume", dimless, GREAT), dimensionedScalar("minTetVolume", dimless, GREAT),
@ -577,8 +577,8 @@ void Foam::writeFields
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar("minPyrVolume", dimless, GREAT), dimensionedScalar("minPyrVolume", dimless, GREAT),
@ -650,8 +650,8 @@ void Foam::writeFields
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(dimless, Zero), dimensionedScalar(dimless, Zero),
@ -701,8 +701,8 @@ void Foam::writeFields
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(scalar(-1)), dimensionedScalar(scalar(-1)),
@ -740,8 +740,8 @@ void Foam::writeFields
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(scalar(-1)), dimensionedScalar(scalar(-1)),

View File

@ -65,7 +65,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );

View File

@ -90,7 +90,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );

View File

@ -73,7 +73,7 @@ tmp<volScalarField> createScalarField
( (
const fvMesh& mesh, const fvMesh& mesh,
const word& name, const word& name,
const labelList& elems const labelUList& elems
) )
{ {
tmp<volScalarField> tfld tmp<volScalarField> tfld
@ -87,7 +87,7 @@ tmp<volScalarField> createScalarField
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::AUTO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(dimless, Zero), dimensionedScalar(dimless, Zero),
@ -1343,7 +1343,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );
refData.updateMesh(map()); refData.updateMesh(map());
@ -1387,7 +1387,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
map().cellMap() map().cellMap()
).write(); ).write();
@ -1402,7 +1402,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
map().faceMap() map().faceMap()
).write(); ).write();
@ -1417,7 +1417,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
map().pointMap() map().pointMap()
).write(); ).write();

View File

@ -150,7 +150,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );

View File

@ -913,7 +913,7 @@ void createAndWriteRegion
newMesh(), newMesh(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
map().pointMap() map().pointMap()
); );
@ -932,7 +932,7 @@ void createAndWriteRegion
newMesh(), newMesh(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
newMesh().nFaces() newMesh().nFaces()
); );
@ -970,7 +970,7 @@ void createAndWriteRegion
newMesh(), newMesh(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
map().cellMap() map().cellMap()
); );
@ -989,7 +989,7 @@ void createAndWriteRegion
newMesh(), newMesh(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
labelList(nNewPatches, -1) labelList(nNewPatches, -1)
); );
@ -1409,7 +1409,7 @@ void writeCellToRegion(const fvMesh& mesh, const labelList& cellRegion)
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
cellRegion cellRegion
); );
@ -1429,7 +1429,7 @@ void writeCellToRegion(const fvMesh& mesh, const labelList& cellRegion)
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(dimless, Zero), dimensionedScalar(dimless, Zero),
@ -1716,7 +1716,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh mesh
); );

View File

@ -414,7 +414,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );

View File

@ -106,7 +106,7 @@ bool writeZones
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
bool writeOk = false; bool writeOk = false;
@ -203,7 +203,7 @@ bool writeOptionalMeshObject
const word& name, const word& name,
const fileName& meshDir, const fileName& meshDir,
Time& runTime, Time& runTime,
const bool valid const bool writeOnProc
) )
{ {
IOobject io IOobject io
@ -214,12 +214,11 @@ bool writeOptionalMeshObject
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
bool writeOk = false; bool writeOk = false;
const bool haveFile = io.typeHeaderOk<IOField<label>>(false);
bool haveFile = io.typeHeaderOk<IOField<label>>(false);
// Make sure all know if there is a valid class name // Make sure all know if there is a valid class name
wordList classNames(1, io.headerClassName()); wordList classNames(1, io.headerClassName());
@ -230,10 +229,10 @@ bool writeOptionalMeshObject
{ {
Info<< " Reading " << classNames[0] Info<< " Reading " << classNames[0]
<< " : " << name << endl; << " : " << name << endl;
T meshObject(io, valid && haveFile); T meshObject(io, writeOnProc && haveFile);
Info<< " Writing " << name << endl; Info<< " Writing " << name << endl;
writeOk = meshObject.regIOobject::write(valid && haveFile); writeOk = meshObject.regIOobject::write(writeOnProc && haveFile);
} }
return writeOk; return writeOk;

View File

@ -31,8 +31,8 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef writeMeshObject_H #ifndef Foam_writeMeshObject_H
#define writeMeshObject_H #define Foam_writeMeshObject_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -59,7 +59,7 @@ inline bool writeMeshObject
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
bool writeOk = false; bool writeOk = false;

View File

@ -94,7 +94,7 @@ void Foam::helpTypes::helpBoundary::fixedValueFieldConditions
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensioned<Type>(dimless, Zero) dimensioned<Type>(dimless, Zero)

View File

@ -189,7 +189,7 @@ autoPtr<labelIOList> procAddressing
procMesh, procMesh,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // do not register IOobject::NO_REGISTER
) )
); );
} }
@ -505,7 +505,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
decompDictFile, decompDictFile,
args.getOrDefault<label>("domains", 0), args.getOrDefault<label>("domains", 0),
@ -543,7 +543,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // do not register IOobject::NO_REGISTER
), ),
decompDictFile decompDictFile
) )
@ -653,7 +653,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
decompDictFile decompDictFile
); );
@ -683,7 +683,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
procIds procIds
); );
@ -816,7 +816,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // not registered IOobject::NO_REGISTER
); );
if (io.typeHeaderOk<faBoundaryMesh>(true)) if (io.typeHeaderOk<faBoundaryMesh>(true))

View File

@ -91,7 +91,7 @@ Foam::domainDecomposition::domainDecomposition
*this, *this,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
) )
: nullptr : nullptr
@ -221,7 +221,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
*this, *this,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );
@ -767,7 +767,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
procMesh, procMesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
std::move(procPoints) std::move(procPoints)
); );
@ -831,7 +831,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
procMesh, procMesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
baseMeshData, baseMeshData,
procCellAddressing_[proci], procCellAddressing_[proci],
@ -907,7 +907,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
procMesh.thisDb(), procMesh.thisDb(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // not registered IOobject::NO_REGISTER
); );
// pointProcAddressing // pointProcAddressing

View File

@ -153,7 +153,7 @@ void Foam::domainDecompositionDryRun::execute
// mesh_, // mesh_,
// IOobject::NO_READ, // IOobject::NO_READ,
// IOobject::NO_WRITE, // IOobject::NO_WRITE,
// false // IOobject::NO_REGISTER
// ), // ),
// std::move(cellToProc) // std::move(cellToProc)
// ); // );

View File

@ -48,7 +48,7 @@ void Foam::domainDecompositionDryRun::writeVolField
this->mesh(), this->mesh(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
this->mesh(), this->mesh(),
dimensionedScalar("cellDist", dimless, -1), dimensionedScalar("cellDist", dimless, -1),

View File

@ -49,7 +49,7 @@ void Foam::domainDecomposition::writeVolField
this->mesh(), this->mesh(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
this->mesh(), this->mesh(),
dimensionedScalar("cellDist", dimless, -1), dimensionedScalar("cellDist", dimless, -1),

View File

@ -780,7 +780,7 @@ int main(int argc, char *argv[])
procMesh, procMesh,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
) )
); );
@ -822,7 +822,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
cellMaps, cellMaps,
pointMaps, pointMaps,
@ -853,7 +853,7 @@ int main(int argc, char *argv[])
procMesh, procMesh,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
) )
); );
@ -895,7 +895,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
cellMaps, cellMaps,
pointMaps, pointMaps,

View File

@ -353,7 +353,7 @@ boundBox procBounds
procDb, procDb,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );
@ -382,7 +382,7 @@ void writeDistribution
masterMesh, masterMesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
masterMesh.nCells() masterMesh.nCells()
); );
@ -418,7 +418,7 @@ void writeDistribution
masterMesh, masterMesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
masterMesh, masterMesh,
dimensionedScalar("cellDist", dimless, -1), dimensionedScalar("cellDist", dimless, -1),
@ -498,7 +498,7 @@ void writeMaps
procMesh, procMesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // Do not register IOobject::NO_REGISTER
); );

View File

@ -114,7 +114,7 @@ Foam::label Foam::parLagrangianDistributor::distributeFields
srcMesh_, srcMesh_,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
label(0) label(0)
); );
@ -130,7 +130,7 @@ Foam::label Foam::parLagrangianDistributor::distributeFields
tgtMesh_, tgtMesh_,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
if (field.size()) if (field.size())
@ -218,7 +218,7 @@ Foam::label Foam::parLagrangianDistributor::distributeFieldFields
srcMesh_, srcMesh_,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
label(0) label(0)
); );
@ -235,7 +235,7 @@ Foam::label Foam::parLagrangianDistributor::distributeFieldFields
tgtMesh_, tgtMesh_,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
if (field.size()) if (field.size())
@ -363,7 +363,7 @@ Foam::label Foam::parLagrangianDistributor::distributeStoredFields
tgtMesh_, tgtMesh_,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
if (field.size()) if (field.size())

View File

@ -397,7 +397,7 @@ void writeDecomposition
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
decomp decomp
); );
@ -415,7 +415,7 @@ void writeDecomposition
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // do not register IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(name, dimless, -1), dimensionedScalar(name, dimless, -1),
@ -891,7 +891,7 @@ autoPtr<mapDistributePolyMesh> redistributeAndWrite
mesh, mesh,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
hexRef8Data refData(io); hexRef8Data refData(io);
@ -2592,7 +2592,7 @@ int main(int argc, char *argv[])
areaProcMeshPtr->thisDb(), areaProcMeshPtr->thisDb(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
faDistMap faDistMap
).write(); ).write();

View File

@ -94,7 +94,7 @@ public:
{} {}
//- Disable writing objects //- Disable writing objects
virtual bool writeObject(IOstreamOption, const bool valid) const virtual bool writeObject(IOstreamOption, const bool writeOnProc) const
{ {
return true; return true;
} }

View File

@ -49,7 +49,7 @@ if (timeDirs.size() > 1)
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // no register IOobject::NO_REGISTER
).typeHeaderOk<pointIOField>(true, false) ).typeHeaderOk<pointIOField>(true, false)
) )
{ {

View File

@ -42,7 +42,7 @@ label timeIndex = 0;
runTime, runTime,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // no register IOobject::NO_REGISTER
); );
if (io.typeHeaderOk<IOdictionary>(true, false)) if (io.typeHeaderOk<IOdictionary>(true, false))

View File

@ -55,7 +55,7 @@ Foam::label Foam::checkData
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // no register IOobject::NO_REGISTER
).typeHeaderOk<volScalarField>(false, false); ).typeHeaderOk<volScalarField>(false, false);
if (!good) if (!good)

View File

@ -7,7 +7,7 @@
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // no register IOobject::NO_REGISTER
); );
if (io.typeHeaderOk<pointIOField>(true, false)) if (io.typeHeaderOk<pointIOField>(true, false))

View File

@ -211,7 +211,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false, // no register IOobject::NO_REGISTER,
true // global-like true // global-like
) )
); );

View File

@ -169,7 +169,7 @@ void fieldInterpolator::interpolate()
objects_[fieldName]->db(), objects_[fieldName]->db(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
fieldName, fieldName,
selectedTimeNames, selectedTimeNames,

View File

@ -10,7 +10,7 @@
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
) )
); );

View File

@ -84,7 +84,7 @@ void blendField
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
if (fieldHeader.typeHeaderOk<volScalarField>(true)) if (fieldHeader.typeHeaderOk<volScalarField>(true))
@ -122,7 +122,7 @@ void calcOmegaField
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
if (omegaHeader.typeHeaderOk<volScalarField>(true)) if (omegaHeader.typeHeaderOk<volScalarField>(true))
@ -159,7 +159,7 @@ void setField
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
if (fldHeader.typeHeaderOk<volScalarField>(true)) if (fldHeader.typeHeaderOk<volScalarField>(true))

View File

@ -548,7 +548,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );
const_cast<word&>(IOPtrList<entry>::typeName) = oldTypeName; const_cast<word&>(IOPtrList<entry>::typeName) = oldTypeName;
@ -672,7 +672,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
if (fieldHeader.typeHeaderOk<localIOdictionary>(false)) if (fieldHeader.typeHeaderOk<localIOdictionary>(false))

View File

@ -59,7 +59,7 @@ Foam::IOPtrList<Foam::entry> Foam::boundaryInfo::readBoundaryDict
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );
@ -75,8 +75,7 @@ Foam::IOPtrList<Foam::entry> Foam::boundaryInfo::readBoundaryDict
if (!procPatch) if (!procPatch)
{ {
label nFaces = dict.get<label>("nFaces"); label nFaces = dict.get<label>("nFaces");
reduce(nFaces, sumOp<label>()); if (returnReduceAnd(nFaces == 0))
if (nFaces == 0)
{ {
addPatch = false; addPatch = false;
} }

View File

@ -108,7 +108,7 @@ Foam::dictionary Foam::solverTemplate::readFluidFieldTemplates
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );

View File

@ -89,7 +89,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
boundary.size() boundary.size()
); );

View File

@ -287,7 +287,7 @@ void rewriteField
runTime, runTime,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );
const_cast<word&>(IOdictionary::typeName) = oldTypeName; const_cast<word&>(IOdictionary::typeName) = oldTypeName;
@ -455,7 +455,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
if (io.typeHeaderOk<IOPtrList<entry>>(false)) if (io.typeHeaderOk<IOPtrList<entry>>(false))
@ -489,7 +489,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
if (io.typeHeaderOk<IOPtrList<entry>>(false)) if (io.typeHeaderOk<IOPtrList<entry>>(false))

View File

@ -82,7 +82,7 @@ void MapLagrangianFields
meshTarget, meshTarget,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
addParticles.size() addParticles.size()
); );
@ -121,7 +121,7 @@ void MapLagrangianFields
meshTarget, meshTarget,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
addParticles.size() addParticles.size()
); );
@ -159,7 +159,7 @@ void MapLagrangianFields
meshTarget, meshTarget,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
addParticles.size() addParticles.size()
); );

View File

@ -67,7 +67,7 @@ int readNumProcs
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // do not register IOobject::NO_REGISTER
), ),
args.getOrDefault<fileName>(optionName, "") args.getOrDefault<fileName>(optionName, "")
) )
@ -360,7 +360,7 @@ int main(int argc, char *argv[])
runTimeTarget, runTimeTarget,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );

View File

@ -81,7 +81,7 @@ void MapLagrangianFields
meshTarget, meshTarget,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
addParticles.size() addParticles.size()
); );
@ -123,7 +123,7 @@ void MapLagrangianFields
meshTarget, meshTarget,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
min(fieldSource.size(), addParticles.size()) // handle 0 size min(fieldSource.size(), addParticles.size()) // handle 0 size
); );
@ -172,7 +172,7 @@ void MapLagrangianFields
meshTarget, meshTarget,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
min(fieldSource.size(), addParticles.size()) // handle 0 size min(fieldSource.size(), addParticles.size()) // handle 0 size
); );

View File

@ -313,7 +313,7 @@ int main(int argc, char *argv[])
runTimeTarget, runTimeTarget,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );

View File

@ -58,7 +58,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );

View File

@ -47,16 +47,14 @@ int main(int argc, char *argv[])
const dictionary NURBSdict const dictionary NURBSdict
( (
IOdictionary IOdictionary::readContents
( (
IOobject IOobject
( (
"dynamicMeshDict", "dynamicMeshDict",
mesh.time().constant(), mesh.time().constant(),
mesh, mesh,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ
IOobject::NO_WRITE,
false
) )
).subDict("volumetricBSplinesMotionSolverCoeffs") ).subDict("volumetricBSplinesMotionSolverCoeffs")
); );

View File

@ -197,7 +197,7 @@ int main(int argc, char *argv[])
mesh.thisDb(), mesh.thisDb(),
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
); );
const bool headOk = fieldHeader.typeHeaderOk<IOdictionary>(false); const bool headOk = fieldHeader.typeHeaderOk<IOdictionary>(false);

View File

@ -163,7 +163,7 @@ bool setField
mesh.thisDb(), mesh.thisDb(),
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // No register IOobject::NO_REGISTER
), ),
mesh mesh
); );

View File

@ -148,7 +148,7 @@ IOobject createIOobject
mesh, mesh,
rOpt, rOpt,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // do not register IOobject::NO_REGISTER
); );
} }
@ -377,7 +377,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // do not register IOobject::NO_REGISTER
), ),
mesh, mesh,
dimensionedScalar(dimless, scalar(1)), dimensionedScalar(dimless, scalar(1)),

View File

@ -480,7 +480,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );
@ -824,7 +824,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
nCoarseFaces nCoarseFaces
); );
@ -1273,7 +1273,7 @@ int main(int argc, char *argv[])
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
std::move(globalFaceFaces) std::move(globalFaceFaces)
); );

View File

@ -1811,7 +1811,7 @@ int main(int argc, char *argv[])
runTime, // registry runTime, // registry
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
feMesh.points(), feMesh.points(),
feMesh.edges() feMesh.edges()

View File

@ -639,8 +639,8 @@ int main(int argc, char *argv[])
"triSurface", "triSurface",
runTime, // registry runTime, // registry
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
feMesh.points(), feMesh.points(),
feMesh.edges() feMesh.edges()

View File

@ -228,7 +228,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
args.getOrDefault<fileName>("dict", "") args.getOrDefault<fileName>("dict", "")
); );

View File

@ -188,7 +188,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
args.getOrDefault<fileName>("dict", "") args.getOrDefault<fileName>("dict", "")
); );

View File

@ -200,7 +200,7 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
), ),
args.getOrDefault<fileName>("dict", "") args.getOrDefault<fileName>("dict", "")
); );

View File

@ -81,12 +81,11 @@ int main(int argc, char *argv[])
runTime, runTime,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false IOobject::NO_REGISTER
) )
); );
const scalar P = 1e5; const scalar P = 1e5;
const scalar T = 3000.0; const scalar T = 3000.0;

View File

@ -7,7 +7,7 @@
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Copyright (C) 2011-2015 OpenFOAM Foundation # Copyright (C) 2011-2015 OpenFOAM Foundation
# Copyright (C) 2017-2021 OpenCFD Ltd. # Copyright (C) 2017-2023 OpenCFD Ltd.
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later. # This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -45,6 +45,7 @@ options:
-local Same as -spawn=1 -local Same as -spawn=1
-remote Same as -spawn=2 -remote Same as -spawn=2
-clean Remove old processor*.{log,sh} files, mpirun.schema etc -clean Remove old processor*.{log,sh} files, mpirun.schema etc
-decompose-dict=<file> Specific decomposeParDict name
-help Print the usage -help Print the usage
Invoke mpirun with separate per-processor log files or running in Invoke mpirun with separate per-processor log files or running in
@ -111,7 +112,7 @@ Linux)
esac esac
unset appName appArgs nProcs unset appName appArgs nProcs
unset method spawn optClean unset method spawn optClean optValue
optConfirm=true optConfirm=true
decompDict="system/decomposeParDict" decompDict="system/decomposeParDict"
@ -126,7 +127,7 @@ do
then then
knownOption=true # Assume success knownOption=true # Assume success
case "$1" in case "$1" in
'') ;; # ignore junk ('') ;; # Ignore junk
-clean) optClean=true ;; -clean) optClean=true ;;
-yes) unset optConfirm ;; -yes) unset optConfirm ;;
@ -173,14 +174,25 @@ do
shift shift
;; ;;
(-decompose-dict=*)
optValue="${1#*=}"
case "$optValue" in
('' | none | false) ;; ## Ignore
(*)
decompDict="$optValue"
appArgs="${appArgs}${appArgs:+ }-decomposeParDict '$decompDict'"
;;
esac
;;
-decomposeParDict) -decomposeParDict)
# Grab values and add to args immediately # Grab values and add to args immediately
decompDict="$2" decompDict="$2"
appArgs="${appArgs}${appArgs:+ }$1 '$2'"
shift shift
appArgs="${appArgs}${appArgs:+ }-decomposeParDict '$decompDict'"
;; ;;
*) (*)
knownOption=false # Fallthrough to regular processing knownOption=false # Fallthrough to regular processing
;; ;;
esac esac
@ -192,23 +204,24 @@ do
fi fi
fi fi
# Processing application arguments
case "$1" in case "$1" in
-help* | --help*) usage ;; (-help* | --help*) usage ;;
'') ;; # ignore junk ('') ;; ## Ignore junk
-np) (-np)
nProcs="$2" nProcs="$2"
shift shift
;; ;;
-decomposeParDict) (-decomposeParDict)
# Grab values and add to args immediately # Grab values and add to args immediately
decompDict="$2" decompDict="$2"
appArgs="${appArgs}${appArgs:+ }$1 '$2'" appArgs="${appArgs}${appArgs:+ }-decomposeParDict '$decompDict'"
shift shift
;; ;;
*) (*)
if [ -z "$appName" ] if [ -z "$appName" ]
then then
appName="$1" appName="$1"

View File

@ -6,7 +6,7 @@
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation # Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2015-2022 OpenCFD Ltd. # Copyright (C) 2015-2023 OpenCFD Ltd.
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later. # This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -180,6 +180,16 @@ getNumberOfProcessors()
{ {
local dict="${1:-system/decomposeParDict}" local dict="${1:-system/decomposeParDict}"
case "$dict" in
(system/*) # Already qualified
;;
(*)
# If it does not exist, assume it refers to location in system/
[ -f "$dict" ] || dict="system/$dict"
;;
esac
# Re-use positional parameters for automatic whitespace elimination # Re-use positional parameters for automatic whitespace elimination
set -- $(foamDictionary -entry numberOfSubdomains -value "$dict" 2>/dev/null) set -- $(foamDictionary -entry numberOfSubdomains -value "$dict" 2>/dev/null)
@ -223,7 +233,7 @@ getApplication()
# #
runApplication() runApplication()
{ {
local appName appRun logFile logMode local appName appRun optValue logFile logMode
# Any additional parsed arguments (eg, decomposeParDict) # Any additional parsed arguments (eg, decomposeParDict)
local appArgs local appArgs
@ -232,25 +242,39 @@ runApplication()
while [ "$#" -gt 0 ] && [ -z "$appRun" ] while [ "$#" -gt 0 ] && [ -z "$appRun" ]
do do
case "$1" in case "$1" in
-a | -append) ('') ;; # Ignore junk
logMode=append
;; (-a | -append)
-o | -overwrite) logMode=append
logMode=overwrite ;;
;; (-o | -overwrite)
-s | -suffix) logMode=overwrite
logFile=".$2" ;;
shift (-s | -suffix)
;; logFile=".$2"
-decomposeParDict) shift
appArgs="$appArgs $1 $2" ;;
shift
;; (-decompose-dict=*)
'') optValue="${1#*=}"
;; case "$optValue" in
*) ('' | none | false) ;; ## Ignore
appRun="$1" (*) appArgs="$appArgs -decomposeParDict $optValue" ;;
;; esac
;;
(-decomposeParDict)
optValue="$2"
shift
case "$optValue" in
('' | none | false) ;; ## Ignore
(*) appArgs="$appArgs -decomposeParDict $optValue" ;;
esac
;;
(*)
appRun="$1"
;;
esac esac
shift shift
done done
@ -280,7 +304,7 @@ runApplication()
# #
runParallel() runParallel()
{ {
local appName appRun logFile logMode nProcs local appName appRun optValue logFile logMode nProcs
# Any additional parsed arguments (eg, decomposeParDict) # Any additional parsed arguments (eg, decomposeParDict)
local appArgs="-parallel" local appArgs="-parallel"
@ -295,30 +319,46 @@ runParallel()
while [ "$#" -gt 0 ] && [ -z "$appRun" ] while [ "$#" -gt 0 ] && [ -z "$appRun" ]
do do
case "$1" in case "$1" in
-a | -append) ('') ;; # Ignore junk
logMode=append
(-a | -append)
logMode=append
;;
(-o | -overwrite)
logMode=overwrite
;;
(-s | -suffix)
logFile=".$2"
shift
;;
(-n | -np)
nProcs="$2"
shift
;;
(-decompose-dict=*)
optValue="${1#*=}"
case "$optValue" in
('' | none | false) ;; ## Ignore
(*)
appArgs="$appArgs -decomposeParDict $optValue"
nProcs="$(getNumberOfProcessors "$optValue")"
;; ;;
-o | -overwrite) esac
logMode=overwrite ;;
;; (-decomposeParDict)
-s | -suffix) optValue="$2"
logFile=".$2" shift
shift case "$optValue" in
;; ('' | none | false) ;; ## Ignore
-n | -np) (*)
nProcs="$2" appArgs="$appArgs -decomposeParDict $optValue"
shift nProcs="$(getNumberOfProcessors "$optValue")"
;;
-decomposeParDict)
appArgs="$appArgs $1 $2"
nProcs=$(getNumberOfProcessors "$2")
shift
;;
'')
;;
*)
appRun="$1"
;; ;;
esac
;;
(*)
appRun="$1"
;;
esac esac
shift shift
done done

Some files were not shown because too many files have changed in this diff Show More