Compare commits

..

1 Commits

Author SHA1 Message Date
54dcde5f9a INT: compressibleInterFoam: assimilate DyM solver
Based on changes from openfoam.org
2024-05-01 16:44:42 +01:00
553 changed files with 4757 additions and 23046 deletions

View File

@ -49,10 +49,10 @@
<!--
Providing details of your set-up can help us identify any issues, e.g.
OpenFOAM version : v2406|v2312|v2306|v2212|v2206 etc
Operating system : ubuntu|openSUSE|RedHat etc
OpenFOAM version : v2312|v2306|v2212|v2206|v2112 etc
Operating system : ubuntu|openSUSE|centos etc
Hardware info : any info that may help?
Compiler : gcc|clang etc
Compiler : gcc|intel|clang etc
-->
- OpenFOAM version :

9
.gitmodules vendored
View File

@ -1,8 +1,8 @@
[submodule "cfmesh"]
path = plugins/cfmesh
path = modules/cfmesh
url = https://develop.openfoam.com/Community/integration-cfmesh.git
[submodule "avalanche"]
path = plugins/avalanche
path = modules/avalanche
url = https://develop.openfoam.com/Community/avalanche.git
[submodule "adios"]
path = modules/adios
@ -18,8 +18,5 @@
path = modules/external-solver
url = https://develop.openfoam.com/Modules/external-solver.git
[submodule "turbulence-community"]
path = plugins/turbulence-community
path = modules/turbulence-community
url = https://gitlab.com/openfoam/community/tc-turbulence/turbulence-community.git
[submodule "plugins/data-community"]
path = plugins/data-community
url = https://gitlab.com/openfoam/community/sig-data-modelling/data-community.git

View File

@ -1,2 +1,2 @@
api=2406
patch=0
api=2402
patch=240220

View File

@ -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-v2406 version:
For example, for the OpenFOAM-v2312 version:
```
source /installation/path/OpenFOAM-v2406/etc/bashrc
source /installation/path/OpenFOAM-v2312/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-v2406
\-- ThirdParty-v2406
|-- OpenFOAM-v2312
\-- ThirdParty-v2312
```
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-sandbox2406, etc..
directory name, e.g. openfoam-sandbox2312, 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*, `v2406-myCustom`,
* allows for an updated value of VERSION, *eg*, `v2312-myCustom`,
without requiring a renamed ThirdParty. The API value would still
be `2406` and the original `ThirdParty-v2406/` would be found.
be `2312` and the original `ThirdParty-v2312/` would be found.
4. PREFIX/ThirdParty-API
* same as the previous example, but using an unadorned API value.
5. PREFIX/ThirdParty-common
@ -213,4 +213,4 @@ ThirdParty directory will contain either an `Allwmake` file or a
- [Governance](http://www.openfoam.com/governance/), [Governance Projects](https://www.openfoam.com/governance/projects)
- [Contacting OpenCFD](http://www.openfoam.com/contact/)
Copyright 2016-2024 OpenCFD Ltd
Copyright 2016-2023 OpenCFD Ltd

View File

@ -21,11 +21,6 @@
+ fvOptions(rho, he)
);
if (MRF.active())
{
EEqn += fvc::div(MRF.phi(), p);
}
EEqn.relax();
fvOptions.constrain(EEqn);

View File

@ -20,11 +20,6 @@
fvOptions(rho, he)
);
if (MRF.active())
{
EEqn += fvc::div(MRF.phi(), p);
}
EEqn.relax();
fvOptions.constrain(EEqn);

View File

@ -14,11 +14,6 @@
fvOptions(rho, he)
);
if (MRF.active())
{
EEqn += fvc::div(MRF.phi(), p);
}
EEqn.relax();
fvOptions.constrain(EEqn);

View File

@ -9,11 +9,6 @@
fvOptions(rho, e)
);
if (MRF.active())
{
EEqn += fvc::div(MRF.phi(), p);
}
EEqn.relax();
fvOptions.constrain(EEqn);

View File

@ -7,7 +7,6 @@ wclean libso surfaceTensionModels
wclean libso VoFphaseCompressibleTurbulenceModels
wclean
wclean compressibleInterDyMFoam
wclean compressibleInterFilmFoam
wclean compressibleInterIsoFoam

View File

@ -8,7 +8,6 @@ wmake $targetType surfaceTensionModels
wmake $targetType VoFphaseCompressibleTurbulenceModels
wmake $targetType
wmake $targetType compressibleInterDyMFoam
wmake $targetType compressibleInterFilmFoam
wmake $targetType compressibleInterIsoFoam
wmake $targetType overCompressibleInterDyMFoam

View File

@ -1,21 +1,25 @@
EXE_INC = \
-I../VoF \
-ItwoPhaseMixtureThermo \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-IVoFphaseCompressibleTurbulenceModels/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
-IVoFphaseCompressibleTurbulenceModels/lnInclude
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-ldynamicMesh \
-ldynamicFvMesh \
-ltwoPhaseMixtureThermo \
-ltwoPhaseSurfaceTension \
-lcompressibleTransportModels \

View File

@ -1,3 +0,0 @@
compressibleInterDyMFoam.C
EXE = $(FOAM_APPBIN)/compressibleInterDyMFoam

View File

@ -1,35 +0,0 @@
EXE_INC = \
-I.. \
-I../../VoF \
-I../twoPhaseMixtureThermo \
-I../VoFphaseCompressibleTurbulenceModels/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-ltwoPhaseMixtureThermo \
-ltwoPhaseSurfaceTension \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \
-ltwoPhaseMixture \
-ltwoPhaseProperties \
-linterfaceProperties \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-lthermoTools \
-lVoFphaseCompressibleTurbulenceModels \
-ldynamicMesh \
-ldynamicFvMesh

View File

@ -1,43 +0,0 @@
volScalarField::Internal Sp
(
IOobject
(
"Sp",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar(dgdt.dimensions(), Zero)
);
volScalarField::Internal Su
(
IOobject
(
"Su",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar(dgdt.dimensions(), Zero)
);
forAll(dgdt, celli)
{
if (dgdt[celli] > 0.0 && alpha1[celli] > 0.0)
{
Sp[celli] -= dgdt[celli]*alpha1[celli];
Su[celli] += dgdt[celli]*alpha1[celli];
}
else if (dgdt[celli] < 0.0 && alpha1[celli] < 1.0)
{
Sp[celli] += dgdt[celli]*(1.0 - alpha1[celli]);
}
}
volScalarField::Internal divU
(
mesh.moving()
? fvc::div(phiCN() + mesh.phi())
: fvc::div(phiCN())
);

View File

@ -1,190 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019 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
compressibleInterDyMFoam
Description
Solver for two compressible, non-isothermal immiscible fluids using a VOF
(volume of fluid) phase-fraction based interface capturing approach,
with optional mesh motion and mesh topology changes including adaptive
re-meshing.
The momentum and other fluid properties are of the "mixture" and a single
momentum equation is solved.
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "CMULES.H"
#include "EulerDdtScheme.H"
#include "localEulerDdtScheme.H"
#include "CrankNicolsonDdtScheme.H"
#include "subCycle.H"
#include "compressibleInterPhaseTransportModel.H"
#include "pimpleControl.H"
#include "fvOptions.H"
#include "CorrectPhi.H"
#include "fvcSmooth.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
argList::addNote
(
"Solver for two compressible, non-isothermal immiscible fluids"
" using VOF phase-fraction based interface capturing.\n"
"With optional mesh motion and mesh topology changes including"
" adaptive re-meshing."
);
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "initContinuityErrs.H"
#include "createDyMControls.H"
#include "createFields.H"
#include "createUf.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
volScalarField& p = mixture.p();
volScalarField& T = mixture.T();
const volScalarField& psi1 = mixture.thermo1().psi();
const volScalarField& psi2 = mixture.thermo2().psi();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readDyMControls.H"
// Store divU and divUp from the previous mesh so that it can be mapped
// and used in correctPhi to ensure the corrected phi has the
// same divergence
volScalarField divU("divU0", fvc::div(fvc::absolute(phi, U)));
volScalarField divUp("divUp", fvc::div(fvc::absolute(phi, U), p));
if (LTS)
{
#include "setRDeltaT.H"
}
else
{
#include "CourantNo.H"
#include "alphaCourantNo.H"
#include "setDeltaT.H"
}
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
if (pimple.firstIter() || moveMeshOuterCorrectors)
{
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
mesh.update();
if (mesh.changing())
{
MRF.update();
Info<< "Execution time for mesh.update() = "
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
<< " s" << endl;
gh = (g & mesh.C()) - ghRef;
ghf = (g & mesh.Cf()) - ghRef;
}
if ((mesh.changing() && correctPhi))
{
// Calculate absolute flux from the mapped surface velocity
phi = mesh.Sf() & Uf;
#include "correctPhi.H"
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
mixture.correct();
}
if (mesh.changing() && checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
}
#include "alphaControls.H"
#include "compressibleAlphaEqnSubCycle.H"
turbulence.correctPhasePhi();
#include "UEqn.H"
#include "TEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{
#include "pEqn.H"
}
if (pimple.turbCorr())
{
turbulence.correct();
}
}
rho = alpha1*rho1 + alpha2*rho2;
// Correct p_rgh for consistency with p and the updated densities
p_rgh = p - rho*gh;
p_rgh.correctBoundaryConditions();
runTime.write();
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,145 +0,0 @@
{
volScalarField rAU("rAU", 1.0/UEqn.A());
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::flux(HbyA)
+ MRF.zeroFilter(fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, Uf))
);
MRF.makeRelative(phiHbyA);
surfaceScalarField phig
(
(
mixture.surfaceTensionForce()
- ghf*fvc::snGrad(rho)
)*rAUf*mesh.magSf()
);
phiHbyA += phig;
// Update the pressure BCs to ensure flux consistency
constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF);
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phiHbyA, U);
tmp<fvScalarMatrix> p_rghEqnComp1;
tmp<fvScalarMatrix> p_rghEqnComp2;
if (pimple.transonic())
{
#include "rhofs.H"
surfaceScalarField phid1("phid1", fvc::interpolate(psi1)*phi);
surfaceScalarField phid2("phid2", fvc::interpolate(psi2)*phi);
p_rghEqnComp1 =
pos(alpha1)
*(
(
fvc::ddt(alpha1, rho1) + fvc::div(alphaPhi1*rho1f)
- (fvOptions(alpha1, mixture.thermo1().rho())&rho1)
)/rho1
- fvc::ddt(alpha1) - fvc::div(alphaPhi1)
+ (alpha1/rho1)
*correction
(
psi1*fvm::ddt(p_rgh)
+ fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh)
)
);
p_rghEqnComp1.ref().relax();
p_rghEqnComp2 =
pos(alpha2)
*(
(
fvc::ddt(alpha2, rho2) + fvc::div(alphaPhi2*rho2f)
- (fvOptions(alpha2, mixture.thermo2().rho())&rho2)
)/rho2
- fvc::ddt(alpha2) - fvc::div(alphaPhi2)
+ (alpha2/rho2)
*correction
(
psi2*fvm::ddt(p_rgh)
+ fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh)
)
);
p_rghEqnComp2.ref().relax();
}
else
{
p_rghEqnComp1 =
fvc::ddt(rho1) + psi1*correction(fvm::ddt(p_rgh))
+ fvc::div(phi, rho1) - fvc::Sp(fvc::div(phi), rho1);
p_rghEqnComp2 =
fvc::ddt(rho2) + psi2*correction(fvm::ddt(p_rgh))
+ fvc::div(phi, rho2) - fvc::Sp(fvc::div(phi), rho2);
}
// Cache p_rgh prior to solve for density update
volScalarField p_rgh_0(p_rgh);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix p_rghEqnIncomp
(
fvc::div(phiHbyA)
- fvm::laplacian(rAUf, p_rgh)
);
solve
(
(
(max(alpha1, scalar(0))/rho1)*p_rghEqnComp1()
+ (max(alpha2, scalar(0))/rho2)*p_rghEqnComp2()
)
+ p_rghEqnIncomp,
p_rgh.select(pimple.finalInnerIter())
);
if (pimple.finalNonOrthogonalIter())
{
p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
p_rgh = p - (alpha1*rho1 + alpha2*rho2)*gh;
dgdt =
(
pos(alpha2)*(p_rghEqnComp2 & p_rgh)/rho2
- pos(alpha1)*(p_rghEqnComp1 & p_rgh)/rho1
);
phi = phiHbyA + p_rghEqnIncomp.flux();
U = HbyA
+ rAU*fvc::reconstruct((phig + p_rghEqnIncomp.flux())/rAUf);
U.correctBoundaryConditions();
fvOptions.correct(U);
}
}
{
Uf = fvc::interpolate(U);
surfaceVectorField n(mesh.Sf()/mesh.magSf());
Uf += n*(fvc::absolute(phi, U)/mesh.magSf() - (n & Uf));
}
// Update densities from change in p_rgh
mixture.thermo1().correctRho(psi1*(p_rgh - p_rgh_0));
mixture.thermo2().correctRho(psi2*(p_rgh - p_rgh_0));
rho = alpha1*rho1 + alpha2*rho2;
// Correct p_rgh for consistency with p and the updated densities
p = max(p_rgh + rho*gh, pMin);
p_rgh = p - rho*gh;
p_rgh.correctBoundaryConditions();
K = 0.5*magSqr(U);
}

View File

@ -5,8 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) OpenCFD OpenCFD Ltd.
Copyright (C) 2011-2018 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -32,7 +32,9 @@ Group
Description
Solver for two compressible, non-isothermal immiscible fluids using a VOF
(volume of fluid) phase-fraction based interface capturing approach.
(volume of fluid) phase-fraction based interface capturing approach,
with optional mesh motion and mesh topology changes including adaptive
re-meshing.
The momentum and other fluid properties are of the "mixture" and a single
momentum equation is solved.
@ -45,6 +47,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "CMULES.H"
#include "EulerDdtScheme.H"
#include "localEulerDdtScheme.H"
@ -53,6 +56,7 @@ Description
#include "compressibleInterPhaseTransportModel.H"
#include "pimpleControl.H"
#include "fvOptions.H"
#include "CorrectPhi.H"
#include "fvcSmooth.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -70,30 +74,31 @@ int main(int argc, char *argv[])
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createTimeControls.H"
#include "createDynamicFvMesh.H"
#include "initContinuityErrs.H"
#include "createDyMControls.H"
#include "createFields.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
#include "createUfIfPresent.H"
volScalarField& p = mixture.p();
volScalarField& T = mixture.T();
const volScalarField& psi1 = mixture.thermo1().psi();
const volScalarField& psi2 = mixture.thermo2().psi();
if (!LTS)
{
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readTimeControls.H"
#include "readDyMControls.H"
// Store divU from the previous mesh so that it can be mapped
// and used in correctPhi to ensure the corrected phi has the
// same divergence
volScalarField divU("divU0", fvc::div(fvc::absolute(phi, U)));
if (LTS)
{
@ -113,6 +118,44 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
if (pimple.firstIter() || moveMeshOuterCorrectors)
{
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
mesh.update();
if (mesh.changing())
{
MRF.update();
Info<< "Execution time for mesh.update() = "
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
<< " s" << endl;
gh = (g & mesh.C()) - ghRef;
ghf = (g & mesh.Cf()) - ghRef;
if (correctPhi)
{
// Calculate absolute flux
// from the mapped surface velocity
phi = mesh.Sf() & Uf();
#include "correctPhi.H"
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
mixture.correct();
}
if (checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
}
}
#include "alphaControls.H"
#include "compressibleAlphaEqnSubCycle.H"

View File

@ -8,6 +8,4 @@ CorrectPhi
pimple
);
//***HGW phi.oldTime() = phi;
#include "continuityErrs.H"

View File

@ -6,7 +6,7 @@
(
"phiHbyA",
fvc::flux(HbyA)
+ MRF.zeroFilter(fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi))
+ MRF.zeroFilter(fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi, Uf))
);
MRF.makeRelative(phiHbyA);
@ -23,6 +23,9 @@
// Update the pressure BCs to ensure flux consistency
constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF);
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phiHbyA, U);
tmp<fvScalarMatrix> p_rghEqnComp1;
tmp<fvScalarMatrix> p_rghEqnComp2;
@ -34,8 +37,7 @@
surfaceScalarField phid2("phid2", fvc::interpolate(psi2)*phi);
p_rghEqnComp1 =
pos(alpha1)
*(
(
(
fvc::ddt(alpha1, rho1) + fvc::div(alphaPhi1*rho1f)
- (fvOptions(alpha1, mixture.thermo1().rho())&rho1)
@ -48,11 +50,9 @@
+ fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh)
)
);
p_rghEqnComp1.ref().relax();
p_rghEqnComp2 =
pos(alpha2)
*(
(
(
fvc::ddt(alpha2, rho2) + fvc::div(alphaPhi2*rho2f)
- (fvOptions(alpha2, mixture.thermo2().rho())&rho2)
@ -65,7 +65,6 @@
+ fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh)
)
);
p_rghEqnComp2.ref().relax();
}
else
{
@ -94,6 +93,21 @@
);
}
if (mesh.moving())
{
p_rghEqnComp1.ref() += fvc::div(mesh.phi())*alpha1;
p_rghEqnComp2.ref() += fvc::div(mesh.phi())*alpha2;
}
p_rghEqnComp1.ref() *= pos(alpha1);
p_rghEqnComp2.ref() *= pos(alpha2);
if (pimple.transonic())
{
p_rghEqnComp1.ref().relax();
p_rghEqnComp2.ref().relax();
}
// Cache p_rgh prior to solve for density update
volScalarField p_rgh_0(p_rgh);
@ -131,6 +145,9 @@
}
}
// Correct Uf if the mesh is moving
fvc::correctUf(Uf, U, fvc::absolute(phi, U));
// Update densities from change in p_rgh
mixture.thermo1().correctRho(psi1*(p_rgh - p_rgh_0));
mixture.thermo2().correctRho(psi2*(p_rgh - p_rgh_0));

