Compare commits
210 Commits
feature-su
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| b050cd9480 | |||
| e73c13466b | |||
| d2c145d7a4 | |||
| 95a5dfacc7 | |||
| 615aae61d7 | |||
| fabb1c2ce5 | |||
| 9f47957df5 | |||
| 50b1c0be53 | |||
| 2e475793bc | |||
| b46b3356bc | |||
| 453efa7ca8 | |||
| 4d702d25a6 | |||
| bf0eb9bede | |||
| 1cdf7d0b00 | |||
| 053f895b2e | |||
| ec7ab996c5 | |||
| 5f580f547f | |||
| 36d1d9b79d | |||
| 9e9c90ddb2 | |||
| 45f8d847b0 | |||
| 1078234f18 | |||
| 3c4e226130 | |||
| 7021b073cf | |||
| cdd1e19f68 | |||
| 09beb5571a | |||
| 23adebdb86 | |||
| 2b0e4dc97a | |||
| e803646228 | |||
| be278abcc0 | |||
| 93f980834b | |||
| e8dce32b0a | |||
| 91925871d9 | |||
| a5090c37a3 | |||
| 0d7816b7fd | |||
| 9bdb75eeef | |||
| a860d48637 | |||
| 97296043c0 | |||
| 6bdceaf29f | |||
| 34df4eaf40 | |||
| 75b2d0b656 | |||
| 9bc6f2f91f | |||
| 96872f031f | |||
| 55d89ac4d6 | |||
| fe0ba07a7a | |||
| 164a3e8330 | |||
| 2f6581133c | |||
| 9e8e14e448 | |||
| ffea136955 | |||
| 5dbc2e5890 | |||
| 1be6991d3f | |||
| 25139e492e | |||
| 0189311026 | |||
| d6e6450834 | |||
| 1d6c77f8f4 | |||
| 83e73e4024 | |||
| 0bb0c1db74 | |||
| 8d9f4c54f3 | |||
| f7c8bfdce0 | |||
| 6ca0c59519 | |||
| 72ce3eb4ef | |||
| a9b59ad27e | |||
| 4668d0e886 | |||
| c78f25035d | |||
| 82e0d76748 | |||
| 4e513cec18 | |||
| ae3adc1007 | |||
| a0bba74950 | |||
| 535a4fccb4 | |||
| e1b04cb6a7 | |||
| a3f74d832a | |||
| a92143400d | |||
| c6220c162e | |||
| e5f147a211 | |||
| ebbeef27b4 | |||
| 5bb030480d | |||
| 4334aa43a0 | |||
| 34143b433a | |||
| c5ceec3c73 | |||
| 91e7870ee8 | |||
| 1d62b6274e | |||
| 5ee8f19bdd | |||
| 2d77f7ae26 | |||
| 5c44f360fe | |||
| 735b701006 | |||
| fd41930377 | |||
| 59f3c55871 | |||
| 0be19b7fae | |||
| 01727c84f1 | |||
| 80d7fe97f0 | |||
| a7e8a43f4a | |||
| 6c20df2808 | |||
| b8a0706e72 | |||
| 7f062a8f5e | |||
| f13a05375c | |||
| eb56c75c4b | |||
| cb6d11d39b | |||
| ad037ac744 | |||
| e3c93a9c85 | |||
| a2df607998 | |||
| e121db6e86 | |||
| e720f823d3 | |||
| bdac68ebc7 | |||
| edf9621ebe | |||
| a9863d9a3f | |||
| bdb890d4e2 | |||
| 707db0b65b | |||
| 8716795d86 | |||
| 8bbfe6eb44 | |||
| aaa9af9ee8 | |||
| 4de0b84c2f | |||
| db871856c0 | |||
| a01f3ed8b7 | |||
| c4b261c615 | |||
| 7b0ab0dbb3 | |||
| b9b0d1b3aa | |||
| 034a0524af | |||
| eaa65913f4 | |||
| 6dd8804acb | |||
| a77aaa7582 | |||
| 5cc36dc5b7 | |||
| d4a959a93f | |||
| 09e04003c4 | |||
| dcbd546d51 | |||
| d64c6371f1 | |||
| 2d246cd5d1 | |||
| 51bb06764a | |||
| 795bce4519 | |||
| db0709f957 | |||
| 38e08fc092 | |||
| 36ae93d017 | |||
| ab7cfdcf49 | |||
| f13be4f62c | |||
| ae638c2b9c | |||
| 9cd0aa8816 | |||
| 939ca03495 | |||
| 28818c73f9 | |||
| 20b2f46315 | |||
| 5d9f8e9a9d | |||
| 3bf1399098 | |||
| 20b6aeb4dd | |||
| c7fc9d4ddc | |||
| f0b844eb47 | |||
| 151f4df546 | |||
| 7ac83f22c7 | |||
| 8c395357f3 | |||
| d4b5280742 | |||
| be30598e3d | |||
| d64682a7af | |||
| cf9fa16788 | |||
| 9437e8d068 | |||
| dd09aa1289 | |||
| 56c52fd69e | |||
| 34c933c1ce | |||
| f276016896 | |||
| e3703c7626 | |||
| dccdb263e8 | |||
| bf60a124ab | |||
| c448ea2a11 | |||
| d41c644a49 | |||
| d2dfd115be | |||
| 8f3d29c1b7 | |||
| e67fffac3f | |||
| 2783e78ae2 | |||
| e041af9481 | |||
| e8e90a8de3 | |||
| 0aecb25024 | |||
| 14b2302b38 | |||
| d655c2d343 | |||
| 533d3b58f8 | |||
| 0c282bda65 | |||
| 4720b61313 | |||
| a66be057c2 | |||
| eae448c7aa | |||
| 81fa7d08ee | |||
| 0ce5053c75 | |||
| eb4345ed44 | |||
| 15ac0bc30b | |||
| 21f36b18e5 | |||
| 3852f7c5b7 | |||
| a3e1376117 | |||
| 512ec01328 | |||
| 3e8b0a2c73 | |||
| 831a55f1ba | |||
| 579f8ef7c6 | |||
| 0ba4f36c60 | |||
| 0adc745b50 | |||
| 3b40dd8c29 | |||
| 6f2fadb48f | |||
| 559ed6c464 | |||
| 0cb812f6ac | |||
| 4ae8ce3f0c | |||
| 9f0d1c7121 | |||
| e1d40646cc | |||
| 9013c9941d | |||
| 0cc5273d0a | |||
| 8f83ed786c | |||
| cf2b305b4f | |||
| b9f05bdc01 | |||
| 0b831572f3 | |||
| 6dc57a1a8b | |||
| a18c15a4cf | |||
| 39e1eb9dc6 | |||
| c77b0e14a1 | |||
| 77cdf22eac | |||
| 2e1552dd30 | |||
| d072ad0e3f | |||
| 0a99702f9e | |||
| b86ba60d35 | |||
| 392aa56f23 | |||
| 6520d8e061 |
@ -49,7 +49,7 @@
|
||||
|
||||
<!--
|
||||
Providing details of your set-up can help us identify any issues, e.g.
|
||||
OpenFOAM version : v2412|v2406|v2312|v2306|v2212 etc
|
||||
OpenFOAM version : v2506|v2412|v2406|v2312|v2306 etc
|
||||
Operating system : ubuntu|openSUSE|RedHat etc
|
||||
Hardware info : any info that may help?
|
||||
Compiler : gcc|clang etc
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
api=2412
|
||||
api=2506
|
||||
patch=0
|
||||
|
||||
12
README.md
12
README.md
@ -40,9 +40,9 @@ Violations of the Trademark are monitored, and will be duly prosecuted.
|
||||
|
||||
If OpenFOAM has already been compiled on your system, simply source
|
||||
the appropriate `etc/bashrc` or `etc/cshrc` file and get started.
|
||||
For example, for the OpenFOAM-v2412 version:
|
||||
For example, for the OpenFOAM-v2506 version:
|
||||
```
|
||||
source /installation/path/OpenFOAM-v2412/etc/bashrc
|
||||
source /installation/path/OpenFOAM-v2506/etc/bashrc
|
||||
```
|
||||
|
||||
## Compiling OpenFOAM
|
||||
@ -127,8 +127,8 @@ These 3rd-party sources are normally located in a directory parallel
|
||||
to the OpenFOAM directory. For example,
|
||||
```
|
||||
/path/parent
|
||||
|-- OpenFOAM-v2412
|
||||
\-- ThirdParty-v2412
|
||||
|-- OpenFOAM-v2506
|
||||
\-- ThirdParty-v2506
|
||||
```
|
||||
There are, however, many cases where this simple convention is inadequate:
|
||||
|
||||
@ -156,9 +156,9 @@ when locating the ThirdParty directory with the following precedence:
|
||||
2. PREFIX/ThirdParty-VERSION
|
||||
* this corresponds to the traditional approach
|
||||
3. PREFIX/ThirdParty-vAPI
|
||||
* allows for an updated value of VERSION, *eg*, `v2412-myCustom`,
|
||||
* allows for an updated value of VERSION, *eg*, `v2506-myCustom`,
|
||||
without requiring a renamed ThirdParty. The API value would still
|
||||
be `2412` and the original `ThirdParty-v2412/` would be found.
|
||||
be `2412` and the original `ThirdParty-v2506/` would be found.
|
||||
4. PREFIX/ThirdParty-API
|
||||
* same as the previous example, but using an unadorned API value.
|
||||
5. PREFIX/ThirdParty-common
|
||||
|
||||
@ -13,7 +13,14 @@ volVectorField U
|
||||
);
|
||||
|
||||
// Initialise the velocity internal field to zero
|
||||
U = dimensionedVector(U.dimensions(), Zero);
|
||||
// Note: explicitly bypass evaluation of contraint patch overrides
|
||||
// (e.g. swirlFanVelocity might lookup phi,rho)
|
||||
//U = dimensionedVector(U.dimensions(), Zero);
|
||||
{
|
||||
const dimensionedVector dt(U.dimensions(), Zero);
|
||||
U.internalFieldRef() = dt;
|
||||
U.boundaryFieldRef() = dt.value();
|
||||
}
|
||||
|
||||
surfaceScalarField phi
|
||||
(
|
||||
|
||||
@ -36,11 +36,13 @@ Description
|
||||
if (adjustTimeStep)
|
||||
{
|
||||
scalar maxDeltaTFact = maxCo/(CoNum + StCoNum + SMALL);
|
||||
scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
|
||||
const scalar deltaTFact =
|
||||
Foam::min(Foam::min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
min
|
||||
Foam::min
|
||||
(
|
||||
deltaTFact*runTime.deltaTValue(),
|
||||
maxDeltaT
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
if (adjustTimeStep)
|
||||
{
|
||||
runTime.setDeltaT(min(dtChem, maxDeltaT));
|
||||
runTime.setDeltaT(Foam::min(dtChem, maxDeltaT));
|
||||
|
||||
Info<< "deltaT = " << runTime.deltaTValue() << endl;
|
||||
}
|
||||
|
||||
@ -54,9 +54,18 @@ if (adjustTimeStep)
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
min
|
||||
Foam::min
|
||||
(
|
||||
dt0*min(min(TFactorFluid, min(TFactorFilm, TFactorSolid)), 1.2),
|
||||
dt0
|
||||
* Foam::min
|
||||
(
|
||||
Foam::min
|
||||
(
|
||||
TFactorFluid,
|
||||
Foam::min(TFactorFilm, TFactorSolid)
|
||||
),
|
||||
1.2
|
||||
),
|
||||
maxDeltaT
|
||||
)
|
||||
);
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020,2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -57,10 +57,22 @@ License
|
||||
// (relative to reference value)
|
||||
scalar alphaY(pimpleDict.getOrDefault<scalar>("alphaY", 1.0));
|
||||
|
||||
Info<< "Time scales min/max:" << endl;
|
||||
|
||||
// Cache old reciprocal time scale field
|
||||
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
|
||||
// The old reciprocal time scale field, with any damping factor
|
||||
tmp<volScalarField> rDeltaT0_damped;
|
||||
|
||||
// Calculate damped value before applying any other changes
|
||||
if
|
||||
(
|
||||
rDeltaTDampingCoeff < 1
|
||||
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
|
||||
)
|
||||
{
|
||||
rDeltaT0_damped = (scalar(1) - rDeltaTDampingCoeff)*(rDeltaT);
|
||||
}
|
||||
|
||||
|
||||
Info<< "Time scales min/max:" << endl;
|
||||
|
||||
// Flow time scale
|
||||
{
|
||||
@ -70,12 +82,14 @@ License
|
||||
/((2*maxCo)*mesh.V()*rho())
|
||||
);
|
||||
|
||||
// Limit the largest time scale
|
||||
rDeltaT.max(1/maxDeltaT);
|
||||
// Limit the largest time scale (=> smallest reciprocal time)
|
||||
rDeltaT.clamp_min(1/maxDeltaT);
|
||||
|
||||
auto limits = gMinMax(rDeltaT.primitiveField());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< " Flow = "
|
||||
<< 1/gMax(rDeltaT.primitiveField()) << ", "
|
||||
<< 1/gMin(rDeltaT.primitiveField()) << endl;
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
|
||||
// Heat release rate time scale
|
||||
@ -86,11 +100,13 @@ License
|
||||
mag(Qdot)/(alphaTemp*rho*thermo.Cp()*T)
|
||||
);
|
||||
|
||||
Info<< " Temperature = "
|
||||
<< 1/(gMax(rDeltaTT.field()) + VSMALL) << ", "
|
||||
<< 1/(gMin(rDeltaTT.field()) + VSMALL) << endl;
|
||||
rDeltaT.primitiveFieldRef().clamp_min(rDeltaTT);
|
||||
|
||||
rDeltaT.ref() = max(rDeltaT(), rDeltaTT);
|
||||
auto limits = gMinMax(rDeltaTT.field());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< " Temperature = "
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
|
||||
// Reaction rate time scale
|
||||
@ -138,11 +154,13 @@ License
|
||||
|
||||
if (foundY)
|
||||
{
|
||||
Info<< " Composition = "
|
||||
<< 1/(gMax(rDeltaTY.field()) + VSMALL) << ", "
|
||||
<< 1/(gMin(rDeltaTY.field()) + VSMALL) << endl;
|
||||
rDeltaT.primitiveFieldRef().clamp_min(rDeltaTY);
|
||||
|
||||
rDeltaT.ref() = max(rDeltaT(), rDeltaTY);
|
||||
auto limits = gMinMax(rDeltaTY.field());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< " Composition = "
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -161,28 +179,22 @@ License
|
||||
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
|
||||
}
|
||||
|
||||
// Limit rate of change of time scale
|
||||
// Limit rate of change of time scale (=> smallest reciprocal time)
|
||||
// - reduce as much as required
|
||||
// - only increase at a fraction of old time scale
|
||||
if
|
||||
(
|
||||
rDeltaTDampingCoeff < 1
|
||||
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
|
||||
)
|
||||
if (rDeltaT0_damped)
|
||||
{
|
||||
rDeltaT = max
|
||||
(
|
||||
rDeltaT,
|
||||
(scalar(1) - rDeltaTDampingCoeff)*rDeltaT0
|
||||
);
|
||||
rDeltaT.clamp_min(rDeltaT0_damped());
|
||||
}
|
||||
|
||||
// Update tho boundary values of the reciprocal time-step
|
||||
rDeltaT.correctBoundaryConditions();
|
||||
|
||||
auto limits = gMinMax(rDeltaT.field());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< " Overall = "
|
||||
<< 1/gMax(rDeltaT.primitiveField())
|
||||
<< ", " << 1/gMin(rDeltaT.primitiveField()) << endl;
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020,2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -106,7 +106,7 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
// Fallback: set to the internal field
|
||||
fvPatchField<scalar>::patchInternalField(*this);
|
||||
this->extrapolateInternal();
|
||||
}
|
||||
|
||||
refValue() = *this;
|
||||
|
||||
@ -23,7 +23,11 @@
|
||||
|
||||
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
|
||||
|
||||
Info<< "Flow time scale min/max = "
|
||||
<< gMin(1/rDeltaT.primitiveField())
|
||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
{
|
||||
auto limits = gMinMax(rDeltaT.primitiveField());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< "Flow time scale min/max = "
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,18 +52,26 @@
|
||||
// Update the boundary values of the reciprocal time-step
|
||||
rDeltaT.correctBoundaryConditions();
|
||||
|
||||
Info<< "Flow time scale min/max = "
|
||||
<< gMin(1/rDeltaT.primitiveField())
|
||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
{
|
||||
auto limits = gMinMax(rDeltaT.primitiveField());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< "Flow time scale min/max = "
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
|
||||
if (rDeltaTSmoothingCoeff < 1.0)
|
||||
{
|
||||
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
|
||||
}
|
||||
|
||||
Info<< "Smoothed flow time scale min/max = "
|
||||
<< gMin(1/rDeltaT.primitiveField())
|
||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
{
|
||||
auto limits = gMinMax(rDeltaT.primitiveField());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< "Smoothed flow time scale min/max = "
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
|
||||
// Limit rate of change of time scale
|
||||
// - reduce as much as required
|
||||
@ -78,8 +86,10 @@
|
||||
rDeltaT0
|
||||
*max(rDeltaT/rDeltaT0, scalar(1) - rDeltaTDampingCoeff);
|
||||
|
||||
auto limits = gMinMax(rDeltaT.primitiveField());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< "Damped flow time scale min/max = "
|
||||
<< gMin(1/rDeltaT.primitiveField())
|
||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
scalar CoNum = -GREAT;
|
||||
forAll(fluidRegions, regionI)
|
||||
{
|
||||
CoNum = max
|
||||
CoNum = Foam::max
|
||||
(
|
||||
compressibleCourantNo
|
||||
(
|
||||
|
||||
@ -78,8 +78,8 @@
|
||||
}
|
||||
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin[i]);
|
||||
rho = min(rho, rhoMax[i]);
|
||||
|
||||
rho.clamp_range(rhoMin[i], rhoMax[i]);
|
||||
rho.relax();
|
||||
|
||||
Info<< "Min/max rho:" << min(rho).value() << ' '
|
||||
|
||||
@ -387,15 +387,18 @@ updateCoeffs()
|
||||
{
|
||||
scalar Q = gSum(kappa(Tp)*patch().magSf()*snGrad());
|
||||
|
||||
Info<< "T solid : " << nl << endl;
|
||||
auto limits = gMinMax(Tp);
|
||||
auto avg = gAverage(Tp);
|
||||
|
||||
Info
|
||||
<< " heat transfer rate from solid:" << Q
|
||||
<< " walltemperature "
|
||||
<< " min:" << gMin(Tp)
|
||||
<< " max:" << gMax(Tp)
|
||||
<< " avg:" << gAverage(Tp) << nl
|
||||
<< endl;
|
||||
Info<< "T solid : " << nl << endl;
|
||||
|
||||
Info
|
||||
<< " heat transfer rate from solid:" << Q
|
||||
<< " walltemperature "
|
||||
<< " min:" << limits.min()
|
||||
<< " max:" << limits.max()
|
||||
<< " avg:" << avg << nl
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
else if (regionType_ == fluid)
|
||||
@ -445,10 +448,16 @@ updateCoeffs()
|
||||
scalarField qLiq((Tp - Tc)*KdeltaLiq);
|
||||
scalarField qVap((Tp - Tv.patchInternalField())*KdeltaVap);
|
||||
|
||||
auto infoT = gMinMax(Tp);
|
||||
auto avgT = gAverage(Tp);
|
||||
|
||||
auto infoLiq = gMinMax(qLiq);
|
||||
auto infoVap = gMinMax(qVap);
|
||||
|
||||
Info<< "T flow : " << nl << endl;
|
||||
|
||||
Info<< " qLiq: " << gMin(qLiq) << " - " << gMax(qLiq) << endl;
|
||||
Info<< " qVap: " << gMin(qVap) << " - " << gMax(qVap) << endl;
|
||||
Info<< " qLiq: " << infoLiq.min() << " - " << infoLiq.max() << nl
|
||||
<< " qVap: " << infoVap.min() << " - " << infoVap.max() << nl;
|
||||
|
||||
scalar QLiq = gSum(qLiq*patch().magSf());
|
||||
scalar QVap = gSum(qVap*patch().magSf());
|
||||
@ -457,9 +466,9 @@ updateCoeffs()
|
||||
Info<< " Heat transfer to Vap: " << QVap << endl;
|
||||
|
||||
Info<< " walltemperature "
|
||||
<< " min:" << gMin(Tp)
|
||||
<< " max:" << gMax(Tp)
|
||||
<< " avg:" << gAverage(Tp)
|
||||
<< " min:" << infoT.min()
|
||||
<< " max:" << infoT.max()
|
||||
<< " avg:" << avgT
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
);
|
||||
|
||||
|
||||
CoNum =
|
||||
scalar regionCoNum =
|
||||
0.5*gMax
|
||||
(
|
||||
sumPhi/fluidRegions[regioni].V().field()
|
||||
@ -41,9 +41,9 @@
|
||||
(
|
||||
fvc::surfaceSum(mag(phi1 - phi2))().primitiveField()
|
||||
/ fluidRegions[regioni].V().field()
|
||||
)*runTime.deltaTValue(),
|
||||
)*runTime.deltaTValue();
|
||||
|
||||
CoNum = max(UrCoNum, CoNum);
|
||||
CoNum = Foam::max(CoNum, Foam::max(regionCoNum, UrCoNum));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
forAll(fluidRegions, regioni)
|
||||
{
|
||||
CoNum = max
|
||||
CoNum = Foam::max
|
||||
(
|
||||
compressibleCourantNo
|
||||
(
|
||||
@ -17,7 +17,7 @@
|
||||
/*
|
||||
forAll(porousFluidRegions, porousi)
|
||||
{
|
||||
CoNum = max
|
||||
CoNum = Foam::max
|
||||
(
|
||||
compressibleCourantNo
|
||||
(
|
||||
|
||||
@ -47,10 +47,10 @@ if (adjustTimeStep)
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
min
|
||||
Foam::min
|
||||
(
|
||||
min(maxCo/CoNum, maxDi/DiNum)*runTime.deltaTValue(),
|
||||
min(runTime.deltaTValue(), maxDeltaT)
|
||||
Foam::min(maxCo/CoNum, maxDi/DiNum)*runTime.deltaTValue(),
|
||||
Foam::min(runTime.deltaTValue(), maxDeltaT)
|
||||
)
|
||||
);
|
||||
Info<< "deltaT = " << runTime.deltaTValue() << endl;
|
||||
|
||||
@ -48,18 +48,14 @@ if (adjustTimeStep)
|
||||
scalar maxDeltaTFluid = maxCo/(CoNum + SMALL);
|
||||
scalar maxDeltaTSolid = maxDi/(DiNum + SMALL);
|
||||
|
||||
scalar deltaTFluid =
|
||||
min
|
||||
(
|
||||
min(maxDeltaTFluid, 1.0 + 0.1*maxDeltaTFluid),
|
||||
1.2
|
||||
);
|
||||
const scalar deltaTFluid =
|
||||
Foam::min(Foam::min(maxDeltaTFluid, 1.0 + 0.1*maxDeltaTFluid), 1.2);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
min
|
||||
Foam::min
|
||||
(
|
||||
min(deltaTFluid, maxDeltaTSolid)*runTime.deltaTValue(),
|
||||
Foam::min(deltaTFluid, maxDeltaTSolid)*runTime.deltaTValue(),
|
||||
maxDeltaT
|
||||
)
|
||||
);
|
||||
|
||||
@ -22,7 +22,7 @@ forAll(solidRegions, i)
|
||||
tmp<volScalarField> trho = thermo.rho();
|
||||
const volScalarField& rho = trho();
|
||||
|
||||
DiNum = max
|
||||
DiNum = Foam::max
|
||||
(
|
||||
solidRegionDiffNo
|
||||
(
|
||||
|
||||
@ -17,7 +17,7 @@ scalar DiNum = -GREAT;
|
||||
tmp<volScalarField> trho = thermo.rho();
|
||||
const volScalarField& rho = trho();
|
||||
|
||||
DiNum = max
|
||||
DiNum = Foam::max
|
||||
(
|
||||
solidRegionDiffNo
|
||||
(
|
||||
|
||||
@ -60,13 +60,10 @@ template<class Type>
|
||||
void zeroCells
|
||||
(
|
||||
GeometricField<Type, fvPatchField, volMesh>& vf,
|
||||
const labelList& cells
|
||||
const labelUList& cells
|
||||
)
|
||||
{
|
||||
forAll(cells, i)
|
||||
{
|
||||
vf[cells[i]] = Zero;
|
||||
}
|
||||
UIndirectList<Type>(vf.primitiveField(), cells) = Zero;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -103,8 +103,8 @@ dimensionedScalar alphaMax
|
||||
laminarTransport
|
||||
);
|
||||
|
||||
const labelList& inletCells = mesh.boundary()["inlet"].faceCells();
|
||||
//const labelList& outletCells = mesh.boundary()["outlet"].faceCells();
|
||||
const labelUList& inletCells = mesh.boundary()["inlet"].faceCells();
|
||||
//const labelUList& outletCells = mesh.boundary()["outlet"].faceCells();
|
||||
|
||||
volScalarField alpha
|
||||
(
|
||||
|
||||
@ -55,7 +55,7 @@ if (mesh.changing())
|
||||
dimensionedScalar rAUf("rAUf", dimTime, 1.0);
|
||||
|
||||
const cellCellStencilObject& overlap = Stencil::New(mesh);
|
||||
const labelList& cellTypes = overlap.cellTypes();
|
||||
const labelUList& cellTypes = overlap.cellTypes();
|
||||
const labelIOList& zoneIDs = overlap.zoneID();
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
|
||||
@ -36,18 +36,26 @@
|
||||
// Update the boundary values of the reciprocal time-step
|
||||
rDeltaT.correctBoundaryConditions();
|
||||
|
||||
Info<< "Flow time scale min/max = "
|
||||
<< gMin(1/rDeltaT.primitiveField())
|
||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
{
|
||||
auto limits = gMinMax(rDeltaT.primitiveField());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< "Flow time scale min/max = "
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
|
||||
if (rDeltaTSmoothingCoeff < 1.0)
|
||||
{
|
||||
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
|
||||
}
|
||||
|
||||
Info<< "Smoothed flow time scale min/max = "
|
||||
<< gMin(1/rDeltaT.primitiveField())
|
||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
{
|
||||
auto limits = gMinMax(rDeltaT.primitiveField());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< "Smoothed flow time scale min/max = "
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
|
||||
// Limit rate of change of time scale
|
||||
// - reduce as much as required
|
||||
@ -62,8 +70,10 @@
|
||||
rDeltaT0
|
||||
*max(rDeltaT/rDeltaT0, scalar(1) - rDeltaTDampingCoeff);
|
||||
|
||||
auto limits = gMinMax(rDeltaT.primitiveField());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< "Damped flow time scale min/max = "
|
||||
<< gMin(1/rDeltaT.primitiveField())
|
||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020,2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -54,10 +54,21 @@ License
|
||||
scalar alphaTemp(pimpleDict.getOrDefault("alphaTemp", 0.05));
|
||||
|
||||
|
||||
Info<< "Time scales min/max:" << endl;
|
||||
// The old reciprocal time scale field, with any damping factor
|
||||
tmp<volScalarField> rDeltaT0_damped;
|
||||
|
||||
// Cache old reciprocal time scale field
|
||||
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
|
||||
// Calculate damped value before applying any other changes
|
||||
if
|
||||
(
|
||||
rDeltaTDampingCoeff < 1
|
||||
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
|
||||
)
|
||||
{
|
||||
rDeltaT0_damped = (scalar(1) - rDeltaTDampingCoeff)*(rDeltaT);
|
||||
}
|
||||
|
||||
|
||||
Info<< "Time scales min/max:" << endl;
|
||||
|
||||
// Flow time scale
|
||||
{
|
||||
@ -67,12 +78,14 @@ License
|
||||
/((2*maxCo)*mesh.V()*rho())
|
||||
);
|
||||
|
||||
// Limit the largest time scale
|
||||
rDeltaT.max(1/maxDeltaT);
|
||||
// Limit the largest time scale (=> smallest reciprocal time)
|
||||
rDeltaT.clamp_min(1/maxDeltaT);
|
||||
|
||||
auto limits = gMinMax(rDeltaT.primitiveField());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< " Flow = "
|
||||
<< gMin(1/rDeltaT.primitiveField()) << ", "
|
||||
<< gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
|
||||
// Reaction source time scale
|
||||
@ -93,15 +106,13 @@ License
|
||||
)
|
||||
);
|
||||
|
||||
Info<< " Temperature = "
|
||||
<< gMin(1/(rDeltaTT.field() + VSMALL)) << ", "
|
||||
<< gMax(1/(rDeltaTT.field() + VSMALL)) << endl;
|
||||
rDeltaT.primitiveFieldRef().clamp_min(rDeltaTT);
|
||||
|
||||
rDeltaT.ref() = max
|
||||
(
|
||||
rDeltaT(),
|
||||
rDeltaTT
|
||||
);
|
||||
auto limits = gMinMax(rDeltaTT.field());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< " Temperature = "
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
|
||||
// Update tho boundary values of the reciprocal time-step
|
||||
@ -113,25 +124,19 @@ License
|
||||
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
|
||||
}
|
||||
|
||||
// Limit rate of change of time scale
|
||||
// Limit rate of change of time scale (=> smallest reciprocal time)
|
||||
// - reduce as much as required
|
||||
// - only increase at a fraction of old time scale
|
||||
if
|
||||
(
|
||||
rDeltaTDampingCoeff < 1.0
|
||||
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
|
||||
)
|
||||
if (rDeltaT0_damped)
|
||||
{
|
||||
rDeltaT = max
|
||||
(
|
||||
rDeltaT,
|
||||
(scalar(1) - rDeltaTDampingCoeff)*rDeltaT0
|
||||
);
|
||||
rDeltaT.clamp_min(rDeltaT0_damped());
|
||||
}
|
||||
|
||||
auto limits = gMinMax(rDeltaT.primitiveField());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< " Overall = "
|
||||
<< gMin(1/rDeltaT.primitiveField())
|
||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -36,13 +36,18 @@ Description
|
||||
if (adjustTimeStep)
|
||||
{
|
||||
const scalar maxDeltaTFact =
|
||||
min(maxCo/(CoNum + SMALL), maxCo/(surfaceFilm.CourantNumber() + SMALL));
|
||||
Foam::min
|
||||
(
|
||||
maxCo/(CoNum + SMALL),
|
||||
maxCo/(surfaceFilm.CourantNumber() + SMALL)
|
||||
);
|
||||
|
||||
const scalar deltaTFact =
|
||||
min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
Foam::min(Foam::min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
min
|
||||
Foam::min
|
||||
(
|
||||
deltaTFact*runTime.deltaTValue(),
|
||||
maxDeltaT
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020,2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -54,10 +54,21 @@ License
|
||||
scalar alphaTemp(pimpleDict.getOrDefault("alphaTemp", 0.05));
|
||||
|
||||
|
||||
Info<< "Time scales min/max:" << endl;
|
||||
// The old reciprocal time scale field, with any damping factor
|
||||
tmp<volScalarField> rDeltaT0_damped;
|
||||
|
||||
// Cache old reciprocal time scale field
|
||||
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
|
||||
// Calculate damped value before applying any other changes
|
||||
if
|
||||
(
|
||||
rDeltaTDampingCoeff < 1
|
||||
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
|
||||
)
|
||||
{
|
||||
rDeltaT0_damped = (scalar(1) - rDeltaTDampingCoeff)*(rDeltaT);
|
||||
}
|
||||
|
||||
|
||||
Info<< "Time scales min/max:" << endl;
|
||||
|
||||
// Flow time scale
|
||||
{
|
||||
@ -67,12 +78,14 @@ License
|
||||
/((2*maxCo)*mesh.V()*rho())
|
||||
);
|
||||
|
||||
// Limit the largest time scale
|
||||
rDeltaT.max(1/maxDeltaT);
|
||||
// Limit the largest time scale (=> smallest reciprocal time)
|
||||
rDeltaT.clamp_min(1/maxDeltaT);
|
||||
|
||||
auto limits = gMinMax(rDeltaT.primitiveField());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< " Flow = "
|
||||
<< gMin(1/rDeltaT.primitiveField()) << ", "
|
||||
<< gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
|
||||
// Reaction source time scale
|
||||
@ -92,15 +105,13 @@ License
|
||||
)
|
||||
);
|
||||
|
||||
Info<< " Temperature = "
|
||||
<< gMin(1/(rDeltaTT.field() + VSMALL)) << ", "
|
||||
<< gMax(1/(rDeltaTT.field() + VSMALL)) << endl;
|
||||
rDeltaT.primitiveFieldRef().clamp_min(rDeltaTT);
|
||||
|
||||
rDeltaT.ref() = max
|
||||
(
|
||||
rDeltaT(),
|
||||
rDeltaTT
|
||||
);
|
||||
auto limits = gMinMax(rDeltaTT.field());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< " Temperature = "
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
|
||||
// Update the boundary values of the reciprocal time-step
|
||||
@ -112,25 +123,22 @@ License
|
||||
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
|
||||
}
|
||||
|
||||
// Limit rate of change of time scale
|
||||
// Limit rate of change of time scale (=> smallest reciprocal time)
|
||||
// - reduce as much as required
|
||||
// - only increase at a fraction of old time scale
|
||||
if
|
||||
(
|
||||
rDeltaTDampingCoeff < 1.0
|
||||
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
|
||||
)
|
||||
if (rDeltaT0_damped)
|
||||
{
|
||||
rDeltaT = max
|
||||
(
|
||||
rDeltaT,
|
||||
(scalar(1) - rDeltaTDampingCoeff)*rDeltaT0
|
||||
);
|
||||
rDeltaT.clamp_min(rDeltaT0_damped());
|
||||
}
|
||||
|
||||
// Update the boundary values of the reciprocal time-step
|
||||
rDeltaT.correctBoundaryConditions();
|
||||
|
||||
auto limits = gMinMax(rDeltaT.primitiveField());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< " Overall = "
|
||||
<< gMin(1/rDeltaT.primitiveField())
|
||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -48,8 +48,7 @@ U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.clamp_range(rhoMin, rhoMax);
|
||||
rho.relax();
|
||||
|
||||
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
|
||||
|
||||
@ -49,8 +49,7 @@
|
||||
fvOptions.correct(U);
|
||||
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.clamp_range(rhoMin, rhoMax);
|
||||
rho.relax();
|
||||
|
||||
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.clamp_range(rhoMin, rhoMax);
|
||||
rho.relax();
|
||||
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
@ -94,8 +93,7 @@ p.relax();
|
||||
|
||||
// Recalculate density from the relaxed pressure
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.clamp_range(rhoMin, rhoMax);
|
||||
rho.relax();
|
||||
Info<< "rho min/max : " << min(rho).value() << " " << max(rho).value() << endl;
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.clamp_range(rhoMin, rhoMax);
|
||||
rho.relax();
|
||||
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
@ -94,8 +93,7 @@ p.relax();
|
||||
|
||||
// Recalculate density from the relaxed pressure
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.clamp_range(rhoMin, rhoMax);
|
||||
rho.relax();
|
||||
Info<< "rho min/max : " << min(rho).value() << " " << max(rho).value() << endl;
|
||||
|
||||
|
||||
@ -36,13 +36,14 @@ Description
|
||||
if (adjustTimeStep)
|
||||
{
|
||||
scalar maxDeltaTFact =
|
||||
min(maxCo/(CoNum + SMALL), maxAlphaCo/(alphaCoNum + SMALL));
|
||||
Foam::min(maxCo/(CoNum + SMALL), maxAlphaCo/(alphaCoNum + SMALL));
|
||||
|
||||
scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
const scalar deltaTFact =
|
||||
Foam::min(Foam::min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
min
|
||||
Foam::min
|
||||
(
|
||||
deltaTFact*runTime.deltaTValue(),
|
||||
maxDeltaT
|
||||
|
||||
@ -53,6 +53,21 @@
|
||||
pimpleDict.getOrDefault<scalar>("maxDeltaT", GREAT)
|
||||
);
|
||||
|
||||
|
||||
// The old reciprocal time scale field, with any damping factor
|
||||
tmp<volScalarField> rDeltaT0_damped;
|
||||
|
||||
// Calculate damped value before applying any other changes
|
||||
if
|
||||
(
|
||||
rDeltaTDampingCoeff < 1
|
||||
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
|
||||
)
|
||||
{
|
||||
rDeltaT0_damped = (scalar(1) - rDeltaTDampingCoeff)*(rDeltaT);
|
||||
}
|
||||
|
||||
|
||||
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
|
||||
|
||||
// Set the reciprocal time-step from the local Courant number
|
||||
@ -83,10 +98,13 @@
|
||||
// Update tho boundary values of the reciprocal time-step
|
||||
rDeltaT.correctBoundaryConditions();
|
||||
|
||||
Info<< "Flow time scale min/max = "
|
||||
<< gMin(1/rDeltaT.primitiveField())
|
||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
{
|
||||
auto limits = gMinMax(rDeltaT.primitiveField());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< "Flow time scale min/max = "
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
if (rDeltaTSmoothingCoeff < 1.0)
|
||||
{
|
||||
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
|
||||
@ -110,27 +128,25 @@
|
||||
fvc::sweep(rDeltaT, alpha1, nAlphaSweepIter, alphaSpreadDiff);
|
||||
}
|
||||
|
||||
Info<< "Smoothed flow time scale min/max = "
|
||||
<< gMin(1/rDeltaT.primitiveField())
|
||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
{
|
||||
auto limits = gMinMax(rDeltaT.primitiveField());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
// Limit rate of change of time scale
|
||||
Info<< "Smoothed flow time scale min/max = "
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
|
||||
// Limit rate of change of time scale (=> smallest reciprocal time)
|
||||
// - reduce as much as required
|
||||
// - only increase at a fraction of old time scale
|
||||
if
|
||||
(
|
||||
rDeltaTDampingCoeff < 1.0
|
||||
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
|
||||
)
|
||||
if (rDeltaT0_damped)
|
||||
{
|
||||
rDeltaT = max
|
||||
(
|
||||
rDeltaT,
|
||||
(scalar(1) - rDeltaTDampingCoeff)*rDeltaT0
|
||||
);
|
||||
rDeltaT.clamp_min(rDeltaT0_damped());
|
||||
|
||||
auto limits = gMinMax(rDeltaT.primitiveField());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< "Damped flow time scale min/max = "
|
||||
<< gMin(1/rDeltaT.primitiveField())
|
||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,13 +36,14 @@ Description
|
||||
if (adjustTimeStep)
|
||||
{
|
||||
scalar maxDeltaTFact =
|
||||
min(maxCo/(CoNum + SMALL), maxAcousticCo/(acousticCoNum + SMALL));
|
||||
Foam::min(maxCo/(CoNum + SMALL), maxAcousticCo/(acousticCoNum + SMALL));
|
||||
|
||||
scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
const scalar deltaTFact =
|
||||
Foam::min(Foam::min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
min
|
||||
Foam::min
|
||||
(
|
||||
deltaTFact*runTime.deltaTValue(),
|
||||
maxDeltaT
|
||||
|
||||
@ -37,11 +37,15 @@ if (adjustTimeStep)
|
||||
if (CoNum > SMALL)
|
||||
{
|
||||
scalar maxDeltaTFact =
|
||||
min(maxCo/(CoNum + SMALL), maxAcousticCo/(acousticCoNum + SMALL));
|
||||
Foam::min
|
||||
(
|
||||
maxCo/(CoNum + SMALL),
|
||||
maxAcousticCo/(acousticCoNum + SMALL)
|
||||
);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
min
|
||||
Foam::min
|
||||
(
|
||||
maxDeltaTFact*runTime.deltaTValue(),
|
||||
maxDeltaT
|
||||
|
||||
@ -26,12 +26,12 @@ forAll(dgdt, celli)
|
||||
{
|
||||
if (dgdt[celli] > 0.0)
|
||||
{
|
||||
Sp[celli] -= dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
|
||||
Su[celli] += dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
|
||||
Sp[celli] -= dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
|
||||
Su[celli] += dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
|
||||
}
|
||||
else if (dgdt[celli] < 0.0)
|
||||
{
|
||||
Sp[celli] += dgdt[celli]/max(alpha1[celli], 1e-4);
|
||||
Sp[celli] += dgdt[celli]/Foam::max(alpha1[celli], 1e-4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -210,7 +210,7 @@ void VoFPatchTransfer::correct
|
||||
film().toRegion(patchi, Vp);
|
||||
|
||||
const polyPatch& pp = pbm[patchi];
|
||||
const labelList& faceCells = pp.faceCells();
|
||||
const labelUList& faceCells = pp.faceCells();
|
||||
|
||||
// Accumulate the total mass removed from patch
|
||||
scalar dMassPatch = 0;
|
||||
|
||||
@ -26,12 +26,12 @@ forAll(dgdt, celli)
|
||||
{
|
||||
if (dgdt[celli] > 0.0)
|
||||
{
|
||||
Sp[celli] -= dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
|
||||
Su[celli] += dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
|
||||
Sp[celli] -= dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
|
||||
Su[celli] += dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
|
||||
}
|
||||
else if (dgdt[celli] < 0.0)
|
||||
{
|
||||
Sp[celli] += dgdt[celli]/max(alpha1[celli], 1e-4);
|
||||
Sp[celli] += dgdt[celli]/Foam::max(alpha1[celli], 1e-4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -26,12 +26,12 @@ forAll(dgdt, celli)
|
||||
{
|
||||
if (dgdt[celli] > 0.0)
|
||||
{
|
||||
Sp[celli] -= dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
|
||||
Su[celli] += dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
|
||||
Sp[celli] -= dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
|
||||
Su[celli] += dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
|
||||
}
|
||||
else if (dgdt[celli] < 0.0)
|
||||
{
|
||||
Sp[celli] += dgdt[celli]/max(alpha1[celli], 1e-4);
|
||||
Sp[celli] += dgdt[celli]/Foam::max(alpha1[celli], 1e-4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -135,7 +135,7 @@ public:
|
||||
virtual volScalarField& he()
|
||||
{
|
||||
NotImplemented;
|
||||
return const_cast<volScalarField&>(volScalarField::null());
|
||||
return volScalarField::null().constCast();
|
||||
}
|
||||
|
||||
//- Enthalpy/Internal energy [J/kg]
|
||||
|
||||
@ -243,7 +243,7 @@ public:
|
||||
virtual volScalarField& he()
|
||||
{
|
||||
NotImplemented;
|
||||
return const_cast<volScalarField&>(volScalarField::null());
|
||||
return volScalarField::null().constCast();
|
||||
}
|
||||
|
||||
//- Enthalpy/Internal energy [J/kg]
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -679,7 +679,7 @@ void Foam::radiation::laserDTRM::calculate()
|
||||
}
|
||||
}
|
||||
|
||||
scalar totalQ = gSum(Q_.primitiveFieldRef()*mesh_.V());
|
||||
scalar totalQ = gWeightedSum(mesh_.V(), Q_.primitiveField());
|
||||
Info << "Total energy absorbed [W]: " << totalQ << endl;
|
||||
|
||||
if (mesh_.time().writeTime())
|
||||
|
||||
@ -36,13 +36,13 @@ Description
|
||||
if (adjustTimeStep)
|
||||
{
|
||||
scalar maxDeltaTFact =
|
||||
min
|
||||
Foam::min
|
||||
(
|
||||
maxCo/(CoNum + SMALL),
|
||||
min
|
||||
Foam::min
|
||||
(
|
||||
maxAlphaCo/(alphaCoNum + SMALL),
|
||||
min
|
||||
Foam::min
|
||||
(
|
||||
maxAlphaDdt/(ddtAlphaNum + SMALL),
|
||||
maxDi/(DiNum + SMALL)
|
||||
@ -50,16 +50,18 @@ if (adjustTimeStep)
|
||||
)
|
||||
);
|
||||
|
||||
scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
const scalar deltaTFact =
|
||||
Foam::min(Foam::min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
min
|
||||
Foam::min
|
||||
(
|
||||
deltaTFact*runTime.deltaTValue(),
|
||||
maxDeltaT
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "deltaT = " << runTime.deltaTValue() << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -86,7 +86,7 @@ public:
|
||||
virtual volScalarField& he()
|
||||
{
|
||||
NotImplemented;
|
||||
return const_cast<volScalarField&>(volScalarField::null());
|
||||
return volScalarField::null().constCast();
|
||||
}
|
||||
|
||||
//- Return access to the internal energy field [J/Kg]
|
||||
|
||||
@ -65,7 +65,7 @@
|
||||
dimensionedScalar rAUf("rAUf", dimTime/rho.dimensions(), 1.0);
|
||||
|
||||
const cellCellStencilObject& overlap = Stencil::New(mesh);
|
||||
const labelList& cellTypes = overlap.cellTypes();
|
||||
const labelUList& cellTypes = overlap.cellTypes();
|
||||
const labelIOList& zoneIDs = overlap.zoneID();
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
|
||||
@ -38,7 +38,9 @@
|
||||
|
||||
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
|
||||
|
||||
auto limits = gMinMax(rDeltaT.primitiveField());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< "Flow time scale min/max = "
|
||||
<< gMin(1/rDeltaT.primitiveField())
|
||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
|
||||
@ -8,5 +8,5 @@
|
||||
|
||||
Info<< "Max Ur Courant Number = " << UrCoNum << endl;
|
||||
|
||||
CoNum = max(CoNum, UrCoNum);
|
||||
CoNum = Foam::max(CoNum, UrCoNum);
|
||||
}
|
||||
|
||||
@ -31,7 +31,9 @@
|
||||
|
||||
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
|
||||
|
||||
auto limits = gMinMax(rDeltaT.primitiveField());
|
||||
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
|
||||
|
||||
Info<< "Flow time scale min/max = "
|
||||
<< gMin(1/rDeltaT.primitiveField())
|
||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
<< limits.min() << ", " << limits.max() << endl;
|
||||
}
|
||||
|
||||
@ -8,5 +8,5 @@
|
||||
|
||||
Info<< "Max Ur Courant Number = " << UrCoNum << endl;
|
||||
|
||||
CoNum = max(CoNum, UrCoNum);
|
||||
CoNum = Foam::max(CoNum, UrCoNum);
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -25,9 +25,12 @@ License
|
||||
|
||||
Description
|
||||
Test the sizeof for basic types.
|
||||
Also tests how the data mapping of OpenFOAM types to UPstream (MPI)
|
||||
type ids are handled.
|
||||
|
||||
Can be compiled and run without any OpenFOAM libraries.
|
||||
|
||||
g++ -std=c++11 -oTest-machine-sizes Test-machine-sizes.cpp
|
||||
g++ -std=c++17 -oTest-machine-sizes Test-machine-sizes.cpp
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -37,6 +40,134 @@ Description
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
#include <typeinfo>
|
||||
#include <type_traits>
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Partial copy from UPstream.H
|
||||
|
||||
//- Some MPI data types
|
||||
//
|
||||
//- Mapping of some fundamental and aggregate types to MPI data types
|
||||
enum class dataTypes : int
|
||||
{
|
||||
// Fundamental Types [10]:
|
||||
Basic_begin,
|
||||
type_byte = Basic_begin,
|
||||
type_int16,
|
||||
type_int32,
|
||||
type_int64,
|
||||
type_uint16,
|
||||
type_uint32,
|
||||
type_uint64,
|
||||
type_float,
|
||||
type_double,
|
||||
type_long_double,
|
||||
invalid,
|
||||
Basic_end = invalid
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Partial copy from UPstreamTraits.H
|
||||
|
||||
//- UPstream data type corresponding to an intrinsic (MPI) type
|
||||
template<class T>
|
||||
struct UPstream_mpi_dataType : std::false_type
|
||||
{
|
||||
static constexpr auto datatype_id = dataTypes::invalid;
|
||||
};
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Specializations to match elements of UPstream::dataTypes
|
||||
#undef defineUPstreamDataTraits
|
||||
#define defineUPstreamDataTraits(TypeId, Type) \
|
||||
template<> struct UPstream_mpi_dataType<Type> : std::true_type \
|
||||
{ \
|
||||
static constexpr auto datatype_id = dataTypes::TypeId; \
|
||||
};
|
||||
|
||||
|
||||
defineUPstreamDataTraits(type_byte, char);
|
||||
defineUPstreamDataTraits(type_byte, unsigned char);
|
||||
defineUPstreamDataTraits(type_int16, int16_t);
|
||||
defineUPstreamDataTraits(type_int32, int32_t);
|
||||
defineUPstreamDataTraits(type_int64, int64_t);
|
||||
defineUPstreamDataTraits(type_uint16, uint16_t);
|
||||
defineUPstreamDataTraits(type_uint32, uint32_t);
|
||||
defineUPstreamDataTraits(type_uint64, uint64_t);
|
||||
defineUPstreamDataTraits(type_float, float);
|
||||
defineUPstreamDataTraits(type_double, double);
|
||||
defineUPstreamDataTraits(type_long_double, long double);
|
||||
|
||||
#undef defineUPstreamDataTraits
|
||||
|
||||
|
||||
//- Explicit handling of data type aliases. This is necessary since
|
||||
//- different systems map things like 'unsigned long' differently but we
|
||||
//- restrict ourselves to int32/int64 types
|
||||
template<class T>
|
||||
struct UPstream_alias_dataType
|
||||
:
|
||||
std::bool_constant
|
||||
<
|
||||
// Basic MPI type
|
||||
UPstream_mpi_dataType<std::remove_cv_t<T>>::value ||
|
||||
(
|
||||
// Or some int 32/64 type to re-map
|
||||
std::is_integral_v<T>
|
||||
&& (sizeof(T) == sizeof(int32_t) || sizeof(T) == sizeof(int64_t))
|
||||
)
|
||||
>
|
||||
{
|
||||
using base = std::conditional_t
|
||||
<
|
||||
UPstream_mpi_dataType<std::remove_cv_t<T>>::value,
|
||||
std::remove_cv_t<T>, // <- using mpi type (no alias)
|
||||
std::conditional_t // <- using alias
|
||||
<
|
||||
(
|
||||
std::is_integral_v<T>
|
||||
&& (sizeof(T) == sizeof(int32_t) || sizeof(T) == sizeof(int64_t))
|
||||
),
|
||||
std::conditional_t
|
||||
<
|
||||
(sizeof(T) == sizeof(int32_t)),
|
||||
std::conditional_t<std::is_signed_v<T>, int32_t, uint32_t>,
|
||||
std::conditional_t<std::is_signed_v<T>, int64_t, uint64_t>
|
||||
>,
|
||||
char // Fallback is a byte (eg, arbitrary contiguous data)
|
||||
>
|
||||
>;
|
||||
|
||||
static constexpr auto datatype_id =
|
||||
UPstream_mpi_dataType<base>::datatype_id;
|
||||
};
|
||||
|
||||
|
||||
// Handle int8_t/uint8_t as aliases since 'signed char' etc may be
|
||||
// ambiguous
|
||||
|
||||
//- Map \c int8_t to UPstream::dataTypes::type_byte
|
||||
template<>
|
||||
struct UPstream_alias_dataType<int8_t> : std::true_type
|
||||
{
|
||||
using base = char;
|
||||
static constexpr auto datatype_id = dataTypes::type_byte;
|
||||
};
|
||||
|
||||
//- Map \c uint8_t to UPstream::dataTypes::type_byte
|
||||
template<>
|
||||
struct UPstream_alias_dataType<uint8_t> : std::true_type
|
||||
{
|
||||
using base = unsigned char;
|
||||
static constexpr auto datatype_id = dataTypes::type_byte;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class T>
|
||||
void print(const char* name, bool showLimits = true)
|
||||
@ -47,28 +178,84 @@ void print(const char* name, bool showLimits = true)
|
||||
if (showLimits)
|
||||
{
|
||||
std::cout
|
||||
<< " \"max\"=" << std::numeric_limits<T>::max();
|
||||
<< " max=<";
|
||||
|
||||
if constexpr (sizeof(T) == 1)
|
||||
{
|
||||
std::cout << int(std::numeric_limits<T>::max());
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << std::numeric_limits<T>::max();
|
||||
}
|
||||
std::cout << '>';
|
||||
}
|
||||
|
||||
// A declared or deduced MPI type, or aliased
|
||||
if constexpr (UPstream_mpi_dataType<T>::value)
|
||||
{
|
||||
std::cout
|
||||
<< " is_mpi=("
|
||||
<< int(UPstream_mpi_dataType<T>::datatype_id) << ')';
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << " is_mpi=(null)";
|
||||
}
|
||||
|
||||
// Any aliases?
|
||||
if constexpr (UPstream_alias_dataType<T>::value)
|
||||
{
|
||||
if constexpr (UPstream_mpi_dataType<T>::value)
|
||||
{
|
||||
std::cout << " alias=base";
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout
|
||||
<< " alias=("
|
||||
<< int(UPstream_alias_dataType<T>::datatype_id) << ')';
|
||||
}
|
||||
}
|
||||
|
||||
std::cout<< '\n';
|
||||
}
|
||||
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
std::cout<< "c++ = " << __cplusplus << '\n';
|
||||
std::cout<< "machine sizes\n---\n\n";
|
||||
std::cout<< "machine sizes (and some MPI traits)\n---\n\n";
|
||||
|
||||
print<int8_t>("int8_t");
|
||||
print<uint8_t>("uint8_t");
|
||||
print<int16_t>("int16_t");
|
||||
print<uint16_t>("uint16_t");
|
||||
print<int32_t>("int32_t");
|
||||
print<uint32_t>("uint32_t");
|
||||
print<int64_t>("int64_t");
|
||||
print<uint64_t>("uint64_t");
|
||||
|
||||
std::cout << '\n';
|
||||
print<char>("char");
|
||||
print<signed char>("signed char");
|
||||
print<unsigned char>("unsigned char");
|
||||
print<short>("short");
|
||||
print<int>("int");
|
||||
print<unsigned>("unsigned");
|
||||
print<long>("long");
|
||||
print<unsigned long>("unsigned long");
|
||||
print<std::size_t>("std::size_t");
|
||||
print<long long>("long long");
|
||||
|
||||
std::cout << '\n';
|
||||
print<std::size_t>("std::size_t");
|
||||
print<std::streamsize>("std::streamsize");
|
||||
|
||||
std::cout << '\n';
|
||||
print<float>("float");
|
||||
print<double>("double");
|
||||
print<long double>("long double");
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
Test-CircularBuffer.C
|
||||
Test-CircularBuffer.cxx
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-CircularBuffer
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -38,12 +38,11 @@ Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "complex.H"
|
||||
#include "Tensor.H"
|
||||
#include "SymmTensor.H"
|
||||
#include "SphericalTensor.H"
|
||||
#include "DiagTensor.H"
|
||||
#include "scalar.H"
|
||||
#include "complex.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -57,45 +56,11 @@ unsigned nTest_ = 0;
|
||||
unsigned nFail_ = 0;
|
||||
|
||||
|
||||
// Compare two floating point types, and print output.
|
||||
// Do ++nFail_ if values of two objects are not equal within a given tolerance.
|
||||
// The function is converted from PEP-485.
|
||||
template<class Type>
|
||||
typename std::enable_if<pTraits<Type>::rank == 0, void>::type
|
||||
cmp
|
||||
(
|
||||
const word& msg,
|
||||
const Type& x,
|
||||
const Type& y,
|
||||
const scalar relTol = 1e-8, //<! are values the same within 8 decimals
|
||||
const scalar absTol = 0 //<! useful for cmps near zero
|
||||
)
|
||||
{
|
||||
Info<< msg << x << endl;
|
||||
|
||||
unsigned nFail = 0;
|
||||
|
||||
if (max(absTol, relTol*max(mag(x), mag(y))) < mag(x - y))
|
||||
{
|
||||
++nFail;
|
||||
}
|
||||
|
||||
if (nFail)
|
||||
{
|
||||
Info<< nl
|
||||
<< " #### Fail in " << nFail << " comps ####" << nl << endl;
|
||||
++nFail_;
|
||||
}
|
||||
++nTest_;
|
||||
}
|
||||
|
||||
|
||||
// Compare two containers elementwise, and print output.
|
||||
// Do ++nFail_ if two components are not equal within a given tolerance.
|
||||
// The function is converted from PEP-485
|
||||
template<class Type>
|
||||
typename std::enable_if<pTraits<Type>::rank != 0, void>::type
|
||||
cmp
|
||||
void cmp
|
||||
(
|
||||
const word& msg,
|
||||
const Type& x,
|
||||
@ -104,18 +69,37 @@ cmp
|
||||
const scalar absTol = 0
|
||||
)
|
||||
{
|
||||
Info<< msg << x << endl;
|
||||
const auto notEqual = [=](const auto& a, const auto& b) -> bool
|
||||
{
|
||||
return
|
||||
(
|
||||
Foam::max(absTol, relTol*Foam::max(Foam::mag(a), Foam::mag(b)))
|
||||
< Foam::mag(a - b)
|
||||
);
|
||||
};
|
||||
|
||||
unsigned nFail = 0;
|
||||
|
||||
for (direction i = 0; i < pTraits<Type>::nComponents; ++i)
|
||||
if constexpr (is_vectorspace_v<Type>)
|
||||
{
|
||||
if (max(absTol, relTol*max(mag(x[i]), mag(y[i]))) < mag(x[i] - y[i]))
|
||||
for (direction i = 0; i < pTraits<Type>::nComponents; ++i)
|
||||
{
|
||||
if (notEqual(x[i], y[i]))
|
||||
{
|
||||
++nFail;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (notEqual(x, y))
|
||||
{
|
||||
++nFail;
|
||||
}
|
||||
}
|
||||
|
||||
Info<< msg << x << endl;
|
||||
|
||||
if (nFail)
|
||||
{
|
||||
Info<< nl
|
||||
@ -368,27 +352,26 @@ void test_global_opers(Type)
|
||||
|
||||
// Do compile-time recursion over the given types
|
||||
template<std::size_t I = 0, typename... Tp>
|
||||
inline typename std::enable_if<I == sizeof...(Tp), void>::type
|
||||
run_tests(const std::tuple<Tp...>& types, const List<word>& typeID){}
|
||||
|
||||
|
||||
template<std::size_t I = 0, typename... Tp>
|
||||
inline typename std::enable_if<I < sizeof...(Tp), void>::type
|
||||
run_tests(const std::tuple<Tp...>& types, const List<word>& typeID)
|
||||
void run_tests(const std::tuple<Tp...>& types, const List<word>& names)
|
||||
{
|
||||
Info<< nl << " ## Test constructors: "<< typeID[I] <<" ##" << nl;
|
||||
test_constructors(std::get<I>(types));
|
||||
if constexpr (I < sizeof...(Tp))
|
||||
{
|
||||
const auto& name = names[I];
|
||||
|
||||
Info<< nl << " ## Test member functions: "<< typeID[I] <<" ##" << nl;
|
||||
test_member_funcs(std::get<I>(types));
|
||||
Info<< nl << " ## Test constructors: " << name << " ##" << nl;
|
||||
test_constructors(std::get<I>(types));
|
||||
|
||||
Info<< nl << " ## Test global functions: "<< typeID[I] << " ##" << nl;
|
||||
test_global_funcs(std::get<I>(types));
|
||||
Info<< nl << " ## Test member functions: " << name << " ##" << nl;
|
||||
test_member_funcs(std::get<I>(types));
|
||||
|
||||
Info<< nl << " ## Test global operators: "<< typeID[I] <<" ##" << nl;
|
||||
test_global_opers(std::get<I>(types));
|
||||
Info<< nl << " ## Test global functions: " << name << " ##" << nl;
|
||||
test_global_funcs(std::get<I>(types));
|
||||
|
||||
run_tests<I + 1, Tp...>(types, typeID);
|
||||
Info<< nl << " ## Test global operators: " << name << " ##" << nl;
|
||||
test_global_opers(std::get<I>(types));
|
||||
|
||||
run_tests<I + 1, Tp...>(types, names);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -403,8 +386,8 @@ int main()
|
||||
|
||||
const List<word> typeID
|
||||
({
|
||||
"DiagTensor<floatScalar>",
|
||||
"DiagTensor<doubleScalar>",
|
||||
"DiagTensor<float>",
|
||||
"DiagTensor<double>",
|
||||
"DiagTensor<complex>"
|
||||
});
|
||||
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
Test-Dictionary.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-Dictionary
|
||||
@ -1,3 +1,3 @@
|
||||
Test-DynamicList.C
|
||||
Test-DynamicList.cxx
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-DynamicList
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
Test-DynamicList2.C
|
||||
Test-DynamicList2.cxx
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-DynamicList2
|
||||
|
||||
@ -52,7 +52,8 @@ void printInfo
|
||||
if (showSize)
|
||||
{
|
||||
Info<< " size=\"" << list.size()
|
||||
<< "\" capacity=\"" << list.capacity() << "\"";
|
||||
<< "\" capacity=\"" << list.capacity() << "\""
|
||||
<< "\" min=\"" << SizeMin << "\"" ;
|
||||
if (list.cdata())
|
||||
{
|
||||
Info<< " ptr=\"" << name(list.cdata()) << "\"";
|
||||
@ -79,7 +80,8 @@ void printInfo
|
||||
if (showSize)
|
||||
{
|
||||
Info<< " size=\"" << list.size()
|
||||
<< "\" capacity=\"" << list.capacity() << "\"";
|
||||
<< "\" capacity=\"" << list.capacity() << "\""
|
||||
<< "\" min=\"" << SizeMin << "\"" ;
|
||||
if (list.cdata())
|
||||
{
|
||||
Info<< " ptr=\"" << name(list.cdata()) << "\"";
|
||||
@ -168,6 +170,22 @@ int main(int argc, char *argv[])
|
||||
printInfo("", list2);
|
||||
}
|
||||
|
||||
{
|
||||
DynamicList<float, 32> list1(std::pair<label,label>(16,0));
|
||||
list1 = -1;
|
||||
|
||||
Info<< "construct with specified size/capacity" << nl;
|
||||
printInfo("", list1);
|
||||
}
|
||||
|
||||
{
|
||||
DynamicList<float, 32> list1(std::pair<label,label>(8,16));
|
||||
list1 = -1;
|
||||
|
||||
Info<< "construct with specified size/capacity" << nl;
|
||||
printInfo("", list1);
|
||||
}
|
||||
|
||||
Info<< "\nEnd\n";
|
||||
|
||||
return 0;
|
||||
@ -1,3 +1,3 @@
|
||||
Test-FixedList.C
|
||||
Test-FixedList.cxx
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-FixedList
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -41,7 +41,6 @@ See also
|
||||
#include "List.H"
|
||||
#include "IPstream.H"
|
||||
#include "OPstream.H"
|
||||
#include <numeric>
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -85,8 +84,7 @@ void compileInfo()
|
||||
|
||||
|
||||
template<class FixedListType>
|
||||
typename std::enable_if
|
||||
<(FixedListType::max_size() == 2), bool>::type
|
||||
std::enable_if_t<(FixedListType::max_size() == 2), bool>
|
||||
is_pair()
|
||||
{
|
||||
return true;
|
||||
@ -94,7 +92,7 @@ is_pair()
|
||||
|
||||
|
||||
template<class FixedListType>
|
||||
typename std::enable_if<(FixedListType::max_size() != 2), std::string>::type
|
||||
std::enable_if_t<(FixedListType::max_size() != 2), std::string>
|
||||
is_pair()
|
||||
{
|
||||
return "not really at all";
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2412 |
|
||||
| \\ / O peration | Version: v2506 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2412 |
|
||||
| \\ / O peration | Version: v2506 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
Test-HashTable1.C
|
||||
Test-HashTable1.cxx
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-HashTable1
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -37,11 +37,30 @@ License
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
void checkCanonicalSize(label size)
|
||||
{
|
||||
const auto n = HashTableCore::canonicalSize(size);
|
||||
|
||||
std::ostringstream buf;
|
||||
buf.setf(std::ios_base::hex, std::ios_base::basefield);
|
||||
buf << n;
|
||||
|
||||
Info<< "hash-table size of " << size
|
||||
<< " = " << n << " (0x" << buf.str().c_str() << ')' << nl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main()
|
||||
{
|
||||
for (label size : { -1, 0, 1, 7, 500, 1024, 1025, 10000, (labelMax-1)} )
|
||||
{
|
||||
checkCanonicalSize(size);
|
||||
}
|
||||
Info<< nl;
|
||||
|
||||
HashTable<scalar> table1
|
||||
{
|
||||
{"aaa", 1.0},
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
Copyright (C) 2021-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -42,9 +42,11 @@ Note
|
||||
#include "Hash.H"
|
||||
|
||||
#ifdef FULLDEBUG
|
||||
#define HashTypeInfo(Args) void info() { std::cerr<< "" Args << "\n"; }
|
||||
#define HashTypeInfo(Name) \
|
||||
static constexpr const char* name() noexcept { return Name; } \
|
||||
void info() const { std::cerr<< name() << " hashing\n"; }
|
||||
#else
|
||||
#define HashTypeInfo(Args) void info() {}
|
||||
#define HashTypeInfo(Name) void info() const {}
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -53,20 +55,36 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Hash Declaration
|
||||
Class HashFunc Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class T, class SFINAEType=bool>
|
||||
template<class T>
|
||||
struct HashFun
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "default"; }
|
||||
#endif
|
||||
HashTypeInfo("plain hash")
|
||||
void info() const
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
if constexpr (std::is_base_of_v<std::string, T>)
|
||||
{
|
||||
std::cerr<< "std::string hashing\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr<< "default hashing\n";
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
unsigned operator()(const T& obj, unsigned seed=0) const
|
||||
{
|
||||
return Foam::Hasher(&obj, sizeof(obj), seed);
|
||||
if constexpr (std::is_base_of_v<std::string, T>)
|
||||
{
|
||||
return Foam::Hasher(obj.data(), obj.size(), seed);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Foam::Hasher(&obj, sizeof(obj), seed);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -76,45 +94,17 @@ struct HashFun
|
||||
//- Hashing for label
|
||||
template<> struct HashFun<Foam::label> : Hash<label>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "label"; }
|
||||
#endif
|
||||
HashTypeInfo("hash label")
|
||||
HashTypeInfo("label")
|
||||
};
|
||||
|
||||
|
||||
//- Hashing for pointers, interpret pointer as a integer type
|
||||
template<> struct HashFun<void*> : Hash<void *>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "pointer"; }
|
||||
#endif
|
||||
HashTypeInfo("hash ptr")
|
||||
HashTypeInfo("pointer")
|
||||
};
|
||||
|
||||
|
||||
//- Hashing for string types
|
||||
template<class StringType>
|
||||
struct HashFun
|
||||
<
|
||||
StringType,
|
||||
typename std::enable_if
|
||||
<
|
||||
std::is_base_of<std::string, StringType>::value, bool
|
||||
>::type
|
||||
>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "string"; }
|
||||
#endif
|
||||
HashTypeInfo("hash string")
|
||||
|
||||
unsigned operator()(const std::string& obj, unsigned seed=0) const
|
||||
{
|
||||
return Foam::Hasher(obj.data(), obj.size(), seed);
|
||||
}
|
||||
};
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -133,83 +123,56 @@ namespace Foam
|
||||
|
||||
template<> struct HashFun<edge> : Hash<edge>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "edge"; }
|
||||
#endif
|
||||
HashTypeInfo("hash edge")
|
||||
HashTypeInfo("edge")
|
||||
};
|
||||
|
||||
|
||||
template<> struct HashFun<face> : Hash<face>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "face"; }
|
||||
#endif
|
||||
HashTypeInfo("hash face")
|
||||
HashTypeInfo("face")
|
||||
};
|
||||
|
||||
|
||||
template<> struct HashFun<triFace> : Hash<triFace>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "triFace"; }
|
||||
#endif
|
||||
HashTypeInfo("hash triFace")
|
||||
HashTypeInfo("triFace")
|
||||
};
|
||||
|
||||
|
||||
template<class T>
|
||||
struct HashFun<Pair<T>> : Hash<Pair<T>>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "Pair"; }
|
||||
#endif
|
||||
HashTypeInfo("hash Pair")
|
||||
HashTypeInfo("Pair")
|
||||
};
|
||||
|
||||
template<class T1, class T2>
|
||||
struct HashFun<Tuple2<T1, T2>> : Hash<Tuple2<T1, T2>>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "Tuple2"; }
|
||||
#endif
|
||||
HashTypeInfo("hash Tuple2")
|
||||
HashTypeInfo("Tuple2")
|
||||
};
|
||||
|
||||
|
||||
template<class T>
|
||||
struct HashFun<List<T>> : Hash<List<T>>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "List"; }
|
||||
#endif
|
||||
HashTypeInfo("hash List")
|
||||
HashTypeInfo("List")
|
||||
};
|
||||
|
||||
template<class T> struct HashFun<UList<T>> : Hash<UList<T>>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "UList"; }
|
||||
#endif
|
||||
HashTypeInfo("hash UList")
|
||||
HashTypeInfo("UList")
|
||||
};
|
||||
|
||||
template<class T, int SizeMin>
|
||||
struct HashFun<DynamicList<T, SizeMin>> : Hash<DynamicList<T, SizeMin>>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "DynamicList"; }
|
||||
#endif
|
||||
HashTypeInfo("hash DynamicList")
|
||||
HashTypeInfo("DynamicList")
|
||||
};
|
||||
|
||||
template<class T, unsigned N>
|
||||
struct HashFun<FixedList<T, N>> : Hash<FixedList<T, N>>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "FixedList"; }
|
||||
#endif
|
||||
HashTypeInfo("hash FixedList")
|
||||
HashTypeInfo("FixedList")
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
Test-Hashing2.C
|
||||
Test-Hashing2.cxx
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-Hashing2
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -81,7 +81,7 @@ void infoHashString
|
||||
|
||||
void reportHashList(const UList<string>& list)
|
||||
{
|
||||
Info<< "contiguous = " << is_contiguous<string>::value << nl << nl;
|
||||
Info<< "contiguous = " << is_contiguous_v<string> << nl << nl;
|
||||
|
||||
for (const string& val : list)
|
||||
{
|
||||
@ -94,7 +94,7 @@ void reportHashList(const UList<string>& list)
|
||||
|
||||
void reportHashList(const UList<label>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<label>::value << nl << nl;
|
||||
Info<<"contiguous = " << is_contiguous_v<label> << nl << nl;
|
||||
|
||||
for (const label val : list)
|
||||
{
|
||||
@ -113,7 +113,7 @@ void reportHashList(const UList<label>& list)
|
||||
|
||||
void reportHashList(const UList<face>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<label>::value << nl << nl;
|
||||
Info<<"contiguous = " << is_contiguous_v<label> << nl << nl;
|
||||
|
||||
for (const face& f : list)
|
||||
{
|
||||
@ -154,7 +154,7 @@ void reportHashList(const UList<labelList>& list)
|
||||
|
||||
void reportHashList(const UList<wordPair>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<wordPair>::value << nl << nl;
|
||||
Info<<"contiguous = " << is_contiguous_v<wordPair> << nl << nl;
|
||||
|
||||
for (const wordPair& pr : list)
|
||||
{
|
||||
@ -179,7 +179,7 @@ void reportHashList(const UList<wordPair>& list)
|
||||
|
||||
void reportHashList(const UList<labelPair>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<labelPair>::value << nl << nl;
|
||||
Info<<"contiguous = " << is_contiguous_v<labelPair> << nl << nl;
|
||||
|
||||
for (const labelPair& pr : list)
|
||||
{
|
||||
@ -200,7 +200,7 @@ void reportHashList(const UList<labelPair>& list)
|
||||
|
||||
void reportHashList(const UList<labelPairPair>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<labelPairPair>::value << nl << nl;
|
||||
Info<<"contiguous = " << is_contiguous_v<labelPairPair> << nl << nl;
|
||||
|
||||
for (const labelPairPair& pr : list)
|
||||
{
|
||||
@ -221,7 +221,7 @@ void reportHashList(const UList<labelPairPair>& list)
|
||||
|
||||
void reportHashList(const UList<edge>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<edge>::value << nl << nl;
|
||||
Info<<"contiguous = " << is_contiguous_v<edge> << nl << nl;
|
||||
|
||||
for (const edge& e : list)
|
||||
{
|
||||
@ -242,7 +242,7 @@ void reportHashList(const UList<edge>& list)
|
||||
|
||||
void reportHashList(const UList<triFace>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<triFace>::value << nl << nl;
|
||||
Info<<"contiguous = " << is_contiguous_v<triFace> << nl << nl;
|
||||
|
||||
for (const triFace& f : list)
|
||||
{
|
||||
@ -274,9 +274,7 @@ int main(int argc, char *argv[])
|
||||
Info<< nl << "No " << is.name() << " file found ..." << nl;
|
||||
}
|
||||
|
||||
token tok;
|
||||
|
||||
while (is.good() && is.read(tok) && tok.good())
|
||||
for (token tok; tok.read(is); /*nil*/)
|
||||
{
|
||||
const word listType(tok.wordToken());
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2412 |
|
||||
| \\ / O peration | Version: v2506 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
Test-ICharStream1.C
|
||||
Test-ICharStream1.cxx
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-ICharStream1
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -83,12 +83,10 @@ Ostream& printView(Ostream& os, const char* first, const char* last)
|
||||
}
|
||||
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
Ostream& printView(Ostream& os, std::string_view s)
|
||||
{
|
||||
return printView(os, s.begin(), s.end());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Ostream& printView(Ostream& os, stdFoam::span<char> s)
|
||||
@ -138,17 +136,10 @@ void printInfo(const List<char>& buf)
|
||||
void printTokens(Istream& is)
|
||||
{
|
||||
label count = 0;
|
||||
token t;
|
||||
while (is.good())
|
||||
for (token tok; tok.read(is); ++count)
|
||||
{
|
||||
is >> t;
|
||||
if (t.good())
|
||||
{
|
||||
++count;
|
||||
Info<<"token: " << t << endl;
|
||||
}
|
||||
Info<< "token: " << tok << nl;
|
||||
}
|
||||
|
||||
Info<< count << " tokens" << endl;
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -213,11 +213,10 @@ int main(int argc, char *argv[])
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "points path: " << io.typeFilePath<labelIOList>() << nl;
|
||||
Info<< "points path: " << io.typeFilePath<void>() << nl;
|
||||
Info<< "points path: " << io.typeFilePath<pointIOField>() << nl;
|
||||
|
||||
io.resetHeader("bad-points");
|
||||
Info<< "bad path: " << io.typeFilePath<void>() << nl;
|
||||
Info<< "bad path: " << io.typeFilePath<labelIOList>() << nl;
|
||||
}
|
||||
|
||||
IOobject io
|
||||
@ -270,7 +269,7 @@ int main(int argc, char *argv[])
|
||||
ioOutput.rename(args.executable() + "-labels");
|
||||
Info<< "write " << ioOutput.objectRelPath() << endl;
|
||||
{
|
||||
IOListRef<label>(ioOutput, ints).write();
|
||||
IOList<label>::writeContents(ioOutput, ints);
|
||||
}
|
||||
|
||||
ioOutput.rename(args.executable() + "-points");
|
||||
|
||||
@ -45,7 +45,7 @@ using namespace Foam;
|
||||
template<class Type>
|
||||
word report()
|
||||
{
|
||||
if (is_globalIOobject<Type>::value)
|
||||
if constexpr (is_globalIOobject<Type>::value)
|
||||
{
|
||||
return "global";
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -73,18 +73,13 @@ Ostream& toString(Ostream& os, const List<char>& list)
|
||||
|
||||
void printTokens(Istream& is)
|
||||
{
|
||||
label count = 0;
|
||||
token t;
|
||||
while (is.good())
|
||||
{
|
||||
is >> t;
|
||||
if (t.good())
|
||||
{
|
||||
++count;
|
||||
Info<< "token: " << t << endl;
|
||||
}
|
||||
}
|
||||
Info<< "stream tokens:" << endl;
|
||||
|
||||
label count = 0;
|
||||
for (token tok; tok.read(is); ++count)
|
||||
{
|
||||
Info<< " : " << tok << nl;
|
||||
}
|
||||
Info<< count << " tokens" << endl;
|
||||
}
|
||||
|
||||
@ -455,6 +450,12 @@ int main(int argc, char *argv[])
|
||||
"( const char input \"string\" to tokenize )\n"
|
||||
"List<label> 5(0 1 2 3 4);";
|
||||
|
||||
// printTokens
|
||||
{
|
||||
ISpanStream is(charInput);
|
||||
printTokens(is);
|
||||
}
|
||||
|
||||
string stringInput("( string ; input \"string\" to tokenize )");
|
||||
|
||||
List<char> listInput
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
Test-IjkField.C
|
||||
Test-IjkField.cxx
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-IjkField
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
Test-List.C
|
||||
Test-List.cxx
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-List
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -51,10 +51,10 @@ See also
|
||||
#include "IndirectList.H"
|
||||
#include "SubList.H"
|
||||
#include "SliceList.H"
|
||||
#include "SubField.H"
|
||||
#include "ListPolicy.H"
|
||||
|
||||
#include <list>
|
||||
#include <numeric>
|
||||
#include <functional>
|
||||
|
||||
// see issue #2083
|
||||
@ -75,8 +75,6 @@ public:
|
||||
|
||||
|
||||
|
||||
namespace Detail
|
||||
{
|
||||
namespace ListPolicy
|
||||
{
|
||||
|
||||
@ -84,7 +82,6 @@ namespace ListPolicy
|
||||
template<> struct short_length<short> : std::integral_constant<int,20> {};
|
||||
|
||||
} // End namespace ListPolicy
|
||||
} // End namespace Detail
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
@ -118,10 +115,10 @@ Ostream& printListOutputType(const char* what)
|
||||
{
|
||||
Info<< what
|
||||
<< " (contiguous="
|
||||
<< is_contiguous<T>::value << " no_linebreak="
|
||||
<< Detail::ListPolicy::no_linebreak<T>::value
|
||||
<< is_contiguous_v<T> << " no_linebreak="
|
||||
<< ListPolicy::no_linebreak<T>::value
|
||||
<< " short_length="
|
||||
<< Detail::ListPolicy::short_length<T>::value << ')';
|
||||
<< ListPolicy::short_length<T>::value << ')';
|
||||
|
||||
return Info;
|
||||
}
|
||||
@ -143,8 +140,46 @@ int main(int argc, char *argv[])
|
||||
argList::addBoolOption("ListList", "Test list of list functionality");
|
||||
argList::addBoolOption("flag");
|
||||
|
||||
argList::addBoolOption("reserve", "Test ListPolicy for reserve_size");
|
||||
|
||||
#include "setRootCase.H"
|
||||
|
||||
if (args.found("reserve"))
|
||||
{
|
||||
using namespace Foam::ListPolicy;
|
||||
|
||||
using control = std::pair<label, label>;
|
||||
|
||||
for
|
||||
(
|
||||
const auto& tup :
|
||||
{
|
||||
control{ 10, 5 },
|
||||
control{ 20, 25 }
|
||||
}
|
||||
)
|
||||
{
|
||||
const auto [len, capacity] = tup;
|
||||
|
||||
Info<< "test " << tup << nl;
|
||||
|
||||
auto size = reserve_size<16,2>(len, capacity);
|
||||
Info<< " => " << size << " (ratio 2)" << nl;
|
||||
|
||||
size = reserve_size<16,3,2>(len, capacity);
|
||||
Info<< " => " << size << " (ratio 3/2)" << nl;
|
||||
|
||||
size = reserve_size<16,13,8>(len, capacity);
|
||||
Info<< " => " << size << " (ratio " << (13.0/8) << ')' << nl;
|
||||
|
||||
size = reserve_size<16,25,16>(len, capacity);
|
||||
Info<< " => " << size << " (ratio " << (25.0/16) << ')' << nl;
|
||||
}
|
||||
|
||||
Info<< nl << "\nEnd" << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
{
|
||||
List<label> ident(15);
|
||||
Foam::identity(ident, 0);
|
||||
@ -247,6 +282,33 @@ int main(int argc, char *argv[])
|
||||
};
|
||||
Info<< "list4: " << list4 << endl;
|
||||
|
||||
{
|
||||
List<scalar> list4Mag = ListOps::create<scalar>
|
||||
(
|
||||
list4,
|
||||
[](const auto& a){ return a.mag(); }
|
||||
);
|
||||
|
||||
const auto equalMag = [](const auto& a, const auto& b)
|
||||
{
|
||||
return (Foam::mag(a) == Foam::mag(b));
|
||||
};
|
||||
|
||||
Info<< "list4 (mag): " << list4Mag << endl;
|
||||
|
||||
bool same = ListOps::equal(list4, list4Mag, equalMag);
|
||||
Info<< "mag(list4) == list4(mag): " << same << nl;
|
||||
|
||||
SubField<scalar>(list4Mag) *= -1;
|
||||
same = ListOps::equal(list4, list4Mag, equalMag);
|
||||
Info<< "mag(list4) == list4(mag): " << same << nl;
|
||||
|
||||
SubField<scalar>(list4Mag) *= 1.1;
|
||||
same = ListOps::equal(list4, list4Mag, equalMag);
|
||||
Info<< "mag(list4) == list4(mag): " << same << nl;
|
||||
}
|
||||
|
||||
|
||||
List<vector> list5
|
||||
{
|
||||
{5, 3, 1},
|
||||
@ -1,3 +1,3 @@
|
||||
Test-List2.C
|
||||
Test-List2.cxx
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-List2
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -35,6 +35,7 @@ Description
|
||||
#include "FixedList.H"
|
||||
#include "labelList.H"
|
||||
#include "vectorList.H"
|
||||
#include "SubList.H"
|
||||
#include "ListOps.H"
|
||||
#include "IFstream.H"
|
||||
#include "OFstream.H"
|
||||
@ -200,6 +201,7 @@ int main(int argc, char *argv[])
|
||||
argList::addBoolOption("order");
|
||||
argList::addBoolOption("labelList");
|
||||
argList::addBoolOption("vectorList");
|
||||
argList::addBoolOption("ulist");
|
||||
|
||||
argList args(argc, argv);
|
||||
|
||||
@ -261,6 +263,37 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
if (args.found("ulist"))
|
||||
{
|
||||
using span_type = stdFoam::span<vector>;
|
||||
using ulist_type = UList<vector>;
|
||||
|
||||
ulist_type view1, view2;
|
||||
span_type span1, span2;
|
||||
|
||||
List<vector> list(10, vector::one);
|
||||
|
||||
Info<< "List: " << Foam::name(list.data()) << nl;
|
||||
Info<< "view: " << Foam::name(view1.data()) << nl;
|
||||
Info<< "span: " << Foam::name(span1.data()) << nl;
|
||||
|
||||
view1 = list.slice(4);
|
||||
span1 = span_type(list.begin(4), list.size()-4);
|
||||
Info<< "view [4]:" << Foam::name(view1.data()) << nl;
|
||||
Info<< "span [4]:" << Foam::name(span1.data()) << nl;
|
||||
|
||||
view2 = std::move(view1);
|
||||
span2 = std::move(span1);
|
||||
Info<< "view old:" << Foam::name(view1.data()) << nl;
|
||||
Info<< "span old:" << Foam::name(span1.data()) << nl;
|
||||
Info<< "view [4]:" << Foam::name(view2.data()) << nl;
|
||||
Info<< "span [4]:" << Foam::name(span2.data()) << nl;
|
||||
|
||||
view1 = list.slice(7);
|
||||
Info<< "view [7]:" << Foam::name(view1.data()) << nl;
|
||||
}
|
||||
|
||||
|
||||
Info<< nl << "Done" << nl << endl;
|
||||
return 0;
|
||||
}
|
||||
@ -1,3 +1,3 @@
|
||||
Test-List3.C
|
||||
Test-List3.cxx
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-List3
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
Test-ListRead1.C
|
||||
Test-ListRead1.cxx
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-ListRead1
|
||||
|
||||
@ -50,7 +50,6 @@ Description
|
||||
#include "ListPolicy.H"
|
||||
|
||||
#include <list>
|
||||
#include <numeric>
|
||||
#include <functional>
|
||||
|
||||
using namespace Foam;
|
||||
@ -86,7 +85,7 @@ bool readBracketList(List<T>& list, Istream& is)
|
||||
// constexpr label chunkSize = 128;
|
||||
typedef std::unique_ptr<List<T>> chunkType;
|
||||
|
||||
is >> tok;
|
||||
tok.read(is);
|
||||
is.fatalCheck(FUNCTION_NAME);
|
||||
|
||||
if (tok.isPunctuation(token::END_LIST))
|
||||
@ -150,7 +149,7 @@ bool readBracketList(List<T>& list, Istream& is)
|
||||
"reading entry"
|
||||
);
|
||||
|
||||
is >> tok;
|
||||
tok.read(is);
|
||||
is.fatalCheck(FUNCTION_NAME);
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
Copyright (C) 2021-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -128,18 +128,17 @@ void test_member_funcs(Type)
|
||||
|
||||
// Do compile-time recursion over the given types
|
||||
template<std::size_t I = 0, typename... Tp>
|
||||
inline typename std::enable_if<I == sizeof...(Tp), void>::type
|
||||
run_tests(const std::tuple<Tp...>& types, const List<word>& typeID){}
|
||||
|
||||
|
||||
template<std::size_t I = 0, typename... Tp>
|
||||
inline typename std::enable_if<I < sizeof...(Tp), void>::type
|
||||
run_tests(const std::tuple<Tp...>& types, const List<word>& typeID)
|
||||
void run_tests(const std::tuple<Tp...>& types, const List<word>& names)
|
||||
{
|
||||
Info<< nl << " ## Test member functions: "<< typeID[I] <<" ##" << nl;
|
||||
test_member_funcs(std::get<I>(types));
|
||||
if constexpr (I < sizeof...(Tp))
|
||||
{
|
||||
const auto& name = names[I];
|
||||
|
||||
run_tests<I + 1, Tp...>(types, typeID);
|
||||
Info<< nl << " ## Test member functions: " << name << " ##" << nl;
|
||||
test_member_funcs(std::get<I>(types));
|
||||
|
||||
run_tests<I + 1, Tp...>(types, names);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
Test-OCharStream1.C
|
||||
Test-OCharStream1.cxx
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-OCharStream1
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -83,12 +83,10 @@ Ostream& printView(Ostream& os, const char* first, const char* last)
|
||||
}
|
||||
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
Ostream& printView(Ostream& os, std::string_view s)
|
||||
{
|
||||
return printView(os, s.begin(), s.end());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Ostream& printView(Ostream& os, stdFoam::span<char> s)
|
||||
@ -129,17 +127,10 @@ void printInfo(const BufType& buf)
|
||||
void printTokens(Istream& is)
|
||||
{
|
||||
label count = 0;
|
||||
token t;
|
||||
while (is.good())
|
||||
for (token tok; tok.read(is); ++count)
|
||||
{
|
||||
is >> t;
|
||||
if (t.good())
|
||||
{
|
||||
++count;
|
||||
Info<<"token: " << t << endl;
|
||||
}
|
||||
Info<< "token: " << tok << nl;
|
||||
}
|
||||
|
||||
Info<< count << " tokens" << endl;
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2412 |
|
||||
| \\ / O peration | Version: v2506 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2412 |
|
||||
| \\ / O peration | Version: v2506 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2412 |
|
||||
| \\ / O peration | Version: v2506 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2412 |
|
||||
| \\ / O peration | Version: v2506 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
Test-PackedList1.C
|
||||
Test-PackedList1.cxx
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-PackedList1
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
Test-PackedList2.C
|
||||
Test-PackedList2.cxx
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-PackedList2
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2412 |
|
||||
| \\ / O peration | Version: v2506 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
3
applications/test/PtrDictionary1/Make/files
Normal file
3
applications/test/PtrDictionary1/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
Test-PtrDictionary1.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-PtrDictionary1
|
||||
@ -25,10 +25,10 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
Test-Dictionary
|
||||
Test-PtrDictionary1
|
||||
|
||||
Description
|
||||
Tests for Dictionary (not dictionary)
|
||||
Tests for Dictionary (not dictionary) and PtrDictionary
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -185,7 +185,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
std::cout<< "iter type: "
|
||||
<< typeid(stdFoam::begin(scalarDict2)).name() << '\n';
|
||||
<< typeid(std::begin(scalarDict2)).name() << '\n';
|
||||
|
||||
scalarDict.transfer(scalarDict2);
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
Test-SpanStream1.C
|
||||
Test-SpanStream1.cxx
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-SpanStream1
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -85,12 +85,10 @@ Ostream& printView(Ostream& os, const char* first, const char* last)
|
||||
}
|
||||
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
Ostream& printView(Ostream& os, std::string_view s)
|
||||
{
|
||||
return printView(os, s.begin(), s.end());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Ostream& printView(Ostream& os, stdFoam::span<char> s)
|
||||
@ -145,17 +143,10 @@ void printInfo(const UList<char>& buf)
|
||||
void printTokens(Istream& is)
|
||||
{
|
||||
label count = 0;
|
||||
token t;
|
||||
while (is.good())
|
||||
for (token tok; tok.read(is); ++count)
|
||||
{
|
||||
is >> t;
|
||||
if (t.good())
|
||||
{
|
||||
++count;
|
||||
Info<<"token: " << t << endl;
|
||||
}
|
||||
Info<< "token: " << tok << nl;
|
||||
}
|
||||
|
||||
Info<< count << " tokens" << endl;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user