Compare commits
3 Commits
openmp-hmm
...
develop.sw
| Author | SHA1 | Date | |
|---|---|---|---|
| e65dc2d578 | |||
| 37db8ccd20 | |||
| a5d6c8ced0 |
@ -36,11 +36,11 @@ Description
|
||||
if (adjustTimeStep)
|
||||
{
|
||||
scalar maxDeltaTFact = maxCo/(CoNum + StCoNum + SMALL);
|
||||
scalar deltaTFact = Foam::min(Foam::min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
Foam::min
|
||||
min
|
||||
(
|
||||
deltaTFact*runTime.deltaTValue(),
|
||||
maxDeltaT
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
if (adjustTimeStep)
|
||||
{
|
||||
runTime.setDeltaT(Foam::min(dtChem, maxDeltaT));
|
||||
runTime.setDeltaT(min(dtChem, maxDeltaT));
|
||||
Info<< "deltaT = " << runTime.deltaT().value() << endl;
|
||||
}
|
||||
|
||||
@ -54,9 +54,9 @@ if (adjustTimeStep)
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
Foam::min
|
||||
min
|
||||
(
|
||||
dt0*Foam::min(Foam::min(TFactorFluid, Foam::min(TFactorFilm, TFactorSolid)), 1.2),
|
||||
dt0*min(min(TFactorFluid, min(TFactorFilm, TFactorSolid)), 1.2),
|
||||
maxDeltaT
|
||||
)
|
||||
);
|
||||
|
||||
@ -18,13 +18,13 @@
|
||||
const surfaceScalarField& phi2 =
|
||||
phaseSystemFluid[regioni].phase2().phiRef();
|
||||
|
||||
sumPhi = Foam::max
|
||||
sumPhi = max
|
||||
(
|
||||
sumPhi,
|
||||
fvc::surfaceSum(mag(phi1))().primitiveField()
|
||||
);
|
||||
|
||||
sumPhi = Foam::max
|
||||
sumPhi = max
|
||||
(
|
||||
sumPhi,
|
||||
fvc::surfaceSum(mag(phi2))().primitiveField()
|
||||
@ -43,7 +43,7 @@
|
||||
/ fluidRegions[regioni].V().field()
|
||||
)*runTime.deltaTValue(),
|
||||
|
||||
CoNum = Foam::max(UrCoNum, CoNum);
|
||||
CoNum = max(UrCoNum, CoNum);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
forAll(fluidRegions, regioni)
|
||||
{
|
||||
CoNum = Foam::max
|
||||
CoNum = max
|
||||
(
|
||||
compressibleCourantNo
|
||||
(
|
||||
|
||||
@ -47,10 +47,10 @@ if (adjustTimeStep)
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
Foam::min
|
||||
min
|
||||
(
|
||||
Foam::min(maxCo/CoNum, maxDi/DiNum)*runTime.deltaT().value(),
|
||||
Foam::min(runTime.deltaTValue(), maxDeltaT)
|
||||
min(maxCo/CoNum, maxDi/DiNum)*runTime.deltaT().value(),
|
||||
min(runTime.deltaTValue(), maxDeltaT)
|
||||
)
|
||||
);
|
||||
Info<< "deltaT = " << runTime.deltaT().value() << endl;
|
||||
|
||||
@ -49,17 +49,17 @@ if (adjustTimeStep)
|
||||
scalar maxDeltaTSolid = maxDi/(DiNum + SMALL);
|
||||
|
||||
scalar deltaTFluid =
|
||||
Foam::min
|
||||
min
|
||||
(
|
||||
Foam::min(maxDeltaTFluid, 1.0 + 0.1*maxDeltaTFluid),
|
||||
min(maxDeltaTFluid, 1.0 + 0.1*maxDeltaTFluid),
|
||||
1.2
|
||||
);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
Foam::min
|
||||
min
|
||||
(
|
||||
Foam::min(deltaTFluid, maxDeltaTSolid)*runTime.deltaT().value(),
|
||||
min(deltaTFluid, maxDeltaTSolid)*runTime.deltaT().value(),
|
||||
maxDeltaT
|
||||
)
|
||||
);
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
(
|
||||
solidRegions[i],
|
||||
thermos[i],
|
||||
coordinateSystem::typeName
|
||||
coordinateSystem::typeName_()
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ forAll(solidRegions, i)
|
||||
tmp<volScalarField> trho = thermo.rho();
|
||||
const volScalarField& rho = trho();
|
||||
|
||||
DiNum = Foam::max
|
||||
DiNum = max
|
||||
(
|
||||
solidRegionDiffNo
|
||||
(
|
||||
|
||||
@ -15,7 +15,7 @@ if (!thermo.isotropic())
|
||||
(
|
||||
mesh,
|
||||
thermo,
|
||||
coordinateSystem::typeName
|
||||
coordinateSystem::typeName_()
|
||||
);
|
||||
|
||||
tmp<volVectorField> tkappaByCp = thermo.Kappa()/thermo.Cp();
|
||||
|
||||
@ -17,7 +17,7 @@ scalar DiNum = -GREAT;
|
||||
tmp<volScalarField> trho = thermo.rho();
|
||||
const volScalarField& rho = trho();
|
||||
|
||||
DiNum = Foam::max
|
||||
DiNum = max
|
||||
(
|
||||
solidRegionDiffNo
|
||||
(
|
||||
|
||||
@ -36,13 +36,13 @@ Description
|
||||
if (adjustTimeStep)
|
||||
{
|
||||
const scalar maxDeltaTFact =
|
||||
Foam::min(maxCo/(CoNum + SMALL), maxCo/(surfaceFilm.CourantNumber() + SMALL));
|
||||
min(maxCo/(CoNum + SMALL), maxCo/(surfaceFilm.CourantNumber() + SMALL));
|
||||
const scalar deltaTFact =
|
||||
Foam::min(Foam::min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
Foam::min
|
||||
min
|
||||
(
|
||||
deltaTFact*runTime.deltaTValue(),
|
||||
maxDeltaT
|
||||
|
||||
@ -214,7 +214,7 @@
|
||||
phiCN,
|
||||
alphaPhi10,
|
||||
Sp,
|
||||
(Su + divU*Foam::min(alpha1(), scalar(1)))(),
|
||||
(Su + divU*min(alpha1(), scalar(1)))(),
|
||||
oneField(),
|
||||
zeroField()
|
||||
);
|
||||
|
||||
@ -214,7 +214,7 @@
|
||||
phiCN,
|
||||
alphaPhi10,
|
||||
Sp,
|
||||
(Su + divU*Foam::min(alpha1(), scalar(1)))(),
|
||||
(Su + divU*min(alpha1(), scalar(1)))(),
|
||||
oneField(),
|
||||
zeroField()
|
||||
);
|
||||
|
||||
@ -36,13 +36,13 @@ Description
|
||||
if (adjustTimeStep)
|
||||
{
|
||||
scalar maxDeltaTFact =
|
||||
Foam::min(maxCo/(CoNum + SMALL), maxAlphaCo/(alphaCoNum + SMALL));
|
||||
min(maxCo/(CoNum + SMALL), maxAlphaCo/(alphaCoNum + SMALL));
|
||||
|
||||
scalar deltaTFact = Foam::min(Foam::min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
Foam::min
|
||||
min
|
||||
(
|
||||
deltaTFact*runTime.deltaTValue(),
|
||||
maxDeltaT
|
||||
|
||||
@ -36,13 +36,13 @@ Description
|
||||
if (adjustTimeStep)
|
||||
{
|
||||
scalar maxDeltaTFact =
|
||||
Foam::min(maxCo/(CoNum + SMALL), maxAcousticCo/(acousticCoNum + SMALL));
|
||||
min(maxCo/(CoNum + SMALL), maxAcousticCo/(acousticCoNum + SMALL));
|
||||
|
||||
scalar deltaTFact = Foam::min(Foam::min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
Foam::min
|
||||
min
|
||||
(
|
||||
deltaTFact*runTime.deltaTValue(),
|
||||
maxDeltaT
|
||||
|
||||
@ -37,11 +37,11 @@ if (adjustTimeStep)
|
||||
if (CoNum > SMALL)
|
||||
{
|
||||
scalar maxDeltaTFact =
|
||||
Foam::min(maxCo/(CoNum + SMALL), maxAcousticCo/(acousticCoNum + SMALL));
|
||||
min(maxCo/(CoNum + SMALL), maxAcousticCo/(acousticCoNum + SMALL));
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
Foam::min
|
||||
min
|
||||
(
|
||||
maxDeltaTFact*runTime.deltaTValue(),
|
||||
maxDeltaT
|
||||
|
||||
@ -26,12 +26,12 @@ forAll(dgdt, celli)
|
||||
{
|
||||
if (dgdt[celli] > 0.0)
|
||||
{
|
||||
Sp[celli] -= dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
|
||||
Su[celli] += dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
|
||||
Sp[celli] -= dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
|
||||
Su[celli] += dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
|
||||
}
|
||||
else if (dgdt[celli] < 0.0)
|
||||
{
|
||||
Sp[celli] += dgdt[celli]/Foam::max(alpha1[celli], 1e-4);
|
||||
Sp[celli] += dgdt[celli]/max(alpha1[celli], 1e-4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// Update alpha1
|
||||
#include "alphaSuSp.H"
|
||||
advector.advect(Sp,(Su + divU*Foam::min(alpha1(), scalar(1)))());
|
||||
advector.advect(Sp,(Su + divU*min(alpha1(), scalar(1)))());
|
||||
|
||||
// Update rhoPhi
|
||||
rhoPhi = advector.getRhoPhi(rho1, rho2);
|
||||
@ -10,6 +10,6 @@ alpha2 = 1.0 - alpha1;
|
||||
|
||||
Info<< "Phase-1 volume fraction = "
|
||||
<< alpha1.weightedAverage(mesh.Vsc()).value()
|
||||
<< " Min(" << alpha1.name() << ") = " << Foam::min(alpha1).value()
|
||||
<< " Max(" << alpha1.name() << ") - 1 = " << Foam::max(alpha1).value() - 1
|
||||
<< " Min(" << alpha1.name() << ") = " << min(alpha1).value()
|
||||
<< " Max(" << alpha1.name() << ") - 1 = " << max(alpha1).value() - 1
|
||||
<< endl;
|
||||
|
||||
@ -26,12 +26,12 @@ forAll(dgdt, celli)
|
||||
{
|
||||
if (dgdt[celli] > 0.0)
|
||||
{
|
||||
Sp[celli] -= dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
|
||||
Su[celli] += dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
|
||||
Sp[celli] -= dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
|
||||
Su[celli] += dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
|
||||
}
|
||||
else if (dgdt[celli] < 0.0)
|
||||
{
|
||||
Sp[celli] += dgdt[celli]/Foam::max(alpha1[celli], 1e-4);
|
||||
Sp[celli] += dgdt[celli]/max(alpha1[celli], 1e-4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -26,12 +26,12 @@ forAll(dgdt, celli)
|
||||
{
|
||||
if (dgdt[celli] > 0.0)
|
||||
{
|
||||
Sp[celli] -= dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
|
||||
Su[celli] += dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
|
||||
Sp[celli] -= dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
|
||||
Su[celli] += dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
|
||||
}
|
||||
else if (dgdt[celli] < 0.0)
|
||||
{
|
||||
Sp[celli] += dgdt[celli]/Foam::max(alpha1[celli], 1e-4);
|
||||
Sp[celli] += dgdt[celli]/max(alpha1[celli], 1e-4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -157,7 +157,12 @@ void Foam::radiation::laserDTRM::initialiseReflection()
|
||||
);
|
||||
}
|
||||
|
||||
reflectionSwitch_ = returnReduceOr(reflections_.size());
|
||||
if (reflections_.size())
|
||||
{
|
||||
reflectionSwitch_ = true;
|
||||
}
|
||||
|
||||
reflectionSwitch_ = returnReduce(reflectionSwitch_, orOp<bool>());
|
||||
}
|
||||
}
|
||||
|
||||
@ -294,12 +299,14 @@ void Foam::radiation::laserDTRM::initialise()
|
||||
DTRMCloud_.addParticle(pPtr);
|
||||
}
|
||||
|
||||
if (nMissed < 10 && returnReduceAnd(cellI < 0))
|
||||
if (returnReduce(cellI, maxOp<label>()) == -1)
|
||||
{
|
||||
++nMissed;
|
||||
WarningInFunction
|
||||
<< "Cannot find owner cell for focalPoint at "
|
||||
<< p0 << endl;
|
||||
if (++nMissed <= 10)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Cannot find owner cell for focalPoint at "
|
||||
<< p0 << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,13 +36,13 @@ Description
|
||||
if (adjustTimeStep)
|
||||
{
|
||||
scalar maxDeltaTFact =
|
||||
Foam::min
|
||||
min
|
||||
(
|
||||
maxCo/(CoNum + SMALL),
|
||||
Foam::min
|
||||
min
|
||||
(
|
||||
maxAlphaCo/(alphaCoNum + SMALL),
|
||||
Foam::min
|
||||
min
|
||||
(
|
||||
maxAlphaDdt/(ddtAlphaNum + SMALL),
|
||||
maxDi/(DiNum + SMALL)
|
||||
@ -50,11 +50,11 @@ if (adjustTimeStep)
|
||||
)
|
||||
);
|
||||
|
||||
scalar deltaTFact = Foam::min(Foam::min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
Foam::min
|
||||
min
|
||||
(
|
||||
deltaTFact*runTime.deltaTValue(),
|
||||
maxDeltaT
|
||||
|
||||
@ -8,5 +8,5 @@
|
||||
|
||||
Info<< "Max Ur Courant Number = " << UrCoNum << endl;
|
||||
|
||||
CoNum = Foam::max(CoNum, UrCoNum);
|
||||
CoNum = max(CoNum, UrCoNum);
|
||||
}
|
||||
|
||||
@ -8,5 +8,5 @@
|
||||
|
||||
Info<< "Max Ur Courant Number = " << UrCoNum << endl;
|
||||
|
||||
CoNum = Foam::max(CoNum, UrCoNum);
|
||||
CoNum = max(CoNum, UrCoNum);
|
||||
}
|
||||
|
||||
@ -28,6 +28,11 @@ License
|
||||
#include "DirLister.H"
|
||||
#include <dirent.h>
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
static const Foam::word extgz("gz");
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
bool Foam::DirLister::const_iterator::open(const fileName& dir)
|
||||
@ -105,9 +110,9 @@ Foam::word Foam::DirLister::next(DIR* dirPtr) const
|
||||
|
||||
if (ok)
|
||||
{
|
||||
if (fType == fileName::FILE && stripgz_ && name.has_ext("gz"))
|
||||
if (fType == fileName::FILE && stripgz_ && name.hasExt(extgz))
|
||||
{
|
||||
name.remove_ext();
|
||||
name = name.lessExt();
|
||||
}
|
||||
|
||||
if (!name.empty() && accept(name))
|
||||
|
||||
@ -113,6 +113,7 @@ int main(int argc, char *argv[])
|
||||
label coarseSize = max(addr)+1;
|
||||
|
||||
Info<< "Level : " << level << endl
|
||||
<< returnReduce(addr.size(), sumOp<label>()) << endl
|
||||
<< " current size : "
|
||||
<< returnReduce(addr.size(), sumOp<label>()) << endl
|
||||
<< " agglomerated size : "
|
||||
|
||||
@ -90,7 +90,7 @@ void writeAndRead
|
||||
const IOobject& io,
|
||||
const label sz,
|
||||
const word& writeType,
|
||||
IOobjectOption::readOption rOpt,
|
||||
const IOobject::readOption rOpt,
|
||||
const word& readType
|
||||
)
|
||||
{
|
||||
@ -208,8 +208,7 @@ int main(int argc, char *argv[])
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
IOobject::NO_REGISTER
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
|
||||
{
|
||||
@ -244,7 +243,9 @@ int main(int argc, char *argv[])
|
||||
args.executable(),
|
||||
"constant",
|
||||
runTime,
|
||||
IOobject::NO_REGISTER // implicit convert to IOobjectOption
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
|
||||
labelList ints(identity(200));
|
||||
|
||||
@ -182,7 +182,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// MPI barrier
|
||||
bool barrier = true;
|
||||
Pstream::broadcast(barrier);
|
||||
Pstream::scatter(barrier);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -83,9 +83,9 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
IOstreamOption streamOpt;
|
||||
|
||||
if (outputName.has_ext("gz"))
|
||||
if (outputName.hasExt("gz"))
|
||||
{
|
||||
outputName.remove_ext();
|
||||
outputName.removeExt();
|
||||
streamOpt.compression(IOstreamOption::COMPRESSED);
|
||||
}
|
||||
|
||||
|
||||
@ -138,8 +138,8 @@ int main()
|
||||
maxFirstEqOp<label>()(maxIndexed, item);
|
||||
}
|
||||
|
||||
Pstream::combineReduce(minIndexed, minFirstEqOp<label>());
|
||||
Pstream::combineReduce(maxIndexed, maxFirstEqOp<label>());
|
||||
Pstream::combineAllGather(minIndexed, minFirstEqOp<label>());
|
||||
Pstream::combineAllGather(maxIndexed, maxFirstEqOp<label>());
|
||||
|
||||
Info<< "Min indexed: " << minIndexed << nl
|
||||
<< "Max indexed: " << maxIndexed << nl;
|
||||
@ -156,8 +156,8 @@ int main()
|
||||
maxIndexed = maxFirstOp<label>()(maxIndexed, item);
|
||||
}
|
||||
|
||||
Pstream::combineReduce(minIndexed, minFirstEqOp<label>());
|
||||
Pstream::combineReduce(maxIndexed, maxFirstEqOp<label>());
|
||||
Pstream::combineAllGather(minIndexed, minFirstEqOp<label>());
|
||||
Pstream::combineAllGather(maxIndexed, maxFirstEqOp<label>());
|
||||
|
||||
Info<< "Min indexed: " << minIndexed << nl
|
||||
<< "Max indexed: " << maxIndexed << nl;
|
||||
|
||||
@ -1,2 +1,7 @@
|
||||
/* EXE_INC = */
|
||||
/* EXE_LIBS = */
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -31,8 +31,7 @@ Description
|
||||
#include "argList.H"
|
||||
#include "Time.H"
|
||||
#include "polyMesh.H"
|
||||
#include "line.H"
|
||||
#include "Random.H"
|
||||
#include "boundBox.H"
|
||||
#include "treeBoundBox.H"
|
||||
#include "cellModel.H"
|
||||
#include "bitSet.H"
|
||||
@ -85,20 +84,7 @@ int main(int argc, char *argv[])
|
||||
else
|
||||
{
|
||||
bb = cube(0, 1);
|
||||
Info<< "starting box: " << bb << endl;
|
||||
|
||||
Info<< "corner: " << bb.hexCorner<0>() << nl
|
||||
<< "corner: " << bb.hexCorner<7>() << nl
|
||||
<< "corner: " << bb.hexCorner<6>() << endl;
|
||||
|
||||
linePoints ln1(bb.max(), bb.centre());
|
||||
Info<< "line: " << ln1 << " box: " << ln1.box() << endl;
|
||||
|
||||
Info<< "box: " << boundBox(ln1.box()) << endl;
|
||||
|
||||
Info<< "corner: " << bb.hexCorner<0>() << nl
|
||||
<< "corner: " << bb.hexCorner<7>() << nl
|
||||
<< "corner: " << bb.hexCorner<6>() << endl;
|
||||
Info<<"starting box: " << bb << endl;
|
||||
|
||||
point pt(Zero);
|
||||
bb.add(pt);
|
||||
@ -161,25 +147,6 @@ int main(int argc, char *argv[])
|
||||
Info<< "box is now => " << box1 << endl;
|
||||
}
|
||||
|
||||
List<boundBox> boxes(12);
|
||||
{
|
||||
Random rndGen(12345);
|
||||
for (auto& bb : boxes)
|
||||
{
|
||||
bb = cube
|
||||
(
|
||||
rndGen.position<scalar>(-10, 10),
|
||||
rndGen.position<scalar>(0, 5)
|
||||
);
|
||||
}
|
||||
|
||||
Info<< "boxes: " << boxes << endl;
|
||||
|
||||
Foam::sort(boxes);
|
||||
|
||||
Info<< "sorted: " << boxes << endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -59,11 +59,11 @@ void basicTests(const coordinateSystem& cs)
|
||||
{
|
||||
cs.writeEntry(cs.name(), Info);
|
||||
|
||||
if ((const auto* cartptr = isA<coordSystem::cartesian>(cs)) != nullptr)
|
||||
if (const auto* cartptr = isA<coordSystem::cartesian>(cs))
|
||||
{
|
||||
if (!cartptr->valid())
|
||||
if (!cartptr->active())
|
||||
{
|
||||
Info<< "invalid cartesian = " << (*cartptr)
|
||||
Info<< "inactive cartesian = " << (*cartptr)
|
||||
<< " with: " << (*cartptr).R() << nl;
|
||||
}
|
||||
}
|
||||
@ -106,7 +106,7 @@ void doTest(const dictionary& dict)
|
||||
|
||||
try
|
||||
{
|
||||
auto cs1ptr = coordinateSystem::New(dict, word::null);
|
||||
auto cs1ptr = coordinateSystem::New(dict, "");
|
||||
coordinateSystem& cs1 = *cs1ptr;
|
||||
cs1.rename(dict.dictName());
|
||||
|
||||
|
||||
@ -51,8 +51,11 @@ cs4
|
||||
{
|
||||
type cylindrical;
|
||||
origin (0 3 5);
|
||||
rotation euler;
|
||||
angles (90 0 0);
|
||||
rotation
|
||||
{
|
||||
type euler;
|
||||
angles (90 0 0);
|
||||
}
|
||||
}
|
||||
|
||||
cyl
|
||||
@ -72,7 +75,10 @@ cyl
|
||||
ident
|
||||
{
|
||||
origin (0 0 0);
|
||||
rotation none;
|
||||
rotation
|
||||
{
|
||||
type none;
|
||||
}
|
||||
}
|
||||
|
||||
)
|
||||
|
||||
@ -26,7 +26,7 @@ rot_x90
|
||||
rot_x90_axesRotation
|
||||
{
|
||||
origin (0 0 0);
|
||||
rotation
|
||||
coordinateRotation
|
||||
{
|
||||
type axesRotation;
|
||||
e1 (1 0 0);
|
||||
@ -37,7 +37,7 @@ rot_x90_axesRotation
|
||||
rot_x90_axisAngle
|
||||
{
|
||||
origin (0 0 0);
|
||||
rotation
|
||||
coordinateRotation
|
||||
{
|
||||
type axisAngle;
|
||||
axis (1 0 0); // non-unit also OK
|
||||
@ -48,7 +48,7 @@ rot_x90_axisAngle
|
||||
rot_x90_euler
|
||||
{
|
||||
origin (0 0 0);
|
||||
rotation
|
||||
coordinateRotation
|
||||
{
|
||||
type euler;
|
||||
angles (0 90 0); // z-x'-z''
|
||||
@ -61,7 +61,7 @@ rot_x90_euler
|
||||
rot_z45_axesRotation
|
||||
{
|
||||
origin (0 0 0);
|
||||
rotation
|
||||
coordinateRotation
|
||||
{
|
||||
type axesRotation;
|
||||
e1 (1 1 0);
|
||||
@ -72,7 +72,7 @@ rot_z45_axesRotation
|
||||
rot_z45_axisAngle
|
||||
{
|
||||
origin (0 0 0);
|
||||
rotation
|
||||
coordinateRotation
|
||||
{
|
||||
type axisAngle;
|
||||
axis (0 0 10); // non-unit also OK
|
||||
@ -83,7 +83,7 @@ rot_z45_axisAngle
|
||||
rot_z45_euler
|
||||
{
|
||||
origin (0 0 0);
|
||||
rotation
|
||||
coordinateRotation
|
||||
{
|
||||
type euler;
|
||||
angles (45 0 0); // z-x'-z''
|
||||
@ -93,7 +93,7 @@ rot_z45_euler
|
||||
rot_z45_starcd
|
||||
{
|
||||
origin (0 0 0);
|
||||
rotation
|
||||
coordinateRotation
|
||||
{
|
||||
type starcd;
|
||||
angles (45 0 0); // z-x'-y''
|
||||
@ -106,7 +106,7 @@ rot_z45_starcd
|
||||
rot_zm45_axesRotation
|
||||
{
|
||||
origin (0 0 0);
|
||||
rotation
|
||||
coordinateRotation
|
||||
{
|
||||
type axesRotation;
|
||||
e1 (1 -1 0);
|
||||
@ -117,7 +117,7 @@ rot_zm45_axesRotation
|
||||
rot_zm45_axisAngle
|
||||
{
|
||||
origin (0 0 0);
|
||||
rotation
|
||||
coordinateRotation
|
||||
{
|
||||
type axisAngle;
|
||||
axis (0 0 10); // non-unit also OK
|
||||
@ -128,7 +128,7 @@ rot_zm45_axisAngle
|
||||
rot_zm45_euler
|
||||
{
|
||||
origin (0 0 0);
|
||||
rotation
|
||||
coordinateRotation
|
||||
{
|
||||
type euler;
|
||||
angles (-45 0 0); // z-x'-z''
|
||||
@ -141,7 +141,7 @@ rot_zm45_euler
|
||||
null_axesRotation
|
||||
{
|
||||
origin (0 0 0);
|
||||
rotation
|
||||
coordinateRotation
|
||||
{
|
||||
type axesRotation;
|
||||
e1 (1 0 0);
|
||||
@ -152,7 +152,7 @@ null_axesRotation
|
||||
null_axisAngle0
|
||||
{
|
||||
origin (0 0 0);
|
||||
rotation
|
||||
coordinateRotation
|
||||
{
|
||||
type axisAngle;
|
||||
axis (0 0 0); // non-unit also OK
|
||||
@ -163,7 +163,7 @@ null_axisAngle0
|
||||
null_axisAngle1
|
||||
{
|
||||
origin (0 0 0);
|
||||
rotation
|
||||
coordinateRotation
|
||||
{
|
||||
type axisAngle;
|
||||
axis (1 1 1); // non-unit also OK
|
||||
@ -174,7 +174,7 @@ null_axisAngle1
|
||||
null_euler
|
||||
{
|
||||
origin (0 0 0);
|
||||
rotation
|
||||
coordinateRotation
|
||||
{
|
||||
type euler;
|
||||
angles (0 0 0); // z-x'-z''
|
||||
|
||||
@ -60,7 +60,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "Reading " << file << nl << endl;
|
||||
decomposedBlockData data
|
||||
(
|
||||
UPstream::worldComm,
|
||||
Pstream::worldComm,
|
||||
IOobject
|
||||
(
|
||||
file,
|
||||
@ -79,6 +79,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
objPath,
|
||||
IOstreamOption::BINARY,
|
||||
IOstreamOption::currentVersion,
|
||||
runTime.writeCompression()
|
||||
);
|
||||
if (!os.good())
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -65,7 +65,8 @@ int main(int argc, char *argv[])
|
||||
"tensor",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
{ IOobject::READ_IF_PRESENT, IOobject::NO_REGISTER }
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensioned<tensor>(dimless, tensor(1,2,3,4,5,6,7,8,9))
|
||||
@ -74,47 +75,6 @@ int main(int argc, char *argv[])
|
||||
Info().beginBlock("transformed")
|
||||
<< tensorfld.T() << nl;
|
||||
Info().endBlock();
|
||||
|
||||
{
|
||||
auto tfld =
|
||||
DimensionedField<scalar, volMesh>::New
|
||||
(
|
||||
tensorfld,
|
||||
"scalar",
|
||||
dimensioned<scalar>(14)
|
||||
);
|
||||
|
||||
Info().beginBlock(tfld().type())
|
||||
<< tfld << nl;
|
||||
Info().endBlock();
|
||||
}
|
||||
|
||||
{
|
||||
auto tfld =
|
||||
volScalarField::New
|
||||
(
|
||||
"scalar",
|
||||
tensorfld.mesh(),
|
||||
dimensioned<scalar>(5)
|
||||
);
|
||||
|
||||
Info().beginBlock(tfld().type())
|
||||
<< tfld() << nl;
|
||||
Info().endBlock();
|
||||
|
||||
// From dissimilar types
|
||||
auto tfld2 =
|
||||
volVectorField::New
|
||||
(
|
||||
tfld(),
|
||||
"vector",
|
||||
dimensioned<vector>(Zero)
|
||||
);
|
||||
|
||||
Info().beginBlock(tfld2().type())
|
||||
<< tfld2() << nl;
|
||||
Info().endBlock();
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TEST_UINT8_FIELD
|
||||
|
||||
@ -120,8 +120,7 @@ int main(int argc, char *argv[])
|
||||
try
|
||||
{
|
||||
// Should not trigger any errors
|
||||
auto expr = expressions::exprString::toExpr(str, dict);
|
||||
|
||||
expressions::exprString expr(str, dict, false);
|
||||
Info<< "expr: " << expr << nl;
|
||||
}
|
||||
catch (const Foam::error& err)
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -48,14 +48,6 @@ Description
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// Create named file with some dummy content
|
||||
void touchFileContent(const fileName& file)
|
||||
{
|
||||
std::ofstream os(file);
|
||||
os << "file=<" << file << ">" << nl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
unsigned testClean(std::initializer_list<Pair<std::string>> tests)
|
||||
@ -268,7 +260,7 @@ int main(int argc, char *argv[])
|
||||
"hello1",
|
||||
"hello2",
|
||||
"hello3",
|
||||
"hello4.ext"
|
||||
"hello4.hmm"
|
||||
};
|
||||
|
||||
Info<< file1 << nl;
|
||||
@ -278,7 +270,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
file1,
|
||||
"some",
|
||||
"more/things.ext"
|
||||
"more/things.hmm"
|
||||
};
|
||||
|
||||
Info<< file2 << nl;
|
||||
@ -289,7 +281,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
std::string("ffO"),
|
||||
"some",
|
||||
"more/things.ext"
|
||||
"more/things.hmm"
|
||||
};
|
||||
Info<< file3 << nl;
|
||||
|
||||
@ -303,7 +295,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
"some",
|
||||
file3,
|
||||
"more/things.ext",
|
||||
"more/things.hmm",
|
||||
file1
|
||||
};
|
||||
Info<< "All ==> " << file4 << nl;
|
||||
@ -336,26 +328,26 @@ int main(int argc, char *argv[])
|
||||
fileName input1("path.to/media/image.png");
|
||||
|
||||
Info<<"File : " << input0 << " ext: "
|
||||
<< Switch(input0.has_ext())
|
||||
<< Switch(input0.hasExt())
|
||||
<< " = " << input0.ext() << nl;
|
||||
Info<<"File : " << input1 << " ext: "
|
||||
<< Switch(input1.has_ext())
|
||||
<< Switch(input1.hasExt())
|
||||
<< " = " << input1.ext() << nl;
|
||||
Info<<"File : " << endWithDot << " ext: "
|
||||
<< Switch(endWithDot.has_ext())
|
||||
<< Switch(endWithDot.hasExt())
|
||||
<< " = " << endWithDot.ext() << " <-- perhaps return false?" << nl;
|
||||
Info<<"File : " << endWithSlash << " ext: "
|
||||
<< Switch(endWithSlash.has_ext())
|
||||
<< Switch(endWithSlash.hasExt())
|
||||
<< " = " << endWithSlash.ext() << nl;
|
||||
|
||||
|
||||
Info<<"Remove extension " << (input0.remove_ext());
|
||||
Info<<"Remove extension " << (input0.removeExt());
|
||||
Info<< " now: " << input0 << nl;
|
||||
|
||||
Info<<"Remove extension " << (input1.removeExt());
|
||||
Info<< " now: " << input1 << nl;
|
||||
|
||||
Info<<"Remove extension " << (endWithSlash.remove_ext());
|
||||
Info<<"Remove extension " << (endWithSlash.removeExt());
|
||||
Info<< " now: " << endWithSlash << nl;
|
||||
|
||||
wordList exts{ "jpg", "png", "txt", word::null };
|
||||
@ -367,14 +359,14 @@ int main(int argc, char *argv[])
|
||||
Info<< nl;
|
||||
|
||||
|
||||
Info<<"Test has_ext(word)" << nl
|
||||
Info<<"Test hasExt(word)" << nl
|
||||
<<"~~~~~~~~~~~~~~~~~" << nl;
|
||||
Info<<"Has extension(s):" << nl
|
||||
<< "input: " << input1 << nl;
|
||||
for (const word& e : exts)
|
||||
{
|
||||
Info<<" '" << e << "' -> "
|
||||
<< Switch(input1.has_ext(e)) << nl;
|
||||
<< Switch(input1.hasExt(e)) << nl;
|
||||
}
|
||||
Info<< nl;
|
||||
|
||||
@ -383,12 +375,12 @@ int main(int argc, char *argv[])
|
||||
for (const word& e : exts)
|
||||
{
|
||||
Info<<" '" << e << "' -> "
|
||||
<< Switch(endWithDot.has_ext(e)) << nl;
|
||||
<< Switch(endWithDot.hasExt(e)) << nl;
|
||||
}
|
||||
Info<< nl;
|
||||
|
||||
|
||||
Info<<"Test has_ext(wordRe)" << nl
|
||||
Info<<"Test hasExt(wordRe)" << nl
|
||||
<<"~~~~~~~~~~~~~~~~~~~" << nl;
|
||||
|
||||
// A regex with a zero length matcher doesn't work at all:
|
||||
@ -401,25 +393,25 @@ int main(int argc, char *argv[])
|
||||
Info<<"Has extension(s):" << nl
|
||||
<< "input: " << endWithDot << nl;
|
||||
Info<<" " << matcher0 << " -> "
|
||||
<< Switch(endWithDot.has_ext(matcher0)) << nl;
|
||||
<< Switch(endWithDot.hasExt(matcher0)) << nl;
|
||||
Info<<" " << matcher1 << " -> "
|
||||
<< Switch(endWithDot.has_ext(matcher1)) << nl;
|
||||
<< Switch(endWithDot.hasExt(matcher1)) << nl;
|
||||
Info<<" " << matcher2 << " -> "
|
||||
<< Switch(endWithDot.has_ext(matcher2)) << nl;
|
||||
<< Switch(endWithDot.hasExt(matcher2)) << nl;
|
||||
|
||||
Info<< "input: " << input1 << nl;
|
||||
Info<<" " << matcher0 << " -> "
|
||||
<< Switch(input1.has_ext(matcher0)) << nl;
|
||||
<< Switch(input1.hasExt(matcher0)) << nl;
|
||||
Info<<" " << matcher1 << " -> "
|
||||
<< Switch(input1.has_ext(matcher1)) << nl;
|
||||
<< Switch(input1.hasExt(matcher1)) << nl;
|
||||
Info<<" " << matcher2 << " -> "
|
||||
<< Switch(input1.has_ext(matcher2)) << nl;
|
||||
<< Switch(input1.hasExt(matcher2)) << nl;
|
||||
Info<< nl;
|
||||
|
||||
Info<<"Remove extension(s):" << nl << "input: " << input1 << nl;
|
||||
while (!input1.empty())
|
||||
{
|
||||
if (input1.remove_ext())
|
||||
if (input1.removeExt())
|
||||
{
|
||||
Info<< " -> " << input1 << nl;
|
||||
}
|
||||
@ -595,54 +587,14 @@ int main(int argc, char *argv[])
|
||||
if (args.found("system"))
|
||||
{
|
||||
const fileName dirA("dirA");
|
||||
const fileName dirB("dirB");
|
||||
const fileName dirC("dirC");
|
||||
const fileName dirD("dirD");
|
||||
const fileName lnA("lnA");
|
||||
const fileName lnB("lnB");
|
||||
const fileName dirB("dirB");
|
||||
|
||||
// Purge anything existing
|
||||
Foam::rmDir(dirA, true);
|
||||
Foam::rmDir(dirB, true);
|
||||
Foam::rmDir(dirC, true);
|
||||
Foam::rmDir(dirD, true);
|
||||
Foam::rmDir(dirA);
|
||||
Foam::rm(lnA);
|
||||
Foam::rm(lnB);
|
||||
|
||||
{
|
||||
fileName name(dirA/dirB/dirC/"abc");
|
||||
Foam::mkDir(name.path());
|
||||
touchFileContent(name); // Create real file
|
||||
|
||||
Foam::mkDir(dirB/dirB/dirB/dirB);
|
||||
Foam::ln("test", dirB/"linkB"); // Create dead link
|
||||
|
||||
Foam::mkDir(dirC);
|
||||
Foam::ln("../dirD", dirC/"linkC"); // Create real link
|
||||
|
||||
Foam::mkDir(dirD);
|
||||
|
||||
for (const fileName& d : { dirA, dirB, dirC, dirD })
|
||||
{
|
||||
Info<< "Directory: " << d << " = "
|
||||
<< readDir(d, fileName::UNDEFINED, false, false) << nl;
|
||||
|
||||
if (Foam::rmDir(d, false, true))
|
||||
{
|
||||
Info<< " Removed empty dir" << nl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " Could not remove empty dir" << nl;
|
||||
}
|
||||
}
|
||||
|
||||
// Force removal before continuing
|
||||
Foam::rmDir(dirA, true);
|
||||
Foam::rmDir(dirB, true);
|
||||
Foam::rmDir(dirC, true);
|
||||
Foam::rmDir(dirD, true);
|
||||
}
|
||||
Foam::rmDir(dirB);
|
||||
|
||||
Info<< nl << "=========================" << nl
|
||||
<< "Test some copying and deletion" << endl;
|
||||
@ -666,7 +618,9 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
Info<<" create: " << file << endl;
|
||||
touchFileContent(file);
|
||||
|
||||
std::ofstream os(file);
|
||||
os << "file=<" << file << ">" << nl;
|
||||
}
|
||||
|
||||
const int oldDebug = POSIX::debug;
|
||||
@ -754,7 +708,7 @@ int main(int argc, char *argv[])
|
||||
"hello1",
|
||||
"hello2",
|
||||
"hello3",
|
||||
"hello4.ext"
|
||||
"hello4.hmm"
|
||||
};
|
||||
|
||||
fileName pathName(wrdList);
|
||||
@ -764,28 +718,14 @@ int main(int argc, char *argv[])
|
||||
<< "pathName.name() = >" << pathName.name() << "<\n"
|
||||
<< "pathName.path() = " << pathName.path() << nl
|
||||
<< "pathName.ext() = >" << pathName.ext() << "<\n"
|
||||
<< "pathName.stem = >" << pathName.stem() << "<\n";
|
||||
<< "pathName.nameLessExt= >" << pathName.nameLessExt() << "<\n";
|
||||
|
||||
Info<< "pathName.components() = " << pathName.components() << nl
|
||||
<< "pathName.component(2) = " << pathName.component(2) << nl
|
||||
<< endl;
|
||||
|
||||
pathName.replace_name("newName.ext");
|
||||
Info<< "new name = " << pathName << nl;
|
||||
Info<< "has ext = " << Switch::name(pathName.has_ext()) << nl;
|
||||
Info<< "has ext('') = " << Switch::name(pathName.has_ext("")) << nl;
|
||||
Info<< "has ext(foo) = " << Switch::name(pathName.has_ext("foo")) << nl;
|
||||
Info<< "has ext(ext) = " << Switch::name(pathName.has_ext("ext")) << nl;
|
||||
|
||||
pathName.replace_ext("png");
|
||||
Info<< "new ext = " << pathName << nl;
|
||||
|
||||
pathName.replace_ext(""); // Same as remove_ext
|
||||
Info<< "new ext = " << pathName << nl;
|
||||
|
||||
Info<< "has path = " << Switch::name(pathName.has_path()) << nl;
|
||||
pathName.remove_path();
|
||||
pathName.removePath(); // second type should be a no-op
|
||||
Info<< "hasPath = " << Switch(pathName.hasPath()) << nl;
|
||||
pathName.removePath();
|
||||
Info<< "removed path = " << pathName << nl;
|
||||
|
||||
Info<< nl << nl;
|
||||
|
||||
@ -64,8 +64,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Slightly extended bb. Slightly off-centred just so on symmetric
|
||||
// geometry there are less face/edge aligned items.
|
||||
treeBoundBox bb(efem.points());
|
||||
bb.grow(ROOTVSMALL);
|
||||
treeBoundBox bb
|
||||
(
|
||||
efem.points()
|
||||
);
|
||||
|
||||
bb.min() -= point::uniform(ROOTVSMALL);
|
||||
bb.max() += point::uniform(ROOTVSMALL);
|
||||
|
||||
labelList allEdges(identity(efem.edges().size()));
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -61,10 +61,10 @@ int main(int argc, char *argv[])
|
||||
InfoErr<< "output: " << outputName;
|
||||
|
||||
IOstreamOption::compressionType comp(IOstreamOption::UNCOMPRESSED);
|
||||
if (outputName.has_ext("gz"))
|
||||
if (outputName.hasExt("gz"))
|
||||
{
|
||||
comp = IOstreamOption::COMPRESSED;
|
||||
outputName.remove_ext();
|
||||
outputName.removeExt();
|
||||
|
||||
InfoErr<< " [compress]";
|
||||
}
|
||||
|
||||
@ -204,7 +204,7 @@ int main(int argc, char *argv[])
|
||||
labelPair inOut;
|
||||
pointField allCcs(globalNumbering.gather(mesh.cellCentres()));
|
||||
inOut[0] = allCcs.size();
|
||||
Pstream::broadcast(allCcs);
|
||||
Pstream::scatter(allCcs);
|
||||
inOut[1] = allCcs.size();
|
||||
Pout<< " " << inOut << endl;
|
||||
|
||||
|
||||
@ -41,8 +41,8 @@ void printInfo(const labelRange& range)
|
||||
<< "last " << range.last() << nl
|
||||
<< "min " << range.min() << nl
|
||||
<< "max " << range.max() << nl
|
||||
<< "end " << range.end_value() << nl
|
||||
<< "begin/end " << *range.cbegin() << ' ' << *range.cend() << nl;
|
||||
<< "after " << range.after() << nl
|
||||
<< "begin end " << *range.cbegin() << ' ' << *range.cend() << nl;
|
||||
|
||||
// Info<< "rbegin rend " << *range.rbegin() << ' ' << *range.rend() << nl;
|
||||
}
|
||||
@ -56,7 +56,7 @@ int main(int argc, char *argv[])
|
||||
argList::noParallel();
|
||||
argList::noFunctionObjects();
|
||||
argList::addArgument("start size .. startN sizeN");
|
||||
argList::addVerboseOption("enable labelRange::debug");
|
||||
argList::addVerbose("enable labelRange::debug");
|
||||
argList::addNote
|
||||
(
|
||||
"The default is to add ranges, use 'add' and 'del' to toggle\n\n"
|
||||
|
||||
@ -44,7 +44,7 @@ using namespace Foam;
|
||||
template<class T>
|
||||
Ostream& printInfo(const MinMax<T>& range)
|
||||
{
|
||||
Info<< range << " good=" << range.good() << " span=" << range.span();
|
||||
Info<< range << " valid=" << range.valid() << " span=" << range.span();
|
||||
|
||||
return Info;
|
||||
}
|
||||
@ -234,7 +234,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
Pout<< "hashed: " << hashed << nl;
|
||||
|
||||
Pstream::mapCombineReduce(hashed, plusEqOp<scalarMinMax>());
|
||||
Pstream::mapCombineGather
|
||||
(
|
||||
hashed,
|
||||
plusEqOp<scalarMinMax>()
|
||||
);
|
||||
|
||||
Info<< "reduced: " << hashed << nl;
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ using namespace Foam;
|
||||
template<class T>
|
||||
Ostream& printInfo(const MinMax<T>& range)
|
||||
{
|
||||
Info<< range << " good=" << range.good();
|
||||
Info<< range << " valid=" << range.valid();
|
||||
|
||||
return Info;
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EXE_INC = $(COMP_OPENMP)
|
||||
EXE_INC = $(COMP_OPENMP) /* -UUSE_OMP */
|
||||
|
||||
/* Mostly do not need to explicitly link openmp libraries */
|
||||
/* EXE_LIBS = $(LINK_OPENMP) */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -41,6 +41,12 @@ Description
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#if USE_OMP
|
||||
std::cout << "USE_OMP defined (" << USE_OMP << ")\n";
|
||||
#else
|
||||
std::cout << "USE_OMP undefined\n";
|
||||
#endif
|
||||
|
||||
#if _OPENMP
|
||||
std::cout << "_OPENMP = " << _OPENMP << "\n\n";
|
||||
|
||||
|
||||
@ -167,7 +167,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
localValue,
|
||||
sumOp<scalar>(),
|
||||
UPstream::msgType(),
|
||||
Pstream::msgType(),
|
||||
comm
|
||||
);
|
||||
Pout<< "sum :" << sum << endl;
|
||||
|
||||
@ -125,13 +125,13 @@ int main(int argc, char *argv[])
|
||||
scalar data1 = 1.0;
|
||||
label request1 = -1;
|
||||
{
|
||||
Foam::reduce(data1, sumOp<scalar>(), UPstream::msgType(), request1);
|
||||
Foam::reduce(data1, sumOp<scalar>(), Pstream::msgType(), request1);
|
||||
}
|
||||
|
||||
scalar data2 = 0.1;
|
||||
label request2 = -1;
|
||||
{
|
||||
Foam::reduce(data2, sumOp<scalar>(), UPstream::msgType(), request2);
|
||||
Foam::reduce(data2, sumOp<scalar>(), Pstream::msgType(), request2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -232,7 +232,6 @@ int main(int argc, char *argv[])
|
||||
const labelListList& edgeFaces = pp.edgeFaces();
|
||||
const labelListList& faceEdges = pp.faceEdges();
|
||||
|
||||
Pout<< "box: " << pp.box() << endl;
|
||||
|
||||
checkFaceEdges(localFaces, edges, faceEdges);
|
||||
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
Test-rawIOField.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-rawIOField
|
||||
@ -1,9 +0,0 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/fileFormats/lnInclude \
|
||||
-I$(LIB_SRC)/surfMesh/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfileFormats \
|
||||
-lsurfMesh \
|
||||
-lmeshTools
|
||||
@ -1,168 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2022 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/>.
|
||||
|
||||
Application
|
||||
Test-rawIOField
|
||||
|
||||
Description
|
||||
Reading rawIOField from disk
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
#include "Time.H"
|
||||
#include "Switch.H"
|
||||
#include "primitiveFields.H"
|
||||
#include "pointField.H"
|
||||
#include "rawIOField.H"
|
||||
#include "exprTraits.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
#undef USE_ROOT_CASE
|
||||
//#define USE_ROOT_CASE
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type>> readRawField
|
||||
(
|
||||
const IOobject& io,
|
||||
IOobjectOption::readOption withAverage
|
||||
)
|
||||
{
|
||||
rawIOField<Type> raw(io, withAverage);
|
||||
|
||||
Info<< "File: " << io.objectPath() << nl
|
||||
<< "Read: " << raw.size()
|
||||
<< ' ' << pTraits<Type>::typeName << " entries" << nl
|
||||
<< "Average: " << Switch::name(raw.hasAverage())
|
||||
<< " = " << raw.average() << endl;
|
||||
|
||||
return tmp<Field<Type>>::New(std::move(static_cast<Field<Type>&>(raw)));
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::addNote
|
||||
(
|
||||
"Test behaviour of rawIOField reading (writing?)"
|
||||
);
|
||||
|
||||
argList::noCheckProcessorDirectories();
|
||||
|
||||
argList::addBoolOption("scalar", "Read scalar field");
|
||||
argList::addBoolOption("vector", "Read vector field");
|
||||
argList::addBoolOption("point", "Read point field");
|
||||
argList::addBoolOption("average", "Require averaged value entry");
|
||||
argList::addBoolOption("try-average", "Optional averaged value entry");
|
||||
|
||||
argList::addArgument("fileName");
|
||||
|
||||
#ifdef USE_ROOT_CASE
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#else
|
||||
// Without root case, or time
|
||||
argList args(argc, argv);
|
||||
#endif
|
||||
|
||||
fileName inputName = args.get<fileName>(1);
|
||||
|
||||
IOobjectOption::readOption withAverage = IOobjectOption::NO_READ;
|
||||
|
||||
if (args.found("average"))
|
||||
{
|
||||
withAverage = IOobjectOption::MUST_READ;
|
||||
}
|
||||
else if (args.found("try-average"))
|
||||
{
|
||||
withAverage = IOobjectOption::READ_IF_PRESENT;
|
||||
}
|
||||
|
||||
Info<< "Using case: " << argList::envGlobalPath() << nl
|
||||
<< "Read file: " << inputName << nl
|
||||
<< "with average: " << int(withAverage) << nl
|
||||
<< endl;
|
||||
|
||||
|
||||
refPtr<Time> timePtr;
|
||||
|
||||
#ifdef USE_ROOT_CASE
|
||||
timePtr.cref(runTime);
|
||||
#endif
|
||||
|
||||
// Fallback (eg, no runTime)
|
||||
if (!timePtr.good())
|
||||
{
|
||||
timePtr.reset(Time::New(argList::envGlobalPath()));
|
||||
}
|
||||
|
||||
|
||||
const auto& tm = timePtr();
|
||||
|
||||
fileName resolvedName(inputName);
|
||||
resolvedName.toAbsolute();
|
||||
|
||||
IOobject io
|
||||
(
|
||||
resolvedName, // absolute path
|
||||
tm,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
IOobject::NO_REGISTER,
|
||||
true // is global object (currently not used)
|
||||
);
|
||||
|
||||
|
||||
if (args.found("scalar"))
|
||||
{
|
||||
auto tfield = readRawField<scalar>(io, withAverage);
|
||||
}
|
||||
else if (args.found("point"))
|
||||
{
|
||||
auto tfield = readRawField<point>(io, withAverage);
|
||||
}
|
||||
else if (args.found("vector"))
|
||||
{
|
||||
auto tfield = readRawField<vector>(io, withAverage);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "no data type specified!\n";
|
||||
}
|
||||
|
||||
Info<< nl << "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -135,7 +135,6 @@ int main(int argc, char *argv[])
|
||||
cout<<"string:" << sizeof(Foam::string) << nl;
|
||||
}
|
||||
|
||||
cout<<"IOobjectOption:" << sizeof(Foam::IOobjectOption) << nl;
|
||||
cout<<"IOobject:" << sizeof(Foam::IOobject) << nl;
|
||||
cout<<"IOstream:" << sizeof(Foam::IOstream) << nl;
|
||||
cout<<"PstreamBuffers:" << sizeof(Foam::PstreamBuffers) << nl;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -91,15 +91,15 @@ int main(int argc, char *argv[])
|
||||
|
||||
const auto importName = args.get<fileName>(1);
|
||||
|
||||
word ext =
|
||||
(
|
||||
importName.has_ext("gz")
|
||||
? importName.stem().ext()
|
||||
: importName.ext()
|
||||
);
|
||||
|
||||
// Allow override of extension
|
||||
args.readIfPresent("ext", ext);
|
||||
word ext;
|
||||
if (!args.readIfPresent("ext", ext))
|
||||
{
|
||||
ext = importName.ext();
|
||||
if (ext == "gz")
|
||||
{
|
||||
ext = importName.lessExt().ext();
|
||||
}
|
||||
}
|
||||
|
||||
args.readIfPresent("stl-parser", fileFormats::STLReader::parserType);
|
||||
|
||||
|
||||
@ -33,7 +33,6 @@ Description
|
||||
|
||||
#include "vectorField.H"
|
||||
#include "IOstreams.H"
|
||||
#include "Random.H"
|
||||
#include <algorithm>
|
||||
#include <random>
|
||||
|
||||
@ -75,12 +74,8 @@ void doTest(vector& vec1, vector& vec2)
|
||||
printInfo(vec1);
|
||||
printInfo(vec2);
|
||||
|
||||
Info<< "vector: " << vec1 << nl
|
||||
<< "vector: " << vec2 << nl
|
||||
<< " min: " << min(vec1, vec2) << nl
|
||||
<< " dist: " << vec1.dist(vec2) << ' ' << mag(vec1 - vec2) << nl
|
||||
<< "dist^2: " << vec1.distSqr(vec2) << ' ' << magSqr(vec1 - vec2) << nl
|
||||
<< nl;
|
||||
Info<< "min of " << vec1 << " and " << vec2 << " = "
|
||||
<< min(vec1, vec2) << nl << nl;
|
||||
}
|
||||
|
||||
|
||||
@ -151,46 +146,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
std::shuffle(vec2.begin(), vec2.end(), std::default_random_engine());
|
||||
Info<< "shuffled: " << vec2 << nl;
|
||||
|
||||
// Vectors with some identical components
|
||||
List<vector> vectors
|
||||
({
|
||||
{1.1, 2.2, 3.3 },
|
||||
{2.2, 3.3, 4.4 },
|
||||
{-1.1, 2.2, 3.3 },
|
||||
{-2.2, 3.3, 4.4 },
|
||||
|
||||
{-1.1, -2.2, 3.3 },
|
||||
{-2.2, -3.3, 4.4 },
|
||||
|
||||
{-1.1, -2.2, -3.3 },
|
||||
{-2.2, -3.3, -4.4 },
|
||||
{-3.3, 2.1, 12 },
|
||||
{3.145, 1.6, 2 },
|
||||
|
||||
{0, 0, 0}
|
||||
});
|
||||
|
||||
shuffle(vectors);
|
||||
|
||||
Info<< "initial vectors: ";
|
||||
vectors.writeList(Info, 1) << nl;
|
||||
|
||||
Foam::sort(vectors);
|
||||
Info<< "regular sort:";
|
||||
vectors.writeList(Info, 1) << nl;
|
||||
|
||||
std::sort(vectors.begin(), vectors.end(), vector::less_xyz);
|
||||
Info<< "sorted xyz:";
|
||||
vectors.writeList(Info, 1) << nl;
|
||||
|
||||
std::sort(vectors.begin(), vectors.end(), vector::less_yzx);
|
||||
Info<< "sorted yzx:";
|
||||
vectors.writeList(Info, 1) << nl;
|
||||
|
||||
std::sort(vectors.begin(), vectors.end(), vector::less_zxy);
|
||||
Info<< "sorted zxy:";
|
||||
vectors.writeList(Info, 1) << nl;
|
||||
}
|
||||
|
||||
// Basic tests for fields
|
||||
|
||||
@ -585,7 +585,7 @@ void createBaffles
|
||||
// Wrapper around find patch. Also makes sure same patch in parallel.
|
||||
label findPatch(const polyBoundaryMesh& patches, const word& patchName)
|
||||
{
|
||||
const label patchi = patches.findPatchID(patchName);
|
||||
label patchi = patches.findPatchID(patchName);
|
||||
|
||||
if (patchi == -1)
|
||||
{
|
||||
@ -597,15 +597,16 @@ label findPatch(const polyBoundaryMesh& patches, const word& patchName)
|
||||
|
||||
// Check same patch for all procs
|
||||
{
|
||||
const label newPatchi = returnReduce(patchi, minOp<label>());
|
||||
label newPatch = patchi;
|
||||
reduce(newPatch, minOp<label>());
|
||||
|
||||
if (newPatchi != patchi)
|
||||
if (newPatch != patchi)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Patch " << patchName
|
||||
<< " should have the same patch index on all processors." << nl
|
||||
<< "On my processor it has index " << patchi
|
||||
<< " ; on some other processor it has index " << newPatchi
|
||||
<< " ; on some other processor it has index " << newPatch
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -397,11 +396,12 @@ int main(int argc, char *argv[])
|
||||
meshSearch queryMesh(mesh);
|
||||
|
||||
// Check all 'outside' points
|
||||
for (const point& outsidePoint : outsidePts)
|
||||
forAll(outsidePts, outsideI)
|
||||
{
|
||||
const label celli = queryMesh.findCell(outsidePoint, -1, false);
|
||||
const point& outsidePoint = outsidePts[outsideI];
|
||||
|
||||
if (returnReduceAnd(celli < 0))
|
||||
label celli = queryMesh.findCell(outsidePoint, -1, false);
|
||||
if (returnReduce(celli, maxOp<label>()) == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "outsidePoint " << outsidePoint
|
||||
|
||||
@ -142,26 +142,26 @@ scalar getEdgeStats(const primitiveMesh& mesh, const direction excludeCmpt)
|
||||
|
||||
if (mag(eVec & x) > 1-edgeTol)
|
||||
{
|
||||
minX = Foam::min(minX, eMag);
|
||||
maxX = Foam::max(maxX, eMag);
|
||||
minX = min(minX, eMag);
|
||||
maxX = max(maxX, eMag);
|
||||
nX++;
|
||||
}
|
||||
else if (mag(eVec & y) > 1-edgeTol)
|
||||
{
|
||||
minY = Foam::min(minY, eMag);
|
||||
maxY = Foam::max(maxY, eMag);
|
||||
minY = min(minY, eMag);
|
||||
maxY = max(maxY, eMag);
|
||||
nY++;
|
||||
}
|
||||
else if (mag(eVec & z) > 1-edgeTol)
|
||||
{
|
||||
minZ = Foam::min(minZ, eMag);
|
||||
maxZ = Foam::max(maxZ, eMag);
|
||||
minZ = min(minZ, eMag);
|
||||
maxZ = max(maxZ, eMag);
|
||||
nZ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
minOther = Foam::min(minOther, eMag);
|
||||
maxOther = Foam::max(maxOther, eMag);
|
||||
minOther = min(minOther, eMag);
|
||||
maxOther = max(maxOther, eMag);
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,19 +179,19 @@ scalar getEdgeStats(const primitiveMesh& mesh, const direction excludeCmpt)
|
||||
|
||||
if (excludeCmpt == 0)
|
||||
{
|
||||
return Foam::min(minY, Foam::min(minZ, minOther));
|
||||
return min(minY, min(minZ, minOther));
|
||||
}
|
||||
else if (excludeCmpt == 1)
|
||||
{
|
||||
return Foam::min(minX, Foam::min(minZ, minOther));
|
||||
return min(minX, min(minZ, minOther));
|
||||
}
|
||||
else if (excludeCmpt == 2)
|
||||
{
|
||||
return Foam::min(minX, Foam::min(minY, minOther));
|
||||
return min(minX, min(minY, minOther));
|
||||
}
|
||||
else
|
||||
{
|
||||
return Foam::min(minX, Foam::min(minY, Foam::min(minZ, minOther)));
|
||||
return min(minX, min(minY, min(minZ, minOther)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -771,7 +771,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
Info<< "Read existing refinement level from file "
|
||||
<< refLevel.objectPath() << nl
|
||||
<< " min level : " << Foam::min(refLevel) << nl
|
||||
<< " min level : " << min(refLevel) << nl
|
||||
<< " max level : " << maxLevel << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -175,7 +175,7 @@ int main(int argc, char *argv[])
|
||||
// strip erroneous extension (.ccm, .ccmg, .ccmp)
|
||||
if (ext == "ccm" || ext == "ccmg" || ext == "ccmp")
|
||||
{
|
||||
exportName.remove_ext();
|
||||
exportName = exportName.lessExt();
|
||||
}
|
||||
}
|
||||
else if (args.found("export"))
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -137,7 +137,7 @@ int main(int argc, char *argv[])
|
||||
// strip erroneous extension (.ccm, .ccmg, .ccmp)
|
||||
if (ext == "ccm" || ext == "ccmg" || ext == "ccmp")
|
||||
{
|
||||
exportName.remove_ext();
|
||||
exportName = exportName.lessExt();
|
||||
}
|
||||
}
|
||||
else if (args.found("case"))
|
||||
|
||||
@ -271,7 +271,7 @@ int main(int argc, char *argv[])
|
||||
if (blockPFacePointi != blockPFacePointi2)
|
||||
{
|
||||
sqrMergeTol =
|
||||
Foam::min
|
||||
min
|
||||
(
|
||||
sqrMergeTol,
|
||||
magSqr
|
||||
@ -338,16 +338,16 @@ int main(int argc, char *argv[])
|
||||
blockNFacePoints[blockNFacePointi]
|
||||
+ blockOffsets[blockNlabel];
|
||||
|
||||
label minPN = Foam::min(PpointLabel, NpointLabel);
|
||||
label minPN = min(PpointLabel, NpointLabel);
|
||||
|
||||
if (pointMergeList[PpointLabel] != -1)
|
||||
{
|
||||
minPN = Foam::min(minPN, pointMergeList[PpointLabel]);
|
||||
minPN = min(minPN, pointMergeList[PpointLabel]);
|
||||
}
|
||||
|
||||
if (pointMergeList[NpointLabel] != -1)
|
||||
{
|
||||
minPN = Foam::min(minPN, pointMergeList[NpointLabel]);
|
||||
minPN = min(minPN, pointMergeList[NpointLabel]);
|
||||
}
|
||||
|
||||
pointMergeList[PpointLabel]
|
||||
@ -411,7 +411,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
pointMergeList[PpointLabel]
|
||||
= pointMergeList[NpointLabel]
|
||||
= Foam::min
|
||||
= min
|
||||
(
|
||||
pointMergeList[PpointLabel],
|
||||
pointMergeList[NpointLabel]
|
||||
@ -757,7 +757,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(Foam::max(10u, IOstream::defaultPrecision()));
|
||||
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
|
||||
|
||||
Info<< "Writing polyMesh" << endl;
|
||||
pShapeMesh.removeFiles();
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -87,8 +87,8 @@ int main(int argc, char *argv[])
|
||||
const scalar scaleFactor = args.getOrDefault<scalar>("scale", 0);
|
||||
const bool doTriangulate = args.found("tri");
|
||||
|
||||
const fileName exportBase = exportName.lessExt();
|
||||
const word exportExt = exportName.ext();
|
||||
fileName exportBase = exportName.lessExt();
|
||||
word exportExt = exportName.ext();
|
||||
|
||||
if (!meshedSurface::canWriteType(exportExt, true))
|
||||
{
|
||||
|
||||
@ -350,7 +350,7 @@ mtype {space}"MTYPE:"{space}
|
||||
// Find out how many labels are expected. If less or equal to
|
||||
// seven, read them all and finish with it. If there is more,
|
||||
// set read of the next line
|
||||
label labelsToRead = Foam::min(8, nVertices);
|
||||
label labelsToRead = min(8, nVertices);
|
||||
label labelI = 0;
|
||||
for (; labelI < labelsToRead; labelI++)
|
||||
{
|
||||
@ -387,7 +387,7 @@ mtype {space}"MTYPE:"{space}
|
||||
|
||||
labelList& curLabels = cellLabels[curNumberOfCells];
|
||||
|
||||
label labelsToRead = Foam::min
|
||||
label labelsToRead = min
|
||||
(
|
||||
(nCellContinuationLines + 1)*7,
|
||||
curLabels.size()
|
||||
@ -869,7 +869,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(Foam::max(10u, IOstream::defaultPrecision()));
|
||||
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
|
||||
|
||||
Info<< "Writing polyMesh" << endl;
|
||||
pShapeMesh.removeFiles();
|
||||
|
||||
@ -269,7 +269,7 @@ void readCells
|
||||
label maxUnvPoint = 0;
|
||||
forAll(unvPointID, pointi)
|
||||
{
|
||||
maxUnvPoint = Foam::max(maxUnvPoint, unvPointID[pointi]);
|
||||
maxUnvPoint = max(maxUnvPoint, unvPointID[pointi]);
|
||||
}
|
||||
labelList unvToFoam(invert(maxUnvPoint+1, unvPointID));
|
||||
|
||||
@ -784,7 +784,7 @@ int main(int argc, char *argv[])
|
||||
label maxUnvPoint = 0;
|
||||
forAll(unvPointID, pointi)
|
||||
{
|
||||
maxUnvPoint = Foam::max(maxUnvPoint, unvPointID[pointi]);
|
||||
maxUnvPoint = max(maxUnvPoint, unvPointID[pointi]);
|
||||
}
|
||||
labelList unvToFoam(invert(maxUnvPoint+1, unvPointID));
|
||||
|
||||
@ -1281,7 +1281,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(Foam::max(10u, IOstream::defaultPrecision()));
|
||||
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
|
||||
|
||||
mesh.write();
|
||||
|
||||
|
||||
@ -8,10 +8,10 @@
|
||||
{
|
||||
if (kivaVersion == kiva3v)
|
||||
{
|
||||
regionIndex = Foam::max
|
||||
regionIndex = max
|
||||
(
|
||||
Foam::max(idface[quadFace[0]], idface[quadFace[1]]),
|
||||
Foam::max(idface[quadFace[2]], idface[quadFace[3]])
|
||||
max(idface[quadFace[0]], idface[quadFace[1]]),
|
||||
max(idface[quadFace[2]], idface[quadFace[3]])
|
||||
);
|
||||
|
||||
if (regionIndex > 0)
|
||||
|
||||
@ -148,7 +148,7 @@ for (label i=0; i<nPoints; i++)
|
||||
end = pointMap[end];
|
||||
}
|
||||
|
||||
label minLabel = Foam::min(start, end);
|
||||
label minLabel = min(start, end);
|
||||
|
||||
pointMap[start] = pointMap[end] = minLabel;
|
||||
}
|
||||
@ -331,7 +331,7 @@ if
|
||||
{
|
||||
forAll(pf, pfi)
|
||||
{
|
||||
minz = Foam::min(minz, points[pf[pfi]].z());
|
||||
minz = min(minz, points[pf[pfi]].z());
|
||||
}
|
||||
}
|
||||
|
||||
@ -344,7 +344,7 @@ if
|
||||
scalar minfz = GREAT;
|
||||
forAll(pf, pfi)
|
||||
{
|
||||
minfz = Foam::min(minfz, points[pf[pfi]].z());
|
||||
minfz = min(minfz, points[pf[pfi]].z());
|
||||
}
|
||||
|
||||
if (minfz > minz)
|
||||
@ -371,7 +371,7 @@ if
|
||||
scalar minfz = GREAT;
|
||||
forAll(pf, pfi)
|
||||
{
|
||||
minfz = Foam::min(minfz, points[pf[pfi]].z());
|
||||
minfz = min(minfz, points[pf[pfi]].z());
|
||||
}
|
||||
|
||||
if (minfz < zHeadMin)
|
||||
@ -570,7 +570,7 @@ polyMesh pShapeMesh
|
||||
);
|
||||
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(Foam::max(10u, IOstream::defaultPrecision()));
|
||||
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
|
||||
|
||||
Info << "Writing polyMesh" << endl;
|
||||
pShapeMesh.removeFiles();
|
||||
|
||||
@ -188,7 +188,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
maxPatch = Foam::max(maxPatch, patchi);
|
||||
maxPatch = max(maxPatch, patchi);
|
||||
|
||||
triFace tri(readLabel(str)-1, readLabel(str)-1, readLabel(str)-1);
|
||||
|
||||
@ -319,7 +319,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(Foam::max(10u, IOstream::defaultPrecision()));
|
||||
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
|
||||
|
||||
Info<< "Writing mesh ..." << endl;
|
||||
mesh.removeFiles();
|
||||
|
||||
@ -538,11 +538,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Add any patches.
|
||||
|
||||
const label nAdded = returnReduce
|
||||
(
|
||||
nPatches - mesh.boundaryMesh().size(),
|
||||
sumOp<label>()
|
||||
);
|
||||
label nAdded = nPatches - mesh.boundaryMesh().size();
|
||||
reduce(nAdded, sumOp<label>());
|
||||
|
||||
Info<< "Adding overall " << nAdded << " processor patches." << endl;
|
||||
|
||||
@ -949,8 +946,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Put all modifications into meshMod
|
||||
bool anyChange = collapser.setRefinement(allPointInfo, meshMod);
|
||||
reduce(anyChange, orOp<bool>());
|
||||
|
||||
if (returnReduceOr(anyChange))
|
||||
if (anyChange)
|
||||
{
|
||||
// Construct new mesh from polyTopoChange.
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
||||
@ -1120,7 +1118,8 @@ int main(int argc, char *argv[])
|
||||
processorMeshes::removeFiles(mesh);
|
||||
|
||||
// Need writing cellSet
|
||||
if (returnReduceOr(addedCellsSet.size()))
|
||||
label nAdded = returnReduce(addedCellsSet.size(), sumOp<label>());
|
||||
if (nAdded > 0)
|
||||
{
|
||||
cellSet addedCells(mesh, "addedCells", addedCellsSet);
|
||||
Info<< "Writing added cells to cellSet " << addedCells.name()
|
||||
|
||||
@ -345,7 +345,7 @@ void deleteEmptyPatches(fvMesh& mesh)
|
||||
else
|
||||
{
|
||||
// Common patch.
|
||||
if (returnReduceAnd(patches[patchi].empty()))
|
||||
if (returnReduce(patches[patchi].empty(), andOp<bool>()))
|
||||
{
|
||||
Pout<< "Deleting patch " << patchi
|
||||
<< " name:" << patches[patchi].name()
|
||||
@ -556,8 +556,8 @@ void calcEdgeMinMaxZone
|
||||
forAll(eFaces, i)
|
||||
{
|
||||
label zoneI = mappedZoneID[eFaces[i]];
|
||||
minZoneID[edgeI] = Foam::min(minZoneID[edgeI], zoneI);
|
||||
maxZoneID[edgeI] = Foam::max(maxZoneID[edgeI], zoneI);
|
||||
minZoneID[edgeI] = min(minZoneID[edgeI], zoneI);
|
||||
maxZoneID[edgeI] = max(maxZoneID[edgeI], zoneI);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -661,8 +661,8 @@ void countExtrudePatches
|
||||
}
|
||||
// Synchronise decision. Actual numbers are not important, just make
|
||||
// sure that they're > 0 on all processors.
|
||||
Pstream::listCombineReduce(zoneSidePatch, plusEqOp<label>());
|
||||
Pstream::listCombineReduce(zoneZonePatch, plusEqOp<label>());
|
||||
Pstream::listCombineAllGather(zoneSidePatch, plusEqOp<label>());
|
||||
Pstream::listCombineAllGather(zoneZonePatch, plusEqOp<label>());
|
||||
}
|
||||
|
||||
|
||||
@ -813,8 +813,8 @@ void addCoupledPatches
|
||||
forAll(eFaces, i)
|
||||
{
|
||||
label proci = procID[eFaces[i]];
|
||||
minProcID[edgeI] = Foam::min(minProcID[edgeI], proci);
|
||||
maxProcID[edgeI] = Foam::max(maxProcID[edgeI], proci);
|
||||
minProcID[edgeI] = min(minProcID[edgeI], proci);
|
||||
maxProcID[edgeI] = max(maxProcID[edgeI], proci);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1291,7 +1291,7 @@ void extrudeGeometricProperties
|
||||
label celli = regionMesh.faceOwner()[facei];
|
||||
if (regionMesh.isInternalFace(facei))
|
||||
{
|
||||
celli = Foam::max(celli, regionMesh.faceNeighbour()[facei]);
|
||||
celli = max(celli, regionMesh.faceNeighbour()[facei]);
|
||||
}
|
||||
|
||||
// Calculate layer from cell numbering (see createShellMesh)
|
||||
@ -1848,7 +1848,7 @@ int main(int argc, char *argv[])
|
||||
const primitiveFacePatch extrudePatch(std::move(zoneFaces), mesh.points());
|
||||
|
||||
|
||||
Pstream::listCombineReduce(isInternal, orEqOp<bool>());
|
||||
Pstream::listCombineAllGather(isInternal, orEqOp<bool>());
|
||||
|
||||
// Check zone either all internal or all external faces
|
||||
checkZoneInside(mesh, zoneNames, zoneID, extrudeMeshFaces, isInternal);
|
||||
@ -2192,8 +2192,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (zone0 != zone1) // || (cos(angle) > blabla))
|
||||
{
|
||||
label minZone = Foam::min(zone0,zone1);
|
||||
label maxZone = Foam::max(zone0,zone1);
|
||||
label minZone = min(zone0,zone1);
|
||||
label maxZone = max(zone0,zone1);
|
||||
label index = minZone*zoneNames.size()+maxZone;
|
||||
|
||||
ePatches.setSize(eFaces.size());
|
||||
@ -2309,7 +2309,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Reduce
|
||||
Pstream::mapCombineReduce(globalSum, plusEqOp<point>());
|
||||
Pstream::mapCombineAllGather(globalSum, plusEqOp<point>());
|
||||
|
||||
forAll(localToGlobalRegion, localRegionI)
|
||||
{
|
||||
|
||||
@ -588,8 +588,9 @@ Foam::label Foam::DistributedDelaunayMesh<Triangulation>::referVertices
|
||||
reduce(preInsertionSize, sumOp<label>());
|
||||
reduce(postInsertionSize, sumOp<label>());
|
||||
|
||||
label nTotalToInsert =
|
||||
returnReduce(referredVertices.size(), sumOp<label>());
|
||||
label nTotalToInsert = referredVertices.size();
|
||||
|
||||
reduce(nTotalToInsert, sumOp<label>());
|
||||
|
||||
if (preInsertionSize + nTotalToInsert != postInsertionSize)
|
||||
{
|
||||
|
||||
@ -167,7 +167,14 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
||||
{
|
||||
if (volumeStatus[celli] == volumeType::UNKNOWN)
|
||||
{
|
||||
treeBoundBox cellBb(mesh_.cells()[celli].box(mesh_));
|
||||
treeBoundBox cellBb
|
||||
(
|
||||
mesh_.cells()[celli].points
|
||||
(
|
||||
mesh_.faces(),
|
||||
mesh_.points()
|
||||
)
|
||||
);
|
||||
|
||||
if (geometry.overlaps(cellBb))
|
||||
{
|
||||
@ -217,7 +224,7 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
||||
);
|
||||
}
|
||||
|
||||
if (returnReduceAnd(newCellsToRefine.empty()))
|
||||
if (returnReduce(newCellsToRefine.size(), sumOp<label>()) == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@ -279,7 +286,14 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
||||
{
|
||||
if (volumeStatus[celli] == volumeType::UNKNOWN)
|
||||
{
|
||||
treeBoundBox cellBb(mesh_.cells()[celli].box(mesh_));
|
||||
treeBoundBox cellBb
|
||||
(
|
||||
mesh_.cells()[celli].points
|
||||
(
|
||||
mesh_.faces(),
|
||||
mesh_.points()
|
||||
)
|
||||
);
|
||||
|
||||
if (geometry.overlaps(cellBb))
|
||||
{
|
||||
@ -498,7 +512,14 @@ bool Foam::backgroundMeshDecomposition::refineCell
|
||||
|
||||
// const conformationSurfaces& geometry = geometryToConformTo_;
|
||||
|
||||
treeBoundBox cellBb(mesh_.cells()[celli].box(mesh_));
|
||||
treeBoundBox cellBb
|
||||
(
|
||||
mesh_.cells()[celli].points
|
||||
(
|
||||
mesh_.faces(),
|
||||
mesh_.points()
|
||||
)
|
||||
);
|
||||
|
||||
weightEstimate = 1.0;
|
||||
|
||||
@ -878,7 +899,7 @@ Foam::backgroundMeshDecomposition::distribute
|
||||
}
|
||||
}
|
||||
|
||||
if (returnReduceAnd(cellsToRefine.empty()))
|
||||
if (returnReduce(cellsToRefine.size(), sumOp<label>()) == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ public:
|
||||
return name_;
|
||||
}
|
||||
|
||||
Switch forceInitialPointInsertion() const noexcept
|
||||
const Switch& forceInitialPointInsertion() const
|
||||
{
|
||||
return forceInitialPointInsertion_;
|
||||
}
|
||||
|
||||
@ -92,7 +92,9 @@ bool Foam::controlMeshRefinement::detectEdge
|
||||
magSqr(a - b) < tolSqr
|
||||
)
|
||||
{
|
||||
pointFound.hitPoint(midPoint);
|
||||
pointFound.setPoint(midPoint);
|
||||
pointFound.setHit();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -262,7 +264,7 @@ void Foam::controlMeshRefinement::initialMeshPopulation
|
||||
const cellSizeAndAlignmentControl& controlFunction =
|
||||
controlFunctions[fI];
|
||||
|
||||
const Switch forceInsertion =
|
||||
const Switch& forceInsertion =
|
||||
controlFunction.forceInitialPointInsertion();
|
||||
|
||||
Info<< "Inserting points from " << controlFunction.name()
|
||||
@ -448,7 +450,7 @@ void Foam::controlMeshRefinement::initialMeshPopulation
|
||||
const cellSizeAndAlignmentControl& controlFunction =
|
||||
controlFunctions[fI];
|
||||
|
||||
const Switch forceInsertion =
|
||||
const Switch& forceInsertion =
|
||||
controlFunction.forceInitialPointInsertion();
|
||||
|
||||
Info<< "Inserting points from " << controlFunction.name()
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -298,7 +298,7 @@ Foam::tmp<Foam::triSurfacePointScalarField> Foam::automatic::load()
|
||||
(
|
||||
surface_.searchableSurface::time().constant()
|
||||
/ "triSurface"
|
||||
/ surfaceName_.stem() + "_cellSize"
|
||||
/ surfaceName_.nameLessExt() + "_cellSize"
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -38,7 +38,6 @@ Description
|
||||
#if defined(CGAL_VERSION_NR) && (CGAL_VERSION_NR < 1050211000)
|
||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wbitwise-instead-of-logical"
|
||||
|
||||
// ------------------------------------------------------------------------- //
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -87,17 +87,23 @@ void Foam::conformalVoronoiMesh::cellSizeMeshOverlapsBackground() const
|
||||
|
||||
boundBox cellSizeMeshBb = cellSizeMesh.bounds();
|
||||
|
||||
bool fullyContained = cellSizeMeshBb.contains(bb);
|
||||
bool fullyContained = true;
|
||||
|
||||
if (!fullyContained)
|
||||
if (!cellSizeMeshBb.contains(bb))
|
||||
{
|
||||
Pout<< "Triangulation not fully contained in cell size mesh." << endl
|
||||
<< "Cell Size Mesh Bounds = " << cellSizeMeshBb << endl
|
||||
<< "foamyHexMesh Bounds = " << bb << endl;
|
||||
Pout<< "Triangulation not fully contained in cell size mesh."
|
||||
<< endl;
|
||||
|
||||
Pout<< "Cell Size Mesh Bounds = " << cellSizeMesh.bounds() << endl;
|
||||
Pout<< "foamyHexMesh Bounds = " << bb << endl;
|
||||
|
||||
fullyContained = false;
|
||||
}
|
||||
|
||||
reduce(fullyContained, andOp<unsigned int>());
|
||||
|
||||
Info<< "Triangulation is "
|
||||
<< (returnReduceAnd(fullyContained) ? "fully" : "not fully")
|
||||
<< (fullyContained ? "fully" : "not fully")
|
||||
<< " contained in the cell size mesh"
|
||||
<< endl;
|
||||
}
|
||||
@ -109,7 +115,12 @@ void Foam::conformalVoronoiMesh::insertInternalPoints
|
||||
bool distribute
|
||||
)
|
||||
{
|
||||
const label nPoints = returnReduce(points.size(), sumOp<label>());
|
||||
label nPoints = points.size();
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
reduce(nPoints, sumOp<label>());
|
||||
}
|
||||
|
||||
Info<< " " << nPoints << " points to insert..." << endl;
|
||||
|
||||
@ -134,15 +145,16 @@ void Foam::conformalVoronoiMesh::insertInternalPoints
|
||||
map().distribute(points);
|
||||
}
|
||||
|
||||
label preReinsertionSize(number_of_vertices());
|
||||
label nVert = number_of_vertices();
|
||||
|
||||
insert(points.begin(), points.end());
|
||||
|
||||
const label nInserted = returnReduce
|
||||
(
|
||||
label(number_of_vertices()) - preReinsertionSize,
|
||||
sumOp<label>()
|
||||
);
|
||||
label nInserted(number_of_vertices() - nVert);
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
reduce(nInserted, sumOp<label>());
|
||||
}
|
||||
|
||||
Info<< " " << nInserted << " points inserted"
|
||||
<< ", failed to insert " << nPoints - nInserted
|
||||
|
||||
@ -753,7 +753,7 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints
|
||||
|
||||
forAll(patches, p)
|
||||
{
|
||||
label nPatchFaces = patchDicts[p].get<label>("nFaces");
|
||||
label totalPatchSize = patchDicts[p].get<label>("nFaces");
|
||||
|
||||
if
|
||||
(
|
||||
@ -762,7 +762,7 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints
|
||||
)
|
||||
{
|
||||
// Do not create empty processor patches
|
||||
if (nPatchFaces)
|
||||
if (totalPatchSize > 0)
|
||||
{
|
||||
patchDicts[p].set("transform", "coincidentFullMatch");
|
||||
|
||||
@ -781,8 +781,9 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints
|
||||
else
|
||||
{
|
||||
// Check that the patch is not empty on every processor
|
||||
reduce(totalPatchSize, sumOp<label>());
|
||||
|
||||
if (returnReduceOr(nPatchFaces))
|
||||
if (totalPatchSize > 0)
|
||||
{
|
||||
patches[nValidPatches] = polyPatch::New
|
||||
(
|
||||
|
||||
@ -729,7 +729,7 @@ Foam::label Foam::conformalVoronoiMesh::synchroniseSurfaceTrees
|
||||
}
|
||||
}
|
||||
|
||||
Pstream::listCombineReduce(hits, plusEqOp<labelHashSet>());
|
||||
Pstream::listCombineAllGather(hits, plusEqOp<labelHashSet>());
|
||||
|
||||
forAll(surfaceHits, eI)
|
||||
{
|
||||
@ -816,7 +816,7 @@ Foam::label Foam::conformalVoronoiMesh::synchroniseEdgeTrees
|
||||
}
|
||||
}
|
||||
|
||||
Pstream::listCombineReduce(hits, plusEqOp<labelHashSet>());
|
||||
Pstream::listCombineAllGather(hits, plusEqOp<labelHashSet>());
|
||||
|
||||
forAll(featureEdgeHits, eI)
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -707,7 +707,9 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
|
||||
|
||||
Info<< incrIndent << indent << "Faces matched." << endl;
|
||||
|
||||
if (returnReduceOr(anyChanged))
|
||||
reduce(anyChanged, orOp<bool>());
|
||||
|
||||
if (anyChanged)
|
||||
{
|
||||
label nReorderedFaces = 0;
|
||||
|
||||
|
||||
@ -44,7 +44,6 @@ SourceFiles
|
||||
#if defined(CGAL_VERSION_NR) && (CGAL_VERSION_NR < 1050211000)
|
||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wbitwise-instead-of-logical"
|
||||
|
||||
// ------------------------------------------------------------------------- //
|
||||
|
||||
|
||||
@ -45,7 +45,6 @@ SourceFiles
|
||||
#if defined(CGAL_VERSION_NR) && (CGAL_VERSION_NR < 1050211000)
|
||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wbitwise-instead-of-logical"
|
||||
|
||||
// ------------------------------------------------------------------------- //
|
||||
|
||||
|
||||
@ -605,7 +605,7 @@ Foam::conformationSurfaces::conformationSurfaces
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::conformationSurfaces::overlaps(const boundBox& bb) const
|
||||
bool Foam::conformationSurfaces::overlaps(const treeBoundBox& bb) const
|
||||
{
|
||||
forAll(surfaces_, s)
|
||||
{
|
||||
|
||||
@ -188,7 +188,7 @@ public:
|
||||
|
||||
//- Check if the supplied bound box overlaps any part of any of
|
||||
// the surfaces
|
||||
bool overlaps(const boundBox& bb) const;
|
||||
bool overlaps(const treeBoundBox& bb) const;
|
||||
|
||||
//- Check if points are inside surfaces to conform to
|
||||
Field<bool> inside(const pointField& samplePts) const;
|
||||
|
||||
@ -84,12 +84,16 @@ Foam::searchableBoxFeatures::features() const
|
||||
autoPtr<extendedFeatureEdgeMesh> features;
|
||||
|
||||
List<vector> faceNormalsList(treeBoundBox::faceNormals);
|
||||
vectorField faceNormals(std::move(faceNormalsList));
|
||||
vectorField faceNormals(faceNormalsList);
|
||||
|
||||
vectorField edgeDirections(12);
|
||||
labelListList normalDirections(12, labelList(2, Zero));
|
||||
labelListList edgeNormals(12, labelList(2, Zero));
|
||||
labelListList normalDirections(12);
|
||||
|
||||
labelListList edgeNormals(12);
|
||||
forAll(edgeNormals, eI)
|
||||
{
|
||||
edgeNormals[eI].setSize(2, 0);
|
||||
}
|
||||
edgeNormals[0][0] = 2; edgeNormals[0][1] = 4;
|
||||
edgeNormals[1][0] = 1; edgeNormals[1][1] = 4;
|
||||
edgeNormals[2][0] = 3; edgeNormals[2][1] = 4;
|
||||
@ -112,6 +116,7 @@ Foam::searchableBoxFeatures::features() const
|
||||
surfacePoints[treeBoundBox::edges[eI].end()]
|
||||
- surfacePoints[treeBoundBox::edges[eI].start()];
|
||||
|
||||
normalDirections[eI] = labelList(2, Zero);
|
||||
for (label j = 0; j < 2; ++j)
|
||||
{
|
||||
const vector cross =
|
||||
@ -133,12 +138,12 @@ Foam::searchableBoxFeatures::features() const
|
||||
}
|
||||
}
|
||||
|
||||
labelListList featurePointNormals(8, labelList(3, Zero));
|
||||
labelListList featurePointEdges(8, labelList(3, Zero));
|
||||
|
||||
labelListList featurePointNormals(8);
|
||||
labelListList featurePointEdges(8);
|
||||
forAll(featurePointNormals, pI)
|
||||
{
|
||||
labelList& ftPtEdges = featurePointEdges[pI];
|
||||
ftPtEdges.setSize(3, 0);
|
||||
|
||||
label edgeI = 0;
|
||||
forAll(treeBoundBox::edges, eI)
|
||||
@ -156,6 +161,7 @@ Foam::searchableBoxFeatures::features() const
|
||||
}
|
||||
|
||||
labelList& ftPtNormals = featurePointNormals[pI];
|
||||
ftPtNormals.setSize(3, 0);
|
||||
|
||||
ftPtNormals[0] = edgeNormals[ftPtEdges[0]][0];
|
||||
ftPtNormals[1] = edgeNormals[ftPtEdges[0]][1];
|
||||
|
||||
@ -38,7 +38,6 @@ Description
|
||||
#if defined(CGAL_VERSION_NR) && (CGAL_VERSION_NR < 1050211000)
|
||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wbitwise-instead-of-logical"
|
||||
|
||||
// ------------------------------------------------------------------------- //
|
||||
|
||||
|
||||
@ -40,7 +40,6 @@ Description
|
||||
#if defined(CGAL_VERSION_NR) && (CGAL_VERSION_NR < 1050211000)
|
||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wbitwise-instead-of-logical"
|
||||
|
||||
// ------------------------------------------------------------------------- //
|
||||
|
||||
|
||||
@ -416,12 +416,10 @@ void extractSurface
|
||||
|
||||
// Allocate zone/patch for all patches
|
||||
HashTable<label> compactZoneID(1024);
|
||||
if (Pstream::master())
|
||||
forAllConstIters(patchSize, iter)
|
||||
{
|
||||
forAllConstIters(patchSize, iter)
|
||||
{
|
||||
compactZoneID.insert(iter.key(), compactZoneID.size());
|
||||
}
|
||||
label sz = compactZoneID.size();
|
||||
compactZoneID.insert(iter.key(), sz);
|
||||
}
|
||||
Pstream::broadcast(compactZoneID);
|
||||
|
||||
@ -433,7 +431,7 @@ void extractSurface
|
||||
label patchi = bMesh.findPatchID(iter.key());
|
||||
if (patchi != -1)
|
||||
{
|
||||
patchToCompactZone[patchi] = iter.val();
|
||||
patchToCompactZone[patchi] = iter();
|
||||
}
|
||||
}
|
||||
|
||||
@ -665,7 +663,7 @@ void removeZeroSizedPatches(fvMesh& mesh)
|
||||
if
|
||||
(
|
||||
isA<coupledPolyPatch>(pp)
|
||||
|| returnReduceOr(pp.size())
|
||||
|| returnReduce(pp.size(), sumOp<label>())
|
||||
)
|
||||
{
|
||||
// Coupled (and unknown size) or uncoupled and used
|
||||
@ -1891,8 +1889,11 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
// Use the maxLocalCells from the refinement parameters
|
||||
const bool preBalance =
|
||||
returnReduceOr(mesh.nCells() >= refineParams.maxLocalCells());
|
||||
bool preBalance = returnReduce
|
||||
(
|
||||
(mesh.nCells() >= refineParams.maxLocalCells()),
|
||||
orOp<bool>()
|
||||
);
|
||||
|
||||
|
||||
if (!overwrite && !debugLevel)
|
||||
|
||||
@ -104,6 +104,9 @@ void Foam::checkPatch
|
||||
// << endl;
|
||||
}
|
||||
|
||||
//DebugVar(globalEdgeFaces);
|
||||
|
||||
|
||||
// Synchronise across coupled edges.
|
||||
syncTools::syncEdgeList
|
||||
(
|
||||
@ -113,6 +116,7 @@ void Foam::checkPatch
|
||||
labelList() // null value
|
||||
);
|
||||
|
||||
//DebugVar(globalEdgeFaces);
|
||||
|
||||
label labelTyp = TopoType::MANIFOLD;
|
||||
forAll(meshEdges, edgei)
|
||||
@ -187,7 +191,7 @@ void Foam::checkPatch
|
||||
{
|
||||
const labelList& mp = pp.meshPoints();
|
||||
|
||||
if (returnReduceOr(mp.size()))
|
||||
if (returnReduce(mp.size(), sumOp<label>()) > 0)
|
||||
{
|
||||
boundBox bb(pp.points(), mp, true); // reduce
|
||||
Info<< ' ' << bb;
|
||||
@ -196,35 +200,6 @@ void Foam::checkPatch
|
||||
}
|
||||
|
||||
|
||||
template<class Zone>
|
||||
Foam::label Foam::checkZones
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const ZoneMesh<Zone, polyMesh>& zones,
|
||||
topoSet& set
|
||||
)
|
||||
{
|
||||
labelList zoneID(set.maxSize(mesh), -1);
|
||||
for (const auto& zone : zones)
|
||||
{
|
||||
for (const label elem : zone)
|
||||
{
|
||||
if
|
||||
(
|
||||
zoneID[elem] != -1
|
||||
&& zoneID[elem] != zone.index()
|
||||
)
|
||||
{
|
||||
set.insert(elem);
|
||||
}
|
||||
zoneID[elem] = zone.index();
|
||||
}
|
||||
}
|
||||
|
||||
return returnReduce(set.size(), sumOp<label>());
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::checkTopology
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
@ -252,10 +227,10 @@ Foam::label Foam::checkTopology
|
||||
}
|
||||
}
|
||||
reduce(nEmpty, sumOp<label>());
|
||||
const label nCells = returnReduce(mesh.cells().size(), sumOp<label>());
|
||||
label nTotCells = returnReduce(mesh.cells().size(), sumOp<label>());
|
||||
|
||||
// These are actually warnings, not errors.
|
||||
if (nCells && (nEmpty % nCells))
|
||||
if (nTotCells && (nEmpty % nTotCells))
|
||||
{
|
||||
Info<< " ***Total number of faces on empty patches"
|
||||
<< " is not divisible by the number of cells in the mesh."
|
||||
@ -335,7 +310,7 @@ Foam::label Foam::checkTopology
|
||||
{
|
||||
noFailedChecks++;
|
||||
|
||||
const label nPoints = returnReduce(points.size(), sumOp<label>());
|
||||
label nPoints = returnReduce(points.size(), sumOp<label>());
|
||||
|
||||
Info<< " <<Writing " << nPoints
|
||||
<< " unused points to set " << points.name() << endl;
|
||||
@ -472,7 +447,7 @@ Foam::label Foam::checkTopology
|
||||
}
|
||||
}
|
||||
|
||||
const label nOneCells = returnReduce(oneCells.size(), sumOp<label>());
|
||||
label nOneCells = returnReduce(oneCells.size(), sumOp<label>());
|
||||
|
||||
if (nOneCells > 0)
|
||||
{
|
||||
@ -488,7 +463,7 @@ Foam::label Foam::checkTopology
|
||||
}
|
||||
}
|
||||
|
||||
const label nTwoCells = returnReduce(twoCells.size(), sumOp<label>());
|
||||
label nTwoCells = returnReduce(twoCells.size(), sumOp<label>());
|
||||
|
||||
if (nTwoCells > 0)
|
||||
{
|
||||
@ -588,7 +563,11 @@ Foam::label Foam::checkTopology
|
||||
}
|
||||
}
|
||||
|
||||
Pstream::listCombineReduce(regionDisconnected, andEqOp<bool>());
|
||||
Pstream::listCombineAllGather
|
||||
(
|
||||
regionDisconnected,
|
||||
andEqOp<bool>()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -635,7 +614,7 @@ Foam::label Foam::checkTopology
|
||||
cellRegions[i].write();
|
||||
}
|
||||
|
||||
const label nPoints = returnReduce(points.size(), sumOp<label>());
|
||||
label nPoints = returnReduce(points.size(), sumOp<label>());
|
||||
if (nPoints)
|
||||
{
|
||||
Info<< " <<Writing " << nPoints
|
||||
@ -735,25 +714,6 @@ Foam::label Foam::checkTopology
|
||||
);
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
// Check for duplicates
|
||||
if (allTopology)
|
||||
{
|
||||
faceSet mzFaces(mesh, "multiZoneFaces", mesh.nFaces()/100);
|
||||
const label nMulti = checkZones(mesh, faceZones, mzFaces);
|
||||
if (nMulti)
|
||||
{
|
||||
Info<< " <<Writing " << nMulti
|
||||
<< " faces that are in multiple zones"
|
||||
<< " to set " << mzFaces.name() << endl;
|
||||
mzFaces.instance() = mesh.pointsInstance();
|
||||
mzFaces.write();
|
||||
if (surfWriter && surfWriter->enabled())
|
||||
{
|
||||
mergeAndWrite(*surfWriter, mzFaces);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -831,26 +791,6 @@ Foam::label Foam::checkTopology
|
||||
<< returnReduce(v, sumOp<scalar>())
|
||||
<< ' ' << bb << endl;
|
||||
}
|
||||
|
||||
|
||||
// Check for duplicates
|
||||
if (allTopology)
|
||||
{
|
||||
cellSet mzCells(mesh, "multiZoneCells", mesh.nCells()/100);
|
||||
const label nMulti = checkZones(mesh, cellZones, mzCells);
|
||||
if (nMulti)
|
||||
{
|
||||
Info<< " <<Writing " << nMulti
|
||||
<< " cells that are in multiple zones"
|
||||
<< " to set " << mzCells.name() << endl;
|
||||
mzCells.instance() = mesh.pointsInstance();
|
||||
mzCells.write();
|
||||
if (surfWriter && surfWriter->enabled())
|
||||
{
|
||||
mergeAndWrite(*surfWriter, mzCells);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -858,65 +798,6 @@ Foam::label Foam::checkTopology
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
Info<< "\nChecking basic pointZone addressing..." << endl;
|
||||
|
||||
Pout.setf(ios_base::left);
|
||||
|
||||
const pointZoneMesh& pointZones = mesh.pointZones();
|
||||
|
||||
if (pointZones.size())
|
||||
{
|
||||
Info<< " "
|
||||
<< setw(20) << "PointZone"
|
||||
<< setw(8) << "Points"
|
||||
<< "BoundingBox" << endl;
|
||||
|
||||
for (const auto& zone : pointZones)
|
||||
{
|
||||
boundBox bb;
|
||||
for (const label pointi : zone)
|
||||
{
|
||||
bb.add(mesh.points()[pointi]);
|
||||
}
|
||||
|
||||
bb.reduce(); // Global min/max
|
||||
|
||||
Info<< " "
|
||||
<< setw(20) << zone.name()
|
||||
<< setw(8)
|
||||
<< returnReduce(zone.size(), sumOp<label>())
|
||||
<< bb << endl;
|
||||
}
|
||||
|
||||
|
||||
// Check for duplicates
|
||||
if (allTopology)
|
||||
{
|
||||
pointSet mzPoints(mesh, "multiZonePoints", mesh.nPoints()/100);
|
||||
const label nMulti = checkZones(mesh, pointZones, mzPoints);
|
||||
if (nMulti)
|
||||
{
|
||||
Info<< " <<Writing " << nMulti
|
||||
<< " points that are in multiple zones"
|
||||
<< " to set " << mzPoints.name() << endl;
|
||||
mzPoints.instance() = mesh.pointsInstance();
|
||||
mzPoints.write();
|
||||
if (setWriter && setWriter->enabled())
|
||||
{
|
||||
mergeAndWrite(*setWriter, mzPoints);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No pointZones found."<<endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Force creation of all addressing if requested.
|
||||
// Errors will be reported as required
|
||||
if (allTopology)
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
#include "labelList.H"
|
||||
#include "autoPtr.H"
|
||||
#include "ZoneMesh.H"
|
||||
#include "topoSet.H"
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
@ -23,14 +21,6 @@ namespace Foam
|
||||
pointSet& points
|
||||
);
|
||||
|
||||
template<class Zone>
|
||||
label checkZones
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const ZoneMesh<Zone, polyMesh>& zones,
|
||||
topoSet& set
|
||||
);
|
||||
|
||||
label checkTopology
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
|
||||
@ -27,7 +27,7 @@ void maxFaceToCell
|
||||
const cell& cFaces = cells[cellI];
|
||||
forAll(cFaces, i)
|
||||
{
|
||||
cellFld[cellI] = Foam::max(cellFld[cellI], faceData[cFaces[i]]);
|
||||
cellFld[cellI] = max(cellFld[cellI], faceData[cFaces[i]]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ void minFaceToCell
|
||||
const cell& cFaces = cells[cellI];
|
||||
forAll(cFaces, i)
|
||||
{
|
||||
cellFld[cellI] = Foam::min(cellFld[cellI], faceData[cFaces[i]]);
|
||||
cellFld[cellI] = min(cellFld[cellI], faceData[cFaces[i]]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,8 +88,8 @@ void minFaceToCell
|
||||
// Internal faces
|
||||
forAll(own, facei)
|
||||
{
|
||||
cellFld[own[facei]] = Foam::min(cellFld[own[facei]], faceData[facei]);
|
||||
cellFld[nei[facei]] = Foam::min(cellFld[nei[facei]], faceData[facei]);
|
||||
cellFld[own[facei]] = min(cellFld[own[facei]], faceData[facei]);
|
||||
cellFld[nei[facei]] = min(cellFld[nei[facei]], faceData[facei]);
|
||||
}
|
||||
|
||||
// Patch faces
|
||||
@ -100,7 +100,7 @@ void minFaceToCell
|
||||
|
||||
forAll(fc, i)
|
||||
{
|
||||
cellFld[fc[i]] = Foam::min(cellFld[fc[i]], fvp[i]);
|
||||
cellFld[fc[i]] = min(cellFld[fc[i]], fvp[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -180,7 +180,7 @@ void Foam::writeFields
|
||||
(
|
||||
radToDeg
|
||||
(
|
||||
Foam::acos(Foam::min(scalar(1), Foam::max(scalar(-1), faceOrthogonality)))
|
||||
Foam::acos(min(scalar(1), max(scalar(-1), faceOrthogonality)))
|
||||
)
|
||||
);
|
||||
|
||||
@ -540,7 +540,7 @@ void Foam::writeFields
|
||||
ownCc,
|
||||
fc
|
||||
).quality();
|
||||
ownVol = Foam::min(ownVol, tetQual);
|
||||
ownVol = min(ownVol, tetQual);
|
||||
}
|
||||
}
|
||||
if (mesh.isInternalFace(facei))
|
||||
@ -556,7 +556,7 @@ void Foam::writeFields
|
||||
fc,
|
||||
neiCc
|
||||
).quality();
|
||||
neiVol = Foam::min(neiVol, tetQual);
|
||||
neiVol = min(neiVol, tetQual);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -608,8 +608,8 @@ void Foam::writeFields
|
||||
// Internal faces
|
||||
forAll(own, facei)
|
||||
{
|
||||
cellFld[own[facei]] = Foam::min(cellFld[own[facei]], ownPyrVol[facei]);
|
||||
cellFld[nei[facei]] = Foam::min(cellFld[nei[facei]], neiPyrVol[facei]);
|
||||
cellFld[own[facei]] = min(cellFld[own[facei]], ownPyrVol[facei]);
|
||||
cellFld[nei[facei]] = min(cellFld[nei[facei]], neiPyrVol[facei]);
|
||||
}
|
||||
|
||||
// Patch faces
|
||||
@ -620,7 +620,7 @@ void Foam::writeFields
|
||||
forAll(fc, i)
|
||||
{
|
||||
const label meshFacei = fvp.patch().start();
|
||||
cellFld[fc[i]] = Foam::min(cellFld[fc[i]], ownPyrVol[meshFacei]);
|
||||
cellFld[fc[i]] = min(cellFld[fc[i]], ownPyrVol[meshFacei]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -631,7 +631,7 @@ void Foam::writeFields
|
||||
if (writeFaceFields)
|
||||
{
|
||||
scalarField minFacePyrVol(neiPyrVol);
|
||||
minFacePyrVol = Foam::min
|
||||
minFacePyrVol = min
|
||||
(
|
||||
minFacePyrVol,
|
||||
SubField<scalar>(ownPyrVol, mesh.nInternalFaces())
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -138,7 +138,7 @@ void filterPatches(fvMesh& mesh, const wordHashSet& addedPatchNames)
|
||||
if
|
||||
(
|
||||
isA<coupledPolyPatch>(pp)
|
||||
|| returnReduceOr(pp.size())
|
||||
|| returnReduce(pp.size(), sumOp<label>())
|
||||
|| addedPatchNames.found(pp.name())
|
||||
)
|
||||
{
|
||||
|
||||
@ -686,7 +686,7 @@ void syncPoints
|
||||
|
||||
//- Note: hasTransformation is only used for warning messages so
|
||||
// reduction not strictly necessary.
|
||||
//Pstream::reduceOr(hasTransformation);
|
||||
//reduce(hasTransformation, orOp<bool>());
|
||||
|
||||
// Synchronize multiple shared points.
|
||||
const globalMeshData& pd = mesh.globalData();
|
||||
@ -714,7 +714,7 @@ void syncPoints
|
||||
}
|
||||
|
||||
// Combine - globally consistent
|
||||
Pstream::listCombineReduce(sharedPts, cop);
|
||||
Pstream::listCombineAllGather(sharedPts, cop);
|
||||
|
||||
// Now we will all have the same information. Merge it back with
|
||||
// my local information.
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -273,7 +272,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
if (returnReduceAnd(changedEdges.empty()))
|
||||
if (returnReduce(changedEdges.size(), sumOp<label>()) == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
@ -100,26 +100,26 @@ void printEdgeStats(const polyMesh& mesh)
|
||||
|
||||
if (mag(eVec & x) > 1-edgeTol)
|
||||
{
|
||||
minX = Foam::min(minX, eMag);
|
||||
maxX = Foam::max(maxX, eMag);
|
||||
minX = min(minX, eMag);
|
||||
maxX = max(maxX, eMag);
|
||||
nX++;
|
||||
}
|
||||
else if (mag(eVec & y) > 1-edgeTol)
|
||||
{
|
||||
minY = Foam::min(minY, eMag);
|
||||
maxY = Foam::max(maxY, eMag);
|
||||
minY = min(minY, eMag);
|
||||
maxY = max(maxY, eMag);
|
||||
nY++;
|
||||
}
|
||||
else if (mag(eVec & z) > 1-edgeTol)
|
||||
{
|
||||
minZ = Foam::min(minZ, eMag);
|
||||
maxZ = Foam::max(maxZ, eMag);
|
||||
minZ = min(minZ, eMag);
|
||||
maxZ = max(maxZ, eMag);
|
||||
nZ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
minOther = Foam::min(minOther, eMag);
|
||||
maxOther = Foam::max(maxOther, eMag);
|
||||
minOther = min(minOther, eMag);
|
||||
maxOther = max(maxOther, eMag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -145,10 +145,10 @@ void getBand
|
||||
|
||||
// Note: mag not necessary for correct (upper-triangular) ordering.
|
||||
label diff = nei-own;
|
||||
cellBandwidth[nei] = Foam::max(cellBandwidth[nei], diff);
|
||||
cellBandwidth[nei] = max(cellBandwidth[nei], diff);
|
||||
}
|
||||
|
||||
bandwidth = Foam::max(cellBandwidth);
|
||||
bandwidth = max(cellBandwidth);
|
||||
|
||||
// Do not use field algebra because of conversion label to scalar
|
||||
profile = 0.0;
|
||||
@ -340,7 +340,7 @@ labelList getRegionFaceOrder
|
||||
}
|
||||
|
||||
// Do region interfaces
|
||||
label nRegions = Foam::max(cellToRegion)+1;
|
||||
label nRegions = max(cellToRegion)+1;
|
||||
{
|
||||
// Sort in increasing region
|
||||
SortableList<label> sortKey(mesh.nFaces(), labelMax);
|
||||
@ -353,8 +353,8 @@ labelList getRegionFaceOrder
|
||||
if (ownRegion != neiRegion)
|
||||
{
|
||||
sortKey[facei] =
|
||||
Foam::min(ownRegion, neiRegion)*nRegions
|
||||
+Foam::max(ownRegion, neiRegion);
|
||||
min(ownRegion, neiRegion)*nRegions
|
||||
+max(ownRegion, neiRegion);
|
||||
}
|
||||
}
|
||||
sortKey.sort();
|
||||
@ -566,7 +566,7 @@ labelList regionRenumber
|
||||
|
||||
labelList cellOrder(cellToRegion.size());
|
||||
|
||||
label nRegions = Foam::max(cellToRegion)+1;
|
||||
label nRegions = max(cellToRegion)+1;
|
||||
|
||||
labelListList regionToCells(invertOneToMany(nRegions, cellToRegion));
|
||||
|
||||
@ -1103,7 +1103,9 @@ int main(int argc, char *argv[])
|
||||
// Update proc maps
|
||||
if (cellProcAddressing.headerOk())
|
||||
{
|
||||
if (returnReduceAnd(cellProcAddressing.size() == mesh.nCells()))
|
||||
bool localOk = (cellProcAddressing.size() == mesh.nCells());
|
||||
|
||||
if (returnReduce(localOk, andOp<bool>()))
|
||||
{
|
||||
Info<< "Renumbering processor cell decomposition map "
|
||||
<< cellProcAddressing.name() << endl;
|
||||
@ -1127,7 +1129,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (faceProcAddressing.headerOk())
|
||||
{
|
||||
if (returnReduceAnd(faceProcAddressing.size() == mesh.nFaces()))
|
||||
bool localOk = (faceProcAddressing.size() == mesh.nFaces());
|
||||
|
||||
if (returnReduce(localOk, andOp<bool>()))
|
||||
{
|
||||
Info<< "Renumbering processor face decomposition map "
|
||||
<< faceProcAddressing.name() << endl;
|
||||
@ -1167,7 +1171,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (pointProcAddressing.headerOk())
|
||||
{
|
||||
if (returnReduceAnd(pointProcAddressing.size() == mesh.nPoints()))
|
||||
bool localOk = (pointProcAddressing.size() == mesh.nPoints());
|
||||
|
||||
if (returnReduce(localOk, andOp<bool>()))
|
||||
{
|
||||
Info<< "Renumbering processor point decomposition map "
|
||||
<< pointProcAddressing.name() << endl;
|
||||
@ -1191,13 +1197,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (boundaryProcAddressing.headerOk())
|
||||
{
|
||||
if
|
||||
bool localOk =
|
||||
(
|
||||
returnReduceAnd
|
||||
(
|
||||
boundaryProcAddressing.size() == mesh.boundaryMesh().size()
|
||||
)
|
||||
)
|
||||
boundaryProcAddressing.size()
|
||||
== mesh.boundaryMesh().size()
|
||||
);
|
||||
if (returnReduce(localOk, andOp<bool>()))
|
||||
{
|
||||
// No renumbering needed
|
||||
}
|
||||
|
||||
@ -320,10 +320,10 @@ bool doCommand
|
||||
const globalMeshData& parData = mesh.globalData();
|
||||
|
||||
label typSize =
|
||||
Foam::max
|
||||
max
|
||||
(
|
||||
parData.nTotalCells(),
|
||||
Foam::max
|
||||
max
|
||||
(
|
||||
parData.nTotalFaces(),
|
||||
parData.nTotalPoints()
|
||||
@ -375,7 +375,7 @@ bool doCommand
|
||||
|
||||
topoSet& currentSet = currentSetPtr();
|
||||
// Presize it according to current mesh data.
|
||||
currentSet.resize(Foam::max(currentSet.size(), typSize));
|
||||
currentSet.resize(max(currentSet.size(), typSize));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -286,8 +286,8 @@ void addToInterface
|
||||
{
|
||||
edge interface
|
||||
(
|
||||
Foam::min(ownRegion, neiRegion),
|
||||
Foam::max(ownRegion, neiRegion)
|
||||
min(ownRegion, neiRegion),
|
||||
max(ownRegion, neiRegion)
|
||||
);
|
||||
|
||||
auto iter = regionsToSize.find(interface);
|
||||
@ -544,8 +544,8 @@ void getInterfaceSizes
|
||||
|
||||
edge interface
|
||||
(
|
||||
Foam::min(ownRegion, neiRegion),
|
||||
Foam::max(ownRegion, neiRegion)
|
||||
min(ownRegion, neiRegion),
|
||||
max(ownRegion, neiRegion)
|
||||
);
|
||||
|
||||
faceToInterface[facei] = regionsToInterface[interface][zoneID];
|
||||
@ -567,8 +567,8 @@ void getInterfaceSizes
|
||||
|
||||
edge interface
|
||||
(
|
||||
Foam::min(ownRegion, neiRegion),
|
||||
Foam::max(ownRegion, neiRegion)
|
||||
min(ownRegion, neiRegion),
|
||||
max(ownRegion, neiRegion)
|
||||
);
|
||||
|
||||
faceToInterface[facei] = regionsToInterface[interface][zoneID];
|
||||
@ -847,7 +847,7 @@ void createAndWriteRegion
|
||||
|
||||
if (!isA<processorPolyPatch>(pp))
|
||||
{
|
||||
if (returnReduceOr(pp.size()))
|
||||
if (returnReduce(pp.size(), sumOp<label>()) > 0)
|
||||
{
|
||||
oldToNew[patchi] = newI;
|
||||
if (!addedPatches.found(patchi))
|
||||
@ -1114,7 +1114,7 @@ label findCorrespondingRegion
|
||||
}
|
||||
}
|
||||
|
||||
Pstream::listCombineReduce(cellsInZone, plusEqOp<label>());
|
||||
Pstream::listCombineAllGather(cellsInZone, plusEqOp<label>());
|
||||
|
||||
// Pick region with largest overlap of zoneI
|
||||
label regionI = findMax(cellsInZone);
|
||||
|
||||
@ -345,7 +345,7 @@ void subsetTopoSets
|
||||
|
||||
Info<< "Subsetting " << set.type() << " " << set.name() << endl;
|
||||
|
||||
labelHashSet subset(2*Foam::min(set.size(), map.size()));
|
||||
labelHashSet subset(2*min(set.size(), map.size()));
|
||||
|
||||
forAll(map, i)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user