View File

@ -130,17 +130,10 @@ int main(int argc, char *argv[])
}
}
}
#include "UEqn.H"
#include "YEqns.H"
#include "TEqn.H"
if (pimple.frozenFlow())
{
continue;
}
#include "UEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{

View File

@ -188,6 +188,8 @@ int main(int argc, char *argv[])
argList::addBoolOption("label", "Use label for tests (default)");
argList::addBoolOption("ref", "Test writing by ref");
#include "addTimeOptions.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createPolyMesh.H"
@ -278,6 +280,7 @@ int main(int argc, char *argv[])
{
IOFieldRef<vector>(ioOutput, mesh.points()).write();
}
}

View File

@ -1,3 +1,3 @@
Test-OCountStream.cxx
Test-OCountStream.C
EXE = $(FOAM_USER_APPBIN)/Test-OCountStream

View File

@ -65,11 +65,11 @@ int main(int argc, char *argv[])
OCountStream cnt;
OCharStream cstr;
OStringStream sstr;
OStringStream str;
ocountstream plain;
generateOutput(cstr);
generateOutput(sstr);
generateOutput(str);
generateOutput(cnt);
generateOutput(plain);
@ -77,7 +77,7 @@ int main(int argc, char *argv[])
Info<< "counter state: " << (cnt.stdStream().rdstate()) << nl
<< "via char-stream: " << label(cstr.view().size()) << " chars" << nl
<< "via string-stream: " << label(sstr.count()) << " chars" << nl
<< "via string-stream: " << str.str().size() << " chars" << nl
<< "via ocountstream: " << plain.count() << " chars" << endl;
fileName outputName;

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2022-2024 OpenCFD Ltd.
Copyright (C) 2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -32,14 +32,10 @@ Description
#include "IOstreams.H"
#include "OSspecific.H"
#include "argList.H"
#include "clock.H"
#include "Switch.H"
#include "ListOps.H"
using namespace Foam;
std::string time_stamp;
void listFiles(const fileName& dir)
{
wordList files = ListOps::create<word>
@ -59,150 +55,25 @@ void listFiles(const fileName& dir)
}
OSstream& printInfo(OFstream& os)
{
InfoErr
<< "open: " << os.name() << nl
<< "appending: " << Switch::name(os.is_appending())
<< " tellp: "<< os.stdStream().tellp()
<< " gz: " << Switch::name(os.compression()) << nl;
return InfoErr.stream();
}
void withHeader(OFstream& os)
{
const auto tellp = os.stdStream().tellp();
if (tellp <= 0)
{
InfoErr
<< "Add header" << nl;
os << "HEADER: " << time_stamp.c_str() << nl;
}
}
template<class OSstreamType>
void generateLines(OSstreamType& os, label count = 1)
{
for (label line = 1; line <= count; ++line)
{
os << "[" << line
<< "] =============================================" << nl;
}
}
template<class OSstreamType>
void generateContent
(
OSstreamType& os,
const bool with_seekend,
const bool test_overwrite = false,
const int64_t seek_out = -1
)
{
if (with_seekend)
{
os.stdStream().seekp(0, std::ios_base::end);
// OR? os.seek_end();
}
printInfo(os);
withHeader(os);
if (test_overwrite && seek_out >= 0)
{
InfoErr<< "... seekp(" << seek_out << ")" << nl;
auto& oss = os.stdStream();
// Actually std::streampos, but cannot increment that
int64_t pos(seek_out);
const int64_t tellp_end = oss.tellp();
if (pos >= 0 && pos < tellp_end)
{
InfoErr
<< "... fill from " << label(pos)
<< " to " << label(tellp_end) << nl;
oss.seekp(pos);
while (pos < tellp_end)
{
// Fill with char 'X', rely on streambuf buffering
oss << 'X';
++pos;
}
oss.seekp(seek_out);
os << "More content [at " << seek_out << ']' << endl;
}
}
generateLines(os, 4);
printInfo(os)
<< "... sleep" << endl;
listFiles(os.name().path());
sleep(2);
os << "[new content] +++++++++++++++++++++++++++++++++++" << endl;
}
template<class OSstreamType>
void generateOverwriteContent
(
OSstreamType& os,
const bool with_seekend,
const int64_t seek_out = -1
)
{
generateContent(os, with_seekend, true, seek_out);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
argList::addBoolOption("gz", "Use compression");
argList::addBoolOption("append-app", "Use append app mode");
argList::addBoolOption("append-ate", "Use append ate mode");
argList::addBoolOption("seekend", "Seek to end after non-append open");
argList::addOption("seek", "value", "Seek from start (default: 100)");
argList::addBoolOption("append", "Use append mode");
argList::addBoolOption("atomic", "Use atomic");
argList::addBoolOption("keep", "Do not remove test directory");
argList::addOption("write", "file", "test writing to file");
#include "setRootCase.H"
// Same time-stamp for all generated files
time_stamp = clock::dateTime();
const fileName baseDir("Test-OFstream-directory");
Foam::mkDir(baseDir);
InfoErr<< "mkdir: " << baseDir << endl;
Info<< "start:" << nl;
listFiles(baseDir);
const bool with_seekend = args.found("seekend");
const int seek_out = args.getOrDefault<int>("seek", 100);
IOstreamOption streamOpt;
if (args.found("gz"))
@ -212,11 +83,10 @@ int main(int argc, char *argv[])
IOstreamOption::appendType append =
(
args.found("append-app") ? IOstreamOption::APPEND_APP
: args.found("append-ate") ? IOstreamOption::APPEND_ATE
: IOstreamOption::NO_APPEND
args.found("append")
? IOstreamOption::APPEND
: IOstreamOption::NON_APPEND
);
IOstreamOption::atomicType atomic =
(
args.found("atomic")
@ -227,6 +97,7 @@ int main(int argc, char *argv[])
{
OFstream(baseDir/"dummy")() << "Some file content" << endl;
Foam::ln("dummy", baseDir/"Test2.txt");
Foam::ln("dummy", baseDir/"Test3.txt");
Foam::ln("dummy", baseDir/"Test4.txt");
Foam::ln("dummy", baseDir/"Test4.txt.gz");
@ -243,31 +114,16 @@ int main(int argc, char *argv[])
append
);
generateOverwriteContent(os, with_seekend, seek_out);
}
os << "=========================" << endl;
{
OFstream os
(
atomic,
baseDir/"Test1-app.txt",
streamOpt,
IOstreamOption::APPEND_APP
);
InfoErr<< "open: " << os.name() << endl;
InfoErr<< "... sleep" << endl;
generateOverwriteContent(os, with_seekend, seek_out);
}
listFiles(baseDir);
{
OFstream os
(
atomic,
baseDir/"Test1-ate.txt",
streamOpt,
IOstreamOption::APPEND_ATE
);
sleep(2);
generateOverwriteContent(os, with_seekend, seek_out);
os << "+++++++++++++++++++++++++++++++++++" << endl;
}
{
@ -276,21 +132,39 @@ int main(int argc, char *argv[])
atomic,
baseDir/"Test2.txt",
streamOpt
// NON_APPEND
);
generateContent(os, with_seekend);
}
os << "=========================" << endl;
InfoErr<< "open: " << os.name() << endl;
InfoErr<< "... sleep" << endl;
listFiles(baseDir);
sleep(2);
os << "+++++++++++++++++++++++++++++++++++" << endl;
}
{
OFstream os
(
atomic,
baseDir/"Test3.txt",
streamOpt,
IOstreamOption::APPEND_APP
IOstreamOption::APPEND
);
generateContent(os, with_seekend, with_seekend);
os << "=========================" << endl;
InfoErr<< "open: " << os.name() << endl;
InfoErr<< "... sleep" << endl;
listFiles(baseDir);
sleep(2);
os << "+++++++++++++++++++++++++++++++++++" << endl;
}
{
OFstream os
@ -300,17 +174,35 @@ int main(int argc, char *argv[])
IOstreamOption::COMPRESSED
);
// No seekend with COMPRESSED
generateContent(os, false);
os << "=========================" << endl;
InfoErr<< "open: " << os.name() << endl;
InfoErr<< "... sleep" << endl;
listFiles(baseDir);
sleep(2);
os << "+++++++++++++++++++++++++++++++++++" << endl;
}
{
OFstream os
(
IOstreamOption::ATOMIC,
baseDir/"Test5.txt"
// ASCII UNCOMPRESSED NON_APPEND
);
generateContent(os, with_seekend);
os << "=========================" << endl;
InfoErr<< "open: " << os.name() << endl;
InfoErr<< "... sleep" << endl;
listFiles(baseDir);
sleep(2);
os << "+++++++++++++++++++++++++++++++++++" << endl;
}
Info<< nl << "done:" << endl;

View File

@ -201,6 +201,7 @@ using namespace Foam;
int main(int argc, char *argv[])
{
#include "addTimeOptions.H"
argList::addArgument("patch");
#include "setRootCase.H"
#include "createTime.H"

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2024 OpenCFD Ltd.
Copyright (C) 2017-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -24,7 +24,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
Test-checkDecomposePar
checkDecomposePar
Group
grpParallelUtilities
@ -35,9 +35,8 @@ Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "timeSelector.H"
#include "polyMesh.H"
#include "OSspecific.H"
#include "fvCFD.H"
#include "cpuTime.H"
#include "IFstream.H"
#include "regionProperties.H"
@ -45,14 +44,10 @@ Description
#include "decompositionInformation.H"
#include "decompositionModel.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
timeSelector::addOptions_singleTime(); // Single-time options
argList::addNote
(
"Check decomposition from kaffpa (KaHIP) output"
@ -70,6 +65,9 @@ int main(int argc, char *argv[])
argList::addArgument("kaffpa-output-file");
// Include explicit constant options, have zero from time range
timeSelector::addOptions(true, false);
#include "setRootCase.H"
const auto decompFile = args.get<fileName>(1);
@ -77,8 +75,8 @@ int main(int argc, char *argv[])
// Set time from database
#include "createTime.H"
// Allow override of time from specified time options, or no-op
timeSelector::setTimeIfPresent(runTime, args);
// Allow override of time
instantList times = timeSelector::selectIfPresent(runTime, args);
// Allow override of decomposeParDict location
const fileName decompDictFile =
@ -97,7 +95,7 @@ int main(int argc, char *argv[])
Info<< "\n\nDecomposing mesh " << regionName << nl << endl;
Info<< "Create mesh..." << flush;
polyMesh mesh
fvMesh mesh
(
IOobject
(
@ -113,7 +111,7 @@ int main(int argc, char *argv[])
Info<< " nCells = " << mesh.nCells() << endl;
// Expected format is a simple ASCII list
cellToProc.resize(mesh.nCells());
cellToProc.setSize(mesh.nCells());
{
IFstream is(decompFile);

View File

@ -123,7 +123,7 @@ int main(int argc, char *argv[])
);
Info<< testInput << nl;
auto args = stringOps::splitSpace(testInput);
SubStrings<string> args = stringOps::splitSpace(testInput);
Info<< "split into " << args.size() << " args" << nl;
CStringList inC(args);

View File

@ -0,0 +1,3 @@
Test-dimField.C
EXE = $(FOAM_USER_APPBIN)/Test-dimField

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020-2024 OpenCFD Ltd.
Copyright (C) 2020-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -24,7 +24,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
Test-dimField1
Test-dimField
Description
Simple tests for DimensionedField
@ -52,12 +52,7 @@ namespace Foam
int main(int argc, char *argv[])
{
argList::addBoolOption("write", "write some test fields");
#include "setRootCase.H"
const bool doWrite = args.found("write");
#include "createTime.H"
#include "createMesh.H"
@ -65,23 +60,19 @@ int main(int argc, char *argv[])
Info<< "Tensor field\n" << endl;
DimensionedField<tensor, volMesh> tensorfld
(
mesh.newIOobject
IOobject
(
"tensor",
{ IOobject::READ_IF_PRESENT, IOobject::NO_WRITE }
runTime.timeName(),
mesh,
{ IOobject::READ_IF_PRESENT, IOobject::NO_REGISTER }
),
mesh,
dimensioned<tensor>(dimless, tensor(1,2,3,4,5,6,7,8,9))
);
if (doWrite)
{
tensorfld.write();
}
Info<< nl;
Info().beginBlock("transformed") << tensorfld.T();
Info().beginBlock("transformed")
<< tensorfld.T() << nl;
Info().endBlock();
{
@ -93,8 +84,8 @@ int main(int argc, char *argv[])
dimensioned<scalar>(14)
);
Info<< nl;
Info().beginBlock(tfld().type()) << tfld;
Info().beginBlock(tfld().type())
<< tfld << nl;
Info().endBlock();
}
@ -107,8 +98,8 @@ int main(int argc, char *argv[])
dimensioned<scalar>(5)
);
Info<< nl;
Info().beginBlock(tfld().type()) << tfld();
Info().beginBlock(tfld().type())
<< tfld() << nl;
Info().endBlock();
// From dissimilar types
@ -120,8 +111,8 @@ int main(int argc, char *argv[])
dimensioned<vector>(Zero)
);
Info<< nl;
Info().beginBlock(tfld2().type()) << tfld2();
Info().beginBlock(tfld2().type())
<< tfld2() << nl;
Info().endBlock();
}
}
@ -131,13 +122,20 @@ int main(int argc, char *argv[])
Info<< "uint8 field\n" << endl;
DimensionedField<uint8_t, volMesh> statefld
(
mesh.newIOobject("state")
IOobject
(
"state",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensioned<uint8_t>(dimless, uint8_t{100})
);
Info<< nl;
Info().beginBlock("stateField") << statefld;
Info().beginBlock("stateField")
<< statefld << nl;
Info().endBlock();
}
#endif

View File

@ -1,3 +0,0 @@
Test-dimField1.cxx
EXE = $(FOAM_USER_APPBIN)/Test-dimField1

View File

@ -0,0 +1,3 @@
Test-ensightFile.C
EXE = $(FOAM_USER_APPBIN)/Test-ensightFile

View File

@ -0,0 +1,8 @@
EXE_INC = \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/conversion/lnInclude
EXE_LIBS = \
-lmeshTools \
-lconversion

View File

@ -24,10 +24,10 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
Test-ensightFileName
Test-ensightFile
Description
Check cleanup of ensight file and variable names
check cleanup of ensight file and variable names
\*---------------------------------------------------------------------------*/

View File

