Compare commits

...

19 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
714 changed files with 4952 additions and 2853 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -243,14 +243,12 @@ turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
<< 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
refValue() = scalarField("refValue", dict, p.size());
refGrad() = scalarField("refGradient", dict, p.size());
valueFraction() = scalarField("valueFraction", dict, p.size());
}
else
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -88,12 +88,12 @@ int main(int argc, char *argv[])
//- Process IDs within a given communicator
Info<< "procIDs: "
<< flatOutput(UPstream::procID(UPstream::worldComm)) << endl;
<< flatOutput(UPstream::procID(UPstream::commWorld())) << endl;
rankInfo(UPstream::worldComm);
rankInfo(UPstream::commWorld());
Pout<< endl;
const int myProci = UPstream::myProcNo(UPstream::worldComm);
const int myProci = UPstream::myProcNo(UPstream::commWorld());
int localRanki = myProci;
labelList subRanks;
@ -101,9 +101,9 @@ int main(int argc, char *argv[])
#if 1
// 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);
Pout.prefix() =
@ -120,14 +120,14 @@ int main(int argc, char *argv[])
#if 1
// With every other rank
subRanks = identity(UPstream::nProcs(UPstream::worldComm));
subRanks = identity(UPstream::nProcs(UPstream::commWorld()));
for (label& val : subRanks)
{
if (val % 2) val = -1;
}
newComm.reset(UPstream::worldComm, subRanks);
newComm.reset(UPstream::commWorld(), subRanks);
localRanki = UPstream::myProcNo(newComm);
Pout.prefix() =
@ -165,19 +165,19 @@ int main(int argc, char *argv[])
}
if (Pstream::parRun() && args.found("host-comm"))
{
// Host communicator, based on the current worldComm
// Host communicator, based on the current world communicator
// Use hostname
// Lowest rank per hostname is the IO rank
label numprocs = UPstream::nProcs(UPstream::globalComm);
label numprocs = UPstream::nProcs(UPstream::commGlobal());
stringList hosts(numprocs);
hosts[Pstream::myProcNo(UPstream::globalComm)] = hostName();
hosts[Pstream::myProcNo(UPstream::commGlobal())] = hostName();
labelList hostIDs_;
// Compact
if (Pstream::master(UPstream::globalComm))
if (Pstream::master(UPstream::commGlobal()))
{
DynamicList<word> hostNames(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 =
hostIDs_[Pstream::myProcNo(UPstream::globalComm)];
hostIDs_[Pstream::myProcNo(UPstream::commGlobal())];
DynamicList<label> subRanks;
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 =
UPstream::allocateCommunicator
(
UPstream::globalComm, // parent
UPstream::commGlobal(),
subRanks,
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,
IOobject::NO_READ,
IOobject::NO_WRITE,
false // do not register
IOobject::NO_REGISTER
);
Info<< "Testing searchable sphere" << endl;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -93,10 +93,7 @@ CONSTRUCT
/*
//Initialise with the value entry if evaluation is not possible
FVPATCHF::operator=
(
FIELD("value", dict, p.size())
);
this->readValueEntry(dict, IOobjectOption::MUST_READ);
this->refValue() = *this;
*/
}

View File

@ -173,6 +173,10 @@ public:
//- (discard old element at that location).
//- Return reference to the new list element.
template<class... Args>
inline T& emplace_set(const label i, Args&&... args);
//- Same as emplace_set()
template<class... Args>
inline T& emplace(const label i, Args&&... args);
//- Set element to given pointer and return old element (can be null)

View File

@ -172,11 +172,17 @@ inline void Foam::PtrList<T>::push_back(PtrList<T>&& other)
template<class T>
template<class... Args>
inline T& Foam::PtrList<T>::emplace
(
const label i,
Args&&... args
)
inline T& Foam::PtrList<T>::emplace_set(const label i, Args&&... args)
{
T* ptr = new T(std::forward<Args>(args)...);
(void)this->set(i, ptr);
return *ptr;
}
template<class T>
template<class... Args>
inline T& Foam::PtrList<T>::emplace(const label i, Args&&... args)
{
T* ptr = new T(std::forward<Args>(args)...);
(void)this->set(i, ptr);

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