Compare commits
184 Commits
OpenFOAM-v
...
openmp-hmm
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d17825eed | |||
| aa93427c7a | |||
| d9226575e6 | |||
| 124702190b | |||
| 8071f2f94b | |||
| fc19ca39f3 | |||
| 2202995f5c | |||
| 21f037e3a0 | |||
| c973066646 | |||
| 371795840c | |||
| 7a43cac55a | |||
| 9433898941 | |||
| 454f7960b0 | |||
| 9db3547bd3 | |||
| 278378031e | |||
| bd000d89e9 | |||
| ac25608fbd | |||
| 37e90dbad7 | |||
| 2c7a7b27a3 | |||
| 7a67c1e72b | |||
| b145e59049 | |||
| 24ffc5236d | |||
| fd55151a12 | |||
| 3caeeb1f51 | |||
| 0c3a938810 | |||
| 62244c6caf | |||
| 3a6a76044d | |||
| 5a9dbcdadf | |||
| 65dc440f3c | |||
| 4585a2d229 | |||
| 18eeba116a | |||
| 61deacd24d | |||
| 81b1c5021f | |||
| 96ff2f32e5 | |||
| 9434972261 | |||
| d5cdc60a54 | |||
| 779a2ca084 | |||
| 98a510c317 | |||
| 0c89f38312 | |||
| bcd461926c | |||
| 793433da72 | |||
| 34d69cad23 | |||
| a246a97b12 | |||
| 7b2bcfda0b | |||
| 7eda6de6f4 | |||
| d938e01d7a | |||
| 623c0624fb | |||
| 36d7954004 | |||
| 159a7a5a38 | |||
| 55f5f8774b | |||
| 9d5a3a5c54 | |||
| ee9119f436 | |||
| 3a6e427409 | |||
| ea51c2c0e4 | |||
| 867b5e9060 | |||
| 7c2311aae6 | |||
| f87f0040b8 | |||
| c59b6db3c4 | |||
| 5677e10d90 | |||
| 38d68824b3 | |||
| 8283599c31 | |||
| f276366a05 | |||
| a7ef33da6b | |||
| 56e9f7bf4b | |||
| 9fa37ba068 | |||
| 5130c7bcbc | |||
| 3c7088b6c0 | |||
| 4710528448 | |||
| cbace69896 | |||
| 39fc7cc957 | |||
| dc28dbc3ad | |||
| b1a8bb1b12 | |||
| a00997f32f | |||
| 0302ba4418 | |||
| fe7dd51258 | |||
| c59dc00623 | |||
| a8057c4bc6 | |||
| 1695f2f5b9 | |||
| 84db37f62f | |||
| e8863cd091 | |||
| 4393ffa8dc | |||
| 88f5be479e | |||
| 88061f3b28 | |||
| c031f7d00a | |||
| 052d8b13e3 | |||
| a0282c7e41 | |||
| b9ca63b118 | |||
| 512f558549 | |||
| 968c1db1af | |||
| 47e172e6ef | |||
| 716d330547 | |||
| 6f764c8d02 | |||
| 1a15bd08f7 | |||
| afffec446a | |||
| 51dbc84ddb | |||
| a964c364b6 | |||
| ff4c776b8b | |||
| f9b85dbfbb | |||
| c841aaed83 | |||
| 793f4e3a37 | |||
| 0ed79f3bc1 | |||
| c624590e26 | |||
| 2a9e68c2bf | |||
| 500ec9dd12 | |||
| 097008544c | |||
| 0b37234804 | |||
| f1da147925 | |||
| d3123a1107 | |||
| 4965dc4cfb | |||
| a39b50d783 | |||
| 0f5cc77b61 | |||
| 9bc46bc0d7 | |||
| 941dd0bec7 | |||
| 332026644d | |||
| 2a007b007e | |||
| 4730c381ef | |||
| 7ea185b0b5 | |||
| e827c117e3 | |||
| 5218bfd721 | |||
| b6a6e40c27 | |||
| 1e02a4ae92 | |||
| bc3bff8ef5 | |||
| b0cd2ea991 | |||
| f249022bfe | |||
| c418c28c66 | |||
| 5ea365a2be | |||
| 27c3d0c23b | |||
| 227727d413 | |||
| c08fc5ecd9 | |||
| 994addc543 | |||
| f2f71f6847 | |||
| c652af4b82 | |||
| bfef08a89f | |||
| 3b40ee8f6b | |||
| f5598706c5 | |||
| 457979a7b7 | |||
| 565c68f454 | |||
| b9507c21f9 | |||
| 88da2d5877 | |||
| 77ecc4c6e0 | |||
| 542fc0c1d1 | |||
| 9ccc2d8fd5 | |||
| 9f40db8977 | |||
| c2cae92fc5 | |||
| a72d4a1708 | |||
| 5894874920 | |||
| 71a612085b | |||
| 6320bab2b5 | |||
| a4a8f77b7b | |||
| 64f4745277 | |||
| ac83b41aaf | |||
| 20f1afd9f7 | |||
| 873f7aac2d | |||
| 66ddf0a104 | |||
| 42150cf3fe | |||
| 5630db5493 | |||
| dfdbe7efd0 | |||
| b4612b4c04 | |||
| c4d18e97a3 | |||
| dea31e9b4a | |||
| 3d892ace29 | |||
| 8b1514c99b | |||
| 1afd27db6c | |||
| d222cb1cee | |||
| ff33bfda96 | |||
| 6e393ccbc8 | |||
| ba49415d68 | |||
| cee6524c34 | |||
| f16f3da645 | |||
| 71246b94b7 | |||
| b4a482751b | |||
| a27c8560a8 | |||
| 8e017fa63c | |||
| 92f38b589a | |||
| da0b241de6 | |||
| 490f02fad4 | |||
| 5589108d73 | |||
| ce486da6bd | |||
| de21a6bc0e | |||
| 62ac69688f | |||
| d058600b21 | |||
| 1ce0cb407a | |||
| 7de07fd8ba | |||
| 97c78a78f3 |
@ -5,6 +5,8 @@ It is likely incomplete...
|
||||
|
||||
## Contributors (alphabetical by surname)
|
||||
|
||||
- Tetsuo Aoyagi
|
||||
- Akira Azami
|
||||
- William Bainbridge
|
||||
- Gabriel Barajas
|
||||
- Kutalmis Bercin
|
||||
@ -19,6 +21,7 @@ It is likely incomplete...
|
||||
- Bernhard Gschaider
|
||||
- Andrew Heather
|
||||
- David Hill
|
||||
- Yoshiaki Inoue
|
||||
- Mattijs Janssens
|
||||
- Andrew Jackson
|
||||
- Hrvoje Jasak
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
api=2206
|
||||
patch=0
|
||||
patch=220907
|
||||
|
||||
@ -11,4 +11,5 @@ EXE_LIBS = \
|
||||
-lfvOptions \
|
||||
-lmeshTools \
|
||||
-lsampling \
|
||||
-lregionFaModels
|
||||
-lregionFaModels \
|
||||
-lfiniteArea
|
||||
|
||||
@ -116,7 +116,7 @@ int main(int argc, char *argv[])
|
||||
"normalisedGradP",
|
||||
tmagGradP()/max(tmagGradP())
|
||||
);
|
||||
normalisedGradP.writeOpt() = IOobject::AUTO_WRITE;
|
||||
normalisedGradP.writeOpt(IOobject::AUTO_WRITE);
|
||||
tmagGradP.clear();
|
||||
|
||||
++runTime;
|
||||
|
||||
@ -36,11 +36,11 @@ Description
|
||||
if (adjustTimeStep)
|
||||
{
|
||||
scalar maxDeltaTFact = maxCo/(CoNum + StCoNum + SMALL);
|
||||
scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
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,5 @@
|
||||
if (adjustTimeStep)
|
||||
{
|
||||
runTime.setDeltaT(min(dtChem, maxDeltaT));
|
||||
runTime.setDeltaT(Foam::min(dtChem, maxDeltaT));
|
||||
Info<< "deltaT = " << runTime.deltaT().value() << endl;
|
||||
}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||
-I${LIB_SRC}/meshTools/lnInclude \
|
||||
-I${LIB_SRC}/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||
|
||||
@ -54,9 +54,9 @@ 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
|
||||
)
|
||||
);
|
||||
|
||||
@ -26,4 +26,5 @@ EXE_LIBS = \
|
||||
-ltopoChangerFvMesh \
|
||||
-lsampling \
|
||||
-latmosphericModels \
|
||||
-lregionFaModels
|
||||
-lregionFaModels \
|
||||
-lfiniteArea
|
||||
|
||||
@ -21,4 +21,5 @@ EXE_LIBS = \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-latmosphericModels \
|
||||
-lregionFaModels
|
||||
-lregionFaModels \
|
||||
-lfiniteArea
|
||||
|
||||
@ -28,4 +28,5 @@ EXE_LIBS = \
|
||||
-ldynamicMesh \
|
||||
-ldynamicFvMesh \
|
||||
-ltopoChangerFvMesh \
|
||||
-lregionFaModels
|
||||
-lregionFaModels \
|
||||
-lfiniteArea
|
||||
|
||||
@ -22,4 +22,5 @@ EXE_LIBS = \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-latmosphericModels \
|
||||
-lregionFaModels
|
||||
-lregionFaModels \
|
||||
-lfiniteArea
|
||||
|
||||
@ -40,4 +40,5 @@ EXE_LIBS = \
|
||||
-lthermoTools \
|
||||
-lradiationModels \
|
||||
-lregionModels \
|
||||
-lregionFaModels
|
||||
-lregionFaModels \
|
||||
-lfiniteArea
|
||||
|
||||
@ -36,5 +36,5 @@ EXE_LIBS = \
|
||||
-lfaOptions \
|
||||
-lregionModels \
|
||||
-lsampling \
|
||||
-lregionFaModels
|
||||
|
||||
-lregionFaModels \
|
||||
-lfiniteArea
|
||||
|
||||
@ -18,13 +18,13 @@
|
||||
const surfaceScalarField& phi2 =
|
||||
phaseSystemFluid[regioni].phase2().phiRef();
|
||||
|
||||
sumPhi = max
|
||||
sumPhi = Foam::max
|
||||
(
|
||||
sumPhi,
|
||||
fvc::surfaceSum(mag(phi1))().primitiveField()
|
||||
);
|
||||
|
||||
sumPhi = max
|
||||
sumPhi = Foam::max
|
||||
(
|
||||
sumPhi,
|
||||
fvc::surfaceSum(mag(phi2))().primitiveField()
|
||||
@ -43,7 +43,7 @@
|
||||
/ fluidRegions[regioni].V().field()
|
||||
)*runTime.deltaTValue(),
|
||||
|
||||
CoNum = max(UrCoNum, CoNum);
|
||||
CoNum = Foam::max(UrCoNum, CoNum);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
forAll(fluidRegions, regioni)
|
||||
{
|
||||
CoNum = max
|
||||
CoNum = Foam::max
|
||||
(
|
||||
compressibleCourantNo
|
||||
(
|
||||
|
||||
@ -47,10 +47,10 @@ if (adjustTimeStep)
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
min
|
||||
Foam::min
|
||||
(
|
||||
min(maxCo/CoNum, maxDi/DiNum)*runTime.deltaT().value(),
|
||||
min(runTime.deltaTValue(), maxDeltaT)
|
||||
Foam::min(maxCo/CoNum, maxDi/DiNum)*runTime.deltaT().value(),
|
||||
Foam::min(runTime.deltaTValue(), maxDeltaT)
|
||||
)
|
||||
);
|
||||
Info<< "deltaT = " << runTime.deltaT().value() << endl;
|
||||
|
||||
@ -49,17 +49,17 @@ if (adjustTimeStep)
|
||||
scalar maxDeltaTSolid = maxDi/(DiNum + SMALL);
|
||||
|
||||
scalar deltaTFluid =
|
||||
min
|
||||
Foam::min
|
||||
(
|
||||
min(maxDeltaTFluid, 1.0 + 0.1*maxDeltaTFluid),
|
||||
Foam::min(maxDeltaTFluid, 1.0 + 0.1*maxDeltaTFluid),
|
||||
1.2
|
||||
);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
min
|
||||
Foam::min
|
||||
(
|
||||
min(deltaTFluid, maxDeltaTSolid)*runTime.deltaT().value(),
|
||||
Foam::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 = max
|
||||
DiNum = Foam::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 = max
|
||||
DiNum = Foam::max
|
||||
(
|
||||
solidRegionDiffNo
|
||||
(
|
||||
|
||||
@ -22,4 +22,5 @@ EXE_LIBS = \
|
||||
-ldynamicFvMesh \
|
||||
-ltopoChangerFvMesh \
|
||||
-latmosphericModels \
|
||||
-lregionFaModels
|
||||
-lregionFaModels \
|
||||
-lfiniteArea
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||
-I${LIB_SRC}/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
|
||||
@ -2,10 +2,10 @@ EXE_INC = \
|
||||
-I../reactingParcelFoam \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||
-I${LIB_SRC}/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I${LIB_SRC}/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||
|
||||
@ -2,8 +2,8 @@ EXE_INC = \
|
||||
-I.. \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||
-I${LIB_SRC}/sampling/lnInclude \
|
||||
-I${LIB_SRC}/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
|
||||
@ -36,13 +36,13 @@ 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
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||
-I${LIB_SRC}/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
|
||||
@ -2,7 +2,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||
-I$(LIB_SRC)/fvOptions/lnInclude \
|
||||
-I${LIB_SRC}/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
|
||||
@ -2,8 +2,8 @@ EXE_INC = \
|
||||
-I../reactingParcelFoam \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||
-I${LIB_SRC}/meshTools/lnInclude \
|
||||
-I${LIB_SRC}/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
|
||||
@ -4,8 +4,8 @@ EXE_INC = \
|
||||
-I../../reactingParcelFoam \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||
-I${LIB_SRC}/meshTools/lnInclude \
|
||||
-I${LIB_SRC}/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
|
||||
@ -2,7 +2,7 @@ EXE_INC = \
|
||||
-I$(FOAM_SOLVERS)/lagrangian/reactingParcelFoam/simpleReactingParcelFoam \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||
-I${LIB_SRC}/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
|
||||
@ -4,8 +4,8 @@ EXE_INC = \
|
||||
-I../../../compressible/rhoPimpleFoam \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||
-I${LIB_SRC}/meshTools/lnInclude \
|
||||
-I${LIB_SRC}/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
|
||||
@ -42,4 +42,5 @@ EXE_LIBS = \
|
||||
-lregionModels \
|
||||
-lregionFaModels \
|
||||
-lsurfaceFilmModels \
|
||||
-lfiniteArea \
|
||||
-lcompressibleTwoPhaseMixtureTurbulenceModels
|
||||
|
||||
@ -214,7 +214,7 @@
|
||||
phiCN,
|
||||
alphaPhi10,
|
||||
Sp,
|
||||
(Su + divU*min(alpha1(), scalar(1)))(),
|
||||
(Su + divU*Foam::min(alpha1(), scalar(1)))(),
|
||||
oneField(),
|
||||
zeroField()
|
||||
);
|
||||
|
||||
@ -214,7 +214,7 @@
|
||||
phiCN,
|
||||
alphaPhi10,
|
||||
Sp,
|
||||
(Su + divU*min(alpha1(), scalar(1)))(),
|
||||
(Su + divU*Foam::min(alpha1(), scalar(1)))(),
|
||||
oneField(),
|
||||
zeroField()
|
||||
);
|
||||
|
||||
@ -36,13 +36,13 @@ 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);
|
||||
scalar deltaTFact = Foam::min(Foam::min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
min
|
||||
Foam::min
|
||||
(
|
||||
deltaTFact*runTime.deltaTValue(),
|
||||
maxDeltaT
|
||||
|
||||
@ -36,13 +36,13 @@ 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);
|
||||
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,11 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// Update alpha1
|
||||
#include "alphaSuSp.H"
|
||||
advector.advect(Sp,(Su + divU*min(alpha1(), scalar(1)))());
|
||||
advector.advect(Sp,(Su + divU*Foam::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() << ") = " << min(alpha1).value()
|
||||
<< " Max(" << alpha1.name() << ") - 1 = " << max(alpha1).value() - 1
|
||||
<< " Min(" << alpha1.name() << ") = " << Foam::min(alpha1).value()
|
||||
<< " Max(" << alpha1.name() << ") - 1 = " << Foam::max(alpha1).value() - 1
|
||||
<< endl;
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -34,8 +34,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef DTRMParticle_H
|
||||
#define DTRMParticle_H
|
||||
#ifndef Foam_DTRMParticle_H
|
||||
#define Foam_DTRMParticle_H
|
||||
|
||||
#include "particle.H"
|
||||
#include "IOstream.H"
|
||||
@ -50,12 +50,13 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward Declarations
|
||||
class DTRMParticle;
|
||||
using namespace Foam::radiation;
|
||||
|
||||
// Forward declaration of friend functions
|
||||
Ostream& operator<<(Ostream&, const DTRMParticle&);
|
||||
|
||||
using namespace Foam::radiation;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class DTRMParticle Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -130,7 +131,7 @@ public:
|
||||
);
|
||||
|
||||
|
||||
// Member functions
|
||||
// Member Functions
|
||||
|
||||
inline const interpolationCell<scalar>& aInterp() const;
|
||||
inline const interpolationCell<scalar>& eInterp() const;
|
||||
@ -232,37 +233,34 @@ public:
|
||||
// Access
|
||||
|
||||
//- Return const access to the initial position
|
||||
inline const point& p0() const;
|
||||
const point& p0() const noexcept { return p0_; }
|
||||
|
||||
//- Return const access to the target position
|
||||
inline const point& p1() const;
|
||||
const point& p1() const noexcept { return p1_; }
|
||||
|
||||
//- Return const access to the initial intensity
|
||||
inline scalar I0() const;
|
||||
scalar I0() const noexcept { return I0_; }
|
||||
|
||||
//- Return const access to the current intensity
|
||||
inline scalar I() const;
|
||||
scalar I() const noexcept { return I_; }
|
||||
|
||||
//- Return const access dA
|
||||
inline scalar dA() const;
|
||||
scalar dA() const noexcept { return dA_; }
|
||||
|
||||
|
||||
// Edit
|
||||
|
||||
//- Return access to the target position
|
||||
inline point& p1();
|
||||
point& p1() noexcept { return p1_; }
|
||||
|
||||
//- Return access to the initial intensity
|
||||
inline scalar& I0();
|
||||
scalar& I0() noexcept { return I0_; }
|
||||
|
||||
//- Return access to the current intensity
|
||||
inline scalar& I();
|
||||
scalar& I() noexcept { return I_; }
|
||||
|
||||
//- Return access to dA
|
||||
inline scalar& dA();
|
||||
|
||||
//- Return access to reflectedId
|
||||
inline label& reflectedId();
|
||||
scalar& dA() noexcept { return dA_; }
|
||||
|
||||
|
||||
// Tracking
|
||||
|
||||
@ -107,58 +107,4 @@ inline Foam::scalar& Foam::DTRMParticle::trackingData::Q(label celli)
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::point& Foam::DTRMParticle::p0() const
|
||||
{
|
||||
return p0_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::point& Foam::DTRMParticle::p1() const
|
||||
{
|
||||
return p1_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::DTRMParticle::I0() const
|
||||
{
|
||||
return I0_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::DTRMParticle::I() const
|
||||
{
|
||||
return I_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::DTRMParticle::dA() const
|
||||
{
|
||||
return dA_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar& Foam::DTRMParticle::dA()
|
||||
{
|
||||
return dA_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::point& Foam::DTRMParticle::p1()
|
||||
{
|
||||
return p1_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar& Foam::DTRMParticle::I0()
|
||||
{
|
||||
return I0_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar& Foam::DTRMParticle::I()
|
||||
{
|
||||
return I_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -59,7 +59,7 @@ Foam::DTRMParticle::DTRMParticle
|
||||
{
|
||||
if (readFields)
|
||||
{
|
||||
if (is.format() == IOstream::ASCII)
|
||||
if (is.format() == IOstreamOption::ASCII)
|
||||
{
|
||||
is >> p0_ >> p1_ >> I0_ >> I_ >> dA_ >> transmissiveId_;
|
||||
}
|
||||
@ -115,7 +115,7 @@ void Foam::DTRMParticle::writeProperties
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const DTRMParticle& p)
|
||||
{
|
||||
if (os.format() == IOstream::ASCII)
|
||||
if (os.format() == IOstreamOption::ASCII)
|
||||
{
|
||||
os << static_cast<const particle&>(p)
|
||||
<< token::SPACE << p.p0_
|
||||
|
||||
@ -157,12 +157,7 @@ void Foam::radiation::laserDTRM::initialiseReflection()
|
||||
);
|
||||
}
|
||||
|
||||
if (reflections_.size())
|
||||
{
|
||||
reflectionSwitch_ = true;
|
||||
}
|
||||
|
||||
reflectionSwitch_ = returnReduce(reflectionSwitch_, orOp<bool>());
|
||||
reflectionSwitch_ = returnReduceOr(reflections_.size());
|
||||
}
|
||||
}
|
||||
|
||||
@ -299,14 +294,12 @@ void Foam::radiation::laserDTRM::initialise()
|
||||
DTRMCloud_.addParticle(pPtr);
|
||||
}
|
||||
|
||||
if (returnReduce(cellI, maxOp<label>()) == -1)
|
||||
if (nMissed < 10 && returnReduceAnd(cellI < 0))
|
||||
{
|
||||
if (++nMissed <= 10)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Cannot find owner cell for focalPoint at "
|
||||
<< p0 << endl;
|
||||
}
|
||||
++nMissed;
|
||||
WarningInFunction
|
||||
<< "Cannot find owner cell for focalPoint at "
|
||||
<< p0 << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -699,7 +692,7 @@ void Foam::radiation::laserDTRM::calculate()
|
||||
|
||||
for (label pointi = 0; pointi < lines.size(); pointi += 2)
|
||||
{
|
||||
os.write(linePointRef(lines[pointi], lines[pointi+1]));
|
||||
os.writeLine(lines[pointi], lines[pointi+1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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,11 +50,11 @@ if (adjustTimeStep)
|
||||
)
|
||||
);
|
||||
|
||||
scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
scalar deltaTFact = Foam::min(Foam::min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
min
|
||||
Foam::min
|
||||
(
|
||||
deltaTFact*runTime.deltaTValue(),
|
||||
maxDeltaT
|
||||
|
||||
@ -8,5 +8,5 @@
|
||||
|
||||
Info<< "Max Ur Courant Number = " << UrCoNum << endl;
|
||||
|
||||
CoNum = max(CoNum, UrCoNum);
|
||||
CoNum = Foam::max(CoNum, UrCoNum);
|
||||
}
|
||||
|
||||
@ -8,5 +8,5 @@
|
||||
|
||||
Info<< "Max Ur Courant Number = " << UrCoNum << endl;
|
||||
|
||||
CoNum = max(CoNum, UrCoNum);
|
||||
CoNum = Foam::max(CoNum, UrCoNum);
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -49,8 +49,8 @@ int main(int argc, char *argv[])
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
|
||||
IOstream::streamFormat format = IOstream::BINARY;
|
||||
// IOstream::streamFormat format = IOstream::ASCII;
|
||||
IOstreamOption streamOpt(IOstreamOption::BINARY);
|
||||
// IOstreamOption streamOpt(IOstreamOption::ASCII);
|
||||
|
||||
const label size = 20000000;
|
||||
|
||||
@ -85,11 +85,7 @@ int main(int argc, char *argv[])
|
||||
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
|
||||
|
||||
|
||||
faces2.writeObject
|
||||
(
|
||||
IOstreamOption(format),
|
||||
true
|
||||
);
|
||||
faces2.writeObject(streamOpt, true);
|
||||
|
||||
Info<< "Written old format faceList in = "
|
||||
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
|
||||
@ -145,11 +141,7 @@ int main(int argc, char *argv[])
|
||||
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
|
||||
|
||||
|
||||
faces2.writeObject
|
||||
(
|
||||
IOstreamOption(format),
|
||||
true
|
||||
);
|
||||
faces2.writeObject(streamOpt, true);
|
||||
|
||||
Info<< "Written new format faceList in = "
|
||||
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
|
||||
|
||||
@ -28,11 +28,6 @@ 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)
|
||||
@ -110,9 +105,9 @@ Foam::word Foam::DirLister::next(DIR* dirPtr) const
|
||||
|
||||
if (ok)
|
||||
{
|
||||
if (fType == fileName::FILE && stripgz_ && name.hasExt(extgz))
|
||||
if (fType == fileName::FILE && stripgz_ && name.has_ext("gz"))
|
||||
{
|
||||
name = name.lessExt();
|
||||
name.remove_ext();
|
||||
}
|
||||
|
||||
if (!name.empty() && accept(name))
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
Copyright (C) 2021-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -104,7 +104,7 @@ void readList
|
||||
{
|
||||
OTstream os;
|
||||
os << input;
|
||||
ITstream is("input", os.tokens());
|
||||
ITstream is(os.tokens());
|
||||
|
||||
is >> output;
|
||||
}
|
||||
@ -118,7 +118,7 @@ void readList
|
||||
{
|
||||
OTstream os;
|
||||
os << input;
|
||||
ITstream is("input", os.tokens());
|
||||
ITstream is(os.tokens());
|
||||
|
||||
is >> output;
|
||||
}
|
||||
|
||||
3
applications/test/FieldFields1/Make/files
Normal file
3
applications/test/FieldFields1/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
Test-FieldFields1.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-FieldFields1
|
||||
117
applications/test/FieldFields1/Test-FieldFields1.C
Normal file
117
applications/test/FieldFields1/Test-FieldFields1.C
Normal file
@ -0,0 +1,117 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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-FieldFields1
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "symmTensorField.H"
|
||||
#include "tensorField.H"
|
||||
#include "FieldFields.H"
|
||||
#include "Random.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
|
||||
template<class Cmpt>
|
||||
void printFieldField(const FieldField<Field, Cmpt>& ff)
|
||||
{
|
||||
forAll(ff, i)
|
||||
{
|
||||
Info<< i << ": " << flatOutput(ff[i]) << nl;
|
||||
}
|
||||
Info<< nl;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type>> randomField(Random& rnd, label dim)
|
||||
{
|
||||
auto tfld = tmp<Field<Type>>::New(dim);
|
||||
auto& fld = tfld.ref();
|
||||
|
||||
for (Type& val : fld)
|
||||
{
|
||||
for (direction cmpt=0; cmpt < pTraits<Type>::nComponents; ++cmpt)
|
||||
{
|
||||
setComponent(val, cmpt) = rnd.position<label>(0, 100);
|
||||
}
|
||||
}
|
||||
|
||||
return tfld;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type>> randomField(label dim)
|
||||
{
|
||||
Random rnd;
|
||||
return randomField<Type>(rnd, dim);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// scalarField
|
||||
{
|
||||
Info<< nl << "scalarFieldField" << nl;
|
||||
|
||||
Random rnd;
|
||||
|
||||
FieldField<Field, scalar> sff1(6);
|
||||
forAll(sff1, i)
|
||||
{
|
||||
sff1.set(i, randomField<scalar>(rnd, 8));
|
||||
}
|
||||
|
||||
printFieldField(sff1);
|
||||
|
||||
Info<< nl << "indexing:" << nl;
|
||||
|
||||
{
|
||||
labelPair index;
|
||||
const label range1 = sff1.size()-1;
|
||||
const label range2 = sff1[0].size()-1;
|
||||
|
||||
for (label iter = 0; iter < 10; ++iter)
|
||||
{
|
||||
index.first() = rnd.position<label>(0, range1);
|
||||
index.second() = rnd.position<label>(0, range2);
|
||||
|
||||
Info<< index << " => " << sff1[index] << nl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Info<< nl << "End\n" << nl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
3
applications/test/FieldFields2/Make/files
Normal file
3
applications/test/FieldFields2/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
Test-FieldFields2.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-FieldFields2
|
||||
2
applications/test/FieldFields2/Make/options
Normal file
2
applications/test/FieldFields2/Make/options
Normal file
@ -0,0 +1,2 @@
|
||||
/* EXE_INC = */
|
||||
/* EXE_LIBS = */
|
||||
@ -24,7 +24,7 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
Test-tensorFieldFields1
|
||||
Test-FieldFields2
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -73,21 +73,29 @@ void allocComponents
|
||||
}
|
||||
|
||||
|
||||
vectorField randomVectorField(label size)
|
||||
template<class Type>
|
||||
tmp<Field<Type>> randomField(Random& rnd, label dim)
|
||||
{
|
||||
Random rnd;
|
||||
auto tfld = tmp<Field<Type>>::New(dim);
|
||||
auto& fld = tfld.ref();
|
||||
|
||||
vectorField vf(size);
|
||||
|
||||
forAll(vf, i)
|
||||
for (Type& val : fld)
|
||||
{
|
||||
for (direction cmpt=0; cmpt < vector::nComponents; ++cmpt)
|
||||
for (direction cmpt=0; cmpt < pTraits<Type>::nComponents; ++cmpt)
|
||||
{
|
||||
vf[i][cmpt] = rnd.position<label>(0, 100);
|
||||
setComponent(val, cmpt) = rnd.position<label>(0, 100);
|
||||
}
|
||||
}
|
||||
|
||||
return vf;
|
||||
return tfld;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type>> randomField(label dim)
|
||||
{
|
||||
Random rnd;
|
||||
return randomField<Type>(rnd, dim);
|
||||
}
|
||||
|
||||
|
||||
@ -191,7 +199,7 @@ int main(int argc, char *argv[])
|
||||
printFieldField(sf1);
|
||||
|
||||
Info<< nl;
|
||||
for (direction cmpt = 0; cmpt < vector::nComponents; ++cmpt)
|
||||
for (direction cmpt = 0; cmpt < pTraits<vector>::nComponents; ++cmpt)
|
||||
{
|
||||
unzipRow(sf1, cmpt, slice[0]);
|
||||
|
||||
@ -253,8 +261,9 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
Info<< nl << "vectorField" << nl;
|
||||
|
||||
Random rnd;
|
||||
FieldField<Field, vector> vf1(1);
|
||||
vf1.set(0, new vectorField(randomVectorField(4)));
|
||||
vf1.set(0, randomField<vector>(rnd, 4));
|
||||
|
||||
FixedList<FieldField<Field, scalar>, 3> cmpts;
|
||||
allocComponents(cmpts, 4);
|
||||
@ -113,7 +113,6 @@ 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 : "
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -31,7 +31,10 @@ Description
|
||||
#include <memory>
|
||||
#include <iostream>
|
||||
#include "autoPtr.H"
|
||||
#include "HashPtrTable.H"
|
||||
#include "refPtr.H"
|
||||
#include "tmp.H"
|
||||
#include "PtrMap.H"
|
||||
#include "primitiveFields.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -250,6 +253,42 @@ int main()
|
||||
Info<< "Table: " << tbl << nl;
|
||||
}
|
||||
|
||||
{
|
||||
PtrMap<scalarField> fields;
|
||||
|
||||
{
|
||||
const label patchi = 2;
|
||||
|
||||
scalarField fld1(patchi, 5.0);
|
||||
scalarField fld2(patchi, 8.0);
|
||||
|
||||
// assign from tmp<>
|
||||
fields.set( patchi, (fld1 * fld2));
|
||||
}
|
||||
|
||||
{
|
||||
const label patchi = 3;
|
||||
|
||||
scalarField fld1(patchi, 6.0);
|
||||
|
||||
// From tmp (clone)
|
||||
fields.set(patchi, tmp<scalarField>(fld1));
|
||||
}
|
||||
|
||||
{
|
||||
const label patchi = 4;
|
||||
|
||||
// From refPtr
|
||||
fields.set(patchi, refPtr<scalarField>::New(patchi, 10.0));
|
||||
}
|
||||
|
||||
Info<< nl
|
||||
<< "PtrMap:" << nl
|
||||
<< fields << endl;
|
||||
}
|
||||
|
||||
Info<< "\nEnd" << nl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
EXE_INC = ${c++LESSWARN}
|
||||
EXE_INC = $(c++LESSWARN)
|
||||
|
||||
/* EXE_LIBS = */
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
EXE_INC = ${c++LESSWARN}
|
||||
EXE_INC = $(c++LESSWARN)
|
||||
|
||||
/* EXE_LIBS = */
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
EXE_INC = ${c++LESSWARN}
|
||||
EXE_INC = $(c++LESSWARN)
|
||||
|
||||
/* EXE_LIBS = */
|
||||
|
||||
@ -90,7 +90,7 @@ void writeAndRead
|
||||
const IOobject& io,
|
||||
const label sz,
|
||||
const word& writeType,
|
||||
const IOobject::readOption rOpt,
|
||||
IOobjectOption::readOption rOpt,
|
||||
const word& readType
|
||||
)
|
||||
{
|
||||
@ -208,7 +208,8 @@ int main(int argc, char *argv[])
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
IOobject::NO_WRITE,
|
||||
IOobject::NO_REGISTER
|
||||
);
|
||||
|
||||
{
|
||||
@ -243,9 +244,7 @@ int main(int argc, char *argv[])
|
||||
args.executable(),
|
||||
"constant",
|
||||
runTime,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
IOobject::NO_REGISTER // implicit convert to IOobjectOption
|
||||
);
|
||||
|
||||
labelList ints(identity(200));
|
||||
|
||||
@ -146,7 +146,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
Info<<"Writing output to " << binaryOutput << endl;
|
||||
|
||||
OFstream os(binaryOutput, IOstream::BINARY);
|
||||
OFstream os(binaryOutput, IOstreamOption::BINARY);
|
||||
|
||||
os.writeEntry("idl1", idl1);
|
||||
os.writeEntry("idl2", idl2);
|
||||
@ -182,7 +182,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// MPI barrier
|
||||
bool barrier = true;
|
||||
Pstream::scatter(barrier);
|
||||
Pstream::broadcast(barrier);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -83,9 +83,9 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
IOstreamOption streamOpt;
|
||||
|
||||
if (outputName.hasExt("gz"))
|
||||
if (outputName.has_ext("gz"))
|
||||
{
|
||||
outputName.removeExt();
|
||||
outputName.remove_ext();
|
||||
streamOpt.compression(IOstreamOption::COMPRESSED);
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -132,7 +132,7 @@ int main(int argc, char *argv[])
|
||||
OTstream os;
|
||||
os << poly;
|
||||
|
||||
ITstream is("input", std::move(os.tokens()));
|
||||
ITstream is(std::move(os.tokens()));
|
||||
is >> polyfunc;
|
||||
}
|
||||
|
||||
|
||||
@ -28,15 +28,14 @@ Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
#include "floatScalar.H"
|
||||
#include "doubleScalar.H"
|
||||
#include "scalar.H"
|
||||
#include "complex.H"
|
||||
#include "Matrix.H"
|
||||
#include "Random.H"
|
||||
#include <chrono>
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Total number of unit tests
|
||||
|
||||
@ -138,8 +138,8 @@ int main()
|
||||
maxFirstEqOp<label>()(maxIndexed, item);
|
||||
}
|
||||
|
||||
Pstream::combineAllGather(minIndexed, minFirstEqOp<label>());
|
||||
Pstream::combineAllGather(maxIndexed, maxFirstEqOp<label>());
|
||||
Pstream::combineReduce(minIndexed, minFirstEqOp<label>());
|
||||
Pstream::combineReduce(maxIndexed, maxFirstEqOp<label>());
|
||||
|
||||
Info<< "Min indexed: " << minIndexed << nl
|
||||
<< "Max indexed: " << maxIndexed << nl;
|
||||
@ -156,8 +156,8 @@ int main()
|
||||
maxIndexed = maxFirstOp<label>()(maxIndexed, item);
|
||||
}
|
||||
|
||||
Pstream::combineAllGather(minIndexed, minFirstEqOp<label>());
|
||||
Pstream::combineAllGather(maxIndexed, maxFirstEqOp<label>());
|
||||
Pstream::combineReduce(minIndexed, minFirstEqOp<label>());
|
||||
Pstream::combineReduce(maxIndexed, maxFirstEqOp<label>());
|
||||
|
||||
Info<< "Min indexed: " << minIndexed << nl
|
||||
<< "Max indexed: " << maxIndexed << nl;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -27,7 +27,6 @@ License
|
||||
|
||||
// #define Foam_autoPtr_deprecate_setMethod
|
||||
|
||||
#include <memory>
|
||||
#include "autoPtr.H"
|
||||
#include "labelList.H"
|
||||
#include "ListOps.H"
|
||||
@ -77,6 +76,14 @@ autoPtr<T> testNullReturn2()
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
struct DerivedList : public List<T>
|
||||
{
|
||||
// Inherit constructors
|
||||
using List<T>::List;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
@ -254,6 +261,16 @@ int main(int argc, char *argv[])
|
||||
// autoPtr<labelList> ptr2 = testNullReturn2<labelList>();
|
||||
}
|
||||
|
||||
{
|
||||
auto input1 = autoPtr<DerivedList<label>>::New(label(10), 1);
|
||||
auto input2 = autoPtr<DerivedList<scalar>>::New(label(10), 1.0);
|
||||
|
||||
autoPtr<labelList> ptr1(std::move(input1));
|
||||
|
||||
// Does not compile: ptr1 = std::move(input2);
|
||||
// Does not compile: ptr1 = autoPtr<List<scalar>>::New(label(10), 2);
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
3
applications/test/barycentric/Make/files
Normal file
3
applications/test/barycentric/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
Test-barycentric.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-barycentric
|
||||
2
applications/test/barycentric/Make/options
Normal file
2
applications/test/barycentric/Make/options
Normal file
@ -0,0 +1,2 @@
|
||||
/* EXE_INC = */
|
||||
/* EXE_LIBS = */
|
||||
93
applications/test/barycentric/Test-barycentric.C
Normal file
93
applications/test/barycentric/Test-barycentric.C
Normal file
@ -0,0 +1,93 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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-barycentric
|
||||
|
||||
Description
|
||||
Some simple tests for barycentric coordinates and transforms
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "barycentricTensor.H"
|
||||
#include "tetrahedron.H"
|
||||
#include "vectorField.H"
|
||||
#include "IOstreams.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// Tets to test
|
||||
tetPoints tetA
|
||||
(
|
||||
point(0, 0, 0),
|
||||
point(1, 0, 0),
|
||||
point(1, 1, 0),
|
||||
point(1, 1, 1)
|
||||
);
|
||||
|
||||
const barycentricTensor baryT(tetA[0], tetA[1], tetA[2], tetA[3]);
|
||||
|
||||
Info<< nl << "Tet: " << tetA << nl;
|
||||
Info<< "tens:" << baryT << nl;
|
||||
|
||||
for
|
||||
(
|
||||
const barycentric& bary :
|
||||
List<barycentric>
|
||||
({
|
||||
{0.25, 0.25, 0.25, 0.25},
|
||||
{1, 0, 0, 0},
|
||||
{0, 1, 0, 0},
|
||||
{0, 0, 1, 0},
|
||||
{0, 0, 0, 1},
|
||||
{0, 0, 0, 0} // Not really valid
|
||||
})
|
||||
)
|
||||
{
|
||||
vector v(tetA.tet().barycentricToPoint(bary));
|
||||
barycentric b(tetA.tet().pointToBarycentric(v));
|
||||
|
||||
Info<< nl
|
||||
<< "bary: " << bary << nl
|
||||
<< "vec: " << v << nl
|
||||
// << "Vec: " << baryT.inner(bary) << nl
|
||||
<< "Vec: " << (baryT & bary) << nl
|
||||
<< "bary: " << b << nl
|
||||
// This won't work (needs a differently defined tensor)
|
||||
// << "Bary: " << (v & baryT) << nl
|
||||
;
|
||||
}
|
||||
|
||||
Info<< "\nEnd\n" << nl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -1,7 +1,2 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
/* EXE_INC = */
|
||||
/* EXE_LIBS = */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -31,7 +31,8 @@ Description
|
||||
#include "argList.H"
|
||||
#include "Time.H"
|
||||
#include "polyMesh.H"
|
||||
#include "boundBox.H"
|
||||
#include "line.H"
|
||||
#include "Random.H"
|
||||
#include "treeBoundBox.H"
|
||||
#include "cellModel.H"
|
||||
#include "bitSet.H"
|
||||
@ -84,7 +85,20 @@ int main(int argc, char *argv[])
|
||||
else
|
||||
{
|
||||
bb = cube(0, 1);
|
||||
Info<<"starting box: " << bb << endl;
|
||||
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;
|
||||
|
||||
point pt(Zero);
|
||||
bb.add(pt);
|
||||
@ -147,6 +161,25 @@ 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))
|
||||
if ((const auto* cartptr = isA<coordSystem::cartesian>(cs)) != nullptr)
|
||||
{
|
||||
if (!cartptr->active())
|
||||
if (!cartptr->valid())
|
||||
{
|
||||
Info<< "inactive cartesian = " << (*cartptr)
|
||||
Info<< "invalid cartesian = " << (*cartptr)
|
||||
<< " with: " << (*cartptr).R() << nl;
|
||||
}
|
||||
}
|
||||
@ -106,7 +106,7 @@ void doTest(const dictionary& dict)
|
||||
|
||||
try
|
||||
{
|
||||
auto cs1ptr = coordinateSystem::New(dict, "");
|
||||
auto cs1ptr = coordinateSystem::New(dict, word::null);
|
||||
coordinateSystem& cs1 = *cs1ptr;
|
||||
cs1.rename(dict.dictName());
|
||||
|
||||
|
||||
@ -51,11 +51,8 @@ cs4
|
||||
{
|
||||
type cylindrical;
|
||||
origin (0 3 5);
|
||||
rotation
|
||||
{
|
||||
type euler;
|
||||
angles (90 0 0);
|
||||
}
|
||||
rotation euler;
|
||||
angles (90 0 0);
|
||||
}
|
||||
|
||||
cyl
|
||||
@ -75,10 +72,7 @@ cyl
|
||||
ident
|
||||
{
|
||||
origin (0 0 0);
|
||||
rotation
|
||||
{
|
||||
type none;
|
||||
}
|
||||
rotation none;
|
||||
}
|
||||
|
||||
)
|
||||
|
||||
@ -26,7 +26,7 @@ rot_x90
|
||||
rot_x90_axesRotation
|
||||
{
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
rotation
|
||||
{
|
||||
type axesRotation;
|
||||
e1 (1 0 0);
|
||||
@ -37,7 +37,7 @@ rot_x90_axesRotation
|
||||
rot_x90_axisAngle
|
||||
{
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
rotation
|
||||
{
|
||||
type axisAngle;
|
||||
axis (1 0 0); // non-unit also OK
|
||||
@ -48,7 +48,7 @@ rot_x90_axisAngle
|
||||
rot_x90_euler
|
||||
{
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
rotation
|
||||
{
|
||||
type euler;
|
||||
angles (0 90 0); // z-x'-z''
|
||||
@ -61,7 +61,7 @@ rot_x90_euler
|
||||
rot_z45_axesRotation
|
||||
{
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
rotation
|
||||
{
|
||||
type axesRotation;
|
||||
e1 (1 1 0);
|
||||
@ -72,7 +72,7 @@ rot_z45_axesRotation
|
||||
rot_z45_axisAngle
|
||||
{
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
rotation
|
||||
{
|
||||
type axisAngle;
|
||||
axis (0 0 10); // non-unit also OK
|
||||
@ -83,7 +83,7 @@ rot_z45_axisAngle
|
||||
rot_z45_euler
|
||||
{
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
rotation
|
||||
{
|
||||
type euler;
|
||||
angles (45 0 0); // z-x'-z''
|
||||
@ -93,7 +93,7 @@ rot_z45_euler
|
||||
rot_z45_starcd
|
||||
{
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
rotation
|
||||
{
|
||||
type starcd;
|
||||
angles (45 0 0); // z-x'-y''
|
||||
@ -106,7 +106,7 @@ rot_z45_starcd
|
||||
rot_zm45_axesRotation
|
||||
{
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
rotation
|
||||
{
|
||||
type axesRotation;
|
||||
e1 (1 -1 0);
|
||||
@ -117,7 +117,7 @@ rot_zm45_axesRotation
|
||||
rot_zm45_axisAngle
|
||||
{
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
rotation
|
||||
{
|
||||
type axisAngle;
|
||||
axis (0 0 10); // non-unit also OK
|
||||
@ -128,7 +128,7 @@ rot_zm45_axisAngle
|
||||
rot_zm45_euler
|
||||
{
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
rotation
|
||||
{
|
||||
type euler;
|
||||
angles (-45 0 0); // z-x'-z''
|
||||
@ -141,7 +141,7 @@ rot_zm45_euler
|
||||
null_axesRotation
|
||||
{
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
rotation
|
||||
{
|
||||
type axesRotation;
|
||||
e1 (1 0 0);
|
||||
@ -152,7 +152,7 @@ null_axesRotation
|
||||
null_axisAngle0
|
||||
{
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
rotation
|
||||
{
|
||||
type axisAngle;
|
||||
axis (0 0 0); // non-unit also OK
|
||||
@ -163,7 +163,7 @@ null_axisAngle0
|
||||
null_axisAngle1
|
||||
{
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
rotation
|
||||
{
|
||||
type axisAngle;
|
||||
axis (1 1 1); // non-unit also OK
|
||||
@ -174,7 +174,7 @@ null_axisAngle1
|
||||
null_euler
|
||||
{
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
rotation
|
||||
{
|
||||
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
|
||||
(
|
||||
Pstream::worldComm,
|
||||
UPstream::worldComm,
|
||||
IOobject
|
||||
(
|
||||
file,
|
||||
@ -78,8 +78,7 @@ int main(int argc, char *argv[])
|
||||
OFstream os
|
||||
(
|
||||
objPath,
|
||||
IOstream::BINARY,
|
||||
IOstream::currentVersion,
|
||||
IOstreamOption::BINARY,
|
||||
runTime.writeCompression()
|
||||
);
|
||||
if (!os.good())
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -42,7 +42,7 @@ namespace Foam
|
||||
// Something like an internal state field. Probably only dimensionless
|
||||
typedef DimensionedField<uint8_t, volMesh> dimUint8Field;
|
||||
|
||||
defineTemplate2TypeNameAndDebug(dimUint8Field, 0);
|
||||
defineTemplateTypeNameAndDebug(dimUint8Field, 0);
|
||||
|
||||
} // End namespace Foam
|
||||
#endif
|
||||
@ -65,8 +65,7 @@ int main(int argc, char *argv[])
|
||||
"tensor",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
{ IOobject::READ_IF_PRESENT, IOobject::NO_REGISTER }
|
||||
),
|
||||
mesh,
|
||||
dimensioned<tensor>(dimless, tensor(1,2,3,4,5,6,7,8,9))
|
||||
@ -75,6 +74,47 @@ 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
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -46,8 +46,8 @@ int main(int argc, char *argv[])
|
||||
profiling::disable(); // No profiling output
|
||||
argList::noBanner();
|
||||
argList::noParallel();
|
||||
argList::noFunctionObjects();
|
||||
argList::removeOption("case");
|
||||
argList::removeOption("noFunctionObjects");
|
||||
argList::addBoolOption("no-close", "Skip dlclose");
|
||||
argList::addBoolOption("quiet", "Disable verbosity");
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -82,8 +82,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< nl << "hash-like functionality" << nl;
|
||||
|
||||
// doesn't work e4 = -1;
|
||||
e4.start() = e4.end() = -1;
|
||||
e4.clear();
|
||||
|
||||
printInfo(e4);
|
||||
for (label i : {2, -1, 2, 1, 4, 1, 2, 3})
|
||||
@ -93,24 +92,24 @@ int main(int argc, char *argv[])
|
||||
printInfo(e4);
|
||||
}
|
||||
|
||||
e4.start() = e4.end() = -1;
|
||||
e4.clear();
|
||||
Info<< "insert from list\n";
|
||||
labelHashSet newIndices({2, -1, 2, 1, 4, 1, 2, 3});
|
||||
e4.insert(newIndices.toc());
|
||||
printInfo(e4);
|
||||
|
||||
e4.start() = e4.end() = -1;
|
||||
e4.clear();
|
||||
Info<< "insert from list\n";
|
||||
e4.insert({0, 5, 2, -1, 2, 1, 4, 1, 2, 3});
|
||||
printInfo(e4);
|
||||
|
||||
FixedList<label, 8> otherIndices{12, 2, -1, 1, 4, 1, 2, 3};
|
||||
e4.start() = e4.end() = -1;
|
||||
e4.clear();
|
||||
Info<< "insert from list: " << otherIndices << nl;
|
||||
e4.insert(otherIndices);
|
||||
printInfo(e4);
|
||||
|
||||
e4.start() = e4.end();
|
||||
e4.a() = e4.b();
|
||||
Info<< "erase from list: " << otherIndices << nl;
|
||||
Info<< "removed " << e4.erase(otherIndices) << " values" << nl;
|
||||
printInfo(e4);
|
||||
|
||||
@ -120,7 +120,8 @@ int main(int argc, char *argv[])
|
||||
try
|
||||
{
|
||||
// Should not trigger any errors
|
||||
expressions::exprString expr(str, dict, false);
|
||||
auto expr = expressions::exprString::toExpr(str, dict);
|
||||
|
||||
Info<< "expr: " << expr << nl;
|
||||
}
|
||||
catch (const Foam::error& err)
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
EXE_INC = ${c++LESSWARN}
|
||||
EXE_INC = $(c++LESSWARN)
|
||||
|
||||
/* EXE_LIBS = */
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||
-I${LIB_SRC}/finiteVolume/lnInclude \
|
||||
-I${LIB_SRC}/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteArea \
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -48,6 +48,14 @@ 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)
|
||||
@ -260,7 +268,7 @@ int main(int argc, char *argv[])
|
||||
"hello1",
|
||||
"hello2",
|
||||
"hello3",
|
||||
"hello4.hmm"
|
||||
"hello4.ext"
|
||||
};
|
||||
|
||||
Info<< file1 << nl;
|
||||
@ -270,7 +278,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
file1,
|
||||
"some",
|
||||
"more/things.hmm"
|
||||
"more/things.ext"
|
||||
};
|
||||
|
||||
Info<< file2 << nl;
|
||||
@ -281,7 +289,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
std::string("ffO"),
|
||||
"some",
|
||||
"more/things.hmm"
|
||||
"more/things.ext"
|
||||
};
|
||||
Info<< file3 << nl;
|
||||
|
||||
@ -295,7 +303,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
"some",
|
||||
file3,
|
||||
"more/things.hmm",
|
||||
"more/things.ext",
|
||||
file1
|
||||
};
|
||||
Info<< "All ==> " << file4 << nl;
|
||||
@ -328,26 +336,26 @@ int main(int argc, char *argv[])
|
||||
fileName input1("path.to/media/image.png");
|
||||
|
||||
Info<<"File : " << input0 << " ext: "
|
||||
<< Switch(input0.hasExt())
|
||||
<< Switch(input0.has_ext())
|
||||
<< " = " << input0.ext() << nl;
|
||||
Info<<"File : " << input1 << " ext: "
|
||||
<< Switch(input1.hasExt())
|
||||
<< Switch(input1.has_ext())
|
||||
<< " = " << input1.ext() << nl;
|
||||
Info<<"File : " << endWithDot << " ext: "
|
||||
<< Switch(endWithDot.hasExt())
|
||||
<< Switch(endWithDot.has_ext())
|
||||
<< " = " << endWithDot.ext() << " <-- perhaps return false?" << nl;
|
||||
Info<<"File : " << endWithSlash << " ext: "
|
||||
<< Switch(endWithSlash.hasExt())
|
||||
<< Switch(endWithSlash.has_ext())
|
||||
<< " = " << endWithSlash.ext() << nl;
|
||||
|
||||
|
||||
Info<<"Remove extension " << (input0.removeExt());
|
||||
Info<<"Remove extension " << (input0.remove_ext());
|
||||
Info<< " now: " << input0 << nl;
|
||||
|
||||
Info<<"Remove extension " << (input1.removeExt());
|
||||
Info<< " now: " << input1 << nl;
|
||||
|
||||
Info<<"Remove extension " << (endWithSlash.removeExt());
|
||||
Info<<"Remove extension " << (endWithSlash.remove_ext());
|
||||
Info<< " now: " << endWithSlash << nl;
|
||||
|
||||
wordList exts{ "jpg", "png", "txt", word::null };
|
||||
@ -359,14 +367,14 @@ int main(int argc, char *argv[])
|
||||
Info<< nl;
|
||||
|
||||
|
||||
Info<<"Test hasExt(word)" << nl
|
||||
Info<<"Test has_ext(word)" << nl
|
||||
<<"~~~~~~~~~~~~~~~~~" << nl;
|
||||
Info<<"Has extension(s):" << nl
|
||||
<< "input: " << input1 << nl;
|
||||
for (const word& e : exts)
|
||||
{
|
||||
Info<<" '" << e << "' -> "
|
||||
<< Switch(input1.hasExt(e)) << nl;
|
||||
<< Switch(input1.has_ext(e)) << nl;
|
||||
}
|
||||
Info<< nl;
|
||||
|
||||
@ -375,12 +383,12 @@ int main(int argc, char *argv[])
|
||||
for (const word& e : exts)
|
||||
{
|
||||
Info<<" '" << e << "' -> "
|
||||
<< Switch(endWithDot.hasExt(e)) << nl;
|
||||
<< Switch(endWithDot.has_ext(e)) << nl;
|
||||
}
|
||||
Info<< nl;
|
||||
|
||||
|
||||
Info<<"Test hasExt(wordRe)" << nl
|
||||
Info<<"Test has_ext(wordRe)" << nl
|
||||
<<"~~~~~~~~~~~~~~~~~~~" << nl;
|
||||
|
||||
// A regex with a zero length matcher doesn't work at all:
|
||||
@ -393,25 +401,25 @@ int main(int argc, char *argv[])
|
||||
Info<<"Has extension(s):" << nl
|
||||
<< "input: " << endWithDot << nl;
|
||||
Info<<" " << matcher0 << " -> "
|
||||
<< Switch(endWithDot.hasExt(matcher0)) << nl;
|
||||
<< Switch(endWithDot.has_ext(matcher0)) << nl;
|
||||
Info<<" " << matcher1 << " -> "
|
||||
<< Switch(endWithDot.hasExt(matcher1)) << nl;
|
||||
<< Switch(endWithDot.has_ext(matcher1)) << nl;
|
||||
Info<<" " << matcher2 << " -> "
|
||||
<< Switch(endWithDot.hasExt(matcher2)) << nl;
|
||||
<< Switch(endWithDot.has_ext(matcher2)) << nl;
|
||||
|
||||
Info<< "input: " << input1 << nl;
|
||||
Info<<" " << matcher0 << " -> "
|
||||
<< Switch(input1.hasExt(matcher0)) << nl;
|
||||
<< Switch(input1.has_ext(matcher0)) << nl;
|
||||
Info<<" " << matcher1 << " -> "
|
||||
<< Switch(input1.hasExt(matcher1)) << nl;
|
||||
<< Switch(input1.has_ext(matcher1)) << nl;
|
||||
Info<<" " << matcher2 << " -> "
|
||||
<< Switch(input1.hasExt(matcher2)) << nl;
|
||||
<< Switch(input1.has_ext(matcher2)) << nl;
|
||||
Info<< nl;
|
||||
|
||||
Info<<"Remove extension(s):" << nl << "input: " << input1 << nl;
|
||||
while (!input1.empty())
|
||||
{
|
||||
if (input1.removeExt())
|
||||
if (input1.remove_ext())
|
||||
{
|
||||
Info<< " -> " << input1 << nl;
|
||||
}
|
||||
@ -587,14 +595,54 @@ 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");
|
||||
|
||||
Foam::rmDir(dirA);
|
||||
// Purge anything existing
|
||||
Foam::rmDir(dirA, true);
|
||||
Foam::rmDir(dirB, true);
|
||||
Foam::rmDir(dirC, true);
|
||||
Foam::rmDir(dirD, true);
|
||||
Foam::rm(lnA);
|
||||
Foam::rm(lnB);
|
||||
Foam::rmDir(dirB);
|
||||
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
Info<< nl << "=========================" << nl
|
||||
<< "Test some copying and deletion" << endl;
|
||||
@ -618,9 +666,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
Info<<" create: " << file << endl;
|
||||
|
||||
std::ofstream os(file);
|
||||
os << "file=<" << file << ">" << nl;
|
||||
touchFileContent(file);
|
||||
}
|
||||
|
||||
const int oldDebug = POSIX::debug;
|
||||
@ -708,7 +754,7 @@ int main(int argc, char *argv[])
|
||||
"hello1",
|
||||
"hello2",
|
||||
"hello3",
|
||||
"hello4.hmm"
|
||||
"hello4.ext"
|
||||
};
|
||||
|
||||
fileName pathName(wrdList);
|
||||
@ -718,14 +764,28 @@ int main(int argc, char *argv[])
|
||||
<< "pathName.name() = >" << pathName.name() << "<\n"
|
||||
<< "pathName.path() = " << pathName.path() << nl
|
||||
<< "pathName.ext() = >" << pathName.ext() << "<\n"
|
||||
<< "pathName.nameLessExt= >" << pathName.nameLessExt() << "<\n";
|
||||
<< "pathName.stem = >" << pathName.stem() << "<\n";
|
||||
|
||||
Info<< "pathName.components() = " << pathName.components() << nl
|
||||
<< "pathName.component(2) = " << pathName.component(2) << nl
|
||||
<< endl;
|
||||
|
||||
Info<< "hasPath = " << Switch(pathName.hasPath()) << nl;
|
||||
pathName.removePath();
|
||||
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<< "removed path = " << pathName << nl;
|
||||
|
||||
Info<< nl << nl;
|
||||
|
||||
@ -64,13 +64,8 @@ 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.min() -= point::uniform(ROOTVSMALL);
|
||||
bb.max() += point::uniform(ROOTVSMALL);
|
||||
treeBoundBox bb(efem.points());
|
||||
bb.grow(ROOTVSMALL);
|
||||
|
||||
labelList allEdges(identity(efem.edges().size()));
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -56,7 +56,7 @@ int main(int argc, char *argv[])
|
||||
// No. of Nodes = nCells
|
||||
// No. of Edges connecting Nodes = nInternalFaces
|
||||
|
||||
OFstream os(args.caseName() + ".graph", IOstream::ASCII);
|
||||
OFstream os(args.caseName() + ".graph", IOstreamOption::ASCII);
|
||||
|
||||
os << "%% metis graph file, of an OpenFOAM mesh %%" << nl
|
||||
<< "%% nCells=" << mesh.nCells()
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2022 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.hasExt("gz"))
|
||||
if (outputName.has_ext("gz"))
|
||||
{
|
||||
comp = IOstreamOption::COMPRESSED;
|
||||
outputName.removeExt();
|
||||
outputName.remove_ext();
|
||||
|
||||
InfoErr<< " [compress]";
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ namespace Foam
|
||||
{
|
||||
typedef GeometricField<vector2D, fvPatchField, volMesh> volVector2DField;
|
||||
|
||||
defineTemplate2TypeNameAndDebug(volVector2DField::Internal, 0);
|
||||
defineTemplateTypeNameAndDebug(volVector2DField::Internal, 0);
|
||||
defineTemplateTypeNameAndDebug(volVector2DField, 0);
|
||||
|
||||
typedef fvPatchField<vector2D> fvPatchVector2DField;
|
||||
|
||||
@ -204,7 +204,7 @@ int main(int argc, char *argv[])
|
||||
labelPair inOut;
|
||||
pointField allCcs(globalNumbering.gather(mesh.cellCentres()));
|
||||
inOut[0] = allCcs.size();
|
||||
Pstream::scatter(allCcs);
|
||||
Pstream::broadcast(allCcs);
|
||||
inOut[1] = allCcs.size();
|
||||
Pout<< " " << inOut << endl;
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -30,11 +30,31 @@ Description
|
||||
|
||||
#include "argList.H"
|
||||
#include "instant.H"
|
||||
#include "Pair.H"
|
||||
#include "fileNameInstant.H"
|
||||
#include "DynamicList.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
template<class T>
|
||||
Ostream& printInstant(const UList<T>& times, const label i)
|
||||
{
|
||||
if (i >= 0 && i < times.size())
|
||||
{
|
||||
Info<< " (" << times[i] << ")";
|
||||
}
|
||||
return Info;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
Ostream& printInstant(const UList<T>& times, const Pair<label>& range)
|
||||
{
|
||||
printInstant(times, range.first());
|
||||
printInstant(times, range.second());
|
||||
return Info;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
@ -48,6 +68,7 @@ int main(int argc, char *argv[])
|
||||
times.append({300.456, "def"});
|
||||
times.append({454.456, "xyz"});
|
||||
times.append({10, "ten"});
|
||||
times.append({15, "fifteen"});
|
||||
|
||||
{
|
||||
word timeName("twenty");
|
||||
@ -61,6 +82,19 @@ int main(int argc, char *argv[])
|
||||
sort(times);
|
||||
Info<< "Sorted:" << times << nl;
|
||||
|
||||
for (const scalar val : { -0.5, 5.0, 18.0, 25.0, 450.0, 480.0 })
|
||||
{
|
||||
label start = instant::findStart(times, val);
|
||||
Pair<label> range = instant::findRange(times, val);
|
||||
|
||||
Info<< nl
|
||||
<< "time:" << val << nl;
|
||||
Info<< " start:" << start;
|
||||
printInstant(times, start) << nl;
|
||||
|
||||
Info<< " range:" << range;
|
||||
printInstant(times, range) << nl;
|
||||
}
|
||||
|
||||
DynamicList<fileNameInstant> files;
|
||||
files.append(fileNameInstant{});
|
||||
|
||||
@ -41,8 +41,8 @@ void printInfo(const labelRange& range)
|
||||
<< "last " << range.last() << nl
|
||||
<< "min " << range.min() << nl
|
||||
<< "max " << range.max() << nl
|
||||
<< "after " << range.after() << nl
|
||||
<< "begin end " << *range.cbegin() << ' ' << *range.cend() << nl;
|
||||
<< "end " << range.end_value() << 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::addVerbose("enable labelRange::debug");
|
||||
argList::addVerboseOption("enable labelRange::debug");
|
||||
argList::addNote
|
||||
(
|
||||
"The default is to add ranges, use 'add' and 'del' to toggle\n\n"
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -24,10 +24,11 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
Print max limits.
|
||||
Print some numerical limits.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include "int.H"
|
||||
#include "uint.H"
|
||||
@ -37,21 +38,63 @@ Description
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
std::ostream& print(const char* tag, float val)
|
||||
{
|
||||
std::cout
|
||||
<< tag << val
|
||||
<< " 0x" << std::hex << *reinterpret_cast<const uint32_t*>(&val);
|
||||
return std::cout;
|
||||
}
|
||||
|
||||
|
||||
std::ostream& print(const char* tag, double val)
|
||||
{
|
||||
std::cout
|
||||
<< tag << val
|
||||
<< " 0x" << std::hex << *reinterpret_cast<const uint64_t*>(&val);
|
||||
return std::cout;
|
||||
}
|
||||
|
||||
|
||||
// Have (float|double)Scalar(GREAT|SMALL|..)
|
||||
|
||||
#define PrintFloatLimits(FloatType, NanFunction) \
|
||||
{ \
|
||||
print("max:", std::numeric_limits<FloatType>::max()); \
|
||||
print(" VGREAT:", FloatType##ScalarVGREAT); \
|
||||
print(" ROOTVGREAT:", FloatType##ScalarROOTVGREAT) << nl; \
|
||||
\
|
||||
print("min:", std::numeric_limits<FloatType>::min()); \
|
||||
print(" VSMALL:", FloatType##ScalarVSMALL); \
|
||||
print(" ROOTVSMALL:", FloatType##ScalarROOTVSMALL) << nl; \
|
||||
\
|
||||
print("epsilon:", std::numeric_limits<FloatType>::epsilon()); \
|
||||
print(" SMALL:", FloatType##ScalarSMALL); \
|
||||
print(" ROOTSMALL:", FloatType##ScalarROOTSMALL) << nl; \
|
||||
\
|
||||
print("1/epsilon:", 1/std::numeric_limits<FloatType>::epsilon()); \
|
||||
print(" GREAT:", FloatType##ScalarGREAT); \
|
||||
print(" ROOTGREAT:", FloatType##ScalarROOTGREAT) << nl; \
|
||||
\
|
||||
print("nan:", std::NanFunction("nan")) << nl; \
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
//NONE Info<<"int16:" << pTraits<int16_t>::max << nl;
|
||||
Info<< "=max=" << nl;
|
||||
Info<< "uint8:" << pTraits<uint8_t>::max << nl;
|
||||
Info<< "int16:" << std::numeric_limits<int16_t>::max() << nl;
|
||||
Info<< "int32:" << pTraits<int32_t>::max << nl;
|
||||
Info<< "uint32:" << pTraits<uint32_t>::max << nl;
|
||||
Info<< "int64:" << pTraits<int64_t>::max << nl;
|
||||
Info<< "uint64:" << pTraits<uint64_t>::max << nl;
|
||||
//NONE cout<<"int16:" << pTraits<int16_t>::max << nl;
|
||||
cout<< "=max=" << nl;
|
||||
cout<< "uint8:" << pTraits<uint8_t>::max << nl;
|
||||
cout<< "int16:" << std::numeric_limits<int16_t>::max() << nl;
|
||||
cout<< "int32:" << pTraits<int32_t>::max << nl;
|
||||
cout<< "uint32:" << pTraits<uint32_t>::max << nl;
|
||||
cout<< "int64:" << pTraits<int64_t>::max << nl;
|
||||
cout<< "uint64:" << pTraits<uint64_t>::max << nl;
|
||||
|
||||
Info<< nl;
|
||||
cout<< nl;
|
||||
|
||||
cout<< "int16:" << std::numeric_limits<int16_t>::max() << nl;
|
||||
cout<< "int32:" << pTraits<int32_t>::max << nl;
|
||||
@ -59,7 +102,7 @@ int main(int argc, char *argv[])
|
||||
cout<< "int64:" << pTraits<int64_t>::max << nl;
|
||||
cout<< "uint64:" << pTraits<uint64_t>::max << nl;
|
||||
|
||||
Info<< nl << "=digits=" << nl;
|
||||
cout<< nl << "=digits=" << nl;
|
||||
|
||||
cout<< "int16:" << std::numeric_limits<int16_t>::digits << nl;
|
||||
cout<< "int32:" << std::numeric_limits<int32_t>::digits << nl;
|
||||
@ -70,29 +113,15 @@ int main(int argc, char *argv[])
|
||||
cout<< "double:" << std::numeric_limits<double>::digits << nl;
|
||||
cout<< "long double:" << std::numeric_limits<long double>::digits << nl;
|
||||
|
||||
Info<< nl << "=float=" << nl;
|
||||
// std::nanl (long double)
|
||||
cout<< nl;
|
||||
cout<< nl << "=float=" << nl;
|
||||
PrintFloatLimits(float, nanf);
|
||||
|
||||
cout<< "max:" << std::numeric_limits<float>::max()
|
||||
<< " VGREAT:" << floatScalarVGREAT << nl;
|
||||
cout<< "min:" << std::numeric_limits<float>::min()
|
||||
<< " VSMALL:" << floatScalarVSMALL << nl;
|
||||
cout<< "epsilon:" << std::numeric_limits<float>::epsilon()
|
||||
<< " SMALL:" << floatScalarSMALL << nl;
|
||||
cout<< "1/epsilon:" << 1.0f/std::numeric_limits<float>::epsilon()
|
||||
<< " GREAT:" << floatScalarGREAT << nl;
|
||||
cout<< nl << "=double=" << nl;
|
||||
PrintFloatLimits(double, nan);
|
||||
|
||||
Info<< nl << "=double=" << nl;
|
||||
|
||||
cout<< "max:" << std::numeric_limits<double>::max()
|
||||
<< " VGREAT:" << doubleScalarVGREAT << nl;
|
||||
cout<< "min:" << std::numeric_limits<double>::min()
|
||||
<< " VSMALL:" << doubleScalarVSMALL << nl;
|
||||
cout<< "epsilon:" << std::numeric_limits<double>::epsilon()
|
||||
<< " SMALL:" << doubleScalarSMALL << nl;
|
||||
cout<< "1/epsilon:" << 1.0f/std::numeric_limits<double>::epsilon()
|
||||
<< " GREAT:" << doubleScalarGREAT << nl;
|
||||
|
||||
Info << "---\nEnd\n" << endl;
|
||||
cout<< "---\nEnd\n" << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -38,8 +38,7 @@ Description
|
||||
|
||||
#include "DiagonalMatrix.H"
|
||||
#include "RectangularMatrix.H"
|
||||
#include "floatScalar.H"
|
||||
#include "doubleScalar.H"
|
||||
#include "scalar.H"
|
||||
#include "complex.H"
|
||||
#include "TestTools.H"
|
||||
|
||||
|
||||
@ -44,8 +44,7 @@ Note
|
||||
|
||||
#include "RectangularMatrix.H"
|
||||
#include "SquareMatrix.H"
|
||||
#include "floatScalar.H"
|
||||
#include "doubleScalar.H"
|
||||
#include "scalar.H"
|
||||
#include "complex.H"
|
||||
#include "IOmanip.H"
|
||||
#include "TestTools.H"
|
||||
|
||||
@ -45,8 +45,7 @@ Note
|
||||
#include "scalarMatrices.H"
|
||||
#include "RectangularMatrix.H"
|
||||
#include "SquareMatrix.H"
|
||||
#include "floatScalar.H"
|
||||
#include "doubleScalar.H"
|
||||
#include "scalar.H"
|
||||
#include "complex.H"
|
||||
#include "IOmanip.H"
|
||||
#include "TestTools.H"
|
||||
|
||||
@ -46,8 +46,7 @@ Note
|
||||
#include "RectangularMatrix.H"
|
||||
#include "SquareMatrix.H"
|
||||
#include "SymmetricSquareMatrix.H"
|
||||
#include "floatScalar.H"
|
||||
#include "doubleScalar.H"
|
||||
#include "scalar.H"
|
||||
#include "complex.H"
|
||||
#include "IOmanip.H"
|
||||
#include "Random.H"
|
||||
|
||||
@ -44,7 +44,7 @@ using namespace Foam;
|
||||
template<class T>
|
||||
Ostream& printInfo(const MinMax<T>& range)
|
||||
{
|
||||
Info<< range << " valid=" << range.valid() << " span=" << range.span();
|
||||
Info<< range << " good=" << range.good() << " span=" << range.span();
|
||||
|
||||
return Info;
|
||||
}
|
||||
@ -234,11 +234,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Pout<< "hashed: " << hashed << nl;
|
||||
|
||||
Pstream::mapCombineGather
|
||||
(
|
||||
hashed,
|
||||
plusEqOp<scalarMinMax>()
|
||||
);
|
||||
Pstream::mapCombineReduce(hashed, plusEqOp<scalarMinMax>());
|
||||
|
||||
Info<< "reduced: " << hashed << nl;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user