@ -1,3 +0,0 @@
Test-ensightFile1.cxx
EXE = $(FOAM_USER_APPBIN)/Test-ensightFile1

View File

@ -1,5 +0,0 @@
EXE_INC = \
-I$(LIB_SRC)/fileFormats/lnInclude
EXE_LIBS = \
-lfileFormats

View File

@ -1,137 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2024 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-ensightFile
Description
check cleanup of ensight file and variable names
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "ensightFile.H"
#include "ensightGeoFile.H"
#include "Switch.H"
#include "IOstreams.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
argList::noBanner();
argList::noParallel();
argList::addBoolOption("ascii", "open as ascii instead of binary");
argList::addBoolOption("binary", "(default)");
argList::addBoolOption("clear", "force clear of time-steps");
argList::addBoolOption("no-end", "skip use of endTimeStep");
argList::addBoolOption("append", "open in append mode");
argList::addOption("geom", "geometry file");
argList::addOption("field", "field file");
#include "setRootCase.H"
const bool with_ascii = args.found("ascii") && !args.found("binary");
// const bool with_binary = args.found("binary");
const bool with_append = args.found("append");
const bool with_clear = args.found("clear");
const bool without_end = args.found("no-end");
const IOstreamOption::streamFormat fmt =
(
with_ascii
? IOstreamOption::ASCII
: IOstreamOption::BINARY
);
const IOstreamOption::appendType append =
(
with_append
? IOstreamOption::APPEND_ATE
: IOstreamOption::NO_APPEND
);
fileName file;
if (args.readIfPresent("geom", file))
{
Info<< "Open " << file << " as geometry "
<< " format:" << (with_ascii ? "ASCII" : "BINARY")
<< " append:" << Switch::name(with_append) << nl;
ensightGeoFile ensFile(append, file, fmt);
if (append)
{
ensFile.beginTimeStep();
// At the moment need to pair begin/end time-step calls
if (!without_end)
{
ensFile.endTimeStep();
}
}
if (with_clear)
{
ensFile.clearTimeSteps();
}
}
if (args.readIfPresent("field", file))
{
Info<< "Open " << file << " as field"
<< " format:" << (with_ascii ? "ASCII" : "BINARY")
<< " append:" << Switch::name(with_append) << nl;
ensightFile ensFile(append, file, fmt);
if (append)
{
ensFile.beginTimeStep();
// At the moment need to pair begin/end time-step calls
if (!without_end)
{
ensFile.endTimeStep();
}
}
if (with_clear)
{
ensFile.clearTimeSteps();
}
}
Info<< "\nEnd\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,3 +0,0 @@
Test-ensightFileName.cxx
EXE = $(FOAM_USER_APPBIN)/Test-ensightFileName

View File

