Compare commits
161 Commits
fix-2640-z
...
multiNodeD
| Author | SHA1 | Date | |
|---|---|---|---|
| 8862a0b3b2 | |||
| c7477885a5 | |||
| cc6ba5c1a0 | |||
| 26420a88d7 | |||
| ff13cdd39d | |||
| 988ec18ecc | |||
| 0339e5ee0d | |||
| 07c69fdf0d | |||
| 03ab6c1a9d | |||
| e62b031f26 | |||
| 33f0ff8145 | |||
| 166164da93 | |||
| 1f68e7f9b3 | |||
| e346620a62 | |||
| df808ad3f2 | |||
| 51ed7a6034 | |||
| 0031cb1efa | |||
| 66908158ae | |||
| 7e61f36c12 | |||
| 4cccd5f854 | |||
| b1e919dbbb | |||
| c273ee4697 | |||
| aebd79ff59 | |||
| 0a01492397 | |||
| 8d2165e7f4 | |||
| 5fa37fb41c | |||
| 87cff55f9e | |||
| 4dafaa8cfe | |||
| ec77d3152b | |||
| fa7f0e1b67 | |||
| 02ca7868d5 | |||
| 029c5a24fe | |||
| b41ddc43c3 | |||
| 48973bad83 | |||
| 7d97b6f791 | |||
| a0f1e98d24 | |||
| d5b7200295 | |||
| 952d42512d | |||
| 0de1df7309 | |||
| d58e06494d | |||
| b7b78a3052 | |||
| 6ad25ef293 | |||
| c551ef3b01 | |||
| 24e97c6b91 | |||
| bd41ad1842 | |||
| ed5690ffbc | |||
| 05322608a2 | |||
| 4b94ac97c2 | |||
| 1888bc62ab | |||
| 95a6e8b419 | |||
| c3b0742e03 | |||
| 7c235371ff | |||
| e90092ad91 | |||
| 115bf529ad | |||
| 09f4d8513f | |||
| 36f66606a2 | |||
| 91a62ca05a | |||
| 993b7af513 | |||
| 6f2c609a14 | |||
| 885456f9a4 | |||
| 8f63fd5230 | |||
| 7441e18475 | |||
| 9e6123b5a4 | |||
| 3a429894b1 | |||
| d8f33c626a | |||
| 9c9088f191 | |||
| 1f393aefa8 | |||
| b94bf625a5 | |||
| 161fab8d60 | |||
| 8afd6ff729 | |||
| b69db76b67 | |||
| d5e82f072e | |||
| a8b0ec0c4e | |||
| d7de6a2772 | |||
| 48f8680941 | |||
| 4c8fc9dc6e | |||
| 5844463ba4 | |||
| 9479ab98eb | |||
| c29e67e5e5 | |||
| eaffe4c2cf | |||
| 0fde8ac91d | |||
| d0061d6f54 | |||
| c439968390 | |||
| 5fb0cd77f1 | |||
| b50591166e | |||
| ce10cc54c2 | |||
| 599b009b18 | |||
| 80f385a3b0 | |||
| 8127ec6a05 | |||
| c9a10055e8 | |||
| 9018c94b90 | |||
| d6204acd0e | |||
| 3e260b84db | |||
| 9fbe2ef0b3 | |||
| 9b379398c5 | |||
| b50850de56 | |||
| 3ab182b1ae | |||
| 3151dacccc | |||
| 8ae2e5a969 | |||
| bbd6bfbb7f | |||
| 8d4e32da22 | |||
| f9191b9377 | |||
| 59811983db | |||
| dff4c3da05 | |||
| e60d0997e6 | |||
| ea44944037 | |||
| 4a01979fa8 | |||
| 689b2ab2a9 | |||
| fbd14e42a2 | |||
| 9711b7f1b9 | |||
| ffeef76d8f | |||
| 7fe8bdcf99 | |||
| e190df9033 | |||
| 0b83d39500 | |||
| 8495b86d8e | |||
| 09a6049f50 | |||
| 6b6d4c10a3 | |||
| 8bfbda8c71 | |||
| bdb437ab10 | |||
| 286c6ce7d8 | |||
| 478c1b2312 | |||
| 69be54107d | |||
| e401e8f132 | |||
| 3f87aec01a | |||
| efc4649f12 | |||
| 360af221fe | |||
| adf95d483c | |||
| 8c02820db6 | |||
| 9d212dfd32 | |||
| 126d831f6e | |||
| cb4e026aed | |||
| 2984d1e3e7 | |||
| 98598ba0bb | |||
| fc0b980333 | |||
| ffbad65538 | |||
| 38b663b6a8 | |||
| ac4f580d09 | |||
| f638db48c7 | |||
| b8d01a88ea | |||
| 3d7dc6a870 | |||
| b129446221 | |||
| fc9311ba0d | |||
| 3384747f9b | |||
| e5006a62d7 | |||
| 1339c3357b | |||
| 0ba458fdbc | |||
| 27c2cdc040 | |||
| 5ec435aca3 | |||
| c33167dc0e | |||
| e4139898d2 | |||
| d3e285b48b | |||
| c7e6ae30bf | |||
| db88265163 | |||
| f3ba6c6da0 | |||
| 9f9b8fb662 | |||
| 8ba1156a56 | |||
| 13606d4e09 | |||
| 90b61429f6 | |||
| 8993af73ac | |||
| a4d235af6b | |||
| dffac4d887 |
@ -49,7 +49,7 @@
|
||||
|
||||
<!--
|
||||
Providing details of your set-up can help us identify any issues, e.g.
|
||||
OpenFOAM version : v2206|v2112|v2106|v2012|v2006 etc
|
||||
OpenFOAM version : v2212|v2206|v2112|v2106|v2012 etc
|
||||
Operating system : ubuntu|openSUSE|centos etc
|
||||
Hardware info : any info that may help?
|
||||
Compiler : gcc|intel|clang etc
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
api=2208
|
||||
patch=220907
|
||||
api=2212
|
||||
patch=230110
|
||||
|
||||
14
README.md
14
README.md
@ -40,9 +40,9 @@ Violations of the Trademark are monitored, and will be duly prosecuted.
|
||||
|
||||
If OpenFOAM has already been compiled on your system, simply source
|
||||
the appropriate `etc/bashrc` or `etc/cshrc` file and get started.
|
||||
For example, for the OpenFOAM-v2206 version:
|
||||
For example, for the OpenFOAM-v2212 version:
|
||||
```
|
||||
source /installation/path/OpenFOAM-v2206/etc/bashrc
|
||||
source /installation/path/OpenFOAM-v2212/etc/bashrc
|
||||
```
|
||||
|
||||
## Compiling OpenFOAM
|
||||
@ -127,8 +127,8 @@ These 3rd-party sources are normally located in a directory parallel
|
||||
to the OpenFOAM directory. For example,
|
||||
```
|
||||
/path/parent
|
||||
|-- OpenFOAM-v2206
|
||||
\-- ThirdParty-v2206
|
||||
|-- OpenFOAM-v2212
|
||||
\-- ThirdParty-v2212
|
||||
```
|
||||
There are, however, many cases where this simple convention is inadequate:
|
||||
|
||||
@ -136,7 +136,7 @@ There are, however, many cases where this simple convention is inadequate:
|
||||
operating system or cluster installation provides it)
|
||||
|
||||
* When we have changed the OpenFOAM directory name to some arbitrary
|
||||
directory name, e.g. openfoam-sandbox2206, etc..
|
||||
directory name, e.g. openfoam-sandbox2212, etc..
|
||||
|
||||
* When we would like any additional 3rd party software to be located
|
||||
inside of the OpenFOAM directory to ensure that the installation is
|
||||
@ -156,9 +156,9 @@ when locating the ThirdParty directory with the following precedence:
|
||||
2. PREFIX/ThirdParty-VERSION
|
||||
* this corresponds to the traditional approach
|
||||
3. PREFIX/ThirdParty-vAPI
|
||||
* allows for an updated value of VERSION, *eg*, `v2206-myCustom`,
|
||||
* allows for an updated value of VERSION, *eg*, `v2212-myCustom`,
|
||||
without requiring a renamed ThirdParty. The API value would still
|
||||
be `2206` and the original `ThirdParty-v2206/` would be found.
|
||||
be `2212` and the original `ThirdParty-v2212/` would be found.
|
||||
4. PREFIX/ThirdParty-API
|
||||
* same as the previous example, but using an unadorned API value.
|
||||
5. PREFIX/ThirdParty-common
|
||||
|
||||
@ -9,7 +9,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -7,7 +7,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
sqrt
|
||||
(
|
||||
2*M_PI*sigma*sqr(aMesh.edgeInterpolation::deltaCoeffs())
|
||||
*aMesh.edgeInterpolation::deltaCoeffs()
|
||||
*mag(aMesh.edgeInterpolation::deltaCoeffs())
|
||||
/rhol
|
||||
)
|
||||
).value()*runTime.deltaT().value();
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
// Volume-to surface mapping object
|
||||
const volSurfaceMapping vsm(aMesh);
|
||||
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
@ -26,6 +29,3 @@ volScalarField H
|
||||
mesh,
|
||||
dimensionedScalar(dimLength, Zero)
|
||||
);
|
||||
|
||||
// Create volume-to surface mapping object
|
||||
volSurfaceMapping vsm(aMesh);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// Create volume-to surface mapping object
|
||||
volSurfaceMapping vsm(aMesh);
|
||||
// Volume-to surface mapping object
|
||||
const volSurfaceMapping vsm(aMesh);
|
||||
|
||||
volScalarField Cvf
|
||||
(
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// Create volume-to surface mapping object
|
||||
volSurfaceMapping vsm(aMesh);
|
||||
// Volume-to surface mapping object
|
||||
const volSurfaceMapping vsm(aMesh);
|
||||
|
||||
volScalarField Cvf
|
||||
(
|
||||
|
||||
@ -10,7 +10,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -7,7 +7,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -19,7 +19,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -113,15 +113,19 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
#include "setRegionFluidFields.H"
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "solveFluid.H"
|
||||
}
|
||||
|
||||
forAll(solidRegions, i)
|
||||
{
|
||||
#include "setRegionSolidFields.H"
|
||||
fvMesh& mesh = solidRegions[i];
|
||||
|
||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "solveSolid.H"
|
||||
}
|
||||
|
||||
@ -133,8 +137,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
#include "setRegionFluidFields.H"
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
if (!frozenFlow)
|
||||
{
|
||||
Info<< "\nSolving for fluid region "
|
||||
@ -166,20 +172,24 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
Info<< "\nSolving for fluid region "
|
||||
<< fluidRegions[i].name() << endl;
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
frozenFlow = true;
|
||||
#include "solveFluid.H"
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
frozenFlow = true;
|
||||
#include "solveFluid.H"
|
||||
}
|
||||
|
||||
forAll(solidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = solidRegions[i];
|
||||
|
||||
Info<< "\nSolving for solid region "
|
||||
<< solidRegions[i].name() << endl;
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "solveSolid.H"
|
||||
}
|
||||
|
||||
|
||||
@ -76,17 +76,21 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
Info<< "\nSolving for fluid region "
|
||||
<< fluidRegions[i].name() << endl;
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "readFluidMultiRegionSIMPLEControls.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "solveFluid.H"
|
||||
}
|
||||
|
||||
forAll(solidRegions, i)
|
||||
{
|
||||
#include "setRegionSolidFields.H"
|
||||
fvMesh& mesh = solidRegions[i];
|
||||
|
||||
#include "readSolidMultiRegionSIMPLEControls.H"
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "solveSolid.H"
|
||||
}
|
||||
|
||||
@ -99,8 +103,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
#include "setRegionFluidFields.H"
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
#include "readSolidMultiRegionSIMPLEControls.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
if (!frozenFlow)
|
||||
{
|
||||
#include "pEqn.H"
|
||||
@ -121,20 +127,24 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
Info<< "\nSolving for fluid region "
|
||||
<< fluidRegions[i].name() << endl;
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "readFluidMultiRegionSIMPLEControls.H"
|
||||
frozenFlow = true;
|
||||
#include "solveFluid.H"
|
||||
#include "readFluidMultiRegionSIMPLEControls.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
frozenFlow = true;
|
||||
#include "solveFluid.H"
|
||||
}
|
||||
|
||||
forAll(solidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = solidRegions[i];
|
||||
|
||||
Info<< "\nSolving for solid region "
|
||||
<< solidRegions[i].name() << endl;
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "readSolidMultiRegionSIMPLEControls.H"
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "solveSolid.H"
|
||||
}
|
||||
|
||||
|
||||
@ -5,3 +5,5 @@
|
||||
|
||||
const bool momentumPredictor =
|
||||
simple.getOrDefault("momentumPredictor", true);
|
||||
|
||||
simple.readIfPresent("frozenFlow", frozenFlowFluid[i]);
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
const fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
rhoThermo& thermo = thermoFluid[i];
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -108,19 +108,23 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
Info<< "\nSolving for fluid region "
|
||||
<< fluidRegions[i].name() << endl;
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "solveFluid.H"
|
||||
}
|
||||
|
||||
forAll(solidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = solidRegions[i];
|
||||
|
||||
Info<< "\nSolving for solid region "
|
||||
<< solidRegions[i].name() << endl;
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "solveSolid.H"
|
||||
}
|
||||
|
||||
@ -135,20 +139,24 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
Info<< "\nSolving for fluid region "
|
||||
<< fluidRegions[i].name() << endl;
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
frozenFlow = true;
|
||||
#include "solveFluid.H"
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
frozenFlow = true;
|
||||
#include "solveFluid.H"
|
||||
}
|
||||
|
||||
forAll(solidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = solidRegions[i];
|
||||
|
||||
Info<< "\nSolving for solid region "
|
||||
<< solidRegions[i].name() << endl;
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "solveSolid.H"
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,3 +9,5 @@
|
||||
(
|
||||
pimpleDict.getOrDefault<int>("nEnergyCorrectors", 1)
|
||||
);
|
||||
|
||||
pimpleDict.readIfPresent("frozenFlow", frozenFlowFluid[i]);
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
twoPhaseSystem& fluid = phaseSystemFluid[i];
|
||||
|
||||
phaseModel& phase1 = fluid.phase1();
|
||||
|
||||
@ -8,3 +8,5 @@
|
||||
|
||||
const bool momentumPredictor =
|
||||
pimple.getOrDefault("momentumPredictor", true);
|
||||
|
||||
pimple.readIfPresent("frozenFlow", frozenFlowFluid[i]);
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
CombustionModel<rhoReactionThermo>& reaction = reactionFluid[i];
|
||||
|
||||
rhoReactionThermo& thermo = reaction.thermo();
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
fvMesh& mesh = solidRegions[i];
|
||||
solidThermo& thermo = thermos[i];
|
||||
|
||||
tmp<volScalarField> trho = thermo.rho();
|
||||
|
||||
@ -8,7 +8,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -64,23 +64,23 @@ inline Ostream& report
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
CircularBuffer<label> buf1(1); report(buf1);
|
||||
buf1.append(10); report(buf1);
|
||||
buf1.push_back(10); report(buf1);
|
||||
|
||||
Info<< buf1.range_one() << nl;
|
||||
|
||||
buf1.append(20); report(buf1);
|
||||
buf1.append(30); report(buf1);
|
||||
buf1.push_back(20); report(buf1);
|
||||
buf1.push_back(30); report(buf1);
|
||||
buf1.push_back(40); report(buf1);
|
||||
buf1.push_front(-50); report(buf1);
|
||||
buf1.append(60); report(buf1);
|
||||
buf1.append(labelList({70,80,90})); report(buf1);
|
||||
buf1.push_back(60); report(buf1);
|
||||
buf1.push_back(labelList({70,80,90})); report(buf1);
|
||||
|
||||
Info<< nl << "access: " << buf1 << nl;
|
||||
|
||||
Info<< buf1[-12] << nl;
|
||||
|
||||
Info<< "found: " << buf1.found(40) << nl;
|
||||
buf1.appendUniq(100); report(buf1);
|
||||
buf1.push_uniq(100); report(buf1);
|
||||
|
||||
buf1 = Zero; report(buf1);
|
||||
|
||||
@ -88,11 +88,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (buf1.size() > 2)
|
||||
{
|
||||
(void) buf1.pop_front();
|
||||
buf1.pop_front();
|
||||
}
|
||||
report(buf1);
|
||||
|
||||
buf1.append(identity(5)); report(buf1);
|
||||
buf1.push_back(identity(5)); report(buf1);
|
||||
|
||||
buf1.info(Info);
|
||||
Info<< buf1 << nl;
|
||||
@ -123,6 +123,8 @@ int main(int argc, char *argv[])
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
Info<< nl << "list: " << flatOutput(buf2.list()) << nl;
|
||||
|
||||
Info<< "normal: " << flatOutput(buf2) << nl;
|
||||
buf2.reverse();
|
||||
Info<< "reverse: " << flatOutput(buf2) << nl;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -67,11 +67,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
for (int i = 0; i<10; i++)
|
||||
{
|
||||
myList.append(1.3*i);
|
||||
myList.push_back(1.3*i);
|
||||
}
|
||||
|
||||
myList.append(100.3);
|
||||
myList.append(500.3);
|
||||
myList.push_back(100.3);
|
||||
myList.push_back(500.3);
|
||||
|
||||
Info<< "DLList<scalar>" << nl;
|
||||
Info<< nl << "flat-output: " << flatOutput(myList) << nl;
|
||||
@ -144,23 +144,23 @@ int main(int argc, char *argv[])
|
||||
Info<< " => " << flatOutput(myList) << nl;
|
||||
}
|
||||
|
||||
myList.append(500.3);
|
||||
myList.append(200.3);
|
||||
myList.append(100.3);
|
||||
myList.push_back(500.3);
|
||||
myList.push_back(200.3);
|
||||
myList.push_back(100.3);
|
||||
|
||||
Info<< nl << "Testing swapUp and swapDown:" << nl;
|
||||
Info<< " => " << flatOutput(myList) << nl;
|
||||
|
||||
{
|
||||
myList.swapUp(myList.DLListBase::first());
|
||||
myList.swapUp(myList.DLListBase::last());
|
||||
myList.swapUp(myList.DLListBase::front());
|
||||
myList.swapUp(myList.DLListBase::back());
|
||||
|
||||
Info<< nl << "swapUp => " << flatOutput(myList) << nl;
|
||||
}
|
||||
|
||||
{
|
||||
myList.swapDown(myList.DLListBase::first());
|
||||
myList.swapDown(myList.DLListBase::last());
|
||||
myList.swapDown(myList.DLListBase::front());
|
||||
myList.swapDown(myList.DLListBase::back());
|
||||
|
||||
Info<< nl << "swapDown => " << flatOutput(myList) << nl;
|
||||
}
|
||||
@ -200,7 +200,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
for (int i = 0; i<5; i++)
|
||||
{
|
||||
labList.append(identity(6));
|
||||
labList.push_back(identity(6));
|
||||
}
|
||||
|
||||
Info<< nl
|
||||
@ -221,16 +221,16 @@ int main(int argc, char *argv[])
|
||||
List<label> content1 = identity(10);
|
||||
|
||||
Info<< nl
|
||||
<< " move append ";
|
||||
<< " move push_back ";
|
||||
printAddress(content1);
|
||||
|
||||
labList.append(std::move(content1));
|
||||
labList.push_back(std::move(content1));
|
||||
|
||||
Info<< " content " << flatOutput(content1) << nl
|
||||
<< " list" << labList << nl;
|
||||
|
||||
printAddresses(labList);
|
||||
// labList.append(content1);
|
||||
// labList.push_back(content1);
|
||||
}
|
||||
|
||||
Info<< nl << "Done." << endl;
|
||||
|
||||
@ -189,6 +189,12 @@ int main(int argc, char *argv[])
|
||||
<< " hash:" << FixedList<label, 4>::hasher()(list1) << nl
|
||||
<< " hash:" << Hash<FixedList<label, 4>>()(list1) << nl;
|
||||
|
||||
Info<< "get<0>: " << list1.get<0>() << nl;
|
||||
Info<< "get<1>: " << list1.get<1>() << nl;
|
||||
Info<< "get<2>: " << list1.get<2>() << nl;
|
||||
Info<< "get<3>: " << list1.get<3>() << nl;
|
||||
// Will not compile: Info<< "get<4>: " << list1.get<4>() << nl;
|
||||
|
||||
label a[4] = {0, 1, 2, 3};
|
||||
FixedList<label, 4> list2(a);
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -37,8 +37,6 @@ Description
|
||||
#include "labelPairHashes.H"
|
||||
#include "FlatOutput.H"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
template<class Iter>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -76,11 +76,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
for (int i = 0; i<10; i++)
|
||||
{
|
||||
myList.append(new Scalar(1.3*i));
|
||||
myList.push_back(new Scalar(1.3*i));
|
||||
}
|
||||
|
||||
myList.append(new Scalar(100.3));
|
||||
myList.append(new Scalar(500.3));
|
||||
myList.push_back(new Scalar(100.3));
|
||||
myList.push_back(new Scalar(500.3));
|
||||
|
||||
Info<< "ISLList<scalar>" << myList << nl;
|
||||
Info<< nl << "flat-output: " << flatOutput(myList) << nl;
|
||||
|
||||
@ -126,8 +126,8 @@ void doTest
|
||||
|
||||
if (testskip)
|
||||
{
|
||||
Info<< " first : " << its.peekFirst().info() << nl
|
||||
<< " last : " << its.peekLast().info() << nl;
|
||||
Info<< " front : " << its.front().info() << nl
|
||||
<< " back : " << its.back().info() << nl;
|
||||
|
||||
Info<< "rewind():" << nl;
|
||||
reportPeek(its);
|
||||
|
||||
@ -101,6 +101,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
printInfo(idl1);
|
||||
|
||||
Info<< "list() = ";
|
||||
idl1.list().writeList(Info, 0) << endl;
|
||||
|
||||
for (const label val : { 10, 30, 40, 50, 90, 80, 120 } )
|
||||
{
|
||||
testFind(val, idl1);
|
||||
|
||||
@ -214,8 +214,8 @@ int main(int argc, char *argv[])
|
||||
forAllReverseIters(list2, iter) { *iter *= 0.5; Info<< " " << *iter; }
|
||||
Info<< endl;
|
||||
|
||||
list1.append(list2);
|
||||
Info<< "list1.append(list2): " << list1 << endl;
|
||||
list1.push_back(list2);
|
||||
Info<< "list1.push_back(list2): " << list1 << endl;
|
||||
|
||||
for (const vector& val : { vector(3, 4, 5), vector(10,11, 12)} )
|
||||
{
|
||||
|
||||
@ -40,8 +40,6 @@ Description
|
||||
#include "OFstream.H"
|
||||
#include "cpuTime.H"
|
||||
|
||||
#include <initializer_list>
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -40,8 +40,6 @@ Description
|
||||
#include "OFstream.H"
|
||||
#include "cpuTime.H"
|
||||
|
||||
#include <initializer_list>
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -245,10 +245,10 @@ int main(int argc, char *argv[])
|
||||
list1.resize(8);
|
||||
report(list1);
|
||||
|
||||
Info<< "\ntest append() operation\n";
|
||||
list1.append(2);
|
||||
list1.append(3);
|
||||
list1.append(4);
|
||||
Info<< "\ntest push_back() operation\n";
|
||||
list1.push_back(2);
|
||||
list1.push_back(3);
|
||||
list1.push_back(4);
|
||||
report(list1);
|
||||
|
||||
Info<< "\ntest reserve() operation\n";
|
||||
@ -326,9 +326,9 @@ int main(int argc, char *argv[])
|
||||
report(list1);
|
||||
|
||||
|
||||
Info<< "\ntest copy constructor + append\n";
|
||||
Info<< "\ntest copy constructor + push_back\n";
|
||||
PackedList<3> list2(list1);
|
||||
list2.append(4);
|
||||
list2.push_back(4);
|
||||
Info<< "source list:\n";
|
||||
report(list1);
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -108,7 +108,7 @@ Ostream& printAddr
|
||||
|
||||
for (label i=0; i < len; ++i)
|
||||
{
|
||||
os << "addr=" << name(list(i)) << nl;
|
||||
os << "addr=" << Foam::name(list.get(i)) << nl;
|
||||
}
|
||||
|
||||
// End delimiter
|
||||
@ -140,7 +140,7 @@ Ostream& print
|
||||
|
||||
for (label i=0; i < len; ++i)
|
||||
{
|
||||
const T* ptr = list(i);
|
||||
const T* ptr = list.get(i);
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
@ -174,7 +174,7 @@ Ostream& print
|
||||
|
||||
for (label i=0; i < len; ++i)
|
||||
{
|
||||
const T* ptr = list(i);
|
||||
const T* ptr = list.get(i);
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
@ -192,7 +192,7 @@ Ostream& print
|
||||
|
||||
for (label i=len; i < cap; ++i)
|
||||
{
|
||||
const T* ptr = list(i);
|
||||
const T* ptr = list.get(i);
|
||||
|
||||
os << "unused " << name(ptr) << nl;
|
||||
}
|
||||
@ -274,9 +274,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
{
|
||||
DLPtrList<Scalar> llist1;
|
||||
llist1.prepend(new Scalar(100));
|
||||
llist1.prepend(new Scalar(200));
|
||||
llist1.prepend(new Scalar(300));
|
||||
llist1.push_front(new Scalar(100));
|
||||
llist1.push_front(new Scalar(200));
|
||||
llist1.push_front(new Scalar(300));
|
||||
|
||||
auto citer = llist1.begin();
|
||||
|
||||
@ -305,9 +305,9 @@ int main(int argc, char *argv[])
|
||||
// Same but as SLPtrList
|
||||
{
|
||||
SLPtrList<Scalar> llist1;
|
||||
llist1.prepend(new Scalar(100));
|
||||
llist1.prepend(new Scalar(200));
|
||||
llist1.prepend(new Scalar(300));
|
||||
llist1.push_front(new Scalar(100));
|
||||
llist1.push_front(new Scalar(200));
|
||||
llist1.push_front(new Scalar(300));
|
||||
|
||||
for (const auto& it : llist1)
|
||||
{
|
||||
@ -334,7 +334,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
listApp.append(new Scalar(1.3*i));
|
||||
}
|
||||
listApp.emplace_append(100);
|
||||
listApp.emplace_back(100);
|
||||
|
||||
|
||||
Info<< nl
|
||||
@ -580,8 +580,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
PtrList<plane> planes;
|
||||
planes.emplace_append(vector::one, vector::one);
|
||||
planes.emplace_append(vector(1,2,3), vector::one);
|
||||
planes.emplace_back(vector::one, vector::one);
|
||||
planes.emplace_back(vector(1,2,3), vector::one);
|
||||
|
||||
Info<< nl << "appended values" << nl;
|
||||
for (const plane& p : planes)
|
||||
@ -594,15 +594,15 @@ int main(int argc, char *argv[])
|
||||
PtrDynList<plane> dynPlanes;
|
||||
|
||||
{
|
||||
dynPlanes.emplace_append(vector::one, vector::one);
|
||||
dynPlanes.emplace_append(vector(1,2,3), vector::one);
|
||||
dynPlanes.emplace_back(vector::one, vector::one);
|
||||
dynPlanes.emplace_back(vector(1,2,3), vector::one);
|
||||
dynPlanes.append(nullptr);
|
||||
|
||||
dynPlanes.set(6, new plane(vector(2,2,1), vector::one));
|
||||
dynPlanes.set(10, new plane(vector(4,5,6), vector::one));
|
||||
|
||||
dynPlanes.emplace(12, vector(3,2,1), vector::one);
|
||||
dynPlanes.emplace_append(Zero, vector::one);
|
||||
dynPlanes.emplace_back(Zero, vector::one);
|
||||
}
|
||||
|
||||
Info<< nl << "PtrDynList: ";
|
||||
@ -633,7 +633,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(dynPlanes, i)
|
||||
{
|
||||
const plane* pln = dynPlanes.set(i);
|
||||
const plane* pln = dynPlanes.get(i);
|
||||
if (pln)
|
||||
{
|
||||
stdPlanes.set(i, new plane(*pln));
|
||||
|
||||
@ -67,11 +67,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
for (int i = 0; i<10; i++)
|
||||
{
|
||||
myList.append(1.3*i);
|
||||
myList.push_back(1.3*i);
|
||||
}
|
||||
|
||||
myList.append(100.3);
|
||||
myList.append(500.3);
|
||||
myList.push_back(100.3);
|
||||
myList.push_back(500.3);
|
||||
|
||||
Info<< "SLList<scalar>" << myList << nl;
|
||||
Info<< nl << "flat-output: " << flatOutput(myList) << nl;
|
||||
@ -103,11 +103,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
for (int i = 0; i<10; i++)
|
||||
{
|
||||
myList.append(1.3*i);
|
||||
myList.push_back(1.3*i);
|
||||
}
|
||||
|
||||
myList.append(100.3);
|
||||
myList.append(500.3);
|
||||
myList.push_back(100.3);
|
||||
myList.push_back(500.3);
|
||||
|
||||
Info<< nl << "Transfer: " << nl;
|
||||
Info<< "original: " << flatOutput(myList) << endl;
|
||||
@ -143,7 +143,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
for (int i = 0; i<5; i++)
|
||||
{
|
||||
labList.append(identity(6));
|
||||
labList.push_back(identity(6));
|
||||
}
|
||||
|
||||
Info<< nl
|
||||
@ -164,16 +164,16 @@ int main(int argc, char *argv[])
|
||||
List<label> content1 = identity(10);
|
||||
|
||||
Info<< nl
|
||||
<< " move append ";
|
||||
<< " move push_back ";
|
||||
printAddress(content1);
|
||||
|
||||
labList.append(std::move(content1));
|
||||
labList.push_back(std::move(content1));
|
||||
|
||||
Info<< " content " << flatOutput(content1) << nl
|
||||
<< " list" << labList << nl;
|
||||
|
||||
printAddresses(labList);
|
||||
// labList.append(content1);
|
||||
// labList.push_back(content1);
|
||||
}
|
||||
|
||||
Info<< nl << "Done." << endl;
|
||||
|
||||
@ -39,7 +39,6 @@ Description
|
||||
#include "Pair.H"
|
||||
|
||||
#include <sstream>
|
||||
#include <initializer_list>
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
|
||||
@ -33,7 +33,6 @@ Description
|
||||
#include "IOstreams.H"
|
||||
#include "stdFoam.H"
|
||||
|
||||
#include <algorithm>
|
||||
#include <type_traits>
|
||||
#include <limits>
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -165,24 +165,24 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Use predicate, or test() method
|
||||
|
||||
if (list2(1))
|
||||
if (list2.test(1))
|
||||
{
|
||||
Info<< "1 is on (original)" << nl;
|
||||
}
|
||||
if (!list2(2))
|
||||
if (!list2.test(2))
|
||||
{
|
||||
Info<< "2 is off (original)" << nl;
|
||||
}
|
||||
if (!list2(100))
|
||||
if (!list2.test(100))
|
||||
{
|
||||
Info<< "100 is off (original)" << nl;
|
||||
}
|
||||
|
||||
if (wrapper(1))
|
||||
if (wrapper.test(1))
|
||||
{
|
||||
Info<< "1 is on (wrapped)" << nl;
|
||||
}
|
||||
if (!wrapper(2))
|
||||
if (!wrapper.test(2))
|
||||
{
|
||||
Info<< "2 is off (wrapped)" << nl;
|
||||
}
|
||||
|
||||
@ -72,13 +72,13 @@ public:
|
||||
// Member Functions
|
||||
|
||||
//- Is empty
|
||||
bool empty() const
|
||||
bool empty() const noexcept
|
||||
{
|
||||
return bits_.empty() && bools_.empty();
|
||||
}
|
||||
|
||||
//- Size
|
||||
label size() const
|
||||
label size() const noexcept
|
||||
{
|
||||
return bits_.size() + bools_.size();
|
||||
}
|
||||
@ -93,7 +93,7 @@ public:
|
||||
bool operator()(const label i) const
|
||||
{
|
||||
// Can also use test(i) etc...
|
||||
return bits_(i) || bools_(i);
|
||||
return bits_.test(i) || bools_.test(i);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -43,7 +43,7 @@ void print(const boolVector& v)
|
||||
<< " any:" << Switch::name(v.any())
|
||||
<< " all:" << Switch::name(v.all())
|
||||
<< " none:" << Switch::name(v.none())
|
||||
<< " count:" << v.count() << nl;
|
||||
<< " on:" << v.count() << " off:" << v.count(false) << nl;
|
||||
}
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ int main(int argc, char *argv[])
|
||||
Info<< nl;
|
||||
|
||||
{
|
||||
boolVector vec{1, 0, 1};
|
||||
boolVector vec(1, 0, 1);
|
||||
print(vec);
|
||||
|
||||
vec.flip();
|
||||
|
||||
@ -34,7 +34,6 @@ Description
|
||||
#include "line.H"
|
||||
#include "Random.H"
|
||||
#include "treeBoundBox.H"
|
||||
#include "cellModel.H"
|
||||
#include "bitSet.H"
|
||||
#include "HashSet.H"
|
||||
#include "ListOps.H"
|
||||
@ -59,8 +58,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
#include "setRootCase.H"
|
||||
|
||||
Info<<"boundBox faces: " << boundBox::faces << nl
|
||||
<<"hex faces: " << cellModel::ref(cellModel::HEX).modelFaces() << nl
|
||||
Info<<"boundBox faces: " << boundBox::hexFaces() << nl
|
||||
<<"tree-bb faces: " << treeBoundBox::faces << nl
|
||||
<<"tree-bb edges: " << treeBoundBox::edges << endl;
|
||||
|
||||
@ -113,10 +111,8 @@ int main(int argc, char *argv[])
|
||||
Info<<"enclose point " << pt << " -> " << bb << endl;
|
||||
|
||||
// restart with same points
|
||||
bb = boundBox::invertedBox;
|
||||
bb.add(point(1,1,1));
|
||||
bb.add(point::zero);
|
||||
bb.add(point(0,1.5,0.5));
|
||||
bb.reset(point::zero);
|
||||
bb.add(point(1,1,1), point(0,1.5,0.5));
|
||||
bb.add(point(5,2,-2));
|
||||
|
||||
Info<<"repeated " << bb << endl;
|
||||
|
||||
3
applications/test/boundBox2/Make/files
Normal file
3
applications/test/boundBox2/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
Test-boundBox2.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-boundBox2
|
||||
235
applications/test/boundBox2/Test-boundBox2.C
Normal file
235
applications/test/boundBox2/Test-boundBox2.C
Normal file
@ -0,0 +1,235 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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/>.
|
||||
|
||||
Description
|
||||
Test bounding box behaviour
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
#include "Time.H"
|
||||
#include "polyMesh.H"
|
||||
#include "line.H"
|
||||
#include "Random.H"
|
||||
#include "treeBoundBox.H"
|
||||
#include "bitSet.H"
|
||||
#include "HashSet.H"
|
||||
#include "ListOps.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
//- simple helper to create a cube, given lower corner and width
|
||||
boundBox cube(scalar start, scalar width)
|
||||
{
|
||||
return boundBox
|
||||
(
|
||||
point::uniform(start),
|
||||
point::uniform(start + width)
|
||||
);
|
||||
}
|
||||
|
||||
//- simple helper to create a cube, given mid-point and width
|
||||
boundBox cubeAt(const point& mid, scalar width)
|
||||
{
|
||||
boundBox bb(mid);
|
||||
bb.grow(0.5*width);
|
||||
|
||||
return bb;
|
||||
}
|
||||
|
||||
|
||||
word faceName(direction whichFace)
|
||||
{
|
||||
switch (whichFace)
|
||||
{
|
||||
case treeBoundBox::LEFT : return "-x";
|
||||
case treeBoundBox::RIGHT : return "+x";
|
||||
|
||||
case treeBoundBox::BOTTOM : return "-y";
|
||||
case treeBoundBox::TOP : return "+y";
|
||||
|
||||
case treeBoundBox::BACK : return "-z";
|
||||
case treeBoundBox::FRONT : return "+z";
|
||||
}
|
||||
|
||||
return "??";
|
||||
}
|
||||
|
||||
|
||||
word octantName(direction octant)
|
||||
{
|
||||
word str("-x-y-z");
|
||||
|
||||
if (octant & treeBoundBox::RIGHTHALF)
|
||||
{
|
||||
str[0] = '+';
|
||||
}
|
||||
if (octant & treeBoundBox::TOPHALF)
|
||||
{
|
||||
str[2] = '+';
|
||||
}
|
||||
if (octant & treeBoundBox::FRONTHALF)
|
||||
{
|
||||
str[4] = '+';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
void testOverlaps(const treeBoundBox& bb, const treeBoundBox& searchBox)
|
||||
{
|
||||
FixedList<bool, 8> overlaps;
|
||||
|
||||
for (direction octant = 0; octant < 8; ++octant)
|
||||
{
|
||||
overlaps[octant] = bb.subOverlaps(octant, searchBox);
|
||||
}
|
||||
|
||||
Info<< "box " << bb << " and " << searchBox << nl;
|
||||
|
||||
Info<< "overlaps any:" << bb.overlaps(searchBox)
|
||||
<< " octants: " << overlaps << nl;
|
||||
}
|
||||
|
||||
|
||||
void testOverlaps
|
||||
(
|
||||
const treeBoundBox& bb,
|
||||
const point& sample,
|
||||
const scalar nearestDistSqr
|
||||
)
|
||||
{
|
||||
FixedList<bool, 8> overlaps;
|
||||
|
||||
for (direction octant = 0; octant < 8; ++octant)
|
||||
{
|
||||
overlaps[octant] = bb.subOverlaps(octant, sample, nearestDistSqr);
|
||||
}
|
||||
|
||||
Info<< "box " << bb << " and "
|
||||
<< sample << " distSqr:" << nearestDistSqr << nl;
|
||||
|
||||
Info<< "overlaps any:" << bb.overlaps(sample, nearestDistSqr)
|
||||
<< " octants: " << overlaps << nl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "setRootCase.H"
|
||||
|
||||
treeBoundBox bb(cube(0, 1));
|
||||
treeBoundBox sub(cube(0.1, 0.8));
|
||||
|
||||
Info<< nl
|
||||
<< "box: " << bb << nl;
|
||||
|
||||
Info<< nl;
|
||||
for (direction octant = 0; octant < 8; ++octant)
|
||||
{
|
||||
Info<< "octant:" << octant
|
||||
<< " (" << octantName(octant) << ") = "
|
||||
<< bb.subBbox(octant) << nl;
|
||||
}
|
||||
|
||||
Info<< nl;
|
||||
for (direction facei = 0; facei < 6; ++facei)
|
||||
{
|
||||
Info<< "sub-half:" << facei
|
||||
<< " (" << faceName(facei) << ") = "
|
||||
<< bb.subHalf(facei) << nl;
|
||||
}
|
||||
|
||||
Info<< nl;
|
||||
for (direction octant = 0; octant < 8; ++octant)
|
||||
{
|
||||
const point pt = sub.corner(octant);
|
||||
const direction subOctant = bb.subOctant(pt);
|
||||
|
||||
Info<< "point:" << pt
|
||||
<< " in octant " << subOctant
|
||||
<< " sub-box: " << bb.subBbox(subOctant) << nl;
|
||||
}
|
||||
|
||||
for (const scalar dist : {0.1})
|
||||
{
|
||||
Info<< nl;
|
||||
for (direction octant = 0; octant < 8; ++octant)
|
||||
{
|
||||
treeBoundBox searchBox(cubeAt(bb.corner(octant), dist));
|
||||
testOverlaps(bb, searchBox);
|
||||
}
|
||||
|
||||
Info<< nl;
|
||||
for (direction facei = 0; facei < 6; ++facei)
|
||||
{
|
||||
treeBoundBox searchBox(cubeAt(bb.faceCentre(facei), dist));
|
||||
testOverlaps(bb, searchBox);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
treeBoundBox largerBox(bb);
|
||||
largerBox.grow(0.2);
|
||||
|
||||
// Checking at corners,
|
||||
// larger by 0.2 in three directions: radius = 0.3464
|
||||
|
||||
for (const scalar dist : {0.1, 0.35})
|
||||
{
|
||||
const scalar distSqr = sqr(dist);
|
||||
|
||||
Info<< nl;
|
||||
for (direction octant = 0; octant < 8; ++octant)
|
||||
{
|
||||
testOverlaps(bb, largerBox.corner(octant), distSqr);
|
||||
}
|
||||
}
|
||||
|
||||
// Checking at face centres,
|
||||
// larger by 0.2 in a single direction
|
||||
|
||||
for (const scalar dist : {0.1, 0.25})
|
||||
{
|
||||
const scalar distSqr = sqr(dist);
|
||||
|
||||
Info<< nl;
|
||||
for (direction facei = 0; facei < 6; ++facei)
|
||||
{
|
||||
testOverlaps(bb, largerBox.faceCentre(facei), distSqr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Info<< nl << "End" << nl << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -59,7 +59,7 @@ void basicTests(const coordinateSystem& cs)
|
||||
{
|
||||
cs.writeEntry(cs.name(), Info);
|
||||
|
||||
if ((const auto* cartptr = isA<coordSystem::cartesian>(cs)) != nullptr)
|
||||
if (const auto* cartptr = isA<coordSystem::cartesian>(cs))
|
||||
{
|
||||
if (!cartptr->valid())
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -67,7 +67,7 @@ int main(int argc, char *argv[])
|
||||
Info<<"collapse? -> " << e4.collapse() << endl;
|
||||
printInfo(e4);
|
||||
|
||||
Info<< e3 << " connects " << e2 << " => " << e2.connects(e3) << endl;
|
||||
Info<< e3 << " connects " << e2 << " => " << e2.connected(e3) << endl;
|
||||
|
||||
labelPair labels(e3);
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -33,6 +33,7 @@ Description
|
||||
|
||||
#include "argList.H"
|
||||
#include "labelledTri.H"
|
||||
#include "edge.H"
|
||||
#include "faceList.H"
|
||||
#include "triFaceList.H"
|
||||
#include "pointList.H"
|
||||
@ -131,10 +132,25 @@ int main(int argc, char *argv[])
|
||||
testSign(f1, points2, testPoints);
|
||||
Info<< nl;
|
||||
|
||||
triFace t1({1, 2, 3});
|
||||
// Initializer list
|
||||
// triFace t1({1, 2, 3});
|
||||
|
||||
// Component-wise
|
||||
{
|
||||
edge e1(3, 2, 1); // Inadvertent sort!!!
|
||||
Info<< "edge:" << e1 << nl;
|
||||
}
|
||||
|
||||
// Component-wise
|
||||
triFace t1(1, 2, 3);
|
||||
Info<< "triFace:"; faceInfo(t1, points1); Info << nl;
|
||||
testSign(t1, points1, testPoints);
|
||||
|
||||
{
|
||||
scalarField fld({0, 20, 20, 30});
|
||||
Info<< "avg:" << t1.average(pointField::null(), fld) << nl;
|
||||
}
|
||||
|
||||
Info<< "triFace:"; faceInfo(t1, points2); Info << nl;
|
||||
testSign(t1, points2, testPoints);
|
||||
Info<< nl;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -53,20 +53,17 @@ int main(int argc, char *argv[])
|
||||
const polyMesh::cellDecomposition decompMode = polyMesh::CELL_TETS;
|
||||
|
||||
treeBoundBox meshBb(mesh.bounds());
|
||||
treeBoundBox shiftedBb(meshBb);
|
||||
|
||||
// Calculate typical cell related size to shift bb by.
|
||||
scalar typDim = meshBb.avgDim()/(2.0*Foam::cbrt(scalar(mesh.nCells())));
|
||||
|
||||
treeBoundBox shiftedBb
|
||||
(
|
||||
meshBb.min(),
|
||||
meshBb.max() + vector(typDim, typDim, typDim)
|
||||
);
|
||||
shiftedBb.max() += vector::uniform(typDim);
|
||||
|
||||
Info<< "Mesh" << endl;
|
||||
Info<< " bounding box : " << meshBb << endl;
|
||||
Info<< " bounding box (shifted) : " << shiftedBb << endl;
|
||||
Info<< " typical dimension : " << shiftedBb.typDim() << endl;
|
||||
Info<< " typical dimension : " << shiftedBb.avgDim() << endl;
|
||||
|
||||
Info<< "Initialised mesh in "
|
||||
<< runTime.cpuTimeIncrement() << " s" << endl;
|
||||
|
||||
@ -67,17 +67,10 @@ int main(int argc, char *argv[])
|
||||
treeBoundBox bb(efem.points());
|
||||
bb.grow(ROOTVSMALL);
|
||||
|
||||
labelList allEdges(identity(efem.edges().size()));
|
||||
|
||||
indexedOctree<treeDataEdge> edgeTree
|
||||
(
|
||||
treeDataEdge
|
||||
(
|
||||
false, // cachebb
|
||||
efem.edges(), // edges
|
||||
efem.points(), // points
|
||||
allEdges // selected edges
|
||||
),
|
||||
treeDataEdge(efem.edges(), efem.points()), // All edges
|
||||
|
||||
bb, // bb
|
||||
8, // maxLevel
|
||||
10, // leafsize
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2206 |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user