Compare commits
109 Commits
develop-fe
...
develop.sw
| Author | SHA1 | Date | |
|---|---|---|---|
| e65dc2d578 | |||
| 37db8ccd20 | |||
| a5d6c8ced0 | |||
| 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 | |||
| 92f38b589a | |||
| ce486da6bd | |||
| de21a6bc0e | |||
| 76d719d1e6 |
@ -1,2 +1,2 @@
|
|||||||
api=2206
|
api=2206
|
||||||
patch=0
|
patch=220907
|
||||||
|
|||||||
@ -11,4 +11,5 @@ EXE_LIBS = \
|
|||||||
-lfvOptions \
|
-lfvOptions \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lsampling \
|
-lsampling \
|
||||||
-lregionFaModels
|
-lregionFaModels \
|
||||||
|
-lfiniteArea
|
||||||
|
|||||||
@ -116,7 +116,7 @@ int main(int argc, char *argv[])
|
|||||||
"normalisedGradP",
|
"normalisedGradP",
|
||||||
tmagGradP()/max(tmagGradP())
|
tmagGradP()/max(tmagGradP())
|
||||||
);
|
);
|
||||||
normalisedGradP.writeOpt() = IOobject::AUTO_WRITE;
|
normalisedGradP.writeOpt(IOobject::AUTO_WRITE);
|
||||||
tmagGradP.clear();
|
tmagGradP.clear();
|
||||||
|
|
||||||
++runTime;
|
++runTime;
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||||
-I${LIB_SRC}/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I${LIB_SRC}/sampling/lnInclude \
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
|
|||||||
@ -26,4 +26,5 @@ EXE_LIBS = \
|
|||||||
-ltopoChangerFvMesh \
|
-ltopoChangerFvMesh \
|
||||||
-lsampling \
|
-lsampling \
|
||||||
-latmosphericModels \
|
-latmosphericModels \
|
||||||
-lregionFaModels
|
-lregionFaModels \
|
||||||
|
-lfiniteArea
|
||||||
|
|||||||
@ -21,4 +21,5 @@ EXE_LIBS = \
|
|||||||
-lcompressibleTurbulenceModels \
|
-lcompressibleTurbulenceModels \
|
||||||
-lthermoTools \
|
-lthermoTools \
|
||||||
-latmosphericModels \
|
-latmosphericModels \
|
||||||
-lregionFaModels
|
-lregionFaModels \
|
||||||
|
-lfiniteArea
|
||||||
|
|||||||
@ -28,4 +28,5 @@ EXE_LIBS = \
|
|||||||
-ldynamicMesh \
|
-ldynamicMesh \
|
||||||
-ldynamicFvMesh \
|
-ldynamicFvMesh \
|
||||||
-ltopoChangerFvMesh \
|
-ltopoChangerFvMesh \
|
||||||
-lregionFaModels
|
-lregionFaModels \
|
||||||
|
-lfiniteArea
|
||||||
|
|||||||
@ -22,4 +22,5 @@ EXE_LIBS = \
|
|||||||
-lcompressibleTurbulenceModels \
|
-lcompressibleTurbulenceModels \
|
||||||
-lthermoTools \
|
-lthermoTools \
|
||||||
-latmosphericModels \
|
-latmosphericModels \
|
||||||
-lregionFaModels
|
-lregionFaModels \
|
||||||
|
-lfiniteArea
|
||||||
|
|||||||
@ -40,4 +40,5 @@ EXE_LIBS = \
|
|||||||
-lthermoTools \
|
-lthermoTools \
|
||||||
-lradiationModels \
|
-lradiationModels \
|
||||||
-lregionModels \
|
-lregionModels \
|
||||||
-lregionFaModels
|
-lregionFaModels \
|
||||||
|
-lfiniteArea
|
||||||
|
|||||||
@ -36,5 +36,5 @@ EXE_LIBS = \
|
|||||||
-lfaOptions \
|
-lfaOptions \
|
||||||
-lregionModels \
|
-lregionModels \
|
||||||
-lsampling \
|
-lsampling \
|
||||||
-lregionFaModels
|
-lregionFaModels \
|
||||||
|
-lfiniteArea
|
||||||
|
|||||||
@ -22,4 +22,5 @@ EXE_LIBS = \
|
|||||||
-ldynamicFvMesh \
|
-ldynamicFvMesh \
|
||||||
-ltopoChangerFvMesh \
|
-ltopoChangerFvMesh \
|
||||||
-latmosphericModels \
|
-latmosphericModels \
|
||||||
-lregionFaModels
|
-lregionFaModels \
|
||||||
|
-lfiniteArea
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteArea/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/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
|
|||||||
@ -2,10 +2,10 @@ EXE_INC = \
|
|||||||
-I../reactingParcelFoam \
|
-I../reactingParcelFoam \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||||
-I${LIB_SRC}/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicFvMesh/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/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
|
|||||||
@ -2,8 +2,8 @@ EXE_INC = \
|
|||||||
-I.. \
|
-I.. \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||||
-I${LIB_SRC}/sampling/lnInclude \
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
-I${LIB_SRC}/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||||
-I${LIB_SRC}/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/sampling/lnInclude \
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
|
|||||||
@ -2,7 +2,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||||
-I$(LIB_SRC)/fvOptions/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/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
|
|||||||
@ -2,8 +2,8 @@ EXE_INC = \
|
|||||||
-I../reactingParcelFoam \
|
-I../reactingParcelFoam \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||||
-I${LIB_SRC}/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I${LIB_SRC}/sampling/lnInclude \
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
|
|||||||
@ -4,8 +4,8 @@ EXE_INC = \
|
|||||||
-I../../reactingParcelFoam \
|
-I../../reactingParcelFoam \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||||
-I${LIB_SRC}/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I${LIB_SRC}/sampling/lnInclude \
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
|
|||||||
@ -2,7 +2,7 @@ EXE_INC = \
|
|||||||
-I$(FOAM_SOLVERS)/lagrangian/reactingParcelFoam/simpleReactingParcelFoam \
|
-I$(FOAM_SOLVERS)/lagrangian/reactingParcelFoam/simpleReactingParcelFoam \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||||
-I${LIB_SRC}/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/sampling/lnInclude \
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
|
|||||||
@ -4,8 +4,8 @@ EXE_INC = \
|
|||||||
-I../../../compressible/rhoPimpleFoam \
|
-I../../../compressible/rhoPimpleFoam \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||||
-I${LIB_SRC}/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I${LIB_SRC}/sampling/lnInclude \
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
|
|||||||
@ -42,4 +42,5 @@ EXE_LIBS = \
|
|||||||
-lregionModels \
|
-lregionModels \
|
||||||
-lregionFaModels \
|
-lregionFaModels \
|
||||||
-lsurfaceFilmModels \
|
-lsurfaceFilmModels \
|
||||||
|
-lfiniteArea \
|
||||||
-lcompressibleTwoPhaseMixtureTurbulenceModels
|
-lcompressibleTwoPhaseMixtureTurbulenceModels
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -59,7 +59,7 @@ Foam::DTRMParticle::DTRMParticle
|
|||||||
{
|
{
|
||||||
if (readFields)
|
if (readFields)
|
||||||
{
|
{
|
||||||
if (is.format() == IOstream::ASCII)
|
if (is.format() == IOstreamOption::ASCII)
|
||||||
{
|
{
|
||||||
is >> p0_ >> p1_ >> I0_ >> I_ >> dA_ >> transmissiveId_;
|
is >> p0_ >> p1_ >> I0_ >> I_ >> dA_ >> transmissiveId_;
|
||||||
}
|
}
|
||||||
@ -115,7 +115,7 @@ void Foam::DTRMParticle::writeProperties
|
|||||||
|
|
||||||
Foam::Ostream& Foam::operator<<(Ostream& os, const DTRMParticle& p)
|
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)
|
os << static_cast<const particle&>(p)
|
||||||
<< token::SPACE << p.p0_
|
<< token::SPACE << p.p0_
|
||||||
|
|||||||
@ -699,7 +699,7 @@ void Foam::radiation::laserDTRM::calculate()
|
|||||||
|
|
||||||
for (label pointi = 0; pointi < lines.size(); pointi += 2)
|
for (label pointi = 0; pointi < lines.size(); pointi += 2)
|
||||||
{
|
{
|
||||||
os.write(linePointRef(lines[pointi], lines[pointi+1]));
|
os.writeLine(lines[pointi], lines[pointi+1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2020 OpenCFD Ltd.
|
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -49,8 +49,8 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
IOstream::streamFormat format = IOstream::BINARY;
|
IOstreamOption streamOpt(IOstreamOption::BINARY);
|
||||||
// IOstream::streamFormat format = IOstream::ASCII;
|
// IOstreamOption streamOpt(IOstreamOption::ASCII);
|
||||||
|
|
||||||
const label size = 20000000;
|
const label size = 20000000;
|
||||||
|
|
||||||
@ -85,11 +85,7 @@ int main(int argc, char *argv[])
|
|||||||
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
|
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
|
||||||
|
|
||||||
|
|
||||||
faces2.writeObject
|
faces2.writeObject(streamOpt, true);
|
||||||
(
|
|
||||||
IOstreamOption(format),
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Written old format faceList in = "
|
Info<< "Written old format faceList in = "
|
||||||
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
|
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
|
||||||
@ -145,11 +141,7 @@ int main(int argc, char *argv[])
|
|||||||
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
|
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
|
||||||
|
|
||||||
|
|
||||||
faces2.writeObject
|
faces2.writeObject(streamOpt, true);
|
||||||
(
|
|
||||||
IOstreamOption(format),
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Written new format faceList in = "
|
Info<< "Written new format faceList in = "
|
||||||
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
|
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2021 OpenCFD Ltd.
|
Copyright (C) 2021-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -104,7 +104,7 @@ void readList
|
|||||||
{
|
{
|
||||||
OTstream os;
|
OTstream os;
|
||||||
os << input;
|
os << input;
|
||||||
ITstream is("input", os.tokens());
|
ITstream is(os.tokens());
|
||||||
|
|
||||||
is >> output;
|
is >> output;
|
||||||
}
|
}
|
||||||
@ -118,7 +118,7 @@ void readList
|
|||||||
{
|
{
|
||||||
OTstream os;
|
OTstream os;
|
||||||
os << input;
|
os << input;
|
||||||
ITstream is("input", os.tokens());
|
ITstream is(os.tokens());
|
||||||
|
|
||||||
is >> output;
|
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/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Application
|
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)
|
||||||
|
{
|
||||||
|
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;
|
Random rnd;
|
||||||
|
return randomField<Type>(rnd, dim);
|
||||||
vectorField vf(size);
|
|
||||||
|
|
||||||
forAll(vf, i)
|
|
||||||
{
|
|
||||||
for (direction cmpt=0; cmpt < vector::nComponents; ++cmpt)
|
|
||||||
{
|
|
||||||
vf[i][cmpt] = rnd.position<label>(0, 100);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return vf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -191,7 +199,7 @@ int main(int argc, char *argv[])
|
|||||||
printFieldField(sf1);
|
printFieldField(sf1);
|
||||||
|
|
||||||
Info<< nl;
|
Info<< nl;
|
||||||
for (direction cmpt = 0; cmpt < vector::nComponents; ++cmpt)
|
for (direction cmpt = 0; cmpt < pTraits<vector>::nComponents; ++cmpt)
|
||||||
{
|
{
|
||||||
unzipRow(sf1, cmpt, slice[0]);
|
unzipRow(sf1, cmpt, slice[0]);
|
||||||
|
|
||||||
@ -253,8 +261,9 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
Info<< nl << "vectorField" << nl;
|
Info<< nl << "vectorField" << nl;
|
||||||
|
|
||||||
|
Random rnd;
|
||||||
FieldField<Field, vector> vf1(1);
|
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;
|
FixedList<FieldField<Field, scalar>, 3> cmpts;
|
||||||
allocComponents(cmpts, 4);
|
allocComponents(cmpts, 4);
|
||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011 OpenFOAM Foundation
|
Copyright (C) 2011 OpenFOAM Foundation
|
||||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -31,7 +31,10 @@ Description
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
#include "HashPtrTable.H"
|
#include "refPtr.H"
|
||||||
|
#include "tmp.H"
|
||||||
|
#include "PtrMap.H"
|
||||||
|
#include "primitiveFields.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
@ -250,6 +253,42 @@ int main()
|
|||||||
Info<< "Table: " << tbl << nl;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
EXE_INC = ${c++LESSWARN}
|
EXE_INC = $(c++LESSWARN)
|
||||||
|
|
||||||
/* EXE_LIBS = */
|
/* EXE_LIBS = */
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
EXE_INC = ${c++LESSWARN}
|
EXE_INC = $(c++LESSWARN)
|
||||||
|
|
||||||
/* EXE_LIBS = */
|
/* EXE_LIBS = */
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
EXE_INC = ${c++LESSWARN}
|
EXE_INC = $(c++LESSWARN)
|
||||||
|
|
||||||
/* EXE_LIBS = */
|
/* EXE_LIBS = */
|
||||||
|
|||||||
@ -146,7 +146,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
Info<<"Writing output to " << binaryOutput << endl;
|
Info<<"Writing output to " << binaryOutput << endl;
|
||||||
|
|
||||||
OFstream os(binaryOutput, IOstream::BINARY);
|
OFstream os(binaryOutput, IOstreamOption::BINARY);
|
||||||
|
|
||||||
os.writeEntry("idl1", idl1);
|
os.writeEntry("idl1", idl1);
|
||||||
os.writeEntry("idl2", idl2);
|
os.writeEntry("idl2", idl2);
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011 OpenFOAM Foundation
|
Copyright (C) 2011 OpenFOAM Foundation
|
||||||
Copyright (C) 2020 OpenCFD Ltd.
|
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -132,7 +132,7 @@ int main(int argc, char *argv[])
|
|||||||
OTstream os;
|
OTstream os;
|
||||||
os << poly;
|
os << poly;
|
||||||
|
|
||||||
ITstream is("input", std::move(os.tokens()));
|
ITstream is(std::move(os.tokens()));
|
||||||
is >> polyfunc;
|
is >> polyfunc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,15 +28,14 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
using namespace Foam;
|
#include "scalar.H"
|
||||||
|
|
||||||
#include "floatScalar.H"
|
|
||||||
#include "doubleScalar.H"
|
|
||||||
#include "complex.H"
|
#include "complex.H"
|
||||||
#include "Matrix.H"
|
#include "Matrix.H"
|
||||||
#include "Random.H"
|
#include "Random.H"
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
||||||
|
using namespace Foam;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Total number of unit tests
|
// Total number of unit tests
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -27,7 +27,6 @@ License
|
|||||||
|
|
||||||
// #define Foam_autoPtr_deprecate_setMethod
|
// #define Foam_autoPtr_deprecate_setMethod
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
#include "labelList.H"
|
#include "labelList.H"
|
||||||
#include "ListOps.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:
|
// Main program:
|
||||||
|
|
||||||
@ -254,6 +261,16 @@ int main(int argc, char *argv[])
|
|||||||
// autoPtr<labelList> ptr2 = testNullReturn2<labelList>();
|
// 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,8 +78,8 @@ int main(int argc, char *argv[])
|
|||||||
OFstream os
|
OFstream os
|
||||||
(
|
(
|
||||||
objPath,
|
objPath,
|
||||||
IOstream::BINARY,
|
IOstreamOption::BINARY,
|
||||||
IOstream::currentVersion,
|
IOstreamOption::currentVersion,
|
||||||
runTime.writeCompression()
|
runTime.writeCompression()
|
||||||
);
|
);
|
||||||
if (!os.good())
|
if (!os.good())
|
||||||
|
|||||||
@ -42,7 +42,7 @@ namespace Foam
|
|||||||
// Something like an internal state field. Probably only dimensionless
|
// Something like an internal state field. Probably only dimensionless
|
||||||
typedef DimensionedField<uint8_t, volMesh> dimUint8Field;
|
typedef DimensionedField<uint8_t, volMesh> dimUint8Field;
|
||||||
|
|
||||||
defineTemplate2TypeNameAndDebug(dimUint8Field, 0);
|
defineTemplateTypeNameAndDebug(dimUint8Field, 0);
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -46,8 +46,8 @@ int main(int argc, char *argv[])
|
|||||||
profiling::disable(); // No profiling output
|
profiling::disable(); // No profiling output
|
||||||
argList::noBanner();
|
argList::noBanner();
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
|
argList::noFunctionObjects();
|
||||||
argList::removeOption("case");
|
argList::removeOption("case");
|
||||||
argList::removeOption("noFunctionObjects");
|
|
||||||
argList::addBoolOption("no-close", "Skip dlclose");
|
argList::addBoolOption("no-close", "Skip dlclose");
|
||||||
argList::addBoolOption("quiet", "Disable verbosity");
|
argList::addBoolOption("quiet", "Disable verbosity");
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017 OpenCFD Ltd.
|
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -82,8 +82,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< nl << "hash-like functionality" << nl;
|
Info<< nl << "hash-like functionality" << nl;
|
||||||
|
|
||||||
// doesn't work e4 = -1;
|
e4.clear();
|
||||||
e4.start() = e4.end() = -1;
|
|
||||||
|
|
||||||
printInfo(e4);
|
printInfo(e4);
|
||||||
for (label i : {2, -1, 2, 1, 4, 1, 2, 3})
|
for (label i : {2, -1, 2, 1, 4, 1, 2, 3})
|
||||||
@ -93,24 +92,24 @@ int main(int argc, char *argv[])
|
|||||||
printInfo(e4);
|
printInfo(e4);
|
||||||
}
|
}
|
||||||
|
|
||||||
e4.start() = e4.end() = -1;
|
e4.clear();
|
||||||
Info<< "insert from list\n";
|
Info<< "insert from list\n";
|
||||||
labelHashSet newIndices({2, -1, 2, 1, 4, 1, 2, 3});
|
labelHashSet newIndices({2, -1, 2, 1, 4, 1, 2, 3});
|
||||||
e4.insert(newIndices.toc());
|
e4.insert(newIndices.toc());
|
||||||
printInfo(e4);
|
printInfo(e4);
|
||||||
|
|
||||||
e4.start() = e4.end() = -1;
|
e4.clear();
|
||||||
Info<< "insert from list\n";
|
Info<< "insert from list\n";
|
||||||
e4.insert({0, 5, 2, -1, 2, 1, 4, 1, 2, 3});
|
e4.insert({0, 5, 2, -1, 2, 1, 4, 1, 2, 3});
|
||||||
printInfo(e4);
|
printInfo(e4);
|
||||||
|
|
||||||
FixedList<label, 8> otherIndices{12, 2, -1, 1, 4, 1, 2, 3};
|
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;
|
Info<< "insert from list: " << otherIndices << nl;
|
||||||
e4.insert(otherIndices);
|
e4.insert(otherIndices);
|
||||||
printInfo(e4);
|
printInfo(e4);
|
||||||
|
|
||||||
e4.start() = e4.end();
|
e4.a() = e4.b();
|
||||||
Info<< "erase from list: " << otherIndices << nl;
|
Info<< "erase from list: " << otherIndices << nl;
|
||||||
Info<< "removed " << e4.erase(otherIndices) << " values" << nl;
|
Info<< "removed " << e4.erase(otherIndices) << " values" << nl;
|
||||||
printInfo(e4);
|
printInfo(e4);
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
EXE_INC = ${c++LESSWARN}
|
EXE_INC = $(c++LESSWARN)
|
||||||
|
|
||||||
/* EXE_LIBS = */
|
/* EXE_LIBS = */
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||||
-I${LIB_SRC}/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I${LIB_SRC}/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteArea \
|
-lfiniteArea \
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017 OpenCFD Ltd.
|
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -56,7 +56,7 @@ int main(int argc, char *argv[])
|
|||||||
// No. of Nodes = nCells
|
// No. of Nodes = nCells
|
||||||
// No. of Edges connecting Nodes = nInternalFaces
|
// 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
|
os << "%% metis graph file, of an OpenFOAM mesh %%" << nl
|
||||||
<< "%% nCells=" << mesh.nCells()
|
<< "%% nCells=" << mesh.nCells()
|
||||||
|
|||||||
@ -39,7 +39,7 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
typedef GeometricField<vector2D, fvPatchField, volMesh> volVector2DField;
|
typedef GeometricField<vector2D, fvPatchField, volMesh> volVector2DField;
|
||||||
|
|
||||||
defineTemplate2TypeNameAndDebug(volVector2DField::Internal, 0);
|
defineTemplateTypeNameAndDebug(volVector2DField::Internal, 0);
|
||||||
defineTemplateTypeNameAndDebug(volVector2DField, 0);
|
defineTemplateTypeNameAndDebug(volVector2DField, 0);
|
||||||
|
|
||||||
typedef fvPatchField<vector2D> fvPatchVector2DField;
|
typedef fvPatchField<vector2D> fvPatchVector2DField;
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2018 OpenCFD Ltd.
|
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -30,11 +30,31 @@ Description
|
|||||||
|
|
||||||
#include "argList.H"
|
#include "argList.H"
|
||||||
#include "instant.H"
|
#include "instant.H"
|
||||||
|
#include "Pair.H"
|
||||||
#include "fileNameInstant.H"
|
#include "fileNameInstant.H"
|
||||||
#include "DynamicList.H"
|
#include "DynamicList.H"
|
||||||
|
|
||||||
using namespace Foam;
|
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:
|
// Main program:
|
||||||
|
|
||||||
@ -48,6 +68,7 @@ int main(int argc, char *argv[])
|
|||||||
times.append({300.456, "def"});
|
times.append({300.456, "def"});
|
||||||
times.append({454.456, "xyz"});
|
times.append({454.456, "xyz"});
|
||||||
times.append({10, "ten"});
|
times.append({10, "ten"});
|
||||||
|
times.append({15, "fifteen"});
|
||||||
|
|
||||||
{
|
{
|
||||||
word timeName("twenty");
|
word timeName("twenty");
|
||||||
@ -61,6 +82,19 @@ int main(int argc, char *argv[])
|
|||||||
sort(times);
|
sort(times);
|
||||||
Info<< "Sorted:" << times << nl;
|
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;
|
DynamicList<fileNameInstant> files;
|
||||||
files.append(fileNameInstant{});
|
files.append(fileNameInstant{});
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2018 OpenCFD Ltd.
|
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -24,10 +24,11 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Print max limits.
|
Print some numerical limits.
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include "int.H"
|
#include "int.H"
|
||||||
#include "uint.H"
|
#include "uint.H"
|
||||||
@ -37,21 +38,63 @@ Description
|
|||||||
|
|
||||||
using namespace Foam;
|
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:
|
// Main program:
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
//NONE Info<<"int16:" << pTraits<int16_t>::max << nl;
|
//NONE cout<<"int16:" << pTraits<int16_t>::max << nl;
|
||||||
Info<< "=max=" << nl;
|
cout<< "=max=" << nl;
|
||||||
Info<< "uint8:" << pTraits<uint8_t>::max << nl;
|
cout<< "uint8:" << pTraits<uint8_t>::max << nl;
|
||||||
Info<< "int16:" << std::numeric_limits<int16_t>::max() << nl;
|
cout<< "int16:" << std::numeric_limits<int16_t>::max() << nl;
|
||||||
Info<< "int32:" << pTraits<int32_t>::max << nl;
|
cout<< "int32:" << pTraits<int32_t>::max << nl;
|
||||||
Info<< "uint32:" << pTraits<uint32_t>::max << nl;
|
cout<< "uint32:" << pTraits<uint32_t>::max << nl;
|
||||||
Info<< "int64:" << pTraits<int64_t>::max << nl;
|
cout<< "int64:" << pTraits<int64_t>::max << nl;
|
||||||
Info<< "uint64:" << pTraits<uint64_t>::max << nl;
|
cout<< "uint64:" << pTraits<uint64_t>::max << nl;
|
||||||
|
|
||||||
Info<< nl;
|
cout<< nl;
|
||||||
|
|
||||||
cout<< "int16:" << std::numeric_limits<int16_t>::max() << nl;
|
cout<< "int16:" << std::numeric_limits<int16_t>::max() << nl;
|
||||||
cout<< "int32:" << pTraits<int32_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<< "int64:" << pTraits<int64_t>::max << nl;
|
||||||
cout<< "uint64:" << pTraits<uint64_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<< "int16:" << std::numeric_limits<int16_t>::digits << nl;
|
||||||
cout<< "int32:" << std::numeric_limits<int32_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<< "double:" << std::numeric_limits<double>::digits << nl;
|
||||||
cout<< "long double:" << std::numeric_limits<long 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()
|
cout<< nl << "=double=" << nl;
|
||||||
<< " VGREAT:" << floatScalarVGREAT << nl;
|
PrintFloatLimits(double, nan);
|
||||||
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;
|
|
||||||
|
|
||||||
Info<< nl << "=double=" << nl;
|
cout<< "---\nEnd\n" << std::endl;
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,8 +38,7 @@ Description
|
|||||||
|
|
||||||
#include "DiagonalMatrix.H"
|
#include "DiagonalMatrix.H"
|
||||||
#include "RectangularMatrix.H"
|
#include "RectangularMatrix.H"
|
||||||
#include "floatScalar.H"
|
#include "scalar.H"
|
||||||
#include "doubleScalar.H"
|
|
||||||
#include "complex.H"
|
#include "complex.H"
|
||||||
#include "TestTools.H"
|
#include "TestTools.H"
|
||||||
|
|
||||||
|
|||||||
@ -44,8 +44,7 @@ Note
|
|||||||
|
|
||||||
#include "RectangularMatrix.H"
|
#include "RectangularMatrix.H"
|
||||||
#include "SquareMatrix.H"
|
#include "SquareMatrix.H"
|
||||||
#include "floatScalar.H"
|
#include "scalar.H"
|
||||||
#include "doubleScalar.H"
|
|
||||||
#include "complex.H"
|
#include "complex.H"
|
||||||
#include "IOmanip.H"
|
#include "IOmanip.H"
|
||||||
#include "TestTools.H"
|
#include "TestTools.H"
|
||||||
|
|||||||
@ -45,8 +45,7 @@ Note
|
|||||||
#include "scalarMatrices.H"
|
#include "scalarMatrices.H"
|
||||||
#include "RectangularMatrix.H"
|
#include "RectangularMatrix.H"
|
||||||
#include "SquareMatrix.H"
|
#include "SquareMatrix.H"
|
||||||
#include "floatScalar.H"
|
#include "scalar.H"
|
||||||
#include "doubleScalar.H"
|
|
||||||
#include "complex.H"
|
#include "complex.H"
|
||||||
#include "IOmanip.H"
|
#include "IOmanip.H"
|
||||||
#include "TestTools.H"
|
#include "TestTools.H"
|
||||||
|
|||||||
@ -46,8 +46,7 @@ Note
|
|||||||
#include "RectangularMatrix.H"
|
#include "RectangularMatrix.H"
|
||||||
#include "SquareMatrix.H"
|
#include "SquareMatrix.H"
|
||||||
#include "SymmetricSquareMatrix.H"
|
#include "SymmetricSquareMatrix.H"
|
||||||
#include "floatScalar.H"
|
#include "scalar.H"
|
||||||
#include "doubleScalar.H"
|
|
||||||
#include "complex.H"
|
#include "complex.H"
|
||||||
#include "IOmanip.H"
|
#include "IOmanip.H"
|
||||||
#include "Random.H"
|
#include "Random.H"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
EXE_INC = ${COMP_OPENMP} /* -UUSE_OMP */
|
EXE_INC = $(COMP_OPENMP) /* -UUSE_OMP */
|
||||||
|
|
||||||
/* Mostly do not need to explicitly link openmp libraries */
|
/* Mostly do not need to explicitly link openmp libraries */
|
||||||
/* EXE_LIBS = ${LINK_OPENMP} */
|
/* EXE_LIBS = $(LINK_OPENMP) */
|
||||||
|
|||||||
@ -55,7 +55,7 @@ void do_exchangeBuf
|
|||||||
const bool wait
|
const bool wait
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const label startOfRequests = Pstream::nRequests();
|
const label startOfRequests = UPstream::nRequests();
|
||||||
|
|
||||||
// Set up receives
|
// Set up receives
|
||||||
// ~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~
|
||||||
@ -132,7 +132,7 @@ void do_exchangeContainer
|
|||||||
const bool wait
|
const bool wait
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const label startOfRequests = Pstream::nRequests();
|
const label startOfRequests = UPstream::nRequests();
|
||||||
|
|
||||||
// Set up receives
|
// Set up receives
|
||||||
// ~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -334,7 +334,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
DynamicList<char> buf;
|
DynamicList<char> buf;
|
||||||
|
|
||||||
OListStream os(std::move(buf), IOstream::BINARY);
|
OListStream os(std::move(buf), IOstreamOption::BINARY);
|
||||||
os << srcList;
|
os << srcList;
|
||||||
|
|
||||||
os.swap(buf); // Recover buffer
|
os.swap(buf); // Recover buffer
|
||||||
@ -342,7 +342,7 @@ int main(int argc, char *argv[])
|
|||||||
// Read back
|
// Read back
|
||||||
List<scalar> dstList;
|
List<scalar> dstList;
|
||||||
|
|
||||||
UIListStream is(buf, IOstream::BINARY);
|
UIListStream is(buf, IOstreamOption::BINARY);
|
||||||
is.setScalarByteSize(sizeof(otherType));
|
is.setScalarByteSize(sizeof(otherType));
|
||||||
|
|
||||||
Info<< "Stream scalar-size ("
|
Info<< "Stream scalar-size ("
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -19,6 +19,9 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "primitiveFields.H"
|
#include "primitiveFields.H"
|
||||||
|
#include "autoPtr.H"
|
||||||
|
#include "refPtr.H"
|
||||||
|
#include "tmp.H"
|
||||||
#include "Switch.H"
|
#include "Switch.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
@ -29,6 +32,36 @@ struct myScalarField : public scalarField
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
void constructInfo()
|
||||||
|
{
|
||||||
|
Info<< " move-constructible:"
|
||||||
|
<< std::is_move_constructible<T>::value
|
||||||
|
<< " move-assignable:"
|
||||||
|
<< std::is_move_assignable<T>::value
|
||||||
|
<< " nothrow:"
|
||||||
|
<< std::is_nothrow_move_assignable<T>::value
|
||||||
|
<< " trivially:"
|
||||||
|
<< std::is_trivially_move_assignable<T>::value
|
||||||
|
<< nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
void printInfo(const autoPtr<T>& item, const bool verbose = false)
|
||||||
|
{
|
||||||
|
Info<< "autoPtr good:" << Switch::name(item.good())
|
||||||
|
<< " addr: " << Foam::name(item.get());
|
||||||
|
|
||||||
|
constructInfo<autoPtr<T>>();
|
||||||
|
|
||||||
|
if (verbose && item)
|
||||||
|
{
|
||||||
|
Info<< "content: " << item() << nl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void printInfo(const refPtr<T>& item, const bool verbose = false)
|
void printInfo(const refPtr<T>& item, const bool verbose = false)
|
||||||
{
|
{
|
||||||
@ -37,15 +70,24 @@ void printInfo(const refPtr<T>& item, const bool verbose = false)
|
|||||||
<< " addr: " << Foam::name(item.get())
|
<< " addr: " << Foam::name(item.get())
|
||||||
<< " movable:" << Switch(item.movable());
|
<< " movable:" << Switch(item.movable());
|
||||||
|
|
||||||
Info<< " move-constructible:"
|
constructInfo<refPtr<T>>();
|
||||||
<< std::is_move_constructible<refPtr<T>>::value
|
|
||||||
<< " move-assignable:"
|
if (verbose && item)
|
||||||
<< std::is_move_assignable<refPtr<T>>::value
|
{
|
||||||
<< " nothrow:"
|
Info<< "content: " << item() << nl;
|
||||||
<< std::is_nothrow_move_assignable<refPtr<T>>::value
|
}
|
||||||
<< " trivially:"
|
}
|
||||||
<< std::is_trivially_move_assignable<refPtr<T>>::value
|
|
||||||
<< nl;
|
|
||||||
|
template<class T>
|
||||||
|
void printInfo(const tmp<T>& item, const bool verbose = false)
|
||||||
|
{
|
||||||
|
Info<< "tmp good:" << Switch::name(item.good())
|
||||||
|
<< " pointer:" << Switch::name(item.is_pointer())
|
||||||
|
<< " addr: " << Foam::name(item.get())
|
||||||
|
<< " movable:" << Switch(item.movable());
|
||||||
|
|
||||||
|
constructInfo<tmp<T>>();
|
||||||
|
|
||||||
if (verbose && item)
|
if (verbose && item)
|
||||||
{
|
{
|
||||||
@ -101,6 +143,62 @@ int main()
|
|||||||
printInfo(tfld3, true);
|
printInfo(tfld3, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
refPtr<scalarField> tfld1;
|
||||||
|
auto aptr = autoPtr<scalarField>::New(2, scalar(2));
|
||||||
|
|
||||||
|
tmp<scalarField> tfld2;
|
||||||
|
printInfo(tfld2, true);
|
||||||
|
|
||||||
|
tfld2 = new scalarField(10, Zero);
|
||||||
|
|
||||||
|
/*
|
||||||
|
tfld2 = aptr.get();
|
||||||
|
|
||||||
|
// tfld1.reset(aptr);
|
||||||
|
// tfld1 = std::move(aptr);
|
||||||
|
// tfld1 = aptr;
|
||||||
|
|
||||||
|
Info<< nl << "From autoPtr" << nl;
|
||||||
|
printInfo(aptr, true);
|
||||||
|
//& Info<< nl << "Construct from autoPtr" << nl;
|
||||||
|
//& // refPtr<scalarField> tfld2(autoPtr<scalarField>::New(10, scalar(2)));
|
||||||
|
//& printInfo(tfld2, true);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto aptr1 = autoPtr<labelField>::New(2, Zero);
|
||||||
|
//auto aptr1 = autoPtr<scalarField>::New(2, scalar(2));
|
||||||
|
auto aptr2 = autoPtr<scalarField>::New(2, scalar(2));
|
||||||
|
|
||||||
|
refPtr<scalarField> tfld2(std::move(aptr2));
|
||||||
|
|
||||||
|
// aptr2 = std::move(aptr1);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto tptr1 = tmp<labelField>::New(2, Zero);
|
||||||
|
auto aptr1 = autoPtr<labelField>::New(2, Zero);
|
||||||
|
auto tfld2 = refPtr<labelField>::New(2, Zero);
|
||||||
|
|
||||||
|
// Deleted: refPtr<labelField> tfld1(aptr1);
|
||||||
|
refPtr<labelField> tfld1;
|
||||||
|
|
||||||
|
// refPtr<labelField> tfld1(std::move(tptr1));
|
||||||
|
// refPtr<labelField> tfld1(tptr1);
|
||||||
|
|
||||||
|
tfld1 = std::move(aptr1);
|
||||||
|
|
||||||
|
// tfld1.reset(aptr1);
|
||||||
|
// tfld1.reset(tfld2);
|
||||||
|
|
||||||
|
// tfld1 = std::move(tptr1);
|
||||||
|
// Does not compile: tfld1.ref(tptr1);
|
||||||
|
// Deleted: tfld1.cref(tptr1);
|
||||||
|
// Deleted: tfld1.ref(aptr1);
|
||||||
|
}
|
||||||
|
|
||||||
Info<< "\nEnd" << endl;
|
Info<< "\nEnd" << endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -126,6 +126,9 @@ int main(int argc, char *argv[])
|
|||||||
testDivide<vector>(vectors);
|
testDivide<vector>(vectors);
|
||||||
|
|
||||||
|
|
||||||
|
//(void) compareOp<vector>()(vector::zero, vector::one);
|
||||||
|
|
||||||
|
|
||||||
Info<< "\nEnd\n" << endl;
|
Info<< "\nEnd\n" << endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
Test-tensorFieldFields1.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_USER_APPBIN)/Test-tensorFieldFields1
|
|
||||||
@ -34,21 +34,29 @@ Application
|
|||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
vectorField randomVectorField(label size)
|
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;
|
Random rnd;
|
||||||
|
return randomField<Type>(rnd, dim);
|
||||||
vectorField vf(size);
|
|
||||||
|
|
||||||
forAll(vf, i)
|
|
||||||
{
|
|
||||||
for (direction cmpt=0; cmpt < vector::nComponents; ++cmpt)
|
|
||||||
{
|
|
||||||
vf[i][cmpt] = rnd.position<label>(0, 100);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return vf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -251,7 +259,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
Info<< nl << "vectorField" << nl;
|
Info<< nl << "vectorField" << nl;
|
||||||
|
|
||||||
vectorField vf1(randomVectorField(4));
|
vectorField vf1(randomField<vector>(4));
|
||||||
FixedList<scalarField, 3> cmpts(scalarField(vf1.size()));
|
FixedList<scalarField, 3> cmpts(scalarField(vf1.size()));
|
||||||
|
|
||||||
Info<< nl
|
Info<< nl
|
||||||
|
|||||||
@ -63,7 +63,6 @@ int main(int argc, char *argv[])
|
|||||||
argList::addNote("Test timeSelector and TimePaths");
|
argList::addNote("Test timeSelector and TimePaths");
|
||||||
|
|
||||||
timeSelector::addOptions(true, true);
|
timeSelector::addOptions(true, true);
|
||||||
argList::noLibs();
|
|
||||||
argList::noFunctionObjects();
|
argList::noFunctionObjects();
|
||||||
|
|
||||||
argList::addOption("relative", "PATH", "Test relativePath");
|
argList::addOption("relative", "PATH", "Test relativePath");
|
||||||
|
|||||||
@ -19,6 +19,9 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "primitiveFields.H"
|
#include "primitiveFields.H"
|
||||||
|
#include "autoPtr.H"
|
||||||
|
#include "refPtr.H"
|
||||||
|
#include "tmp.H"
|
||||||
#include "Switch.H"
|
#include "Switch.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
@ -126,6 +129,28 @@ int main()
|
|||||||
printInfo(tfld2);
|
printInfo(tfld2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto tptr1 = refPtr<labelField>::New(2, Zero);
|
||||||
|
auto aptr1 = autoPtr<labelField>::New(2, Zero);
|
||||||
|
|
||||||
|
// Deleted: tmp<labelField> tfld1(aptr1);
|
||||||
|
// tmp<labelField> tfld1(std::move(aptr1));
|
||||||
|
// tmp<labelField> tfld1(std::move(tptr1));
|
||||||
|
tmp<labelField> tfld1;
|
||||||
|
//tfld1.cref(tptr1);
|
||||||
|
//tfld1.cref(aptr1);
|
||||||
|
|
||||||
|
// refPtr<labelField> tfld1(std::move(tptr1));
|
||||||
|
// refPtr<labelField> tfld1(tptr1);
|
||||||
|
|
||||||
|
// tfld1 = std::move(aptr1);
|
||||||
|
|
||||||
|
// tfld1 = std::move(tptr1);
|
||||||
|
// Does not compile: tfld1.ref(tptr1);
|
||||||
|
// Deleted: tfld1.cref(tptr1);
|
||||||
|
// Deleted: tfld1.ref(aptr1);
|
||||||
|
}
|
||||||
|
|
||||||
Info<< "\nEnd" << endl;
|
Info<< "\nEnd" << endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -42,7 +42,7 @@ namespace Foam
|
|||||||
// - still needs some basic boundary conditions!!
|
// - still needs some basic boundary conditions!!
|
||||||
typedef GeometricField<uint8_t, fvPatchField, volMesh> volUint8Field;
|
typedef GeometricField<uint8_t, fvPatchField, volMesh> volUint8Field;
|
||||||
|
|
||||||
defineTemplate2TypeNameAndDebug(volUint8Field, 0);
|
defineTemplateTypeNameAndDebug(volUint8Field, 0);
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -116,12 +116,16 @@ Description
|
|||||||
{
|
{
|
||||||
const faPatch& p = patches[patchi];
|
const faPatch& p = patches[patchi];
|
||||||
|
|
||||||
|
// Report physical size (nEdges) not virtual size
|
||||||
Info<< " " << "patch " << p.index()
|
Info<< " " << "patch " << p.index()
|
||||||
<< " (size: " << returnReduce(p.size(), sumOp<label>())
|
<< " (size: " << returnReduce(p.nEdges(), sumOp<label>())
|
||||||
<< ") name: " << p.name()
|
<< ") name: " << p.name()
|
||||||
<< nl;
|
<< nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Info<< "----------------" << nl
|
||||||
|
<< "Used polyPatches: " << flatOutput(aMesh.whichPolyPatches()) << nl;
|
||||||
|
|
||||||
|
|
||||||
// Geometry information
|
// Geometry information
|
||||||
Info<< nl;
|
Info<< nl;
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2021 OpenCFD Ltd.
|
Copyright (C) 2021-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -36,12 +36,17 @@ Description
|
|||||||
{
|
{
|
||||||
const faPatch& p = patches[patchi];
|
const faPatch& p = patches[patchi];
|
||||||
|
|
||||||
|
// Report physical size (nEdges) not virtual size
|
||||||
Info<< " " << "patch " << p.index()
|
Info<< " " << "patch " << p.index()
|
||||||
<< " (size: " << returnReduce(p.size(), sumOp<label>())
|
<< " (size: " << returnReduce(p.nEdges(), sumOp<label>())
|
||||||
<< ") name: " << p.name()
|
<< ") name: " << p.name()
|
||||||
<< nl;
|
<< nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Info<< "----------------" << nl
|
||||||
|
<< "Used polyPatches: " << flatOutput(aMesh.whichPolyPatches()) << nl;
|
||||||
|
|
||||||
|
|
||||||
// Geometry information
|
// Geometry information
|
||||||
Info<< nl;
|
Info<< nl;
|
||||||
{
|
{
|
||||||
|
|||||||
@ -226,14 +226,18 @@ int main(int argc, char *argv[])
|
|||||||
// Add the boundary patches
|
// Add the boundary patches
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
List<polyPatch*> p(patches.size());
|
polyPatchList newPatches(patches.size());
|
||||||
|
|
||||||
forAll(p, patchi)
|
forAll(newPatches, patchi)
|
||||||
{
|
{
|
||||||
p[patchi] = patches[patchi].clone(fMesh.boundaryMesh()).ptr();
|
newPatches.set
|
||||||
|
(
|
||||||
|
patchi,
|
||||||
|
patches[patchi].clone(fMesh.boundaryMesh())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fMesh.addFvPatches(p);
|
fMesh.addFvPatches(newPatches);
|
||||||
|
|
||||||
|
|
||||||
// Refinement level
|
// Refinement level
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2018-2019 OpenCFD Ltd.
|
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -205,34 +205,43 @@ label addPatch(polyMesh& mesh, const word& patchName)
|
|||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
List<polyPatch*> newPatches(patches.size() + 1);
|
polyPatchList newPatches(patches.size() + 1);
|
||||||
|
|
||||||
|
label nPatches = 0;
|
||||||
|
|
||||||
// Add empty patch as 0th entry (Note: only since subsetMesh wants this)
|
// Add empty patch as 0th entry (Note: only since subsetMesh wants this)
|
||||||
patchi = 0;
|
patchi = 0;
|
||||||
|
{
|
||||||
newPatches[patchi] =
|
newPatches.set
|
||||||
|
(
|
||||||
|
nPatches,
|
||||||
new emptyPolyPatch
|
new emptyPolyPatch
|
||||||
(
|
(
|
||||||
Foam::word(patchName),
|
patchName,
|
||||||
0,
|
0,
|
||||||
mesh.nInternalFaces(),
|
mesh.nInternalFaces(),
|
||||||
patchi,
|
nPatches,
|
||||||
patches,
|
patches,
|
||||||
emptyPolyPatch::typeName
|
emptyPolyPatch::typeName
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
++nPatches;
|
||||||
|
}
|
||||||
|
|
||||||
forAll(patches, i)
|
for (const polyPatch& pp : patches)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[i];
|
newPatches.set
|
||||||
|
(
|
||||||
newPatches[i+1] =
|
nPatches,
|
||||||
pp.clone
|
pp.clone
|
||||||
(
|
(
|
||||||
patches,
|
patches,
|
||||||
i+1,
|
nPatches,
|
||||||
pp.size(),
|
pp.size(),
|
||||||
pp.start()
|
pp.start()
|
||||||
).ptr();
|
)
|
||||||
|
);
|
||||||
|
++nPatches;
|
||||||
}
|
}
|
||||||
|
|
||||||
mesh.removeBoundary();
|
mesh.removeBoundary();
|
||||||
|
|||||||
@ -1678,7 +1678,7 @@ int main(int argc, char *argv[])
|
|||||||
label defaultPatchID = mesh.boundaryMesh().findPatchID(defaultFacesName);
|
label defaultPatchID = mesh.boundaryMesh().findPatchID(defaultFacesName);
|
||||||
if (mesh.boundaryMesh()[defaultPatchID].size() == 0)
|
if (mesh.boundaryMesh()[defaultPatchID].size() == 0)
|
||||||
{
|
{
|
||||||
List<polyPatch*> newPatchPtrList((mesh.boundaryMesh().size() - 1));
|
polyPatchList newPatches((mesh.boundaryMesh().size() - 1));
|
||||||
label newPatchi = 0;
|
label newPatchi = 0;
|
||||||
forAll(mesh.boundaryMesh(), patchi)
|
forAll(mesh.boundaryMesh(), patchi)
|
||||||
{
|
{
|
||||||
@ -1686,18 +1686,21 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const polyPatch& patch = mesh.boundaryMesh()[patchi];
|
const polyPatch& patch = mesh.boundaryMesh()[patchi];
|
||||||
|
|
||||||
newPatchPtrList[newPatchi] = patch.clone
|
newPatches.set
|
||||||
|
(
|
||||||
|
newPatchi,
|
||||||
|
patch.clone
|
||||||
(
|
(
|
||||||
mesh.boundaryMesh(),
|
mesh.boundaryMesh(),
|
||||||
newPatchi,
|
newPatchi,
|
||||||
patch.size(),
|
patch.size(),
|
||||||
patch.start()
|
patch.start()
|
||||||
).ptr();
|
)
|
||||||
|
);
|
||||||
newPatchi++;
|
++newPatchi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repatcher.changePatches(newPatchPtrList);
|
repatcher.changePatches(newPatches);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the precision of the points data to 10
|
// Set the precision of the points data to 10
|
||||||
|
|||||||
@ -1,30 +1,56 @@
|
|||||||
// Handle merging of patch pairs
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | www.openfoam.com
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Copyright (C) 2009 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
|
|
||||||
|
Description
|
||||||
|
Handle merging of patch pairs
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
{
|
{
|
||||||
wordPairList mergePatchPairs;
|
wordPairList mergePatchPairs;
|
||||||
|
|
||||||
// Read in a list of dictionaries for the merge patch pairs
|
// Read in a list of merge patch pairs
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
meshDict.readIfPresent("mergePatchPairs", mergePatchPairs)
|
meshDict.readIfPresent("mergePatchPairs", mergePatchPairs)
|
||||||
&& mergePatchPairs.size()
|
&& mergePatchPairs.size()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Info<< "Creating merge patch pairs" << nl << endl;
|
Info<< "Merging " << mergePatchPairs.size() << " patch pairs" << nl;
|
||||||
|
|
||||||
|
// Cleanup
|
||||||
|
wordHashSet cleanupPatches(4*mergePatchPairs.size());
|
||||||
|
wordHashSet cleanupPointZones(2*mergePatchPairs.size());
|
||||||
|
wordHashSet cleanupFaceZones(2*mergePatchPairs.size());
|
||||||
|
|
||||||
Info<< " Adding point and face zones" << endl;
|
Info<< " Adding point and face zones" << endl;
|
||||||
{
|
{
|
||||||
auto& pzs = mesh.pointZones();
|
const auto& pbm = mesh.boundaryMesh();
|
||||||
pzs.clearAddressing();
|
|
||||||
auto& fzs = mesh.faceZones();
|
auto& pzs = mesh.pointZones(); pzs.clearAddressing();
|
||||||
fzs.clearAddressing();
|
auto& fzs = mesh.faceZones(); fzs.clearAddressing();
|
||||||
|
|
||||||
forAll(mergePatchPairs, pairi)
|
forAll(mergePatchPairs, pairi)
|
||||||
{
|
{
|
||||||
|
// Patch pairs
|
||||||
|
const polyPatch& patch0 = pbm[mergePatchPairs[pairi].first()];
|
||||||
|
const polyPatch& patch1 = pbm[mergePatchPairs[pairi].second()];
|
||||||
|
|
||||||
const word mergeName
|
const word mergeName
|
||||||
(
|
(
|
||||||
mergePatchPairs[pairi].first()
|
mergePatchPairs[pairi].first()
|
||||||
+ mergePatchPairs[pairi].second()
|
+ mergePatchPairs[pairi].second()
|
||||||
+ name(pairi)
|
+ Foam::name(pairi)
|
||||||
);
|
);
|
||||||
|
|
||||||
// An empty zone for cut points
|
// An empty zone for cut points
|
||||||
@ -37,40 +63,35 @@
|
|||||||
pzs
|
pzs
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
cleanupPointZones.insert(pzs.last().name());
|
||||||
|
|
||||||
// Master patch
|
// Coupling side 0 (master)
|
||||||
const word masterPatchName(mergePatchPairs[pairi].first());
|
|
||||||
const polyPatch& masterPatch =
|
|
||||||
mesh.boundaryMesh()[masterPatchName];
|
|
||||||
|
|
||||||
fzs.append
|
fzs.append
|
||||||
(
|
(
|
||||||
new faceZone
|
new faceZone
|
||||||
(
|
(
|
||||||
mergeName + "MasterZone",
|
mergeName + "Side0Zone",
|
||||||
identity(masterPatch.range()),
|
identity(patch0.range()),
|
||||||
false, // none are flipped
|
false, // none are flipped
|
||||||
fzs.size(),
|
fzs.size(),
|
||||||
fzs
|
fzs
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
cleanupFaceZones.insert(fzs.last().name());
|
||||||
|
|
||||||
// Slave patch
|
// Coupling side 1 (slave)
|
||||||
const word slavePatchName(mergePatchPairs[pairi].second());
|
|
||||||
const polyPatch& slavePatch =
|
|
||||||
mesh.boundaryMesh()[slavePatchName];
|
|
||||||
|
|
||||||
fzs.append
|
fzs.append
|
||||||
(
|
(
|
||||||
new faceZone
|
new faceZone
|
||||||
(
|
(
|
||||||
mergeName + "SlaveZone",
|
mergeName + "Side1Zone",
|
||||||
identity(slavePatch.range()),
|
identity(patch1.range()),
|
||||||
false, // none are flipped
|
false, // none are flipped
|
||||||
fzs.size(),
|
fzs.size(),
|
||||||
fzs
|
fzs
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
cleanupFaceZones.insert(fzs.last().name());
|
||||||
|
|
||||||
// An empty zone for cut faces
|
// An empty zone for cut faces
|
||||||
fzs.append
|
fzs.append
|
||||||
@ -82,35 +103,38 @@
|
|||||||
fzs
|
fzs
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} // end of all merge pairs
|
cleanupFaceZones.insert(fzs.last().name());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Info<< " Merging with attachPolyTopoChanger" << endl;
|
||||||
Info<< "Creating attachPolyTopoChanger" << endl;
|
|
||||||
attachPolyTopoChanger polyMeshAttacher(mesh);
|
attachPolyTopoChanger polyMeshAttacher(mesh);
|
||||||
polyMeshAttacher.setSize(mergePatchPairs.size());
|
polyMeshAttacher.resize(1);
|
||||||
|
|
||||||
forAll(mergePatchPairs, pairi)
|
forAll(mergePatchPairs, pairi)
|
||||||
{
|
{
|
||||||
|
cleanupPatches.insert(mergePatchPairs[pairi].first());
|
||||||
|
cleanupPatches.insert(mergePatchPairs[pairi].second());
|
||||||
|
|
||||||
const word mergeName
|
const word mergeName
|
||||||
(
|
(
|
||||||
mergePatchPairs[pairi].first()
|
mergePatchPairs[pairi].first()
|
||||||
+ mergePatchPairs[pairi].second()
|
+ mergePatchPairs[pairi].second()
|
||||||
+ name(pairi)
|
+ Foam::name(pairi)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add the sliding interface mesh modifier
|
// Add the sliding interface mesh modifier
|
||||||
polyMeshAttacher.set
|
polyMeshAttacher.set
|
||||||
(
|
(
|
||||||
pairi,
|
0,
|
||||||
new slidingInterface
|
new slidingInterface
|
||||||
(
|
(
|
||||||
"couple" + name(pairi),
|
"couple" + Foam::name(pairi),
|
||||||
pairi,
|
pairi,
|
||||||
polyMeshAttacher,
|
polyMeshAttacher,
|
||||||
mergeName + "MasterZone",
|
mergeName + "Side0Zone",
|
||||||
mergeName + "SlaveZone",
|
mergeName + "Side1Zone",
|
||||||
mergeName + "CutPointZone",
|
mergeName + "CutPointZone",
|
||||||
mergeName + "CutFaceZone",
|
mergeName + "CutFaceZone",
|
||||||
mergePatchPairs[pairi].first(),
|
mergePatchPairs[pairi].first(),
|
||||||
@ -120,12 +144,135 @@
|
|||||||
intersection::VISIBLE
|
intersection::VISIBLE
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
polyMeshAttacher.attach(false); // Do not yet remove empty patches
|
||||||
}
|
}
|
||||||
|
|
||||||
polyMeshAttacher.attach(true);
|
// Re-do the boundary patches, removing empty merge patches
|
||||||
|
// but keeping any other empty patches
|
||||||
|
{
|
||||||
|
const polyBoundaryMesh& oldPatches = mesh.boundaryMesh();
|
||||||
|
|
||||||
|
polyPatchList newPatches(oldPatches.size());
|
||||||
|
label nNewPatches = 0;
|
||||||
|
|
||||||
|
wordHashSet removedPatches(cleanupPatches.capacity());
|
||||||
|
|
||||||
|
forAll(oldPatches, patchi)
|
||||||
|
{
|
||||||
|
const word& patchName = oldPatches[patchi].name();
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
!cleanupPatches.found(patchName)
|
||||||
|
|| returnReduceOr(oldPatches[patchi].size())
|
||||||
|
)
|
||||||
|
{
|
||||||
|
newPatches.set
|
||||||
|
(
|
||||||
|
nNewPatches,
|
||||||
|
oldPatches[patchi].clone
|
||||||
|
(
|
||||||
|
mesh.boundaryMesh(),
|
||||||
|
nNewPatches,
|
||||||
|
oldPatches[patchi].size(),
|
||||||
|
oldPatches[patchi].start()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
++nNewPatches;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info<< nl << "There are no merge patch pairs" << endl;
|
removedPatches.insert(patchName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newPatches.resize(nNewPatches);
|
||||||
|
|
||||||
|
mesh.removeBoundary();
|
||||||
|
mesh.addPatches(newPatches);
|
||||||
|
|
||||||
|
Info<< "Removed " << removedPatches.size()
|
||||||
|
<< " empty merged patches:" << nl
|
||||||
|
<< " " << flatOutput(removedPatches.sortedToc()) << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cleanup empty merged point zones
|
||||||
|
{
|
||||||
|
PtrList<pointZone>& zones = mesh.pointZones();
|
||||||
|
mesh.pointZones().clearAddressing();
|
||||||
|
|
||||||
|
wordHashSet removedZones(2*zones.size());
|
||||||
|
|
||||||
|
label nZones = 0;
|
||||||
|
forAll(zones, zonei)
|
||||||
|
{
|
||||||
|
if
|
||||||
|
(
|
||||||
|
!cleanupPointZones.found(zones[zonei].name())
|
||||||
|
|| returnReduceOr(zones[zonei].size())
|
||||||
|
)
|
||||||
|
{
|
||||||
|
zones.set(nZones, zones.release(zonei));
|
||||||
|
zones[nZones].index() = nZones; // re-index
|
||||||
|
++nZones;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
removedZones.insert(zones[zonei].name());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
zones.resize(nZones);
|
||||||
|
|
||||||
|
if (removedZones.size())
|
||||||
|
{
|
||||||
|
Info<< "Removed " << removedZones.size()
|
||||||
|
<< " empty point zones:" << nl
|
||||||
|
<< " " << flatOutput(removedZones.sortedToc()) << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cleanup empty merged face zones
|
||||||
|
{
|
||||||
|
PtrList<faceZone>& zones = mesh.faceZones();
|
||||||
|
mesh.faceZones().clearAddressing();
|
||||||
|
|
||||||
|
wordHashSet removedZones(2*zones.size());
|
||||||
|
|
||||||
|
label nZones = 0;
|
||||||
|
forAll(zones, zonei)
|
||||||
|
{
|
||||||
|
if
|
||||||
|
(
|
||||||
|
!cleanupFaceZones.found(zones[zonei].name())
|
||||||
|
|| returnReduceOr(zones[zonei].size())
|
||||||
|
)
|
||||||
|
{
|
||||||
|
zones.set(nZones, zones.release(zonei));
|
||||||
|
zones[nZones].index() = nZones; // re-index
|
||||||
|
++nZones;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
removedZones.insert(zones[zonei].name());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
zones.resize(nZones);
|
||||||
|
|
||||||
|
if (removedZones.size())
|
||||||
|
{
|
||||||
|
Info<< "Removed " << removedZones.size()
|
||||||
|
<< " empty merged face zones:" << nl
|
||||||
|
<< " " << flatOutput(removedZones.sortedToc()) << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info<< "No patch pairs to merge" << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -1397,26 +1397,20 @@ void extrudeGeometricProperties
|
|||||||
{
|
{
|
||||||
Pout<< "Model :" << faceCentres[facei] << endl
|
Pout<< "Model :" << faceCentres[facei] << endl
|
||||||
<< "regionMesh:" << regionMesh.faceCentres()[facei] << endl;
|
<< "regionMesh:" << regionMesh.faceCentres()[facei] << endl;
|
||||||
faceStr.write
|
faceStr.writeLine
|
||||||
(
|
|
||||||
linePointRef
|
|
||||||
(
|
(
|
||||||
faceCentres[facei],
|
faceCentres[facei],
|
||||||
regionMesh.faceCentres()[facei]
|
regionMesh.faceCentres()[facei]
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
forAll(cellCentres, celli)
|
forAll(cellCentres, celli)
|
||||||
{
|
{
|
||||||
Pout<< "Model :" << cellCentres[celli] << endl
|
Pout<< "Model :" << cellCentres[celli] << endl
|
||||||
<< "regionMesh:" << regionMesh.cellCentres()[celli] << endl;
|
<< "regionMesh:" << regionMesh.cellCentres()[celli] << endl;
|
||||||
cellStr.write
|
cellStr.writeLine
|
||||||
(
|
|
||||||
linePointRef
|
|
||||||
(
|
(
|
||||||
cellCentres[celli],
|
cellCentres[celli],
|
||||||
regionMesh.cellCentres()[celli]
|
regionMesh.cellCentres()[celli]
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -152,7 +152,7 @@ void Foam::PrintTable<KeyType, DataType>::print
|
|||||||
|
|
||||||
os << endl;
|
os << endl;
|
||||||
|
|
||||||
const List<KeyType>& sortedTable = combinedTable.sortedToc();
|
const List<KeyType> sortedTable(combinedTable.sortedToc());
|
||||||
|
|
||||||
forAll(sortedTable, keyI)
|
forAll(sortedTable, keyI)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1687,7 +1687,7 @@ void Foam::conformalVoronoiMesh::move()
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
multipleIntersections.write(linePointRef(ptA, ptB));
|
multipleIntersections.writeLine(ptA, ptB);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,7 +83,7 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
// Forward Declarations
|
||||||
class initialPointsMethod;
|
class initialPointsMethod;
|
||||||
class relaxationModel;
|
class relaxationModel;
|
||||||
class faceAreaWeightModel;
|
class faceAreaWeightModel;
|
||||||
|
|||||||
@ -1433,18 +1433,15 @@ void Foam::conformalVoronoiMesh::indexDualVertices
|
|||||||
// && (mag(snapDir & norm[0]) > 0.5)
|
// && (mag(snapDir & norm[0]) > 0.5)
|
||||||
// )
|
// )
|
||||||
// {
|
// {
|
||||||
// snapping1.write
|
// snapping1.writeLine
|
||||||
// (
|
// (
|
||||||
// linePointRef(dual, nearestPointOnTet)
|
// dual,
|
||||||
|
// nearestPointOnTet
|
||||||
// );
|
// );
|
||||||
//
|
// snapping2.writeLine
|
||||||
// snapping2.write
|
|
||||||
// (
|
|
||||||
// linePointRef
|
|
||||||
// (
|
// (
|
||||||
// nearestPointOnTet,
|
// nearestPointOnTet,
|
||||||
// hitInfo.hitPoint()
|
// hitInfo.hitPoint()
|
||||||
// )
|
|
||||||
// );
|
// );
|
||||||
//
|
//
|
||||||
// pts[cit->cellIndex()] = hitInfo.hitPoint();
|
// pts[cit->cellIndex()] = hitInfo.hitPoint();
|
||||||
@ -1764,9 +1761,10 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
|||||||
|
|
||||||
if ((*vcit)->real())
|
if ((*vcit)->real())
|
||||||
{
|
{
|
||||||
featurePointDualsStr.write
|
featurePointDualsStr.writeLine
|
||||||
(
|
(
|
||||||
linePointRef(topoint(vit->point()), (*vcit)->dual())
|
topoint(vit->point()),
|
||||||
|
(*vcit)->dual()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1867,7 +1865,7 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
|||||||
<< " " << vc2->dual()
|
<< " " << vc2->dual()
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
startCellStr.write(linePointRef(vc1->dual(), vc2->dual()));
|
startCellStr.writeLine(vc1->dual(), vc2->dual());
|
||||||
|
|
||||||
// Get patch by getting face between cells and the two
|
// Get patch by getting face between cells and the two
|
||||||
// points on the face that are not the feature vertex
|
// points on the face that are not the feature vertex
|
||||||
|
|||||||
@ -1395,10 +1395,7 @@ void Foam::conformalVoronoiMesh::writePointPairs
|
|||||||
|
|
||||||
if (ptPairs_.isPointPair(vA, vB))
|
if (ptPairs_.isPointPair(vA, vB))
|
||||||
{
|
{
|
||||||
os.write
|
os.writeLine(topoint(vA->point()), topoint(vB->point()));
|
||||||
(
|
|
||||||
linePointRef(topoint(vA->point()), topoint(vB->point()))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2012-2016 OpenFOAM Foundation
|
Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -73,7 +73,7 @@ scalar getMergeDistance
|
|||||||
Info<< "Merge tolerance : " << mergeTol << nl
|
Info<< "Merge tolerance : " << mergeTol << nl
|
||||||
<< "Write tolerance : " << writeTol << endl;
|
<< "Write tolerance : " << writeTol << endl;
|
||||||
|
|
||||||
if (runTime.writeFormat() == IOstream::ASCII && mergeTol < writeTol)
|
if (runTime.writeFormat() == IOstreamOption::ASCII && mergeTol < writeTol)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Your current settings specify ASCII writing with "
|
<< "Your current settings specify ASCII writing with "
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2013-2016 OpenFOAM Foundation
|
Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2021 OpenCFD Ltd.
|
Copyright (C) 2021-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -167,28 +167,32 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Constructing patches." << endl;
|
Info<< "Constructing patches." << endl;
|
||||||
List<polyPatch*> patches(poly2DMesh.patchNames().size());
|
polyPatchList newPatches(poly2DMesh.patchNames().size());
|
||||||
label countPatches = 0;
|
label nPatches = 0;
|
||||||
|
|
||||||
forAll(patches, patchi)
|
forAll(newPatches, patchi)
|
||||||
{
|
{
|
||||||
if (poly2DMesh.patchSizes()[patchi] != 0)
|
if (poly2DMesh.patchSizes()[patchi] != 0)
|
||||||
{
|
{
|
||||||
patches[countPatches] = new polyPatch
|
newPatches.set
|
||||||
|
(
|
||||||
|
nPatches,
|
||||||
|
new polyPatch
|
||||||
(
|
(
|
||||||
poly2DMesh.patchNames()[patchi],
|
poly2DMesh.patchNames()[patchi],
|
||||||
poly2DMesh.patchSizes()[patchi],
|
poly2DMesh.patchSizes()[patchi],
|
||||||
poly2DMesh.patchStarts()[patchi],
|
poly2DMesh.patchStarts()[patchi],
|
||||||
countPatches,
|
nPatches,
|
||||||
pMesh.boundaryMesh(),
|
pMesh.boundaryMesh(),
|
||||||
word::null
|
word::null
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
countPatches++;
|
++nPatches;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
patches.setSize(countPatches);
|
newPatches.resize(nPatches);
|
||||||
pMesh.addPatches(patches);
|
pMesh.addPatches(newPatches);
|
||||||
|
|
||||||
if (extrude)
|
if (extrude)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -616,7 +616,7 @@ scalar getMergeDistance
|
|||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
// check writing tolerance
|
// check writing tolerance
|
||||||
if (mesh.time().writeFormat() == IOstream::ASCII && !dryRun)
|
if (mesh.time().writeFormat() == IOstreamOption::ASCII && !dryRun)
|
||||||
{
|
{
|
||||||
const scalar writeTol = std::pow
|
const scalar writeTol = std::pow
|
||||||
(
|
(
|
||||||
@ -1342,6 +1342,17 @@ int main(int argc, char *argv[])
|
|||||||
const snapParameters snapParams(snapDict, dryRun);
|
const snapParameters snapParams(snapDict, dryRun);
|
||||||
|
|
||||||
|
|
||||||
|
Info<< "Setting refinement level of surface to be consistent"
|
||||||
|
<< " with curvature." << endl;
|
||||||
|
surfaces.setCurvatureMinLevelFields
|
||||||
|
(
|
||||||
|
refineParams.curvature(),
|
||||||
|
meshRefiner.meshCutter().level0EdgeLength()
|
||||||
|
);
|
||||||
|
Info<< "Checked curvature refinement in = "
|
||||||
|
<< mesh.time().cpuTimeIncrement() << " s" << nl << endl;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Add all the cellZones and faceZones
|
// Add all the cellZones and faceZones
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
@ -191,7 +191,7 @@ int main(int argc, char *argv[])
|
|||||||
const PtrList<boundaryPatch>& patches = bMesh.patches();
|
const PtrList<boundaryPatch>& patches = bMesh.patches();
|
||||||
|
|
||||||
// Create new list of patches with old ones first
|
// Create new list of patches with old ones first
|
||||||
List<polyPatch*> newPatchPtrList(patches.size());
|
polyPatchList newPatches(patches.size());
|
||||||
|
|
||||||
newPatchi = 0;
|
newPatchi = 0;
|
||||||
|
|
||||||
@ -200,34 +200,41 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const polyPatch& patch = mesh.boundaryMesh()[patchi];
|
const polyPatch& patch = mesh.boundaryMesh()[patchi];
|
||||||
|
|
||||||
newPatchPtrList[newPatchi] =
|
newPatches.set
|
||||||
|
(
|
||||||
|
newPatchi,
|
||||||
patch.clone
|
patch.clone
|
||||||
(
|
(
|
||||||
mesh.boundaryMesh(),
|
mesh.boundaryMesh(),
|
||||||
newPatchi,
|
newPatchi,
|
||||||
patch.size(),
|
patch.size(),
|
||||||
patch.start()
|
patch.start()
|
||||||
).ptr();
|
)
|
||||||
|
);
|
||||||
|
|
||||||
newPatchi++;
|
++newPatchi;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new ones with empty size.
|
// Add new ones with empty size.
|
||||||
for (label patchi = newPatchi; patchi < patches.size(); patchi++)
|
for (label patchi = newPatchi; patchi < patches.size(); patchi++)
|
||||||
{
|
{
|
||||||
const boundaryPatch& bp = patches[patchi];
|
const word& patchName = patches[patchi].name();
|
||||||
|
|
||||||
newPatchPtrList[newPatchi] = polyPatch::New
|
newPatches.set
|
||||||
|
(
|
||||||
|
newPatchi,
|
||||||
|
polyPatch::New
|
||||||
(
|
(
|
||||||
polyPatch::typeName,
|
polyPatch::typeName,
|
||||||
bp.name(),
|
patchName,
|
||||||
0,
|
0,
|
||||||
mesh.nFaces(),
|
mesh.nFaces(),
|
||||||
newPatchi,
|
newPatchi,
|
||||||
mesh.boundaryMesh()
|
mesh.boundaryMesh()
|
||||||
).ptr();
|
)
|
||||||
|
);
|
||||||
|
|
||||||
newPatchi++;
|
++newPatchi;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!overwrite)
|
if (!overwrite)
|
||||||
@ -238,7 +245,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Change patches
|
// Change patches
|
||||||
repatchPolyTopoChanger polyMeshRepatcher(mesh);
|
repatchPolyTopoChanger polyMeshRepatcher(mesh);
|
||||||
polyMeshRepatcher.changePatches(newPatchPtrList);
|
polyMeshRepatcher.changePatches(newPatches);
|
||||||
|
|
||||||
|
|
||||||
// Change face ordering
|
// Change face ordering
|
||||||
|
|||||||
@ -40,6 +40,7 @@ License
|
|||||||
#include "vtkSurfaceWriter.H"
|
#include "vtkSurfaceWriter.H"
|
||||||
#include "checkTools.H"
|
#include "checkTools.H"
|
||||||
#include "treeBoundBox.H"
|
#include "treeBoundBox.H"
|
||||||
|
#include "syncTools.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -48,25 +49,113 @@ void Foam::checkPatch
|
|||||||
(
|
(
|
||||||
const bool allGeometry,
|
const bool allGeometry,
|
||||||
const word& name,
|
const word& name,
|
||||||
|
const polyMesh& mesh,
|
||||||
const PatchType& pp,
|
const PatchType& pp,
|
||||||
|
const labelList& meshFaces,
|
||||||
|
const labelList& meshEdges,
|
||||||
pointSet& points
|
pointSet& points
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
typedef typename PatchType::surfaceTopo TopoType;
|
||||||
|
|
||||||
|
const label globalSize = returnReduce(pp.size(), sumOp<label>());
|
||||||
|
|
||||||
Info<< " "
|
Info<< " "
|
||||||
<< setw(20) << name
|
<< setw(20) << name
|
||||||
<< setw(9) << returnReduce(pp.size(), sumOp<label>())
|
<< setw(9) << globalSize
|
||||||
<< setw(9) << returnReduce(pp.nPoints(), sumOp<label>());
|
<< setw(9) << returnReduce(pp.nPoints(), sumOp<label>());
|
||||||
|
|
||||||
if (!Pstream::parRun())
|
if (globalSize == 0)
|
||||||
{
|
|
||||||
typedef typename PatchType::surfaceTopo TopoType;
|
|
||||||
TopoType pTyp = pp.surfaceType();
|
|
||||||
|
|
||||||
if (pp.empty())
|
|
||||||
{
|
{
|
||||||
Info<< setw(34) << "ok (empty)";
|
Info<< setw(34) << "ok (empty)";
|
||||||
}
|
}
|
||||||
else if (pTyp == TopoType::MANIFOLD)
|
else if (Pstream::parRun())
|
||||||
|
{
|
||||||
|
// Parallel - use mesh edges
|
||||||
|
// - no check for point-pinch
|
||||||
|
// - no check for consistent orientation (if that is posible to
|
||||||
|
// check?)
|
||||||
|
|
||||||
|
// (see addPatchCellLayer::globalEdgeFaces)
|
||||||
|
// From mesh edge to global face labels. Non-empty sublists only for
|
||||||
|
// pp edges.
|
||||||
|
labelListList globalEdgeFaces(mesh.nEdges());
|
||||||
|
|
||||||
|
const labelListList& edgeFaces = pp.edgeFaces();
|
||||||
|
|
||||||
|
// Global numbering
|
||||||
|
const globalIndex globalFaces(mesh.nFaces());
|
||||||
|
|
||||||
|
forAll(edgeFaces, edgei)
|
||||||
|
{
|
||||||
|
label meshEdgei = meshEdges[edgei];
|
||||||
|
const labelList& eFaces = edgeFaces[edgei];
|
||||||
|
|
||||||
|
// Store face and processor as unique tag.
|
||||||
|
labelList& globalEFaces = globalEdgeFaces[meshEdgei];
|
||||||
|
globalEFaces.setSize(eFaces.size());
|
||||||
|
forAll(eFaces, i)
|
||||||
|
{
|
||||||
|
globalEFaces[i] = globalFaces.toGlobal(meshFaces[eFaces[i]]);
|
||||||
|
}
|
||||||
|
//Pout<< "At edge:" << meshEdgei
|
||||||
|
// << " ctr:" << mesh.edges()[meshEdgei].centre(mesh.points())
|
||||||
|
// << " have eFaces:" << globalEdgeFaces[meshEdgei]
|
||||||
|
// << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
//DebugVar(globalEdgeFaces);
|
||||||
|
|
||||||
|
|
||||||
|
// Synchronise across coupled edges.
|
||||||
|
syncTools::syncEdgeList
|
||||||
|
(
|
||||||
|
mesh,
|
||||||
|
globalEdgeFaces,
|
||||||
|
ListOps::uniqueEqOp<label>(),
|
||||||
|
labelList() // null value
|
||||||
|
);
|
||||||
|
|
||||||
|
//DebugVar(globalEdgeFaces);
|
||||||
|
|
||||||
|
label labelTyp = TopoType::MANIFOLD;
|
||||||
|
forAll(meshEdges, edgei)
|
||||||
|
{
|
||||||
|
const label meshEdgei = meshEdges[edgei];
|
||||||
|
const labelList& globalEFaces = globalEdgeFaces[meshEdgei];
|
||||||
|
if (globalEFaces.size() == 1)
|
||||||
|
{
|
||||||
|
//points.insert(mesh.edges()[meshEdgei]);
|
||||||
|
labelTyp = max(labelTyp, TopoType::OPEN);
|
||||||
|
}
|
||||||
|
else if (globalEFaces.size() == 0 || globalEFaces.size() > 2)
|
||||||
|
{
|
||||||
|
points.insert(mesh.edges()[meshEdgei]);
|
||||||
|
labelTyp = max(labelTyp, TopoType::ILLEGAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reduce(labelTyp, maxOp<label>());
|
||||||
|
|
||||||
|
if (labelTyp == TopoType::MANIFOLD)
|
||||||
|
{
|
||||||
|
Info<< setw(34) << "ok (closed singly connected)";
|
||||||
|
}
|
||||||
|
else if (labelTyp == TopoType::OPEN)
|
||||||
|
{
|
||||||
|
Info<< setw(34)
|
||||||
|
<< "ok (non-closed singly connected)";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info<< setw(34)
|
||||||
|
<< "multiply connected (shared edge)";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TopoType pTyp = pp.surfaceType();
|
||||||
|
|
||||||
|
if (pTyp == TopoType::MANIFOLD)
|
||||||
{
|
{
|
||||||
if (pp.checkPointManifold(true, &points))
|
if (pp.checkPointManifold(true, &points))
|
||||||
{
|
{
|
||||||
@ -548,16 +637,9 @@ Foam::label Foam::checkTopology
|
|||||||
mesh.nPoints()/1000
|
mesh.nPoints()/1000
|
||||||
);
|
);
|
||||||
|
|
||||||
{
|
|
||||||
if (!Pstream::parRun())
|
|
||||||
{
|
{
|
||||||
Info<< "\nChecking patch topology for multiply connected"
|
Info<< "\nChecking patch topology for multiply connected"
|
||||||
<< " surfaces..." << endl;
|
<< " surfaces..." << endl;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< "\nChecking basic patch addressing..." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
@ -566,11 +648,8 @@ Foam::label Foam::checkTopology
|
|||||||
Info<< " "
|
Info<< " "
|
||||||
<< setw(20) << "Patch"
|
<< setw(20) << "Patch"
|
||||||
<< setw(9) << "Faces"
|
<< setw(9) << "Faces"
|
||||||
<< setw(9) << "Points";
|
<< setw(9) << "Points"
|
||||||
if (!Pstream::parRun())
|
<< "Surface topology";
|
||||||
{
|
|
||||||
Info<< setw(34) << "Surface topology";
|
|
||||||
}
|
|
||||||
if (allGeometry)
|
if (allGeometry)
|
||||||
{
|
{
|
||||||
Info<< " Bounding box";
|
Info<< " Bounding box";
|
||||||
@ -583,7 +662,16 @@ Foam::label Foam::checkTopology
|
|||||||
|
|
||||||
if (!isA<processorPolyPatch>(pp))
|
if (!isA<processorPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
checkPatch(allGeometry, pp.name(), pp, points);
|
checkPatch
|
||||||
|
(
|
||||||
|
allGeometry,
|
||||||
|
pp.name(),
|
||||||
|
mesh,
|
||||||
|
pp,
|
||||||
|
identity(pp.size(), pp.start()),
|
||||||
|
pp.meshEdges(),
|
||||||
|
points
|
||||||
|
);
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -591,16 +679,9 @@ Foam::label Foam::checkTopology
|
|||||||
//Info.setf(ios_base::right);
|
//Info.setf(ios_base::right);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
if (!Pstream::parRun())
|
|
||||||
{
|
{
|
||||||
Info<< "\nChecking faceZone topology for multiply connected"
|
Info<< "\nChecking faceZone topology for multiply connected"
|
||||||
<< " surfaces..." << endl;
|
<< " surfaces..." << endl;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< "\nChecking basic faceZone addressing..." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Pout.setf(ios_base::left);
|
Pout.setf(ios_base::left);
|
||||||
|
|
||||||
@ -611,12 +692,8 @@ Foam::label Foam::checkTopology
|
|||||||
Info<< " "
|
Info<< " "
|
||||||
<< setw(20) << "FaceZone"
|
<< setw(20) << "FaceZone"
|
||||||
<< setw(9) << "Faces"
|
<< setw(9) << "Faces"
|
||||||
<< setw(9) << "Points";
|
<< setw(9) << "Points"
|
||||||
|
<< setw(34) << "Surface topology";
|
||||||
if (!Pstream::parRun())
|
|
||||||
{
|
|
||||||
Info<< setw(34) << "Surface topology";
|
|
||||||
}
|
|
||||||
if (allGeometry)
|
if (allGeometry)
|
||||||
{
|
{
|
||||||
Info<< " Bounding box";
|
Info<< " Bounding box";
|
||||||
@ -625,7 +702,16 @@ Foam::label Foam::checkTopology
|
|||||||
|
|
||||||
for (const faceZone& fz : faceZones)
|
for (const faceZone& fz : faceZones)
|
||||||
{
|
{
|
||||||
checkPatch(allGeometry, fz.name(), fz(), points);
|
checkPatch
|
||||||
|
(
|
||||||
|
allGeometry,
|
||||||
|
fz.name(),
|
||||||
|
mesh,
|
||||||
|
fz(), // patch
|
||||||
|
fz, // mesh face labels
|
||||||
|
fz.meshEdges(), // mesh edge labels
|
||||||
|
points
|
||||||
|
);
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "label.H"
|
#include "labelList.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
@ -14,7 +14,10 @@ namespace Foam
|
|||||||
(
|
(
|
||||||
const bool allGeometry,
|
const bool allGeometry,
|
||||||
const word& name,
|
const word& name,
|
||||||
|
const polyMesh& mesh,
|
||||||
const PatchType& pp,
|
const PatchType& pp,
|
||||||
|
const labelList& meshFaces,
|
||||||
|
const labelList& meshEdges,
|
||||||
pointSet& points
|
pointSet& points
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2016 OpenCFD Ltd.
|
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -136,46 +136,55 @@ void Foam::mergePolyMesh::sortProcessorPatches()
|
|||||||
|
|
||||||
const polyBoundaryMesh& oldPatches = boundaryMesh();
|
const polyBoundaryMesh& oldPatches = boundaryMesh();
|
||||||
|
|
||||||
DynamicList<polyPatch*> newPatches(oldPatches.size());
|
polyPatchList newPatches(oldPatches.size());
|
||||||
|
|
||||||
labelList oldToSorted(oldPatches.size());
|
labelList oldToSorted(oldPatches.size());
|
||||||
|
|
||||||
|
label nPatches = 0;
|
||||||
|
|
||||||
forAll(oldPatches, patchi)
|
forAll(oldPatches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = oldPatches[patchi];
|
const polyPatch& pp = oldPatches[patchi];
|
||||||
|
|
||||||
if (!isA<processorPolyPatch>(pp))
|
if (!isA<processorPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
oldToSorted[patchi] = newPatches.size();
|
newPatches.set
|
||||||
newPatches.append
|
|
||||||
(
|
(
|
||||||
|
nPatches,
|
||||||
pp.clone
|
pp.clone
|
||||||
(
|
(
|
||||||
oldPatches,
|
oldPatches,
|
||||||
oldToSorted[patchi],
|
nPatches,
|
||||||
0,
|
0,
|
||||||
nInternalFaces()
|
nInternalFaces()
|
||||||
).ptr()
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
oldToSorted[patchi] = nPatches;
|
||||||
|
++nPatches;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(oldPatches, patchi)
|
forAll(oldPatches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = oldPatches[patchi];
|
const polyPatch& pp = oldPatches[patchi];
|
||||||
|
|
||||||
if (isA<processorPolyPatch>(pp))
|
if (isA<processorPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
oldToSorted[patchi] = newPatches.size();
|
newPatches.set
|
||||||
newPatches.append
|
|
||||||
(
|
(
|
||||||
|
nPatches,
|
||||||
pp.clone
|
pp.clone
|
||||||
(
|
(
|
||||||
oldPatches,
|
oldPatches,
|
||||||
oldToSorted[patchi],
|
oldToSorted[patchi],
|
||||||
0,
|
0,
|
||||||
nInternalFaces()
|
nInternalFaces()
|
||||||
).ptr()
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
oldToSorted[patchi] = nPatches;
|
||||||
|
++nPatches;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -461,7 +470,7 @@ void Foam::mergePolyMesh::merge()
|
|||||||
{
|
{
|
||||||
Info<< "Copying old patches" << endl;
|
Info<< "Copying old patches" << endl;
|
||||||
|
|
||||||
List<polyPatch*> newPatches(patchNames_.size());
|
polyPatchList newPatches(patchNames_.size());
|
||||||
|
|
||||||
const polyBoundaryMesh& oldPatches = boundaryMesh();
|
const polyBoundaryMesh& oldPatches = boundaryMesh();
|
||||||
|
|
||||||
@ -470,7 +479,11 @@ void Foam::mergePolyMesh::merge()
|
|||||||
|
|
||||||
for (patchi = 0; patchi < oldPatches.size(); patchi++)
|
for (patchi = 0; patchi < oldPatches.size(); patchi++)
|
||||||
{
|
{
|
||||||
newPatches[patchi] = oldPatches[patchi].clone(oldPatches).ptr();
|
newPatches.set
|
||||||
|
(
|
||||||
|
patchi,
|
||||||
|
oldPatches[patchi].clone(oldPatches)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Adding new patches. " << endl;
|
Info<< "Adding new patches. " << endl;
|
||||||
@ -487,7 +500,9 @@ void Foam::mergePolyMesh::merge()
|
|||||||
dict.set("nFaces", 0);
|
dict.set("nFaces", 0);
|
||||||
dict.set("startFace", endOfLastPatch);
|
dict.set("startFace", endOfLastPatch);
|
||||||
|
|
||||||
newPatches[patchi] =
|
newPatches.set
|
||||||
|
(
|
||||||
|
patchi,
|
||||||
(
|
(
|
||||||
polyPatch::New
|
polyPatch::New
|
||||||
(
|
(
|
||||||
@ -495,7 +510,8 @@ void Foam::mergePolyMesh::merge()
|
|||||||
dict,
|
dict,
|
||||||
patchi,
|
patchi,
|
||||||
oldPatches
|
oldPatches
|
||||||
).ptr()
|
)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2017-2018 OpenCFD Ltd.
|
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -404,20 +404,24 @@ Foam::mirrorFvMesh::mirrorFvMesh
|
|||||||
fvMesh& pMesh = mirrorMeshPtr_();
|
fvMesh& pMesh = mirrorMeshPtr_();
|
||||||
|
|
||||||
// Add the boundary patches
|
// Add the boundary patches
|
||||||
List<polyPatch*> p(newPatchSizes.size());
|
polyPatchList newPatches(newPatchSizes.size());
|
||||||
|
|
||||||
forAll(p, patchi)
|
forAll(newPatches, patchi)
|
||||||
{
|
{
|
||||||
p[patchi] = boundaryMesh()[patchi].clone
|
newPatches.set
|
||||||
|
(
|
||||||
|
patchi,
|
||||||
|
boundaryMesh()[patchi].clone
|
||||||
(
|
(
|
||||||
pMesh.boundaryMesh(),
|
pMesh.boundaryMesh(),
|
||||||
patchi,
|
patchi,
|
||||||
newPatchSizes[patchi],
|
newPatchSizes[patchi],
|
||||||
newPatchStarts[patchi]
|
newPatchStarts[patchi]
|
||||||
).ptr();
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pMesh.addPatches(p);
|
pMesh.addPatches(newPatches);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
${COMP_FLAGS} \
|
$(COMP_FLAGS) \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -564,7 +564,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
mesh.faceZones()
|
mesh.faceZones()
|
||||||
(
|
(
|
||||||
mergePatchName + "MasterZone",
|
mergePatchName + "Side0Zone",
|
||||||
true // verbose
|
true // verbose
|
||||||
).resetAddressing(std::move(faceIds), false);
|
).resetAddressing(std::move(faceIds), false);
|
||||||
|
|
||||||
@ -574,7 +574,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
mesh.faceZones()
|
mesh.faceZones()
|
||||||
(
|
(
|
||||||
mergePatchName + "SlaveZone",
|
mergePatchName + "Side1Zone",
|
||||||
true // verbose
|
true // verbose
|
||||||
).resetAddressing(std::move(faceIds), false);
|
).resetAddressing(std::move(faceIds), false);
|
||||||
|
|
||||||
@ -595,8 +595,8 @@ int main(int argc, char *argv[])
|
|||||||
"couple" + Foam::name(actioni),
|
"couple" + Foam::name(actioni),
|
||||||
0,
|
0,
|
||||||
stitcher,
|
stitcher,
|
||||||
mergePatchName + "MasterZone",
|
mergePatchName + "Side0Zone",
|
||||||
mergePatchName + "SlaveZone",
|
mergePatchName + "Side1Zone",
|
||||||
mergePatchName + "CutPointZone",
|
mergePatchName + "CutPointZone",
|
||||||
cutZoneName,
|
cutZoneName,
|
||||||
masterPatchName,
|
masterPatchName,
|
||||||
|
|||||||
@ -62,8 +62,8 @@ Usage
|
|||||||
-rotate-z angle
|
-rotate-z angle
|
||||||
Rotate (degrees) about z-axis.
|
Rotate (degrees) about z-axis.
|
||||||
|
|
||||||
or -yawPitchRoll (yawdegrees pitchdegrees rolldegrees)
|
or -yawPitchRoll : (yaw pitch roll) degrees
|
||||||
or -rollPitchYaw (rolldegrees pitchdegrees yawdegrees)
|
or -rollPitchYaw : (roll pitch yaw) degrees
|
||||||
|
|
||||||
-scale scalar|vector
|
-scale scalar|vector
|
||||||
Scale the points by the given scalar or vector on output.
|
Scale the points by the given scalar or vector on output.
|
||||||
@ -268,15 +268,18 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
argList::addBoolOption
|
argList::addBoolOption
|
||||||
(
|
(
|
||||||
"auto-origin",
|
"auto-centre",
|
||||||
"Use bounding box centre as origin for rotations"
|
"Use bounding box centre as centre for rotations"
|
||||||
);
|
);
|
||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
"origin",
|
"centre",
|
||||||
"point",
|
"point",
|
||||||
"Use specified <point> as origin for rotations"
|
"Use specified <point> as centre for rotations"
|
||||||
);
|
);
|
||||||
|
argList::addOptionCompat("auto-centre", {"auto-origin", 2206});
|
||||||
|
argList::addOptionCompat("centre", {"origin", 2206});
|
||||||
|
|
||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
"rotate",
|
"rotate",
|
||||||
@ -437,18 +440,18 @@ int main(int argc, char *argv[])
|
|||||||
points += v;
|
points += v;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector origin;
|
vector rotationCentre;
|
||||||
bool useOrigin = args.readIfPresent("origin", origin);
|
bool useRotationCentre = args.readIfPresent("centre", rotationCentre);
|
||||||
if (args.found("auto-origin") && !useOrigin)
|
if (args.found("auto-centre") && !useRotationCentre)
|
||||||
{
|
{
|
||||||
useOrigin = true;
|
useRotationCentre = true;
|
||||||
origin = boundBox(points).centre();
|
rotationCentre = boundBox(points).centre();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useOrigin)
|
if (useRotationCentre)
|
||||||
{
|
{
|
||||||
Info<< "Set origin for rotations to " << origin << endl;
|
Info<< "Set centre of rotation to " << rotationCentre << endl;
|
||||||
points -= origin;
|
points -= rotationCentre;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -545,15 +548,15 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (useRotationCentre)
|
||||||
|
{
|
||||||
|
Info<< "Unset centre of rotation from " << rotationCentre << endl;
|
||||||
|
points += rotationCentre;
|
||||||
|
}
|
||||||
|
|
||||||
// Output scaling
|
// Output scaling
|
||||||
applyScaling(points, getScalingOpt("scale", args));
|
applyScaling(points, getScalingOpt("scale", args));
|
||||||
|
|
||||||
if (useOrigin)
|
|
||||||
{
|
|
||||||
Info<< "Unset origin for rotations from " << origin << endl;
|
|
||||||
points += origin;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Set the precision of the points data to 10
|
// Set the precision of the points data to 10
|
||||||
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
|
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
|
||||||
|
|||||||
@ -43,7 +43,7 @@ Description
|
|||||||
static void usage();
|
static void usage();
|
||||||
static void version();
|
static void version();
|
||||||
static std::string getLine(const std::string&, const std::string&);
|
static std::string getLine(const std::string&, const std::string&);
|
||||||
static std::string pOpen(const std::string&, int line=0);
|
static std::string pipeOpen(const std::string& cmd, const int lineNum = 0);
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -132,51 +132,50 @@ void version()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string pOpen(const std::string& cmd, int line)
|
// Read up to and including lineNum from the piped command
|
||||||
|
// Return the final line read
|
||||||
|
std::string pipeOpen(const std::string& cmd, int lineNum)
|
||||||
{
|
{
|
||||||
std::string res;
|
std::string str;
|
||||||
|
|
||||||
FILE* cmdPipe = popen(cmd.c_str(), "r");
|
FILE* handle = popen(cmd.c_str(), "r");
|
||||||
if (!cmdPipe) return res;
|
if (!handle) return str;
|
||||||
|
|
||||||
char* buf = nullptr;
|
char* buf = nullptr;
|
||||||
|
size_t len = 0;
|
||||||
|
ssize_t nread;
|
||||||
|
|
||||||
// Read line number of lines
|
// Read lineNum number of lines
|
||||||
for (int cnt = 0; cnt <= line; ++cnt)
|
for
|
||||||
|
(
|
||||||
|
int cnt = 0;
|
||||||
|
cnt <= lineNum && (nread = ::getline(&buf, &len, handle)) >= 0;
|
||||||
|
++cnt
|
||||||
|
)
|
||||||
{
|
{
|
||||||
size_t linecap = 0;
|
if (cnt == lineNum)
|
||||||
ssize_t linelen = ::getline(&buf, &linecap, cmdPipe);
|
{
|
||||||
|
// Retain the last line, trimming trailing newline
|
||||||
|
str.assign(buf);
|
||||||
|
|
||||||
if (linelen < 0)
|
if (str.size())
|
||||||
{
|
{
|
||||||
break;
|
str.resize(str.size()-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cnt == line)
|
|
||||||
{
|
|
||||||
res = std::string(buf);
|
|
||||||
|
|
||||||
// Trim trailing newline
|
|
||||||
if (res.size())
|
|
||||||
{
|
|
||||||
res.resize(res.size()-1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buf) free(buf);
|
free(buf);
|
||||||
|
pclose(handle);
|
||||||
|
|
||||||
pclose(cmdPipe);
|
return str;
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string getLine(const std::string& filename, const std::string& addr)
|
std::string getLine(const std::string& filename, const std::string& addr)
|
||||||
{
|
{
|
||||||
std::string line =
|
std::string line =
|
||||||
pOpen
|
pipeOpen
|
||||||
(
|
(
|
||||||
"echo 'image lookup -va " + addr
|
"echo 'image lookup -va " + addr
|
||||||
+ "'"
|
+ "'"
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -160,7 +160,7 @@ bool writeZones
|
|||||||
// Force writing as ASCII
|
// Force writing as ASCII
|
||||||
writeOk = meshObject.regIOobject::writeObject
|
writeOk = meshObject.regIOobject::writeObject
|
||||||
(
|
(
|
||||||
IOstreamOption(IOstream::ASCII, compression),
|
IOstreamOption(IOstreamOption::ASCII, compression),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -355,7 +355,7 @@ int main(int argc, char *argv[])
|
|||||||
runTime
|
runTime
|
||||||
);
|
);
|
||||||
|
|
||||||
if (runTime.writeFormat() == IOstream::ASCII)
|
if (runTime.writeFormat() == IOstreamOption::ASCII)
|
||||||
{
|
{
|
||||||
// Only do zones when converting from binary to ascii
|
// Only do zones when converting from binary to ascii
|
||||||
// The other way gives problems since working on dictionary level.
|
// The other way gives problems since working on dictionary level.
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -65,8 +65,8 @@ int main(int argc, char *argv[])
|
|||||||
profiling::disable(); // No profiling output
|
profiling::disable(); // No profiling output
|
||||||
argList::noBanner();
|
argList::noBanner();
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
|
argList::noFunctionObjects();
|
||||||
argList::removeOption("case");
|
argList::removeOption("case");
|
||||||
argList::removeOption("noFunctionObjects");
|
|
||||||
argList::addBoolOption
|
argList::addBoolOption
|
||||||
(
|
(
|
||||||
"or",
|
"or",
|
||||||
|
|||||||
@ -1014,7 +1014,9 @@ int main(int argc, char *argv[])
|
|||||||
Time::controlDictName,
|
Time::controlDictName,
|
||||||
args.rootPath(),
|
args.rootPath(),
|
||||||
args.caseName()
|
args.caseName()
|
||||||
/ ("processor" + Foam::name(proci))
|
/ ("processor" + Foam::name(proci)),
|
||||||
|
args.allowFunctionObjects(),
|
||||||
|
args.allowLibs()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -244,7 +244,9 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
Time::controlDictName,
|
Time::controlDictName,
|
||||||
args.rootPath(),
|
args.rootPath(),
|
||||||
args.caseName()/("processor" + Foam::name(proci))
|
args.caseName()/("processor" + Foam::name(proci)),
|
||||||
|
args.allowFunctionObjects(),
|
||||||
|
args.allowLibs()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -663,7 +663,11 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Merge tolerance : " << mergeTol << nl
|
Info<< "Merge tolerance : " << mergeTol << nl
|
||||||
<< "Write tolerance : " << writeTol << endl;
|
<< "Write tolerance : " << writeTol << endl;
|
||||||
|
|
||||||
if (runTime.writeFormat() == IOstream::ASCII && mergeTol < writeTol)
|
if
|
||||||
|
(
|
||||||
|
runTime.writeFormat() == IOstreamOption::ASCII
|
||||||
|
&& mergeTol < writeTol
|
||||||
|
)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Your current settings specify ASCII writing with "
|
<< "Your current settings specify ASCII writing with "
|
||||||
@ -727,7 +731,9 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
Time::controlDictName,
|
Time::controlDictName,
|
||||||
args.rootPath(),
|
args.rootPath(),
|
||||||
args.caseName()/("processor" + Foam::name(proci))
|
args.caseName()/("processor" + Foam::name(proci)),
|
||||||
|
args.allowFunctionObjects(),
|
||||||
|
args.allowLibs()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1180,7 +1186,7 @@ int main(int argc, char *argv[])
|
|||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
masterMeshPtr = fvMeshes[0];
|
masterMeshPtr.cref(fvMeshes[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -159,7 +159,7 @@ public:
|
|||||||
p.origProc = ppi.origProc();
|
p.origProc = ppi.origProc();
|
||||||
p.origId = ppi.origId();
|
p.origId = ppi.origId();
|
||||||
|
|
||||||
if (os.format() == IOstream::ASCII)
|
if (os.format() == IOstreamOption::ASCII)
|
||||||
{
|
{
|
||||||
os << p.position
|
os << p.position
|
||||||
<< token::SPACE << p.celli
|
<< token::SPACE << p.celli
|
||||||
|
|||||||
@ -168,7 +168,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Less frequently used - reduce some clutter
|
// Less frequently used - reduce some clutter
|
||||||
argList::setAdvanced("decomposeParDict");
|
argList::setAdvanced("decomposeParDict");
|
||||||
argList::setAdvanced("noFunctionObjects");
|
|
||||||
|
|
||||||
argList::addVerboseOption("Additional verbosity");
|
argList::addVerboseOption("Additional verbosity");
|
||||||
|
|
||||||
|
|||||||
@ -65,7 +65,7 @@ label writeDimFields
|
|||||||
{
|
{
|
||||||
typedef VolumeInternalField<Type> FieldType;
|
typedef VolumeInternalField<Type> FieldType;
|
||||||
|
|
||||||
const fvMesh& mesh = dynamicCast<const fvMesh>(ensMesh.mesh());
|
const auto& mesh = refCast<const fvMesh>(ensMesh.mesh());
|
||||||
|
|
||||||
label count = 0;
|
label count = 0;
|
||||||
|
|
||||||
|
|||||||
@ -88,7 +88,7 @@ label writeVolFields
|
|||||||
{
|
{
|
||||||
typedef VolumeField<Type> FieldType;
|
typedef VolumeField<Type> FieldType;
|
||||||
|
|
||||||
const fvMesh& mesh = dynamicCast<const fvMesh>(ensMesh.mesh());
|
const auto& mesh = refCast<const fvMesh>(ensMesh.mesh());
|
||||||
|
|
||||||
label count = 0;
|
label count = 0;
|
||||||
|
|
||||||
|
|||||||
@ -232,13 +232,13 @@ vtk::outputOptions getOutputOptions(const argList& args)
|
|||||||
|
|
||||||
if (!args.found("ascii"))
|
if (!args.found("ascii"))
|
||||||
{
|
{
|
||||||
if (sizeof(floatScalar) != 4 || sizeof(label) != 4)
|
if (sizeof(float) != 4 || sizeof(label) != 4)
|
||||||
{
|
{
|
||||||
opts.ascii(true);
|
opts.ascii(true);
|
||||||
|
|
||||||
WarningInFunction
|
WarningInFunction
|
||||||
<< "Using ASCII rather than legacy binary VTK format since "
|
<< "Using ASCII rather than legacy binary VTK format since "
|
||||||
<< "floatScalar and/or label are not 4 bytes in size."
|
<< "float and/or label are not 4 bytes in size."
|
||||||
<< nl << endl;
|
<< nl << endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -268,7 +268,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Less frequently used - reduce some clutter
|
// Less frequently used - reduce some clutter
|
||||||
argList::setAdvanced("decomposeParDict");
|
argList::setAdvanced("decomposeParDict");
|
||||||
argList::setAdvanced("noFunctionObjects");
|
|
||||||
|
|
||||||
argList::addVerboseOption("Additional verbosity");
|
argList::addVerboseOption("Additional verbosity");
|
||||||
|
|
||||||
|
|||||||
@ -87,7 +87,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Less frequently used - reduce some clutter
|
// Less frequently used - reduce some clutter
|
||||||
argList::setAdvanced("decomposeParDict");
|
argList::setAdvanced("decomposeParDict");
|
||||||
argList::setAdvanced("noFunctionObjects");
|
|
||||||
|
|
||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -100,7 +100,9 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
Time::controlDictName,
|
Time::controlDictName,
|
||||||
args.rootPath(),
|
args.rootPath(),
|
||||||
args.caseName()/("processor" + Foam::name(proci))
|
args.caseName()/("processor" + Foam::name(proci)),
|
||||||
|
args.allowFunctionObjects(),
|
||||||
|
args.allowLibs()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -390,7 +392,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
summary.writeHeader(os);
|
summary.writeHeader(os);
|
||||||
summary.writeData(os);
|
summary.writeData(os);
|
||||||
summary.writeEndDivider(os);
|
IOobject::writeEndDivider(os);
|
||||||
|
|
||||||
Info<< "Wrote to " << outputName << nl << endl;
|
Info<< "Wrote to " << outputName << nl << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -662,8 +662,8 @@ int main(int argc, char *argv[])
|
|||||||
// Read dictionary
|
// Read dictionary
|
||||||
// Note: disable class type checking so we can load field
|
// Note: disable class type checking so we can load field
|
||||||
Info<< "Loading dictionary " << fieldName << endl;
|
Info<< "Loading dictionary " << fieldName << endl;
|
||||||
const word oldTypeName = IOdictionary::typeName;
|
const word oldTypeName = localIOdictionary::typeName;
|
||||||
const_cast<word&>(IOdictionary::typeName) = word::null;
|
const_cast<word&>(localIOdictionary::typeName) = word::null;
|
||||||
|
|
||||||
IOobject fieldHeader
|
IOobject fieldHeader
|
||||||
(
|
(
|
||||||
@ -675,11 +675,15 @@ int main(int argc, char *argv[])
|
|||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
if (fieldHeader.typeHeaderOk<IOdictionary>(false))
|
if (fieldHeader.typeHeaderOk<localIOdictionary>(false))
|
||||||
{
|
{
|
||||||
IOdictionary fieldDict(fieldHeader);
|
//IOdictionary fieldDict(fieldHeader);
|
||||||
|
//- dictionaries to-be-changed are either boundary
|
||||||
|
// or field dictionary. Both are processor-local.
|
||||||
|
localIOdictionary fieldDict(fieldHeader);
|
||||||
|
|
||||||
const_cast<word&>(IOdictionary::typeName) = oldTypeName;
|
const_cast<word&>(localIOdictionary::typeName) =
|
||||||
|
oldTypeName;
|
||||||
|
|
||||||
// Fake type back to what was in field
|
// Fake type back to what was in field
|
||||||
const_cast<word&>(fieldDict.type()) =
|
const_cast<word&>(fieldDict.type()) =
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user