@ -1,5 +0,0 @@
EXE_INC = \
-I$(LIB_SRC)/fileFormats/lnInclude
EXE_LIBS = \
-lfileFormats

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021-2024 OpenCFD Ltd.
Copyright (C) 2021-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -21,8 +21,6 @@ Description
#include "argList.H"
#include "IOstreams.H"
#include "ITstream.H"
#include "OTstream.H"
#include "SpanStream.H"
#include "exprValue.H"
#include "Pstream.H"
@ -36,41 +34,6 @@ void printInfo(const expressions::exprValue& val)
}
void write_read(const expressions::exprValue& val)
{
OCharStream os;
os << val;
ISpanStream is(os.view());
expressions::exprValue val2;
is >> val2;
Pout<< "wrote " << os.count() << " chars: " << os.str() << nl;
printInfo(val);
printInfo(val2);
Pout<< "====" << nl;
}
tokenList tokens_of(const expressions::exprValue& val)
{
OTstream toks;
toks << val;
Pout<< "val with tokens: ";
toks.writeList(Pout, 0) << nl;
for (const auto& t : toks)
{
Pout<< " " << t.info() << nl;
}
Pout<< nl;
return toks;
}
expressions::exprValue tryParse(const std::string& str)
{
expressions::exprValue val, val2;
@ -127,7 +90,6 @@ int main(int argc, char *argv[])
{
expressions::exprValue value;
tokenList toks;
Info<< "exprValue"
<< " sizeof:" << value.size_bytes()
@ -137,31 +99,21 @@ int main(int argc, char *argv[])
// Nothing
printInfo(value);
toks = tokens_of(value);
write_read(value);
value.set(scalar(100));
printInfo(value); write_read(value); toks = tokens_of(value);
value.set(scalar(100.01));
printInfo(value); write_read(value); toks = tokens_of(value);
printInfo(value);
value.set(vector(1,2,3));
printInfo(value); write_read(value); toks = tokens_of(value);
printInfo(value);
value = vector(4,5,6);
printInfo(value); write_read(value); toks = tokens_of(value);
printInfo(value);
value = Zero;
printInfo(value); write_read(value); toks = tokens_of(value);
printInfo(value);
value.clear();
printInfo(value); write_read(value); toks = tokens_of(value);
value.set<bool>(true);
printInfo(value);
printInfo(value); write_read(value); toks = tokens_of(value);
if (UPstream::parRun())
{

View File

@ -1,3 +1,5 @@
exprValueFieldTag.cxx
Test-exprValue2.cxx
EXE = $(FOAM_USER_APPBIN)/Test-exprValue2

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2023-2024 OpenCFD Ltd.
Copyright (C) 2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -36,6 +36,7 @@ Description
#include "vectorField.H"
#include "DynamicList.H"
#include "Random.H"
#include "exprValue.H"
#include "exprValueFieldTag.H"
using namespace Foam;
@ -60,81 +61,27 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
DynamicList<fieldTag> allTags;
{
scalarField fld1(20);
scalarField fld2a(20, Zero);
scalarField fld2b(10, 3.10);
scalarField fld3;
for (auto& val : fld1)
forAll(fld1, i)
{
val = rnd.position<scalar>(0, 20);
}
if (!UPstream::master())
{
fld2b.resize(5);
fld2b *= 2;
fld1[i] = rnd.position<scalar>(0, 20);
}
fieldTag tag1(fld1.begin(), fld1.end());
fieldTag tag2a(fld2a.begin(), fld2a.end());
fieldTag tag2b(fld2b.begin(), fld2b.end());
fieldTag tag3(fld3.begin(), fld3.end());
fieldTag tag4(fld3.begin(), fld3.end());
printInfo(tag1) << nl;
printInfo(tag2a) << nl;
printInfo(tag2b) << nl;
printInfo(tag3) << nl;
{
Pout<< "Test reduce" << nl;
fieldTag work(fld2b.begin(), fld2b.end());
Pout<< "Before" << nl;
printInfo(work) << nl;
work.reduce();
Pout<< "After" << nl;
printInfo(work) << nl;
Pout<< "====" << nl;
}
allTags.clear();
allTags.push_back(tag1);
allTags.push_back(tag2a);
allTags.push_back(tag2b);
allTags.push_back(tag3);
allTags.push_back(tag4);
allTags.push_back(fieldTag::make_empty<tensor>());
// Add some other types
{
vectorField vfld2a(20, vector::uniform(1.23));
allTags.emplace_back
(
vfld2a.begin(),
vfld2a.end()
);
allTags.emplace_back(vector(1.01, 2.02, 3.03));
allTags.emplace_back(12.4);
allTags.emplace_back().set_value(vector::uniform(2.0));
allTags.back().set_empty();
}
Info<< "all tags: " << allTags << nl;
Foam::sort(allTags);
Info<< "sorted: " << allTags << nl;
fieldTag result;
result = fieldTag::combineOp{}(tag1, tag2a);

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2023-2024 OpenCFD Ltd.
Copyright (C) 2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,11 +27,11 @@ Class
Foam::expressions::exprValueFieldTag
Description
An expressions::exprValue (polymorphic typed union) with an additional
flag for tracking Field content as uniform etc.
A polymorphic single-value container for tracking Field content
as uniform etc.
SourceFiles
exprValueFieldTag.C
exprValueFieldTag.cxx
\*---------------------------------------------------------------------------*/
@ -39,7 +39,7 @@ SourceFiles
#define Foam_expressions_exprValueFieldTag_H
#include "exprValue.H"
#include "UList.H" // For ListPolicy
#include "List.H" // For ListPolicy
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,38 +54,20 @@ namespace expressions
class exprValueFieldTag
{
// Private Data
// Private data
//- Uniformity of field (0: empty, 1: uniform, 2: non-uniform, ...)
// Values as per internal enum Foam::Detail::ListPolicy::uniformity
//- Uniformity of field
int uniformity_{};
//- Representative (uniform) type/value for the field
//- Representative (uniform) value for the field
expressions::exprValue value_{};
public:
// Generated Methods
//- Default construct. Uniformity = empty, type = none
exprValueFieldTag() = default;
//- Copy construct
exprValueFieldTag(const exprValueFieldTag&) = default;
//- Copy assignment
exprValueFieldTag& operator=(const exprValueFieldTag&) = default;
// Constructors
//- Construct as uniform with the specified type/value
template<class Type>
explicit exprValueFieldTag(const Type& val)
{
set_value(val);
}
//- Default construct
exprValueFieldTag() = default;
//- Construct from a range of values
template<class Type>
@ -95,18 +77,6 @@ public:
}
// Factory Methods
//- Make an empty field tag with the specified type (zero-value)
template<class Type>
static exprValueFieldTag make_empty()
{
exprValueFieldTag tag; // construct empty, no type
tag.set_zero<Type>(); // set type and zero value
return tag;
}
// Member Functions
//- True if the uniformity is "empty"
@ -118,18 +88,9 @@ public:
//- True if the uniformity is "non-uniform"
bool is_nonuniform() const noexcept;
//- Representative (uniform) value for the field
const expressions::exprValue& value() const noexcept;
//- Compare (uniformity, type, value)
int compare(const exprValueFieldTag& rhs) const;
//- Test for equality of the values
bool equal(const exprValueFieldTag& rhs) const;
// Setters
//- Set value and uniformity from range of data
template<class Type>
void set(const Type* first, const Type* last)
@ -143,48 +104,29 @@ public:
}
else
{
// Is empty, set zero value
value_.set<Type>(Foam::zero{});
}
}
//- Set as uniform, with specified value
//- Set uniform type and value
template<class Type>
void set_value(const Type& val)
void set_uniform(const Type& val)
{
uniformity_ = Foam::Detail::ListPolicy::uniformity::UNIFORM;
value_.set<Type>(val);
}
//- Set type and zero value (does not affect uniformity)
template<class Type>
void set_zero()
{
value_.set<Type>(Foam::zero{});
}
//- Set as empty with zero value, leave type unchanged
void set_empty();
//- Set as non-uniform with zero value, leave type unchanged
void set_nouniform();
// Parallel
//- Inplace parallel reduction, uses worldComm
void reduce();
//- Perform a reduction on a copy and return the result
static exprValueFieldTag returnReduce(const exprValueFieldTag& tag);
//- Set as non-uniform
void set_nouniform() noexcept;
// Reduction operations
//- Inplace combine - eg, for global uniformity
//- Combine - eg, for global uniformity
void combine(const exprValueFieldTag& b);
//- Binary combine operator, e.g. for global reduction
//- Binary operator to be used by reduce function for detecting
//- global uniformity
struct combineOp
{
exprValueFieldTag operator()
@ -202,32 +144,11 @@ public:
// IO Operations
//- Read uniformity label and the value as pair
void read(Istream& is);
//- Write uniformity label and the value as pair
void write(Ostream& os) const;
//- Print description to Ostream
void print(Ostream& os) const;
// Member Operators
//- Assign from zero. Changes value but not type
void operator=(const Foam::zero) { value_ = Foam::zero{}; }
//- Compare (uniformity,value) for equality
bool operator==(const exprValueFieldTag&) const;
//- Compare (uniformity,value) for inequality
bool operator!=(const exprValueFieldTag& rhs) const
{
return !(*this == rhs);
}
//- Compare (uniformity,value)
bool operator<(const exprValueFieldTag&) const;
};
} // End namespace expressions

View File

@ -0,0 +1,160 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2023 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/>.
\*---------------------------------------------------------------------------*/
#include "exprValueFieldTag.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::expressions::exprValueFieldTag::empty() const noexcept
{
return
(
uniformity_ == Foam::Detail::ListPolicy::uniformity::EMPTY
);
}
bool Foam::expressions::exprValueFieldTag::is_uniform() const noexcept
{
return
(
uniformity_ == Foam::Detail::ListPolicy::uniformity::UNIFORM
);
}
bool Foam::expressions::exprValueFieldTag::is_nonuniform() const noexcept
{
return
(
uniformity_ == Foam::Detail::ListPolicy::uniformity::NONUNIFORM
);
}
bool Foam::expressions::exprValueFieldTag::equal
(
const exprValueFieldTag& rhs
) const
{
return (value_ == rhs.value_);
}
void Foam::expressions::exprValueFieldTag::set_nouniform() noexcept
{
uniformity_ = Foam::Detail::ListPolicy::uniformity::NONUNIFORM;
value_ = Foam::zero{};
}
void Foam::expressions::exprValueFieldTag::combine
(
const exprValueFieldTag& b
)
{
if (b.empty())
{
// no-op
return;
}
exprValueFieldTag& a = *this;
if (a.empty())
{
a = b;
}
else if (a.is_nonuniform())
{
// Already non-uniform/mixed
// a.uniformity_ |= b.uniformity_;
a.value_ = Foam::zero{};
}
else if (a.is_uniform() && b.is_uniform())
{
// Both are uniform, but are they the same value?
if (!a.equal(b))
{
a.set_nouniform();
}
}
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
void Foam::expressions::exprValueFieldTag::read(Istream& is)
{
label uniformTag;
is >> uniformTag;
uniformity_ = int(uniformTag);
value_.read(is);
}
void Foam::expressions::exprValueFieldTag::write(Ostream& os) const
{
os << label(uniformity_);
value_.write(os, false); // No pruning
}
void Foam::expressions::exprValueFieldTag::print(Ostream& os) const
{
os << "{ uniform:"
<< label(uniformity_)
<< " type:" << label(value_.typeCode())
<< " value: " << value_ << " }";
}
Foam::Istream& Foam::operator>>
(
Istream& is,
expressions::exprValueFieldTag& tag
)
{
tag.read(is);
return is;
}
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const expressions::exprValueFieldTag& tag
)
{
tag.write(os);
return os;
}
// ************************************************************************* //

View File

@ -32,7 +32,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "timeSelector.H"
#include "fvMesh.H"
#include "volFields.H"
#include "Time.H"
@ -127,14 +126,14 @@ void writeStencilStats(const labelListList& stencil)
int main(int argc, char *argv[])
{
timeSelector::addOptions_singleTime(); // Single-time options
#include "addTimeOptions.H"
#include "setRootCase.H"
#include "createTime.H"
// Set time from specified time options, or force start from Time=0
timeSelector::setTimeIfPresent(runTime, args, true);
// Get times list
instantList Times = runTime.times();
#include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
#include "createMesh.H"
// Force calculation of extended edge addressing

View File

@ -32,7 +32,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "timeSelector.H"
#include "fvMesh.H"
#include "volFields.H"
#include "surfaceFields.H"
@ -108,16 +107,14 @@ void writeStencilStats(const labelListList& stencil)
int main(int argc, char *argv[])
{
argList::noFunctionObjects(); // Never use function objects
timeSelector::addOptions_singleTime(); // Single-time options
#include "addTimeOptions.H"
#include "setRootCase.H"
#include "createTime.H"
// Set time from specified time options, or force start from Time=0
timeSelector::setTimeIfPresent(runTime, args, true);
// Get times list
instantList Times = runTime.times();
#include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
#include "createMesh.H"

View File

@ -5,5 +5,4 @@ EXE_INC = \
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-ldynamicMesh

View File

@ -32,7 +32,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "timeSelector.H"
#include "fvMesh.H"
#include "volFields.H"
#include "Time.H"
@ -52,33 +51,22 @@ using namespace Foam;
int main(int argc, char *argv[])
{
timeSelector::addOptions_singleTime(); // Single-time options
argList::addBoolOption
(
"inflate",
"Use inflation/deflation for deleting cells"
);
#include "addTimeOptions.H"
argList::addArgument("inflate (true|false)");
#include "setRootCase.H"
#include "createTime.H"
// Allow override of time from specified time options, or no-op
timeSelector::setTimeIfPresent(runTime, args);
#include "createMesh.H"
const bool inflate = args.found("inflate");
const Switch inflate(args[1]);
if (inflate)
{
Info<< "Deleting cells using inflation/deflation"
<< nl << endl;
Info<< "Deleting cells using inflation/deflation" << nl << endl;
}
else
{
Info<< "Deleting cells, introducing points at new position"
<< nl << endl;
Info<< "Deleting cells, introducing points at new position" << nl
<< endl;
}

View File

@ -47,7 +47,7 @@ using namespace Foam;
template<class PrimitiveType>
static List<PrimitiveType> splitStringToList(const std::string& str)
{
const auto items = stringOps::splitAny(str, " ,;");
const SubStrings<std::string> items = stringOps::splitAny(str, " ,;");
DynamicList<PrimitiveType> values(items.size());

View File

@ -5,5 +5,4 @@ EXE_INC = \
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-ldynamicMesh

View File

@ -33,7 +33,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "timeSelector.H"
#include "Time.H"
#include "volFields.H"
#include "surfaceFields.H"
@ -53,28 +52,21 @@ using namespace Foam;
// Main program:
int main(int argc, char *argv[])
{
timeSelector::addOptions_singleTime(); // Single-time options
argList::addBoolOption
(
"inflate",
"Use inflation/deflation for splitting/deleting cells"
);
#include "addTimeOptions.H"
argList::addArgument("inflate (true|false)");
#include "setRootCase.H"
#include "createTime.H"
// Allow override of time from specified time options, or no-op
timeSelector::setTimeIfPresent(runTime, args);
#include "createMesh.H"
const bool inflate = args.found("inflate");
const pointConstraints& pc = pointConstraints::New(pointMesh::New(mesh));
const Switch inflate(args[1]);
if (inflate)
{
Info<< "Splitting/deleting cells using inflation/deflation"
<< nl << endl;
Info<< "Splitting/deleting cells using inflation/deflation" << nl
<< endl;
}
else
{
@ -83,8 +75,6 @@ int main(int argc, char *argv[])
}
const pointConstraints& pc = pointConstraints::New(pointMesh::New(mesh));
Random rndGen(0);

View File

@ -51,6 +51,7 @@ using namespace Foam;
int main(int argc, char *argv[])
{
#include "addTimeOptions.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"

View File

@ -66,13 +66,13 @@ int main(int argc, char *argv[])
for (const entry& dEntry : dict)
{
if (dEntry.isStream())
if (!dEntry.isStream())
{
List<namedDictionary> list(dEntry.stream());
Info<< "input: " << dEntry << nl
<< "list: " << list << nl;
continue;
}
Info<< "input: " << dEntry << nl;
List<namedDictionary> list(dEntry.stream());
Info<< "list: " << list << nl;
}
}
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2022-2024 OpenCFD Ltd.
Copyright (C) 2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -44,62 +44,175 @@ Description
using namespace Foam;
//- Number of elements corresponding to max byte transfer.
// Normal upper limit is INT_MAX since MPI sizes are limited to <int>.
template<class Type>
inline std::size_t maxTransferCount
// Looks like Pstream::exchangeBuf
template<class T>
void do_exchangeBuf
(
const std::size_t max_bytes = std::size_t(0)
) noexcept
const label sendSize,
const char* sendData,
const label recvSize,
char* recvData,
const int tag,
const label comm,
const bool wait
)
{
return
(
(max_bytes == 0) // ie, unlimited
? (std::size_t(0)) //
: (max_bytes > std::size_t(INT_MAX)) // MPI limit is <int>
? (std::size_t(INT_MAX) / sizeof(Type)) //
: (max_bytes > sizeof(Type)) // require an integral number
? (max_bytes / sizeof(Type)) //
: (std::size_t(1)) // min of one element
);
const label startOfRequests = UPstream::nRequests();
// Set up receives
// ~~~~~~~~~~~~~~~
// forAll(recvSizes, proci)
{
// if (proci != Pstream::myProcNo(comm) && recvSizes[proci] > 0)
if (!Pstream::master(comm) && recvSize > 0)
{
UIPstream::read
(
UPstream::commsTypes::nonBlocking,
UPstream::myProcNo(comm), // proci,
recvData,
recvSize*sizeof(T),
tag,
comm
);
}
}
// Set up sends
// ~~~~~~~~~~~~
// forAll(sendBufs, proci)
for (const int proci : Pstream::subProcs(comm))
{
if (sendSize > 0)
// if (proci != Pstream::myProcNo(comm) && sendSizes[proci] > 0)
{
if
(
!UOPstream::write
(
UPstream::commsTypes::nonBlocking,
proci,
sendData,
sendSize*sizeof(T),
tag,
comm
)
)
{
FatalErrorInFunction
<< "Cannot send outgoing message. "
<< "to:" << proci << " nBytes:"
<< label(sendSize*sizeof(T))
<< Foam::abort(FatalError);
}
}
}
// Wait for all to finish
// ~~~~~~~~~~~~~~~~~~~~~~
if (wait)
{
UPstream::waitRequests(startOfRequests);
}
}
//- Upper limit on number of transfer bytes.
// Max bytes is normally INT_MAX since MPI sizes are limited to <int>.
// Negative values indicate a subtraction from INT_MAX.
inline std::size_t PstreamDetail_maxTransferBytes
// Looks like Pstream::exchangeContainer
template<class Container, class T>
void do_exchangeContainer
(
const int64_t max_bytes
) noexcept
const Container& sendData,
const label recvSize,
Container& recvData,
const int tag,
const label comm,
const bool wait
)
{
return
(
(max_bytes < 0) // (numBytes fewer than INT_MAX)
? std::size_t(INT_MAX + max_bytes)
: std::size_t(max_bytes)
);
const label startOfRequests = UPstream::nRequests();
// Set up receives
// ~~~~~~~~~~~~~~~
// for (const int proci : Pstream::allProcs(comm))
{
if (!Pstream::master(comm) && recvSize > 0)
// if (proci != Pstream::myProcNo(comm) && recvSize > 0)
{
UIPstream::read
(
UPstream::commsTypes::nonBlocking,
UPstream::myProcNo(comm), // proci,
recvData.data_bytes(),
recvSize*sizeof(T),
tag,
comm
);
}
}
// Set up sends
// ~~~~~~~~~~~~
if (Pstream::master(comm) && sendData.size() > 0)
{
for (const int proci : Pstream::subProcs(comm))
{
if
(
!UOPstream::write
(
UPstream::commsTypes::nonBlocking,
proci,
sendData.cdata_bytes(),
sendData.size_bytes(),
tag,
comm
)
)
{
FatalErrorInFunction
<< "Cannot send outgoing message. "
<< "to:" << proci << " nBytes:"
<< label(sendData.size_bytes())
<< Foam::abort(FatalError);
}
}
}
// Wait for all to finish
// ~~~~~~~~~~~~~~~~~~~~~~
if (wait)
{
UPstream::waitRequests(startOfRequests);
}
}
template<class Container, class Type>
template<class Container, class T>
void broadcast_chunks
(
Container& sendData,
const int tag = UPstream::msgType(),
const label comm = UPstream::worldComm
const int64_t maxComms_bytes = UPstream::maxCommsSize
const label comm = UPstream::worldComm,
const bool wait = true
)
{
// OR static_assert(is_contiguous<T>::value, "Contiguous data only!")
if (!is_contiguous<Type>::value)
if (!is_contiguous<T>::value)
{
FatalErrorInFunction
<< "Contiguous data only." << sizeof(Type)
<< Foam::abort(FatalError);
<< "Contiguous data only." << sizeof(T) << Foam::abort(FatalError);
}
if (maxComms_bytes == 0)
if (UPstream::maxCommsSize <= 0)
{
// Do in one go
Info<< "send " << sendData.size() << " elements in one go" << endl;
@ -114,90 +227,93 @@ void broadcast_chunks
sendData.resize_nocopy(recvSize); // A no-op on master
// Determine the number of chunks to send. Note that we
// only have to look at the sending data since we are
// guaranteed that some processor's sending size is some other
// processor's receive size. Also we can ignore any local comms.
// The chunk size (number of elements) corresponding to max byte transfer
// Is zero for non-chunked exchanges.
const std::size_t chunkSize
// We need to send chunks so the number of iterations:
// maxChunkSize iterations
// ------------ ----------
// 0 0
// 1..maxChunkSize 1
// maxChunkSize+1..2*maxChunkSize 2
// ...
const label maxChunkSize
(
PstreamDetail_maxTransferCount<Type>
max
(
PstreamDetail_maxTransferBytes(maxComms_bytes)
static_cast<label>(1),
static_cast<label>(UPstream::maxCommsSize/sizeof(T))
)
);
if (chunkSize)
label nChunks(0);
{
// Get max send count (elements)
// forAll(sendBufs, proci)
// {
// if (proci != Pstream::myProcNo(comm))
// {
// nChunks = max(nChunks, sendBufs[proci].size());
// }
// }
nChunks = sendSize;
// Convert from send count (elements) to number of chunks.
// Can normally calculate with (count-1), but add some safety
label nChunks = 1 + (sendSize/label(chunkSize));
if (nChunks)
{
nChunks = 1 + (nChunks/maxChunkSize);
}
reduce(nChunks, maxOp<label>(), tag, comm);
Info
<< "send " << sendSize << " elements ("
<< (sendSize*sizeof(Type)) << " bytes) in " << nChunks
<< " chunks of " << label(chunkSize) << " elements ("
<< label(chunkSize*sizeof(Type)) << " bytes) for maxCommsSize:"
<< label(maxComms_bytes)
<< (sendSize*sizeof(T)) << " bytes) in " << nChunks
<< " chunks of " << maxChunkSize << " elements ("
<< (maxChunkSize*sizeof(T)) << " bytes) for maxCommsSize:"
<< Pstream::maxCommsSize
<< endl;
}
// stress-test with shortened sendSize
// will produce useless loops, but no calls
// sendSize /= 2;
typedef stdFoam::span<Type> sendType;
label nSend(0);
label startSend(0);
char* charPtrSend;
do
for (label iter = 0; iter < nChunks; ++iter)
{
sendType payload(sendData.data(), sendData.size());
nSend = min
(
maxChunkSize,
sendSize-startSend
);
if (!chunkSize)
charPtrSend =
(
nSend > 0
? reinterpret_cast<char*>(&(sendData[startSend]))
: nullptr
);
Info<< "iter " << iter
<< ": beg=" << startSend << " len=" << nSend
<< " (" << (nSend*sizeof(T)) << " bytes)" << endl;
UPstream::broadcast(charPtrSend, nSend*sizeof(T), comm);
// forAll(nSend, proci)
{
UPstream::broadcast
(
payload.data_bytes(),
payload.size_bytes(),
comm
);
break;
}
// Dispatch chunk-wise until there is nothing left
for (int iter = 0; /*true*/; ++iter)
{
// The begin/end for the data window
const std::size_t beg = (std::size_t(iter)*chunkSize);
const std::size_t end = (std::size_t(iter+1)*chunkSize);
if (payload.size() <= beg)
{
// No more data windows
break;
}
sendType window
(
(end < payload.size())
? payload.subspan(beg, end - beg)
: payload.subspan(beg)
);
Info<< "iter " << iter
<< ": beg=" << label(beg) << " len=" << label(window.size())
<< " (" << label(window.size_bytes()) << " bytes)" << endl;
UPstream::broadcast
(
window.data_bytes(),
window.size_bytes(),
comm
);
startSend += nSend;
}
}
while (false);
Info<< "final" << endl;
Info<< "final: " << startSend << endl;
}
@ -217,7 +333,7 @@ int main(int argc, char *argv[])
}
labelList input1;
if (UPstream::master())
if (Pstream::master())
{
input1 = identity(500);
}
@ -232,7 +348,7 @@ int main(int argc, char *argv[])
// Mostly the same with PstreamBuffers
if (false)
{
PstreamBuffers pBufs;
PstreamBuffers pBufs(UPstream::commsTypes::nonBlocking);
labelList sendData;
if (Pstream::master())

View File

@ -130,7 +130,7 @@ int main(int argc, char *argv[])
for (bool barrier_active = false, done = false; !done; /*nil*/)
{
std::pair<int, int64_t> probed =
std::pair<int, int> probed =
UPstream::probeMessage
(
UPstream::commsTypes::nonBlocking,
@ -143,8 +143,8 @@ int main(int argc, char *argv[])
{
// Message found and had size: receive it
const label proci(probed.first);
const label count(probed.second);
const label proci = probed.first;
const label count = probed.second;
recvBufs(proci).resize_nocopy(count);
recvFromProc(recvRequests.size()) = proci;

View File

@ -119,7 +119,7 @@ int main(int argc, char *argv[])
for (bool barrier_active = false, done = false; !done; /*nil*/)
{
std::pair<int, int64_t> probed =
std::pair<int, int> probed =
UPstream::probeMessage
(
UPstream::commsTypes::nonBlocking,
@ -132,8 +132,8 @@ int main(int argc, char *argv[])
{
// Message found and had size: receive it
const label proci(probed.first);
const label count(probed.second);
const label proci = probed.first;
const label count = probed.second;
if (optNonBlocking)
{

View File

@ -7,6 +7,5 @@ EXE_INC = \
EXE_LIBS = \
-lfiniteVolume \
-ldynamicFvMesh \
-lsampling \
-loverset

View File

@ -56,7 +56,6 @@ Description
#include "fvCFD.H"
#include "simpleControl.H"
#include "predicates.H"
#include "dynamicFvMesh.H"
#include "dynamicOversetFvMesh.H"
@ -98,7 +97,6 @@ int main(int argc, char *argv[])
component(T.ref(), mesh.C(), 1);
// Interpolate + halo swap
T.correctBoundaryConditions();
// T.boundaryFieldRef().evaluate_if(predicates::always{});
// Check halo swap
dynamicOversetFvMesh::checkCoupledBC(T);
}

View File

@ -148,7 +148,7 @@ int main(int argc, char *argv[])
Info<< "input: " << input << nl
<< "expand: " << output << nl
<< "split: " << stringOps::split(output, '/') << nl << nl;
<< "split: " << stringOps::split(output, "/") << nl << nl;
}
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2024 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -34,7 +34,6 @@ Description
#include "argList.H"
#include "fileName.H"
#include "stringOps.H"
#include "Switch.H"
using namespace Foam;
@ -66,9 +65,6 @@ int main(int argc, char *argv[])
{
argList::noBanner();
argList::noParallel();
argList::noMandatoryArgs();
argList::addArgument("string .. stringN");
argList::addOption
(
"any",
@ -93,12 +89,6 @@ int main(int argc, char *argv[])
"int",
"test split on fixed width"
);
argList::addOption
(
"begin",
"int",
"begin offset for splits"
);
argList::addBoolOption
(
"slash",
@ -114,25 +104,18 @@ int main(int argc, char *argv[])
"empty",
"preserve empty strings in split"
);
argList args(argc, argv);
argList args(argc, argv, false, true);
if (args.size() <= 1 && args.options().empty())
{
args.printUsage();
}
const label beginOffset = args.getOrDefault<label>("begin", 0);
const bool keepEmpty = args.found("empty");
Info<< "begin offset: " << beginOffset << nl;
Info<< "keep empty : " << Switch::name(keepEmpty) << nl;
const label nopts =
args.count({"any", "slash", "space", "sub", "fixed", "char"});
if (args.found("any"))
{
const std::string& str = args["any"];
@ -142,7 +125,7 @@ int main(int argc, char *argv[])
for (label argi=1; argi < args.size(); ++argi)
{
auto split = stringOps::splitAny(args[argi], str, beginOffset);
const auto split = stringOps::splitAny(args[argi], str);
printSubStrings(args[argi], split);
}
@ -161,7 +144,7 @@ int main(int argc, char *argv[])
for (label argi=1; argi < args.size(); ++argi)
{
auto split = stringOps::split(args[argi], str, beginOffset);
const auto split = stringOps::split(args[argi], str);
printSubStrings(args[argi], split);
}
@ -178,11 +161,7 @@ int main(int argc, char *argv[])
for (label argi=1; argi < args.size(); ++argi)
{
auto split = stringOps::splitSpace(args[argi], beginOffset);
printSubStrings(args[argi], split);
Info<< "pop_front(2)" << nl;
split.pop_front(2);
const auto split = stringOps::splitSpace(args[argi]);
printSubStrings(args[argi], split);
}
@ -201,8 +180,7 @@ int main(int argc, char *argv[])
for (label argi=1; argi < args.size(); ++argi)
{
auto split =
stringOps::split(args[argi], delim, beginOffset, keepEmpty);
const auto split = stringOps::split(args[argi], delim, keepEmpty);
printSubStrings(args[argi], split);
}
@ -221,7 +199,7 @@ int main(int argc, char *argv[])
for (label argi=1; argi < args.size(); ++argi)
{
auto split = stringOps::splitFixed(args[argi], width, beginOffset);
const auto split = stringOps::splitFixed(args[argi], width);
printSubStrings(args[argi], split);
}
@ -241,8 +219,7 @@ int main(int argc, char *argv[])
for (label argi=1; argi < args.size(); ++argi)
{
auto split =
stringOps::split(args[argi], delim, beginOffset, keepEmpty);
const auto split = stringOps::split(args[argi], delim, keepEmpty);
printSubStrings(args[argi], split);
}
}

View File

@ -157,7 +157,7 @@ int main(int argc, char *argv[])
// // skip over time=0, unless some other time option has been specified
// if
// (
// !args.found("noZero")
// !args.found("zeroTime")
// && !args.found("time")
// && !args.found("latestTime")
// && Times.size() > 2

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2022-2024 OpenCFD Ltd.
Copyright (C) 2022-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -93,34 +93,29 @@ void Foam::fileFormats::ensightMeshReader::readIDs
(
ensightReadFile& is,
const bool doRead,
const label elemCount,
const label nShapes,
labelList& foamToElem,
Map<label>& elemToFoam
) const
{
const label begElem = foamToElem.size();
const label endElem = begElem + elemCount;
foamToElem.resize(foamToElem.size()+elemCount);
const label sz = foamToElem.size();
foamToElem.resize(sz+nShapes);
if (doRead)
{
elemToFoam.reserve(elemToFoam.size()+elemCount);
for (label elemi = begElem; elemi < endElem; ++elemi)
elemToFoam.reserve(elemToFoam.size()+nShapes);
for (label shapei = 0; shapei < nShapes; shapei++)
{
label id;
is.read(id);
foamToElem[elemi] = id;
elemToFoam.insert(id, elemi);
label elemi;
is.read(elemi);
foamToElem[sz+shapei] = elemi;
elemToFoam.insert(elemi, sz+shapei);
}
}
else
{
// identity
for (label elemi = begElem; elemi < endElem; ++elemi)
for (label shapei = 0; shapei < nShapes; shapei++)
{
foamToElem[elemi] = elemi;
foamToElem[sz+shapei] = sz+shapei;
}
}
}
@ -214,54 +209,37 @@ bool Foam::fileFormats::ensightMeshReader::readGoldPart
// Work
DynamicList<label> verts;
string buffer;
string line;
while (is.good())
{
do
{
// Get entire line/string
is.read(buffer);
is.readKeyword(line);
}
while (buffer.empty() && is.good());
while (line.empty() && is.good());
if (!is.good())
{
break;
}
else if (buffer.contains("BEGIN TIME STEP"))
{
// Graciously handle a miscued start
continue;
}
else if (buffer.contains("END TIME STEP"))
{
// END TIME STEP is a valid means to terminate input
break;
}
const auto split = stringOps::splitSpace(buffer);
const auto split = stringOps::splitSpace(line);
if (split.empty())
if (split.size() == 0)
{
continue;
}
const auto keyword(split[0].str());
if (keyword == "part")
if (split[0] == "part")
{
return false;
}
else if (keyword == "node_ids")
else if (split[0] == "node_ids")
{
const label nPoints = points.size();
// Ignore point ids
for (label pointi = 0; pointi < nPoints; ++pointi)
// Ignore for now
for (label i = 0; i < nPoints; i++)
{
label id;
is.read(id);
label index;
is.read(index);
}
}
else if (keyword == "coordinates")
else if (split[0] == "coordinates")
{
label nPoints;
is.read(nPoints);
@ -279,205 +257,207 @@ bool Foam::fileFormats::ensightMeshReader::readGoldPart
nodeIdToPoints
);
points.setSize(nPoints);
is.readPoints(nPoints, points);
for (label pointi = 0; pointi < nPoints; pointi++)
{
is.read(points[pointi].x());
}
for (label pointi = 0; pointi < nPoints; pointi++)
{
is.read(points[pointi].y());
}
for (label pointi = 0; pointi < nPoints; pointi++)
{
is.read(points[pointi].z());
}
}
else if (keyword == "tetra4")
else if (split[0] == "tetra4")
{
label elemCount;
is.read(elemCount);
label nShapes;
is.read(nShapes);
Pout<< indent<< "tetra4 " << elemCount
Pout<< indent<< "tetra4 " << nShapes
<< " starting at line " << is.lineNumber()
<< " position " << is.stdStream().tellg() << endl;
const label celli = cells.size();
cells.resize(celli+nShapes);
readIDs
(
is,
read_elem_ids,
elemCount,
nShapes,
cellToElemIds,
elemIdToCells
);
// Extend and fill the new trailing portion
const label startElemi = cells.size();
cells.resize(startElemi+elemCount);
faceListList::subList myElements = cells.slice(startElemi);
const auto& model = cellModel::ref(cellModel::TET);
for (auto& cellFaces : myElements)
for (label shapei = 0; shapei < nShapes; shapei++)
{
readVerts(is, 4, nodeIdToPoints, verts);
if (setHandedness_)
{
setHandedness(model, verts, points);
}
cellFaces = cellShape(model, verts).faces();
const cellShape cellVerts(model, verts);
cells[celli+shapei] = cellVerts.faces();
}
}
else if (keyword == "pyramid5")
else if (split[0] == "pyramid5")
{
label elemCount;
is.read(elemCount);
label nShapes;
is.read(nShapes);
Pout<< indent<< "pyramid5 " << elemCount
Pout<< indent<< "pyramid5 " << nShapes
<< " starting at line " << is.lineNumber()
<< " position " << is.stdStream().tellg() << endl;
const label celli = cells.size();
cells.resize(celli+nShapes);
readIDs
(
is,
read_elem_ids,
elemCount,
nShapes,
cellToElemIds,
elemIdToCells
);
// Extend and fill the new trailing portion
const label startElemi = cells.size();
cells.resize(startElemi+elemCount);
faceListList::subList myElements = cells.slice(startElemi);
const auto& model = cellModel::ref(cellModel::PYR);
for (auto& cellFaces : myElements)
for (label shapei = 0; shapei < nShapes; shapei++)
{
readVerts(is, 5, nodeIdToPoints, verts);
if (setHandedness_)
{
setHandedness(model, verts, points);
}
cellFaces = cellShape(model, verts).faces();
const cellShape cellVerts(model, verts);
cells[celli+shapei] = cellVerts.faces();
}
}
else if (keyword == "penta6")
else if (split[0] == "penta6")
{
label elemCount;
is.read(elemCount);
label nShapes;
is.read(nShapes);
Pout<< indent<< "penta6 " << elemCount
Pout<< indent<< "penta6 " << nShapes
<< " starting at line " << is.lineNumber()
<< " position " << is.stdStream().tellg() << endl;
const label celli = cells.size();
cells.resize(celli+nShapes);
readIDs
(
is,
read_elem_ids,
elemCount,
nShapes,
cellToElemIds,
elemIdToCells
);
// Extend and fill the new trailing portion
const label startElemi = cells.size();
cells.resize(startElemi+elemCount);
faceListList::subList myElements = cells.slice(startElemi);
const auto& model = cellModel::ref(cellModel::PRISM);
for (auto& cellFaces : myElements)
for (label shapei = 0; shapei < nShapes; shapei++)
{
readVerts(is, 6, nodeIdToPoints, verts);
if (setHandedness_)
{
setHandedness(model, verts, points);
}
cellFaces = cellShape(model, verts).faces();
const cellShape cellVerts(model, verts);
cells[celli+shapei] = cellVerts.faces();
}
}
else if (keyword == "hexa8")
else if (split[0] == "hexa8")
{
label elemCount;
is.read(elemCount);
label nShapes;
is.read(nShapes);
Pout<< indent<< "hexa8 " << elemCount
Pout<< indent<< "hexa8 " << nShapes
<< " starting at line " << is.lineNumber()
<< " position " << is.stdStream().tellg() << endl;
const label celli = cells.size();
cells.resize(celli+nShapes);
readIDs
(
is,
read_elem_ids,
elemCount,
nShapes,
cellToElemIds,
elemIdToCells
);
// Extend and fill the new trailing portion
const label startElemi = cells.size();
cells.resize(startElemi+elemCount);
faceListList::subList myElements = cells.slice(startElemi);
const auto& model = cellModel::ref(cellModel::HEX);
for (auto& cellFaces : myElements)
for (label shapei = 0; shapei < nShapes; shapei++)
{
readVerts(is, 8, nodeIdToPoints, verts);
if (setHandedness_)
{
setHandedness(model, verts, points);
}
cellFaces = cellShape(model, verts).faces();
const cellShape cellVerts(model, verts);
cells[celli+shapei] = cellVerts.faces();
}
}
else if (keyword == "nfaced")
else if (split[0] == "nfaced")
{
label elemCount;
is.read(elemCount);
label nShapes;
is.read(nShapes);
Pout<< indent<< "nfaced " << elemCount
Pout<< indent<< "nfaced " << nShapes
<< " starting at line " << is.lineNumber()
<< " position " << is.stdStream().tellg() << endl;
const label celli = cells.size();
cells.resize(celli+nShapes);
readIDs
(
is,
read_elem_ids,
elemCount,
nShapes,
cellToElemIds,
elemIdToCells
);
// Extend and fill the new trailing portion
const label startElemi = cells.size();
cells.resize(startElemi+elemCount);
faceListList::subList myElements = cells.slice(startElemi);
for (auto& cellFaces : myElements)
for (label shapei = 0; shapei < nShapes; shapei++)
{
label nFaces;
is.read(nFaces);
cellFaces.resize(nFaces);
faceList& cellFaces = cells[celli+shapei];
cellFaces.setSize(nFaces);
}
for (auto& cellFaces : myElements)
for (label shapei = 0; shapei < nShapes; shapei++)
{
for (face& f : cellFaces)
faceList& cellFaces = cells[celli+shapei];
forAll(cellFaces, cellFacei)
{
label nVerts;
is.read(nVerts);
f.resize(nVerts);
cellFaces[cellFacei].setSize(nVerts);
}
}
for (faceList& cellFaces : myElements)
for (label shapei = 0; shapei < nShapes; shapei++)
{
for (face& f : cellFaces)
faceList& cellFaces = cells[celli+shapei];
forAll(cellFaces, cellFacei)
{
face& f = cellFaces[cellFacei];
readVerts(is, f.size(), nodeIdToPoints, verts);
f.labelList::operator=(verts);
}
}
// Full check
forAll(myElements, elemi)
{
for (const face& f : myElements[elemi])
{
for (label pointi : f)
forAll(f, fp)
{
if (pointi < 0 || pointi >= points.size())
if (f[fp] < 0 || f[fp] >= points.size())
{
FatalErrorInFunction
<< "Face:" << elemi
FatalErrorInFunction<< "Face:" << shapei
<< " verts:" << f
<< " indexes outside points:" << points.size()
<< exit(FatalError);
@ -486,104 +466,107 @@ bool Foam::fileFormats::ensightMeshReader::readGoldPart
}
}
}
else if (keyword == "tria3")
else if (split[0] == "tria3")
{
label elemCount;
is.read(elemCount);
label nShapes;
is.read(nShapes);
Pout<< indent << "tria3 " << elemCount
Pout<< indent << "tria3 " << nShapes
<< " starting at line " << is.lineNumber()
<< " position " << is.stdStream().tellg() << endl;
const label facei = faces.size();
readIDs
(
is,
read_elem_ids,
elemCount,
nShapes,
faceToElemIDs,
elemIdToFaces
);
// Extend and fill the new trailing portion
const label startElemi = cells.size();
faces.resize(startElemi+elemCount, face(3)); // <- tria3
faceList::subList myElements = faces.slice(startElemi);
faces.setSize(facei+nShapes);
for (face& f : myElements)
for (label shapei = 0; shapei < nShapes; shapei++)
{
auto& f = faces[facei+shapei];
f.setSize(3);
readVerts(is, f.size(), nodeIdToPoints, verts);
f.labelList::operator=(verts);
}
}
else if (keyword == "quad4")
else if (split[0] == "quad4")
{
label elemCount;
is.read(elemCount);
label nShapes;
is.read(nShapes);
Pout<< indent << "quad4 " << elemCount
Pout<< indent << "quad4 " << nShapes
<< " starting at line " << is.lineNumber()
<< " position " << is.stdStream().tellg() << endl;
const label facei = faces.size();
readIDs
(
is,
read_elem_ids,
elemCount,
nShapes,
faceToElemIDs,
elemIdToFaces
);
// Extend and fill the new trailing portion
const label startElemi = cells.size();
faces.resize(startElemi+elemCount, face(4)); // <- quad4
faceList::subList myElements = faces.slice(startElemi);
faces.setSize(facei+nShapes);
for (face& f : myElements)
for (label shapei = 0; shapei < nShapes; shapei++)
{
auto& f = faces[facei+shapei];
f.setSize(4);
readVerts(is, f.size(), nodeIdToPoints, verts);
f.labelList::operator=(verts);
}
}
else if (keyword == "nsided")
else if (split[0] == "nsided")
{
label elemCount;
is.read(elemCount);
label nShapes;
is.read(nShapes);
Pout<< indent << "nsided " << elemCount
Pout<< indent << "nsided " << nShapes
<< " starting at line " << is.lineNumber()
<< " position " << is.stdStream().tellg() << endl;
const label facei = faces.size();
readIDs
(
is,
read_elem_ids,
elemCount,
nShapes,
faceToElemIDs,
elemIdToFaces
);
// Extend and fill the new trailing portion
const label startElemi = cells.size();
faces.resize(startElemi+elemCount);
faceList::subList myElements = faces.slice(startElemi);
faces.setSize(facei+nShapes);
for (face& f : myElements)
for (label shapei = 0; shapei < nShapes; shapei++)
{
auto& f = faces[facei+shapei];
label nVerts;
is.read(nVerts);
f.resize(nVerts);
f.setSize(nVerts);
}
for (face& f : myElements)
for (label shapei = 0; shapei < nShapes; shapei++)
{
auto& f = faces[facei+shapei];
readVerts(is, f.size(), nodeIdToPoints, verts);
f.labelList::operator=(verts);
}
}
else
{
WarningInFunction << "Unhandled key " << keyword
<< " from line " << buffer
WarningInFunction << "Unhandled key " << string(split[0])
<< " from line " << line
<< " starting at line " << is.lineNumber()
<< " position " << is.stdStream().tellg() << endl;
}
@ -601,21 +584,16 @@ bool Foam::fileFormats::ensightMeshReader::readGeometry
const scalar scaleFactor
)
{
// Auto-detect ascii/binary format,
// skips any initial "BEGIN TIME STEP"
ensightReadFile is(geometryFile_);
// Skip 'binary' tag
is.readBinaryHeader();
string buffer;
// Ensight Geometry File
is.read(buffer);
Info<< "Ensight : " << buffer << nl;
// Description - 1
is.read(buffer);
Info<< "Ensight : " << buffer << nl;
string header;
is.read(header);
Info<< "Ensight : " << header << endl;
is.read(header);
Info<< "Ensight : " << header << endl;
bool read_node_ids = false;
@ -645,72 +623,61 @@ bool Foam::fileFormats::ensightMeshReader::readGeometry
// Parse all
SubStrings<string> split;
string line;
while (is.good())
{
do
{
// Get entire line/string
is.read(buffer);
is.readKeyword(line);
}
while (buffer.empty() && is.good());
if (buffer.contains("END TIME STEP"))
while (line.empty() && is.good());
const auto split = stringOps::splitSpace(line);
if (split[0] == "extents")
{
// END TIME STEP is a valid means to terminate input
break;
point min;
point max;
is.read(min.x());
is.read(max.x());
is.read(min.y());
is.read(max.y());
is.read(min.z());
is.read(max.z());
Pout<< indent
<< "Read extents " << boundBox(min, max)
<< endl;
}
split = stringOps::splitSpace(buffer);
if (split.empty())
else if (split[0] == "node")
{
continue;
}
const auto keyword(split[0].str());
if (keyword == "extents")
{
// Optional extents (xmin, xmax, ymin, ymax, zmin, zmax)
boundBox bb;
point& min = bb.min();
point& max = bb.max();
is.read(min.x()); is.read(max.x());
is.read(min.y()); is.read(max.y());
is.read(min.z()); is.read(max.z());
Pout<< indent << "Read extents " << bb << endl;
}
else if (keyword == "node")
{
// "node id (off|assign|given|ignore)"
std::string op(split[2]);
word id(split[1]);
word op(split[2]);
if (op == "given" || op == "ignore")
{
Pout<< indent << "Reading node ids" << endl;
read_node_ids = true;
}
}
else if (keyword == "element")
else if (split[0] == "element")
{
// "element id (off|assign|given|ignore)"
std::string op(split[2]);
word id(split[1]);
word op(split[2]);
if (op == "given" || op == "ignore")
{
Pout<< indent << "Reading element ids" << endl;
read_elem_ids = true;
}
}
else if (keyword == "part")
else if (split[0] == "part")
{
bool finished = false;
do
{
// Read part id and name
is.read(partIDs.emplace_back());
is.read(partNames.emplace_back());
// Make space
partIDs.emplace_back();
is.read(partIDs.back());
partNames.emplace_back();
is.read(partNames.back());
Pout<< indent
<< "Reading part " << partIDs.back()
@ -987,7 +954,7 @@ bool Foam::fileFormats::ensightMeshReader::readGeometry
const face& f = rotateFace(cFaces[cFacei], rotatedFace);
const auto fFnd = vertsToCell.find(f);
if (fFnd.good())
if (fFnd)
{
// Already inserted. Internal face.
vertsToCell.erase(fFnd);
@ -1059,12 +1026,7 @@ bool Foam::fileFormats::ensightMeshReader::readGeometry
)
);
if (cAndF.good())
{
partCellAndFace[patchFacei++] = cAndF.val();
vertsToCell.erase(cAndF);
}
else
if (!cAndF)
{
//WarningInFunction
// << "Did not find face " << facei
@ -1074,6 +1036,11 @@ bool Foam::fileFormats::ensightMeshReader::readGeometry
// << " in part " << parti
// << endl;
}
else
{
partCellAndFace[patchFacei++] = cAndF();
vertsToCell.erase(cAndF);
}
}
partCellAndFace.setSize(patchFacei);
}

View File

@ -1569,7 +1569,7 @@ int main(int argc, char *argv[])
//Get polyMesh to write to constant
runTime.setTime(instant(0, runTime.constant()), 0);
runTime.setTime(instant(runTime.constant()), 0);
repatcher.repatch();

View File

@ -803,10 +803,6 @@ CompactListList<label> regionRenumber
int main(int argc, char *argv[])
{
argList::noFunctionObjects(); // Never use function objects
timeSelector::addOptions_singleTime(); // Single-time options
argList::addNote
(
"Renumber mesh cells to reduce the bandwidth. Use the -lib option or"
@ -867,8 +863,11 @@ int main(int argc, char *argv[])
"eg, 'reverse true;'"
);
argList::noFunctionObjects(); // Never use function objects
#include "addAllRegionOptions.H"
#include "addOverwriteOption.H"
#include "addTimeOptions.H"
// -------------------------
@ -927,15 +926,14 @@ int main(int argc, char *argv[])
// Get region names
#include "getAllRegionOptions.H"
// Set time from specified time options, or force start from Time=0
timeSelector::setTimeIfPresent(runTime, args, true);
// Get times list
instantList Times = runTime.times();
// Set startTime depending on -time and -latestTime options
#include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
// Capture current time information for non-overwrite
const Tuple2<instant, label> startTime
(
instant(runTime.value(), runTime.timeName()),
runTime.timeIndex()
);
// Start/reset all timings
timer.resetTime();
@ -949,10 +947,7 @@ int main(int argc, char *argv[])
for (fvMesh& mesh : meshes)
{
// Reset time in case of multiple meshes and not overwrite
if (!overwrite)
{
runTime.setTime(startTime.first(), startTime.second());
}
runTime.setTime(Times[startTime], startTime);
const word oldInstance = mesh.pointsInstance();

View File

@ -62,13 +62,12 @@ using namespace Foam;
int main(int argc, char *argv[])
{
timeSelector::addOptions_singleTime(); // Single-time options
argList::addNote
(
"Add point/face/cell Zones from similarly named point/face/cell Sets"
);
timeSelector::addOptions(true, false); // constant(true), zero(false)
argList::addBoolOption
(
"noFlipMap",
@ -76,13 +75,14 @@ int main(int argc, char *argv[])
);
#include "addRegionOption.H"
#include "addTimeOptions.H"
#include "setRootCase.H"
#include "createTime.H"
const bool noFlipMap = args.found("noFlipMap");
// Allow override of time from specified time options, or no-op
timeSelector::setTimeIfPresent(runTime, args);
// Get times list
(void)timeSelector::selectIfPresent(runTime, args);
#include "createNamedPolyMesh.H"

View File

@ -240,9 +240,9 @@ int main(int argc, char *argv[])
// Read set construct info from dictionary
List<namedDictionary> actionEntries(topoSetDict.lookup("actions"));
forAll(timeDirs, timei)
forAll(timeDirs, timeI)
{
runTime.setTime(timeDirs[timei], timei);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;
// Optionally re-read mesh

View File

@ -7,7 +7,6 @@
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2024 OpenCFD Ltd.
Copyright (C) 2024 Haakan Nilsson
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -72,9 +71,6 @@ Usage
The any or all of the three options may be specified and are processed
in the above order.
-cylToCart (originVector axisVector directionVector)
Tranform cylindrical coordinates to cartesian coordinates
With -rotateFields (in combination with -rotate/yawPitchRoll/rollPitchYaw)
it will also read & transform vector & tensor fields.
@ -97,7 +93,6 @@ Note
#include "transformGeometricField.H"
#include "axisAngleRotation.H"
#include "EulerCoordinateRotation.H"
#include "cylindricalCS.H"
using namespace Foam;
using namespace Foam::coordinateRotations;
@ -331,13 +326,6 @@ int main(int argc, char *argv[])
"Scale by the specified amount - Eg, for uniform [mm] to [m] scaling "
"use either '(0.001 0.001 0.001)' or simply '0.001'"
);
argList::addOption
(
"cylToCart",
"(originVec axisVec directionVec)",
"Tranform cylindrical coordinates to cartesian coordinates"
);
// Compatibility with surfaceTransformPoints
argList::addOptionCompat("scale", {"write-scale", 0});
@ -360,8 +348,7 @@ int main(int argc, char *argv[])
"rotate-z",
"rollPitchYaw",
"yawPitchRoll",
"scale",
"cylToCart"
"scale"
});
if (!args.count(operationNames))
@ -565,23 +552,6 @@ int main(int argc, char *argv[])
// Output scaling
applyScaling(points, getScalingOpt("scale", args));
if (args.found("cylToCart"))
{
vectorField n1n2(args.lookup("cylToCart")());
n1n2[1].normalise();
n1n2[2].normalise();
cylindricalCS ccs
(
"ccs",
n1n2[0],
n1n2[1],
n1n2[2]
);
points = ccs.globalPosition(points);
}
// More precision (for points data)
IOstream::minPrecision(10);

View File

@ -549,17 +549,16 @@ int main(int argc, char *argv[])
{
Info<< finder.dict();
}
else if (finder.isStream())
else if (finder.ref().isStream())
{
bool separator = false;
bool addSep = false;
for (const token& tok : finder.stream())
const tokenList& tokens = finder.ref().stream();
for (const token& tok : tokens)
{
if (separator)
{
Info<< token::SPACE;
}
separator = true;
if (addSep) Info<< token::SPACE;
addSep = true;
Info<< tok;
}
Info<< endl;

View File

@ -554,8 +554,7 @@ int main(int argc, char *argv[])
{
autoPtr<ensightGeoFile> os =
ensCase.newGeometry(hasMovingMesh);
ensMesh.write(os.ref());
ensMesh.write(os);
}
// finite-area
@ -563,8 +562,7 @@ int main(int argc, char *argv[])
{
autoPtr<ensightGeoFile> os =
ensFaCasePtr->newGeometry(hasMovingMesh);
ensFaMeshPtr->write(os.ref());
ensFaMeshPtr->write(os);
}
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2023-2024 OpenCFD Ltd.
Copyright (C) 2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -36,7 +36,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "timeSelector.H"
#include "fvMesh.H"
#include "volFields.H"
#include "pointFields.H"
@ -146,22 +145,20 @@ void ReadAndMapFields
int main(int argc, char *argv[])
{
argList::noFunctionObjects(); // Never use function objects
timeSelector::addOptions_singleTime(); // Single-time options
argList::addNote
(
"Convert polyMesh results to tetDualMesh"
);
#include "addOverwriteOption.H"
#include "addTimeOptions.H"
#include "setRootCase.H"
#include "createTime.H"
// Set time from specified time options, or force start from Time=0
timeSelector::setTimeIfPresent(runTime, args, true);
// Get times list
instantList Times = runTime.times();
#include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
// Read the mesh
#include "createNamedMesh.H"

View File

@ -353,7 +353,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
runTime.setTime(instant(0, runTime.constant()), 0);
runTime.setTime(instant(runTime.constant()), 0);
#include "createNamedMesh.H"

View File

@ -106,7 +106,7 @@ int main(int argc, char *argv[])
}
runTime.setTime(instant(0, runTime.constant()), 0);
runTime.setTime(instant(runTime.constant()), 0);
#include "createNamedMesh.H"

View File

@ -26,8 +26,8 @@ License
\*---------------------------------------------------------------------------*/
#ifndef Foam_MapConsistentVolFields_H
#define Foam_MapConsistentVolFields_H
#ifndef MapConsistentVolFields_H
#define MapConsistentVolFields_H
#include "GeometricField.H"
#include "meshToMesh.H"
@ -41,9 +41,10 @@ namespace Foam
template<class Type>
void evaluateConstraintTypes(GeometricField<Type, fvPatchField, volMesh>& fld)
{
auto& bfld = fld.boundaryFieldRef();
auto& fldBf = fld.boundaryFieldRef();
const UPstream::commsTypes commsType = UPstream::defaultCommsType;
const label startOfRequests = UPstream::nRequests();
if
(
@ -51,32 +52,37 @@ void evaluateConstraintTypes(GeometricField<Type, fvPatchField, volMesh>& fld)
|| commsType == UPstream::commsTypes::nonBlocking
)
{
const label startOfRequests = UPstream::nRequests();
for (auto& pfld : bfld)
forAll(fldBf, patchi)
{
fvPatchField<Type>& tgtField = fldBf[patchi];
if
(
pfld.type() == pfld.patch().patch().type()
&& polyPatch::constraintType(pfld.patch().patch().type())
tgtField.type() == tgtField.patch().patch().type()
&& polyPatch::constraintType(tgtField.patch().patch().type())
)
{
pfld.initEvaluate(commsType);
tgtField.initEvaluate(commsType);
}
}
// Wait for outstanding requests (non-blocking)
UPstream::waitRequests(startOfRequests);
for (auto& pfld : bfld)
// Wait for outstanding requests
if (commsType == UPstream::commsTypes::nonBlocking)
{
UPstream::waitRequests(startOfRequests);
}
forAll(fldBf, patchi)
{
fvPatchField<Type>& tgtField = fldBf[patchi];
if
(
pfld.type() == pfld.patch().patch().type()
&& polyPatch::constraintType(pfld.patch().patch().type())
tgtField.type() == tgtField.patch().patch().type()
&& polyPatch::constraintType(tgtField.patch().patch().type())
)
{
pfld.evaluate(commsType);
tgtField.evaluate(commsType);
}
}
}
@ -88,21 +94,22 @@ void evaluateConstraintTypes(GeometricField<Type, fvPatchField, volMesh>& fld)
for (const auto& schedEval : patchSchedule)
{
const label patchi = schedEval.patch;
auto& pfld = bfld[patchi];
fvPatchField<Type>& tgtField = fldBf[patchi];
if
(
pfld.type() == pfld.patch().patch().type()
&& polyPatch::constraintType(pfld.patch().patch().type())
tgtField.type() == tgtField.patch().patch().type()
&& polyPatch::constraintType(tgtField.patch().patch().type())
)
{
if (schedEval.init)
{
pfld.initEvaluate(commsType);
tgtField.initEvaluate(commsType);
}
else
{
pfld.evaluate(commsType);
tgtField.evaluate(commsType);
}
}
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 DHI
Copyright (C) 2017-2024 OpenCFD Ltd.
Copyright (C) 2017-2020 OpenCFD Ltd.
Copyright (C) 2017-2020 German Aerospace Center (DLR)
Copyright (C) 2020 Johan Roenby
-------------------------------------------------------------------------------
@ -39,7 +39,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "timeSelector.H"
#include "triSurface.H"
#include "triSurfaceTools.H"
@ -140,10 +139,6 @@ void setAlpha
int main(int argc, char *argv[])
{
argList::noFunctionObjects(); // Never use function objects
timeSelector::addOptions_singleTime(); // Single-time options
argList::addNote
(
"Uses cutCellIso to create a volume fraction field from an "
@ -156,14 +151,9 @@ int main(int argc, char *argv[])
"file",
"Alternative setAlphaFieldDict dictionary"
);
#include "addRegionOption.H"
#include "setRootCase.H"
#include "createTime.H"
// Set time from specified time options, or no-op
timeSelector::setTimeIfPresent(runTime, args);
#include "createNamedMesh.H"
const word dictName("setAlphaFieldDict");

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2022-2024 OpenCFD Ltd.
Copyright (C) 2022-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -36,7 +36,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "timeSelector.H"
#include "Time.H"
#include "fvMesh.H"
#include "faMesh.H"
@ -657,10 +656,6 @@ struct setAreaField
int main(int argc, char *argv[])
{
argList::noFunctionObjects(); // Never use function objects
timeSelector::addOptions_singleTime(); // Single-time options
argList::addNote
(
"Set values on a selected set of cells/patch-faces via a dictionary"
@ -675,15 +670,8 @@ int main(int argc, char *argv[])
);
#include "addRegionOption.H"
// -------------------------
#include "setRootCase.H"
#include "createTime.H"
// Set time from specified time options, or no-op
timeSelector::setTimeIfPresent(runTime, args);
#include "createNamedMesh.H"
autoPtr<faMesh> faMeshPtr;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2015-2024 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -161,34 +161,38 @@ int main(int argc, char *argv[])
// rather than tensors to allow indexed permutation.
// Cartesian basis vectors - right handed orthogonal triplet
FixedList<vector, 3> cartesian;
List<vector> cartesian(3);
cartesian[0] = vector(1, 0, 0);
cartesian[1] = vector(0, 1, 0);
cartesian[2] = vector(0, 0, 1);
// Principal axis basis vectors - right handed orthogonal triplet
FixedList<vector, 3> principal;
// Principal axis basis vectors - right handed orthogonal
// triplet
List<vector> principal(3);
principal[0] = eVec.x();
principal[1] = eVec.y();
principal[2] = eVec.z();
// Matching axis indices, first: cartesian, second:principal
Pair<label> match(-1, -1);
scalar maxMagDotProduct = -GREAT;
// Matching axis indices, first: cartesian, second:principal
Pair<label> match(-1, -1);
forAll(cartesian, cI)
{
forAll(principal, pI)
{
scalar magDotProduct = mag(cartesian[cI] & principal[pI]);
if (maxMagDotProduct < magDotProduct)
if (magDotProduct > maxMagDotProduct)
{
maxMagDotProduct = magDotProduct;
match.first() = cI;
match.second() = pI;
}
}
@ -204,7 +208,7 @@ int main(int argc, char *argv[])
// Invert the best match direction and swap the order of
// the other two vectors
FixedList<vector, 3> tPrincipal = principal;
List<vector> tPrincipal = principal;
tPrincipal[match.second()] *= -1;
@ -233,7 +237,7 @@ int main(int argc, char *argv[])
permutationDelta += 3;
FixedList<vector, 3> tPrincipal = principal;
List<vector> tPrincipal = principal;
vector tEVal = eVal;
@ -249,9 +253,10 @@ int main(int argc, char *argv[])
eVal = tEVal;
}
const label matchedAlready = match.first();
label matchedAlready = match.first();
match =Pair<label>(-1, -1);
match = Pair<label>(-1, -1);
maxMagDotProduct = -GREAT;
forAll(cartesian, cI)
@ -270,11 +275,12 @@ int main(int argc, char *argv[])
scalar magDotProduct = mag(cartesian[cI] & principal[pI]);
if (maxMagDotProduct < magDotProduct)
if (magDotProduct > maxMagDotProduct)
{
maxMagDotProduct = magDotProduct;
match.first() = cI;
match.second() = pI;
}
}
@ -289,7 +295,7 @@ int main(int argc, char *argv[])
{
principal[match.second()] *= -1;
FixedList<vector, 3> tPrincipal = principal;
List<vector> tPrincipal = principal;
tPrincipal[(matchedAlready + 1) % 3] =
principal[(matchedAlready + 2) % 3]*-sense;
@ -329,16 +335,15 @@ int main(int argc, char *argv[])
showTransform = false;
}
// calculate the total surface area
// Calculate total surface area and average normal vector
scalar surfaceArea = 0;
vector averageNormal(Zero);
forAll(surf, facei)
{
const labelledTri& f = surf[facei];
if (!f.good())
if (f[0] == f[1] || f[0] == f[2] || f[1] == f[2])
{
WarningInFunction
<< "Illegal triangle " << facei << " vertices " << f
@ -346,23 +351,20 @@ int main(int argc, char *argv[])
}
else
{
triPointRef tri = f.tri(surf.points());
surfaceArea += tri.mag();
averageNormal += tri.areaNormal();
surfaceArea += triPointRef
(
surf.points()[f[0]],
surf.points()[f[1]],
surf.points()[f[2]]
).mag();
}
}
// The unit normal (area-averaged)
averageNormal.normalise();
Info<< nl << setprecision(12)
<< "Density: " << density << nl
<< "Mass: " << m << nl
<< "Centre of mass: " << cM << nl
<< "Surface area: " << surfaceArea << nl
<< "Average normal: " << averageNormal << nl
<< "Inertia tensor around centre of mass: " << nl << J << nl
<< "eigenValues (principal moments): " << eVal << nl
<< "eigenVectors (principal axes): " << nl
@ -396,26 +398,21 @@ int main(int argc, char *argv[])
<< endl;
}
OFstream str("axes.obj");
// Write (scaled) principal axes at centre of mass
Info<< nl << "Writing scaled principal axes at centre of mass of "
<< surfFileName << " to " << str.name() << endl;
scalar scale = mag(cM - surf.points()[0])/eVal.component(findMin(eVal));
meshTools::writeOBJ(str, cM);
meshTools::writeOBJ(str, cM + scale*eVal.x()*eVec.x());
meshTools::writeOBJ(str, cM + scale*eVal.y()*eVec.y());
meshTools::writeOBJ(str, cM + scale*eVal.z()*eVec.z());
for (label i = 1; i < 4; i++)
{
OFstream str("axes.obj");
Info<< nl << "Writing scaled principal axes at centre of mass of "
<< surfFileName << " to " << str.name() << endl;
scalar scale =
mag(cM - surf.points()[0])/eVal.component(findMin(eVal));
meshTools::writeOBJ(str, cM);
meshTools::writeOBJ(str, cM + scale*eVal.x()*eVec.x());
meshTools::writeOBJ(str, cM + scale*eVal.y()*eVec.y());
meshTools::writeOBJ(str, cM + scale*eVal.z()*eVec.z());
for (label i = 1; i < 4; i++)
{
str << "l " << 1 << ' ' << i + 1 << endl;
}
str << "l " << 1 << ' ' << i + 1 << endl;
}
Info<< "\nEnd\n" << endl;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2022,2024 OpenCFD Ltd.
Copyright (C) 2017-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -58,7 +58,6 @@ Description
#include "axisAngleRotation.H"
#include "EulerCoordinateRotation.H"
#include "MeshedSurfaces.H"
#include "cylindricalCS.H"
using namespace Foam;
using namespace Foam::coordinateRotations;
@ -258,12 +257,6 @@ int main(int argc, char *argv[])
"type",
"Output format (default: use file extension)"
);
argList::addOption
(
"cylToCart",
"(originVec axisVec directionVec)",
"Tranform cylindrical coordinates to cartesian coordinates"
);
// Backward compatibility and with transformPoints
argList::addOptionCompat("write-scale", {"scale", -2006});
@ -284,8 +277,7 @@ int main(int argc, char *argv[])
"rollPitchYaw",
"yawPitchRoll",
"read-scale",
"write-scale",
"cylToCart"
"write-scale"
});
if (!args.count(operationNames))
@ -469,24 +461,6 @@ int main(int argc, char *argv[])
// Output scaling
applyScaling(points, getScalingOpt("write-scale", args));
// Conversion to cylindrical coords
if (args.found("cylToCart"))
{
vectorField n1n2(args.lookup("cylToCart")());
n1n2[1].normalise();
n1n2[2].normalise();
cylindricalCS ccs
(
"ccs",
n1n2[0],
n1n2[1],
n1n2[2]
);
points = ccs.globalPosition(points);
}
surf1.movePoints(points);
surf1.write(exportName, writeFileType);

View File

@ -210,7 +210,7 @@ reportExecutable()
{
APP_NAME="$1"
APP_SPEC="$2"
APP_PATH="$(findExec "$PATH" "$1")"
APP_PATH="$(findExec $PATH $1)"
VERSION="unknown"
if [ -z "$APP_PATH" ]

View File

@ -6,7 +6,7 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2019-2024 OpenCFD Ltd.
# Copyright (C) 2019-2023 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -48,16 +48,8 @@ options:
-name=NAME Stem for tar-file (default: auto)
-output=DIR Output directory (default: ".")
-prefix=NAME Prefix directory within tar-file (default: auto)
-pkg-modules Package 'modules' exclusively (no OpenFOAM)
-pkg-plugins Package 'plugins' exclusively (no OpenFOAM)
-no-extras Exclude 'modules, plugins,...' from source pack
-no-modules Exclude 'modules' from source pack (default: off)
-no-plugins Exclude 'plugins' from source pack (default: on)
-all-extras Include 'modules, plugins,...' into source pack
-with-modules Include 'modules' into source pack (default: on)
-with-plugins Include 'plugins' into source pack (default: off)
-modules=name1,.. Include specifed 'modules' into source pack
-plugins=name1,.. Include specifed 'plugins' into source pack
-pkg-modules Only package submodules - exclude OpenFOAM
-no-modules Exclude submodules
-no-patch Ignore '_patch' number for output tar-file
-no-prefix Do not prefix subdirectory
-no-compress Disable compression
@ -75,7 +67,7 @@ Script generator for packing OpenFOAM sources and submodules.
Eg,
$Script -output=some-dir origin/master > create-tar-file
bash ./create-tar-file
sh ./create-tar-file
$Script -tgz origin/master | bash
@ -98,16 +90,11 @@ die()
#-------------------------------------------------------------------------------
outputDir='.'
outputDir="."
versionSeparator='_'
withPatchNum=true
# Default selections
select_source=true
select_modules=true
select_plugins=false
unset compress gitbase packageApi prefixDir tarName
unset compress packageApi withSource withModules prefixDir tarName
unset gitbase
# Cleanup tarName to remove trailing '.tar', detect compression etc
cleanTarName() {
@ -130,7 +117,7 @@ cleanTarName() {
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help* | --help*)
-h | -help*)
printHelp
;;
-debian | -debian=[0-9]*)
@ -159,43 +146,13 @@ do
prefixDir="${1#*=}"
prefixDir="${prefixDir%/}"
;;
-all-extras)
select_modules=true
select_plugins=true
;;
-with-modules)
select_modules=true
;;
-modules=*)
select_modules="${1#*=}"
: "${select_modules:=true}"
;;
-with-plugins)
select_plugins=true
;;
-plugins=*)
select_plugins="${1#*=}"
: "${select_plugins:=true}"
;;
-no-extras)
select_modules=false
select_plugins=false
-pkg-modules)
withModules=true
withSource=false
;;
-no-modules)
select_modules=false
;;
-no-plugins)
select_plugins=false
;;
-pkg-modules) # Package modules exclusively
select_modules=true
select_plugins=false
select_source=false
;;
-pkg-plugins) # Package plugins exclusively
select_modules=false
select_plugins=true
select_source=false
withModules=false
withSource=true
;;
-no-patch)
withPatchNum=false
@ -334,15 +291,9 @@ fi
if [ -z "$prefixDir" ]
then
prefixDir="OpenFOAM-v${packageApi}"
if [ "$select_source" = false ]
if [ "$withSource" = false ]
then
# Either -pkg-modules or -pkg-plugins, not both
if [ "$select_modules" != false ]
then
prefixDir="OpenFOAM-modules-v${packageApi}"
else
prefixDir="OpenFOAM-plugins-v${packageApi}"
fi
prefixDir="OpenFOAM-modules-v${packageApi}"
fi
elif [ "$prefixDir" = false ]
then
@ -369,15 +320,9 @@ case "$tarName" in
('')
tarName="OpenFOAM-v${packageApi}"
if [ "$select_source" = false ]
if [ "$withSource" = false ]
then
# Either -pkg-modules or -pkg-plugins, not both
if [ "$select_modules" != false ]
then
tarName="OpenFOAM-modules-v${packageApi}"
else
tarName="OpenFOAM-plugins-v${packageApi}"
fi
tarName="OpenFOAM-modules-v${packageApi}"
fi
if [ "$withPatchNum" = false ]
@ -417,56 +362,48 @@ echo 'tar -cf "$outputDir/$tarName.tar" -T /dev/null'
echo
echo 'buildInfo="${prefixDir}${prefixDir:+@}META-INFO@build-info"'
echo 'manifest0="${prefixDir}${prefixDir:+@}META-INFO@manifest.txt"'
echo 'manifest1="${prefixDir}${prefixDir:+@}META-INFO@manifest-modules.txt"'
echo 'manifest2="${prefixDir}${prefixDir:+@}META-INFO@manifest-plugins.txt"'
echo 'manifest1="${prefixDir}${prefixDir:+@}META-INFO@modules-manifest.txt"'
echo '#--------'
#------------------------------------------------------------------------------
# Sort out particulars related to modules, source
if [ "$select_source" = false ]
# Sort out particulars related to modules
if [ "$withModules" = false ]
then
echo 'unset buildInfo manifest0 # No source'
echo '# No modules'
echo 'unset manifest1'
fi
if [ "$select_modules" = false ]
if [ "$withSource" = false ]
then
echo 'unset manifest1 # No modules'
echo '# No OpenFOAM source (package modules exclusively)'
echo 'unset buildInfo'
echo 'unset manifest0'
fi
if [ "$select_plugins" = false ]
then
echo 'unset manifest2 # No plugins'
fi
echo '#--------'
echo 'set -x'
echo
#------------------------------------------------------------------------------
# OpenFOAM sources (unless explicitly excluded)
if [ "$select_source" != false ]
# OpenFOAM sources
if [ "$withSource" != false ]
then
echo 'git -c tar.umask=0022 archive --format=tar ${prefixDir:+--prefix="$prefixDir/"} -o "$outputDir/$tarName.tar" "$head"'
# Tag build information with underscore to distinguish from "real" build
# information when git is available.
echo echo 'build="${build:+_}$build" > "$outputDir/$buildInfo"'
echo
echo '# source'
echo 'manifestFile="$manifest0"'
echo 'echo build="${build:+_}$build" > "$outputDir/$buildInfo"'
echo '{'
echo ' echo api="$api"'
echo ' echo patch="$patch"'
echo ' echo head="$head"'
echo ' echo'
echo ' git ls-tree -r "$head"'
echo '} > "$outputDir/${manifestFile:?}"'
echo 'unset manifestFile'
echo '} > "$outputDir/$manifest0"'
fi
#------------------------------------------------------------------------------
# OpenFOAM modules/plugins
# Add in modules
# Recursive addition of submodule content.
# NB: must be called from within the respective parent directory.
@ -474,15 +411,11 @@ fi
#
# packModule abc (implied cd)
# packModule abc/def
# packModule abc/def/ghi
# packModule abc/def/hij
#
packModule()
{
local parent="$1"
local filter="$2"
# Using filter=true means accept everything
if [ "$filter" = true ]; then unset filter; fi
(
if [ -n "$parent" ]
@ -491,51 +424,34 @@ packModule()
fi
git ls-tree -d HEAD | \
while read mode gittype sha1 moduleName
while read mode gittype sha1 module
do
[ "$gittype" == commit ] || continue
case "$moduleName" in
case "$module" in
(. | ./)
echo
echo "# ----"
echo "# submodule $parent : not initialized?"
echo "# module $parent : not initialized?"
echo "# ----"
continue
;;
esac
# Fully qualified
module="$parent${parent:+/}$moduleName"
moduleName="${moduleName##*/}"
module="$parent${parent:+/}$module"
echo
echo "# submodule"
echo "# module"
echo "module='$module'"
echo "commit='$sha1'"
# Simplistic filtering
if [ -n "$filter" ] && [ "${filter/$moduleName/}" = "$filter" ]
then
echo "# ----"
echo '{'
echo ' echo'
echo ' echo "$module"'
echo ' echo commit="$commit"'
echo ' echo "# not exported"'
echo ' echo'
echo '} >> "$outputDir/${manifestFile:?}"'
continue
fi
# Intermediate tar file for module contents
echo "tmpTarFile='$tarName-$moduleName.tar'"
echo "tmpTarFile='$tarName-${module##*/}.tar'"
echo "# ----"
echo '('
echo ' cd "$module" || exit'
echo ' newPrefix="$prefixDir${prefixDir:+/}$module"'
echo ' git -c tar.umask=0022 archive --format=tar --prefix="$newPrefix/" -o "$outputDir/$tmpTarFile" "$commit" || exit'
echo ' # Without {test,tests,validation} directories (potentially large)'
# Without {test,tests,validation} directories (potentially large)
echo ' tar --delete -f "$outputDir/$tmpTarFile" "$newPrefix/test" "$newPrefix/tests" "$newPrefix/validation" 2>/dev/null'
echo ' tar -Af "$outputDir/$tarName.tar" "$outputDir/$tmpTarFile"'
echo ' {'
@ -545,58 +461,32 @@ packModule()
echo ' echo'
echo ' # Without {test,tests,validation} directories'
echo ' git ls-tree -r "$commit" | sed -e '"'"'/\t\(test\|\tests\|validation\)\//d'"'"
echo ' } >> "$outputDir/${manifestFile:?}"'
echo ' } >> "$outputDir/$manifest1"'
echo ')'
echo "# ----"
# Remove tmp tar file, even if git archive failed (creates zero-sized tar)
echo 'rm -f "$outputDir/$tmpTarFile"'
# No filter for lower levels...
packModule "$module"
done
)
}
# modules/
if [ "$select_modules" != false ]
if [ "$withModules" != false ]
then
echo
echo '# modules/'
echo 'manifestFile="$manifest1"'
echo '# Modules'
echo '{'
echo ' echo "# OpenFOAM modules"'
echo ' echo api="$api"'
echo ' echo patch="$patch"'
echo ' echo head="$head"'
echo '} > "$outputDir/${manifestFile:?}"'
echo '} > "$outputDir/$manifest1"'
# With all or specified modules
packModule modules "$select_modules"
packModule modules
echo
echo '{ echo; echo "# End"; } >> "$outputDir/${manifestFile:?}"'
echo 'unset manifestFile'
fi
# plugins/
if [ "$select_plugins" != false ]
then
echo
echo '# plugins/'
echo 'manifestFile="$manifest2"'
echo '{'
echo ' echo "# OpenFOAM plugins"'
echo ' echo api="$api"'
echo ' echo patch="$patch"'
echo ' echo head="$head"'
echo '} > "$outputDir/${manifestFile:?}"'
# With all or specified plugins
packModule plugins "$select_plugins"
echo
echo '{ echo; echo "# End"; } >> "$outputDir/${manifestFile:?}"'
echo 'unset manifestFile'
echo '{ echo; echo "# End"; } >> "$outputDir/$manifest1"'
fi
#------------------------------------------------------------------------------
@ -604,10 +494,10 @@ fi
# Decode '@' in the names as '/' directory separator
echo
echo echo 'Adding build-info and manifest files'
echo "echo 'Adding build-info and manifest files'"
echo 'if pushd "$outputDir"; then'
echo "tar --owner=root --group=root --append --transform='s|@|/|g' -v -f \"\$tarName.tar\" \"\$buildInfo\" \"\$manifest0\" \"\$manifest1\" \"\$manifest2\""
echo 'rm -f "$buildInfo" "$manifest0" "$manifest1" "$manifest2"'
echo "tar --owner=root --group=root --append --transform='s|@|/|g' -v -f \"\$tarName.tar\" \"\$buildInfo\" \"\$manifest0\" \"\$manifest1\""
echo 'rm -f "$buildInfo" "$manifest0" "$manifest1"'
echo 'popd; fi'
echo
@ -619,18 +509,18 @@ echo "# -----------------------"
# Compression
case "$compress" in
('')
('')
echo "No compression requested" 1>&2
;;
(gz | gzip)
(gz | gzip)
echo "Using gzip compression" 1>&2
echo 'gzip -f -9 "$outputDir/$tarName.tar"'
echo
echo '# End of compression'
;;
(tgz)
(tgz)
echo "Using gzip compression with tgz ending" 1>&2
echo 'gzip -c -9 "$outputDir/$tarName.tar" > "$outputDir/$tarName.tgz"'
echo 'rm -f "$outputDir/$tarName.tar"'
@ -638,28 +528,28 @@ case "$compress" in
echo '# End of compression'
;;
(bz | bzip | bzip2)
(bz | bzip | bzip2)
echo "Using bzip2 compression" 1>&2
echo 'bzip2 -f -9 "$outputDir/$tarName.tar"'
echo
echo '# End of compression'
;;
(xz)
(xz)
echo "Using xz compression" 1>&2
echo 'xz -f -9 "$outputDir/$tarName.tar"'
echo
echo '# End of compression'
;;
(zst | zstd)
(zst | zstd)
echo "Using zstd compression" 1>&2
echo 'zstd --rm -f -9 "$outputDir/$tarName.tar"'
echo
echo '# End of compression'
;;
(*)
(*)
echo "Unknown compression scheme: $compress" 1>&2
;;
esac

View File

@ -1,23 +1,23 @@
## Getting the code
Links to all code packs are available on https://dl.openfoam.com. For OpenFOAM-v2406:
Links to all code packs are available on https://dl.openfoam.com. For OpenFOAM-v2312:
- https://dl.openfoam.com/source/latest/
- Source: https://dl.openfoam.com/source/v2406/OpenFOAM-v2406.tgz
- ThirdParty: https://dl.openfoam.com/source/v2406/ThirdParty-v2406.tgz
- Source: https://dl.openfoam.com/source/v2312/OpenFOAM-v2312.tgz
- ThirdParty: https://dl.openfoam.com/source/v2312/ThirdParty-v2312.tgz
## OpenFOAM&reg; Quick Build Guide
Prior to building, ensure that the [system requirements][link openfoam-require]
are satisfied (including any special [cross-compiling][wiki-cross-compile]
considerations), and source the correct OpenFOAM environment.
For example, for the OpenFOAM-v2406 version:
For example, for the OpenFOAM-v2312 version:
```
source <installation path>/OpenFOAM-v2406/etc/bashrc
source <installation path>/OpenFOAM-v2312/etc/bashrc
```
e.g. if installed under the `~/openfoam` directory
```
source ~/openfoam/OpenFOAM-v2406/etc/bashrc
source ~/openfoam/OpenFOAM-v2312/etc/bashrc
```
@ -157,4 +157,4 @@ More details in the [ThirdParty build guide][link third-build].
[wiki-config]: https://develop.openfoam.com/Development/openfoam/-/wikis/configuring
---
Copyright 2019-2024 OpenCFD Ltd
Copyright 2019-2023 OpenCFD Ltd

View File

@ -1,4 +1,4 @@
## Known Build Issues (v2406, v2312, v2306, v2212, v2206, v2112, v2106, v2012)
## Known Build Issues (v2312, v2306, v2212, v2206, v2112, v2106, v2012)
### Windows cross-compilation
@ -188,4 +188,4 @@ and attempt to install a `paraview~qt` version instead.
[wiki-config]: https://develop.openfoam.com/Development/openfoam/-/wikis/configuring
---
Copyright 2019-2024 OpenCFD Ltd
Copyright 2019-2023 OpenCFD Ltd

View File

@ -6,7 +6,7 @@
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2016-2024 OpenCFD Ltd.
# Copyright (C) 2016-2023 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -55,7 +55,7 @@
# [WM_PROJECT_VERSION] - A human-readable version name
# A development version is often named 'com' - as in www.openfoam.com
export WM_PROJECT_VERSION=v2406
export WM_PROJECT_VERSION=v2312
#------------------------------------------------------------------------------
# Configuration environment variables.

View File

@ -34,16 +34,6 @@ cellSet_doc
// or
min (0 0 0);
max (1 1 1);
// Optional the cell centres can be transformed before being used. This
// can be used to simulate moving selections in transient simulations.
// Any solidBodyMotionFunction can be used. Note: the same optional
// transformation can be used for any selection requiring face centres
// or point locations.
solidBodyMotionFunction linearMotion
{
velocity (-0.1 -0.1 0);
}
}
@ -68,8 +58,6 @@ cellSet_doc
radius 5.0;
// optional
innerRadius 1.0;
// See boxToCell for optional transformation of the cell centres
}
//- Select based on faceSet
@ -129,8 +117,6 @@ cellSet_doc
{
source nearestToCell;
points ((0 0 0) (1 1 1)(2 2 2));
// See boxToCell for optional transformation of the cell centres
}
@ -176,8 +162,6 @@ cellSet_doc
i (0.2 0.2 0);
j (-0.2 0.2 0);
k (10 10 10);
// See boxToCell for optional transformation of the cell centres
}
@ -186,8 +170,6 @@ cellSet_doc
source searchableSurfaceToCell;
surfaceType triSurfaceMesh; // Type of surface
surfaceName blob.obj; // Name for surface object
// See boxToCell for optional transformation of the cell centres
}
@ -206,8 +188,6 @@ cellSet_doc
// optional
innerRadius 1.0;
// See boxToCell for optional transformation of the cell centres
}
@ -229,7 +209,6 @@ cellSet_doc
useSurfaceOrientation false; // use closed surface inside/outside
// test (ignores includeCut,
// outsidePoints)
// See boxToCell for optional transformation of the cell centres
}
@ -278,8 +257,6 @@ faceSet_doc
// or
min (0 0 0);
max (1 1 1);
// See boxToCell for optional transformation of the face centres
}
@ -309,8 +286,6 @@ faceSet_doc
radius 5.0;
// optional
innerRadius 1.0;
// See boxToCell for optional transformation of the face centres
}
@ -377,8 +352,6 @@ faceSet_doc
source searchableSurfaceToFace;
surfaceType triSurfaceMesh; // Type of surface
surfaceName blob.obj; // Name for surface object
// See boxToCell for optional transformation of the face centres
}
@ -389,8 +362,6 @@ faceSet_doc
radius 5.0;
// optional
innerRadius 1.0;
// See boxToCell for optional transformation of the face centres
}
@ -439,8 +410,6 @@ pointSet_doc
// or
min (0 0 0);
max (1 1 1);
// See boxToCell for optional transformation of the points
}
@ -467,7 +436,6 @@ pointSet_doc
radius 5.0;
// optional
innerRadius 1.0;
// See boxToCell for optional transformation of the points
}
@ -497,7 +465,6 @@ pointSet_doc
{
source nearestToPoint;
points ((0 0 0) (1 1 1));
// See boxToCell for optional transformation of the points
}
@ -519,7 +486,6 @@ pointSet_doc
source searchableSurfaceToCell;
surfaceType triSurfaceMesh; // Type of surface
surfaceName blob.obj; // Name for surface object
// See boxToCell for optional transformation of the points
}
@ -530,7 +496,6 @@ pointSet_doc
radius 5.0;
// optional
innerRadius 1.0;
// See boxToCell for optional transformation of the points
}
@ -543,7 +508,6 @@ pointSet_doc
// (requires closed surface with consistent
// normals)
includeOutside false; // ,, outside ,,
// See boxToCell for optional transformation of the points
}

View File

@ -14,7 +14,6 @@ cyclic
cyclicAMI
{
type cyclicAMI;
value $internalField;
}
cyclicACMI

View File

@ -5,7 +5,7 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2017-2024 OpenCFD Ltd.
# Copyright (C) 2017-2023 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -20,7 +20,7 @@
#------------------------------------------------------------------------------
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
set adios2_version=ADIOS2-2.10.1
set adios2_version=ADIOS2-2.9.2
setenv ADIOS2_ARCH_PATH "$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$adios2_version"
# END OF (NORMAL) USER EDITABLE PART

View File

@ -5,7 +5,7 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2018-2024 OpenCFD Ltd.
# Copyright (C) 2018-2021 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -30,7 +30,7 @@
#------------------------------------------------------------------------------
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
set hypre_version=hypre-2.31.0
set hypre_version=hypre-2.23.0
setenv HYPRE_ARCH_PATH "$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$hypre_version"
# END OF (NORMAL) USER EDITABLE PART

View File

@ -6,7 +6,7 @@
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2016-2024 OpenCFD Ltd.
# Copyright (C) 2016-2023 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -52,7 +52,7 @@
#------------------------------------------------------------------------------
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
set ParaView_VERSION=5.12.1
set ParaView_VERSION=5.11.2
set ParaView_QT=qt-system
# END OF (NORMAL) USER EDITABLE PART

View File

@ -5,7 +5,7 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2018-2024 OpenCFD Ltd.
# Copyright (C) 2018-2023 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -30,7 +30,7 @@
#------------------------------------------------------------------------------
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
set petsc_version=petsc-3.21.2
set petsc_version=petsc-3.19.2
setenv PETSC_ARCH_PATH "$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$petsc_version"
# END OF (NORMAL) USER EDITABLE PART

View File

@ -5,7 +5,7 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2017-2024 OpenCFD Ltd.
# Copyright (C) 2017-2023 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -21,7 +21,7 @@
#------------------------------------------------------------------------------
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
adios2_version=ADIOS2-2.10.1
adios2_version=ADIOS2-2.9.2
export ADIOS2_ARCH_PATH="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$adios2_version"
# END OF (NORMAL) USER EDITABLE PART

View File

@ -1,61 +0,0 @@
#----------------------------------*-sh-*--------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2024 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# File
# etc/config.sh/hdf5
# [optional/experimental: not sourced by OpenFOAM-*/etc/bashrc]
#
# Description
# Setup for HDF5 include/libraries (usually ThirdParty installation).
#
# To disable its use: hdf5_version=hdf5-none
# For system-wide installations: hdf5_version=hdf5-system
#
# For central installations not located under ThirdParty:
# 1. use hdf5-system
# 2. and provide full path for HDF5_ARCH_PATH
#
#------------------------------------------------------------------------------
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
hdf5_version=hdf5-1.14.4.3
export HDF5_ARCH_PATH="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$hdf5_version"
# END OF (NORMAL) USER EDITABLE PART
#------------------------------------------------------------------------------
if [ -n "$FOAM_VERBOSE" ] && [ -n "$PS1" ]
then
echo "Using hdf5 ($hdf5_version) -> $HDF5_ARCH_PATH" 1>&2
fi
if command -v _foamAddLibAuto >/dev/null
then
# Normal sourcing (not makeHDF5)
_foamAddLibAuto $HDF5_ARCH_PATH
unset hdf5_version
elif [ "$1" = "-force" ]
then
# Forced command-line sourcing
if output="$($WM_PROJECT_DIR/bin/tools/lib-dir -sh $HDF5_ARCH_PATH 2>/dev/null)"
then
eval "$output"
fi
unset hdf5_version output
fi
#------------------------------------------------------------------------------

View File

@ -5,7 +5,7 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2018-2024 OpenCFD Ltd.
# Copyright (C) 2018-2021 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -27,7 +27,7 @@
#------------------------------------------------------------------------------
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
hypre_version=hypre-2.31.0
hypre_version=hypre-2.23.0
export HYPRE_ARCH_PATH="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$hypre_version"
# END OF (NORMAL) USER EDITABLE PART

View File

@ -6,7 +6,7 @@
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2016-2024 OpenCFD Ltd.
# Copyright (C) 2016-2023 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -57,7 +57,7 @@
#------------------------------------------------------------------------------
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
ParaView_VERSION=5.12.1
ParaView_VERSION=5.11.2
ParaView_QT=qt-system
# END OF (NORMAL) USER EDITABLE PART

View File

@ -5,7 +5,7 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2018-2024 OpenCFD Ltd.
# Copyright (C) 2018-2023 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -27,7 +27,7 @@
#------------------------------------------------------------------------------
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
petsc_version=petsc-3.21.2
petsc_version=petsc-3.19.2
export PETSC_ARCH_PATH="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$petsc_version"
# END OF (NORMAL) USER EDITABLE PART

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2406 |
| \\ / O peration | Version: v2312 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -146,18 +146,13 @@ OptimisationSwitches
// The default and minimum is (20000000).
mpiBufferSize 0;
// Optional max size (bytes) for unstructured data exchanges.
// In some phases of OpenFOAM it can send over very large data chunks
// Optional max size (bytes) for unstructured data exchanges. In some
// phases of OpenFOAM it can send over very large data chunks
// (e.g. in parallel load balancing) and some MPI implementations have
// problems with this.
//
// This tuning parameter specifies the max number of bytes before
// switching to a multi-pass send/recv
// (currently only affects PstreamBuffers exchanges).
//
// 0 : disabled
// >0 : limit exchanges to specified number of bytes
// <0 : limit exchanges to INT_MAX minus specified number of bytes
// problems with this. Setting this variable > 0 indicates that the
// data exchange needs to be done in multiple passes, each of maxCommsSize.
// This is not switched on by default since it requires an additional
// global reduction, even if multi-pass is not needed)
maxCommsSize 0;
// Optional (experimental) feature in lduMatrixUpdate

View File

@ -6,7 +6,7 @@
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2016-2024 OpenCFD Ltd.
# Copyright (C) 2016-2023 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -55,7 +55,7 @@
# [WM_PROJECT_VERSION] - A human-readable version name
# A development version is often named 'com' - as in www.openfoam.com
setenv WM_PROJECT_VERSION v2406
setenv WM_PROJECT_VERSION v2312
#------------------------------------------------------------------------------
# Configuration environment variables.

View File

@ -1,17 +1,12 @@
[[_TOC_]]
## OpenFOAM modules
## OpenFOAM Modules
This directory is a location for additional OpenFOAM components or
tools to placed and have them built as part of the normal OpenFOAM
build process. It is assumed that each subdirectory contain an
appropriate `Allwmake` (or `Allwmake.override`) file.
The primary distinction between `modules` and `plugins` is that `modules` are
mainly maintained and released by OpenFOAM developers, whereas `plugins` are an
open and welcoming area for add-ons, predominantly maintained and driven by
OpenFOAM community members and groups.
### How to use
On the first use, you need to register the submodules, and then update them.
@ -96,7 +91,7 @@ To build the doxygen information for the components, it is also
necessary to link the directories to the doc/ subdirectory.
This is a purely manual operation.
### Developer information
### Developer Information
#### Build locations

Some files were not shown because too many files have changed in this diff Show More