mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
MRG: Integrated Foundation code to commit 19e602b
This commit is contained in:
@ -4,4 +4,5 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lfvOptions \
|
||||
-lmeshTools
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -184,7 +184,8 @@ public:
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
const Pstream::commsTypes commsType=
|
||||
Pstream::commsTypes::blocking
|
||||
);
|
||||
|
||||
//- Return face-gradient transform diagonal
|
||||
|
||||
@ -2,11 +2,11 @@
|
||||
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
|
||||
autoPtr<psiThermo> pThermo
|
||||
autoPtr<fluidThermo> pThermo
|
||||
(
|
||||
psiThermo::New(mesh)
|
||||
fluidThermo::New(mesh)
|
||||
);
|
||||
psiThermo& thermo = pThermo();
|
||||
fluidThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
@ -40,27 +40,7 @@ volVectorField U
|
||||
|
||||
#include "compressibleCreatePhi.H"
|
||||
|
||||
dimensionedScalar rhoMax
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"rhoMax",
|
||||
pimple.dict(),
|
||||
dimDensity,
|
||||
GREAT
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar rhoMin
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"rhoMin",
|
||||
pimple.dict(),
|
||||
dimDensity,
|
||||
0
|
||||
)
|
||||
);
|
||||
pressureControl pressureControl(p, rho, pimple.dict(), false);
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
|
||||
@ -1,8 +1,3 @@
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.relax();
|
||||
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||
@ -12,55 +7,54 @@ if (pimple.nCorrPISO() <= 1)
|
||||
tUEqn.clear();
|
||||
}
|
||||
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
(
|
||||
fvc::flux(rho*HbyA)
|
||||
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||
)
|
||||
);
|
||||
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
|
||||
|
||||
if (pimple.transonic())
|
||||
{
|
||||
surfaceScalarField phid
|
||||
(
|
||||
"phid",
|
||||
fvc::interpolate(psi)
|
||||
*(
|
||||
fvc::flux(HbyA)
|
||||
+ rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho)
|
||||
)
|
||||
(fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyA
|
||||
);
|
||||
|
||||
MRF.makeRelative(fvc::interpolate(psi), phid);
|
||||
phiHbyA -= fvc::interpolate(p)*phid;
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::ddt(psi, p)
|
||||
+ fvc::div(phiHbyA)
|
||||
+ fvm::div(phid, p)
|
||||
- fvm::laplacian(rhorAUf, p)
|
||||
==
|
||||
fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
// Relax the pressure equation to ensure diagonal-dominance
|
||||
pEqn.relax();
|
||||
|
||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi == pEqn.flux();
|
||||
phi = phiHbyA + pEqn.flux();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
(
|
||||
fvc::flux(rho*HbyA)
|
||||
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||
)
|
||||
);
|
||||
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
@ -87,19 +81,20 @@ else
|
||||
// Explicitly relax pressure for momentum corrector
|
||||
p.relax();
|
||||
|
||||
// Recalculate density from the relaxed pressure
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.relax();
|
||||
Info<< "rho max/min : " << max(rho).value()
|
||||
<< " " << min(rho).value() << endl;
|
||||
|
||||
U = HbyA - rAU*fvc::grad(p);
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
K = 0.5*magSqr(U);
|
||||
|
||||
pressureControl.limit(p);
|
||||
p.correctBoundaryConditions();
|
||||
rho = thermo.rho();
|
||||
|
||||
if (!pimple.transonic())
|
||||
{
|
||||
rho.relax();
|
||||
}
|
||||
|
||||
if (thermo.dpdt())
|
||||
{
|
||||
dpdt = fvc::ddt(p);
|
||||
|
||||
@ -1,8 +1,3 @@
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.relax();
|
||||
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||
@ -12,72 +7,64 @@ if (pimple.nCorrPISO() <= 1)
|
||||
tUEqn.clear();
|
||||
}
|
||||
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
(
|
||||
fvc::flux(rho*HbyA)
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi)
|
||||
)
|
||||
);
|
||||
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
volScalarField rhorAtU("rhorAtU", rho*rAtU);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rho, U, phiHbyA, rhorAtU, MRF);
|
||||
|
||||
if (pimple.transonic())
|
||||
{
|
||||
surfaceScalarField phid
|
||||
(
|
||||
"phid",
|
||||
fvc::interpolate(psi)
|
||||
*(
|
||||
fvc::flux(HbyA)
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi)
|
||||
/fvc::interpolate(rho)
|
||||
)
|
||||
(fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyA
|
||||
);
|
||||
|
||||
MRF.makeRelative(fvc::interpolate(psi), phid);
|
||||
|
||||
surfaceScalarField phic
|
||||
(
|
||||
"phic",
|
||||
phiHbyA +=
|
||||
fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf()
|
||||
);
|
||||
- fvc::interpolate(p)*phid;
|
||||
|
||||
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
||||
|
||||
volScalarField rhorAtU("rhorAtU", rho*rAtU);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::ddt(psi, p)
|
||||
+ fvc::div(phiHbyA)
|
||||
+ fvm::div(phid, p)
|
||||
+ fvc::div(phic)
|
||||
- fvm::laplacian(rhorAtU, p)
|
||||
==
|
||||
fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
// Relax the pressure equation to ensure diagonal-dominance
|
||||
pEqn.relax();
|
||||
|
||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi == phic + pEqn.flux();
|
||||
phi = phiHbyA + pEqn.flux();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
(
|
||||
fvc::flux(rho*HbyA)
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi)
|
||||
)
|
||||
);
|
||||
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf();
|
||||
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
||||
|
||||
volScalarField rhorAtU("rhorAtU", rho*rAtU);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rho, U, phiHbyA, rhorAtU, MRF);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
@ -109,19 +96,16 @@ U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
K = 0.5*magSqr(U);
|
||||
|
||||
if (thermo.dpdt())
|
||||
{
|
||||
dpdt = fvc::ddt(p);
|
||||
}
|
||||
|
||||
// Recalculate density from the relaxed pressure
|
||||
pressureControl.limit(p);
|
||||
p.correctBoundaryConditions();
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
|
||||
if (!pimple.transonic())
|
||||
{
|
||||
rho.relax();
|
||||
}
|
||||
|
||||
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;
|
||||
if (thermo.dpdt())
|
||||
{
|
||||
dpdt = fvc::ddt(p);
|
||||
}
|
||||
|
||||
@ -1,8 +1,3 @@
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.relax();
|
||||
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||
@ -12,55 +7,53 @@ if (pimple.nCorrPISO() <= 1)
|
||||
tUEqn.clear();
|
||||
}
|
||||
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
fvc::flux(rho*HbyA)
|
||||
+ rhorAUf*fvc::ddtCorr(rho, U, rhoUf)
|
||||
);
|
||||
|
||||
fvc::makeRelative(phiHbyA, rho, U);
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
|
||||
|
||||
if (pimple.transonic())
|
||||
{
|
||||
surfaceScalarField phid
|
||||
(
|
||||
"phid",
|
||||
fvc::interpolate(psi)
|
||||
*(
|
||||
fvc::flux(HbyA)
|
||||
+ rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho)
|
||||
)
|
||||
(fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyA
|
||||
);
|
||||
|
||||
fvc::makeRelative(phid, psi, U);
|
||||
MRF.makeRelative(fvc::interpolate(psi), phid);
|
||||
phiHbyA -= fvc::interpolate(p)*phid;
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::ddt(psi, p)
|
||||
+ fvc::div(phiHbyA)
|
||||
+ fvm::div(phid, p)
|
||||
- fvm::laplacian(rhorAUf, p)
|
||||
==
|
||||
fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
// Relax the pressure equation to ensure diagonal-dominance
|
||||
pEqn.relax();
|
||||
|
||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi == pEqn.flux();
|
||||
phi = phiHbyA + pEqn.flux();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
fvc::flux(rho*HbyA)
|
||||
+ rhorAUf*fvc::ddtCorr(rho, U, rhoUf)
|
||||
);
|
||||
|
||||
fvc::makeRelative(phiHbyA, rho, U);
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
// Pressure corrector
|
||||
@ -88,19 +81,20 @@ else
|
||||
// Explicitly relax pressure for momentum corrector
|
||||
p.relax();
|
||||
|
||||
// Recalculate density from the relaxed pressure
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.relax();
|
||||
Info<< "rho max/min : " << max(rho).value()
|
||||
<< " " << min(rho).value() << endl;
|
||||
|
||||
U = HbyA - rAU*fvc::grad(p);
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
K = 0.5*magSqr(U);
|
||||
|
||||
pressureControl.limit(p);
|
||||
p.correctBoundaryConditions();
|
||||
rho = thermo.rho();
|
||||
|
||||
if (!pimple.transonic())
|
||||
{
|
||||
rho.relax();
|
||||
}
|
||||
|
||||
{
|
||||
rhoUf = fvc::interpolate(rho*U);
|
||||
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -22,7 +22,7 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
rhoPimpleFoam
|
||||
rhoPimpleDyMFoam
|
||||
|
||||
Group
|
||||
grpCompressibleSolvers grpMovingMeshSolvers
|
||||
@ -38,10 +38,11 @@ Description
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "psiThermo.H"
|
||||
#include "fluidThermo.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "bound.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "pressureControl.H"
|
||||
#include "CorrectPhi.H"
|
||||
#include "fvOptions.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -37,10 +37,11 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "psiThermo.H"
|
||||
#include "fluidThermo.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "bound.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "pressureControl.H"
|
||||
#include "fvOptions.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
#include "fvcSmooth.H"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
autoPtr<rhoThermo> pThermo
|
||||
|
||||
autoPtr<fluidThermo> pThermo
|
||||
(
|
||||
fluidThermo::New(mesh)
|
||||
@ -7,6 +7,8 @@ autoPtr<fluidThermo> pThermo
|
||||
fluidThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
@ -20,8 +22,6 @@ volScalarField rho
|
||||
thermo.rho()
|
||||
);
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
|
||||
Info<< "Reading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
@ -40,34 +40,8 @@ volVectorField U
|
||||
|
||||
pressureControl pressureControl(p, rho, simple.dict());
|
||||
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
setRefCell(p, simple.dict(), pRefCell, pRefValue);
|
||||
|
||||
mesh.setFluxRequired(p.name());
|
||||
|
||||
dimensionedScalar rhoMax
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"rhoMax",
|
||||
simple.dict(),
|
||||
dimDensity,
|
||||
GREAT
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar rhoMin
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"rhoMin",
|
||||
simple.dict(),
|
||||
dimDensity,
|
||||
0
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
(
|
||||
|
||||
@ -8,16 +8,18 @@
|
||||
|
||||
bool closedVolume = false;
|
||||
|
||||
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
|
||||
|
||||
if (simple.transonic())
|
||||
{
|
||||
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
|
||||
surfaceScalarField rhof(fvc::interpolate(rho));
|
||||
MRF.makeRelative(rhof, phiHbyA);
|
||||
|
||||
surfaceScalarField phid
|
||||
(
|
||||
"phid",
|
||||
(fvc::interpolate(psi)/rhof)*phiHbyA
|
||||
(fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyA
|
||||
);
|
||||
phiHbyA -= fvc::interpolate(p)*phid;
|
||||
|
||||
@ -51,14 +53,8 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
closedVolume = adjustPhi(phiHbyA, U, p);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
|
||||
|
||||
while (simple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
|
||||
@ -5,16 +5,20 @@ tUEqn.clear();
|
||||
|
||||
bool closedVolume = false;
|
||||
|
||||
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
volScalarField rhorAtU("rhorAtU", rho*rAtU);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rho, U, phiHbyA, rhorAtU, MRF);
|
||||
|
||||
if (simple.transonic())
|
||||
{
|
||||
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
|
||||
surfaceScalarField rhof(fvc::interpolate(rho));
|
||||
MRF.makeRelative(rhof, phiHbyA);
|
||||
|
||||
surfaceScalarField phid
|
||||
(
|
||||
"phid",
|
||||
(fvc::interpolate(psi)/rhof)*phiHbyA
|
||||
(fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyA
|
||||
);
|
||||
|
||||
phiHbyA +=
|
||||
@ -23,14 +27,12 @@ if (simple.transonic())
|
||||
|
||||
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
||||
|
||||
volScalarField rhorAtU("rhorAtU", rho*rAtU);
|
||||
|
||||
while (simple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::div(phid, p)
|
||||
+ fvc::div(phiHbyA)
|
||||
fvc::div(phiHbyA)
|
||||
+ fvm::div(phid, p)
|
||||
- fvm::laplacian(rhorAtU, p)
|
||||
==
|
||||
fvOptions(psi, p, rho.name())
|
||||
@ -55,19 +57,11 @@ if (simple.transonic())
|
||||
}
|
||||
else
|
||||
{
|
||||
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
closedVolume = adjustPhi(phiHbyA, U, p);
|
||||
|
||||
phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf();
|
||||
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
||||
|
||||
volScalarField rhorAtU("rhorAtU", rho*rAtU);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rho, U, phiHbyA, rhorAtU, MRF);
|
||||
|
||||
while (simple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
|
||||
@ -2,46 +2,57 @@
|
||||
word alphaScheme("div(phi,alpha)");
|
||||
word alpharScheme("div(phirb,alpha)");
|
||||
|
||||
tmp<fv::ddtScheme<scalar>> ddtAlpha
|
||||
(
|
||||
fv::ddtScheme<scalar>::New
|
||||
(
|
||||
mesh,
|
||||
mesh.ddtScheme("ddt(alpha)")
|
||||
)
|
||||
);
|
||||
|
||||
// Set the off-centering coefficient according to ddt scheme
|
||||
scalar ocCoeff = 0;
|
||||
if
|
||||
(
|
||||
isType<fv::EulerDdtScheme<scalar>>(ddtAlpha())
|
||||
|| isType<fv::localEulerDdtScheme<scalar>>(ddtAlpha())
|
||||
)
|
||||
{
|
||||
ocCoeff = 0;
|
||||
}
|
||||
else if (isType<fv::CrankNicolsonDdtScheme<scalar>>(ddtAlpha()))
|
||||
{
|
||||
if (nAlphaSubCycles > 1)
|
||||
tmp<fv::ddtScheme<scalar>> tddtAlpha
|
||||
(
|
||||
fv::ddtScheme<scalar>::New
|
||||
(
|
||||
mesh,
|
||||
mesh.ddtScheme("ddt(alpha)")
|
||||
)
|
||||
);
|
||||
const fv::ddtScheme<scalar>& ddtAlpha = tddtAlpha();
|
||||
|
||||
if
|
||||
(
|
||||
isType<fv::EulerDdtScheme<scalar>>(ddtAlpha)
|
||||
|| isType<fv::localEulerDdtScheme<scalar>>(ddtAlpha)
|
||||
)
|
||||
{
|
||||
ocCoeff = 0;
|
||||
}
|
||||
else if (isType<fv::CrankNicolsonDdtScheme<scalar>>(ddtAlpha))
|
||||
{
|
||||
if (nAlphaSubCycles > 1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Sub-cycling is not supported "
|
||||
"with the CrankNicolson ddt scheme"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
alphaRestart
|
||||
|| mesh.time().timeIndex() > mesh.time().startTimeIndex() + 1
|
||||
)
|
||||
{
|
||||
ocCoeff =
|
||||
refCast<const fv::CrankNicolsonDdtScheme<scalar>>(ddtAlpha)
|
||||
.ocCoeff();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Sub-cycling is not supported "
|
||||
"with the CrankNicolson ddt scheme"
|
||||
<< "Only Euler and CrankNicolson ddt schemes are supported"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
ocCoeff =
|
||||
refCast<const fv::CrankNicolsonDdtScheme<scalar>>(ddtAlpha())
|
||||
.ocCoeff();
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Only Euler and CrankNicolson ddt schemes are supported"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
// Set the time blending factor, 1 for Euler
|
||||
scalar cnCoeff = 1.0/(1.0 + ocCoeff);
|
||||
|
||||
// Standard face-flux compression coefficient
|
||||
@ -136,8 +147,8 @@
|
||||
(
|
||||
fvc::flux
|
||||
(
|
||||
phi,
|
||||
alpha1,
|
||||
phiCN(),
|
||||
cnCoeff*alpha1 + (1.0 - cnCoeff)*alpha1.oldTime(),
|
||||
alphaScheme
|
||||
)
|
||||
+ fvc::flux
|
||||
@ -148,13 +159,6 @@
|
||||
)
|
||||
);
|
||||
|
||||
// Calculate the Crank-Nicolson off-centred alpha flux
|
||||
if (ocCoeff > 0)
|
||||
{
|
||||
talphaPhiUn =
|
||||
cnCoeff*talphaPhiUn + (1.0 - cnCoeff)*alphaPhi.oldTime();
|
||||
}
|
||||
|
||||
if (MULESCorr)
|
||||
{
|
||||
tmp<surfaceScalarField> talphaPhiCorr(talphaPhiUn() - alphaPhi);
|
||||
|
||||
20
applications/solvers/multiphase/VoF/createAlphaFluxes.H
Normal file
20
applications/solvers/multiphase/VoF/createAlphaFluxes.H
Normal file
@ -0,0 +1,20 @@
|
||||
IOobject alphaPhiHeader
|
||||
(
|
||||
"alphaPhi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
);
|
||||
|
||||
const bool alphaRestart = alphaPhiHeader.headerOk();
|
||||
|
||||
// MULES flux from previous time-step
|
||||
surfaceScalarField alphaPhi
|
||||
(
|
||||
alphaPhiHeader,
|
||||
phi*fvc::interpolate(alpha1)
|
||||
);
|
||||
|
||||
// MULES Correction
|
||||
tmp<surfaceScalarField> talphaPhiCorr0;
|
||||
@ -5,7 +5,7 @@
|
||||
+ fvm::div(rhoPhi, T)
|
||||
- fvm::laplacian(mixture.alphaEff(turbulence->mut()), T)
|
||||
+ (
|
||||
divU*p
|
||||
fvc::div(fvc::absolute(phi, U), p)
|
||||
+ fvc::ddt(rho, K) + fvc::div(rhoPhi, K)
|
||||
)
|
||||
*(
|
||||
|
||||
@ -64,6 +64,7 @@ int main(int argc, char *argv[])
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createControl.H"
|
||||
#include "createFields.H"
|
||||
#include "createAlphaFluxes.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "createUf.H"
|
||||
#include "createControls.H"
|
||||
|
||||
@ -64,6 +64,7 @@ int main(int argc, char *argv[])
|
||||
#include "createControl.H"
|
||||
#include "createTimeControls.H"
|
||||
#include "createFields.H"
|
||||
#include "createAlphaFluxes.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
volScalarField& p = mixture.p();
|
||||
@ -112,7 +113,6 @@ int main(int argc, char *argv[])
|
||||
solve(fvm::ddt(rho) + fvc::div(rhoPhi));
|
||||
|
||||
#include "UEqn.H"
|
||||
volScalarField divU(fvc::div(fvc::absolute(phi, U)));
|
||||
#include "TEqn.H"
|
||||
|
||||
// --- Pressure corrector loop
|
||||
|
||||
@ -101,21 +101,4 @@ autoPtr<compressible::turbulenceModel> turbulence
|
||||
Info<< "Creating field kinetic energy K\n" << endl;
|
||||
volScalarField K("K", 0.5*magSqr(U));
|
||||
|
||||
// MULES flux from previous time-step
|
||||
surfaceScalarField alphaPhi
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"alphaPhi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
phi*fvc::interpolate(alpha1)
|
||||
);
|
||||
|
||||
// MULES Correction
|
||||
tmp<surfaceScalarField> talphaPhiCorr0;
|
||||
|
||||
#include "createMRF.H"
|
||||
|
||||
@ -121,20 +121,6 @@ if (p_rgh.needReference())
|
||||
mesh.setFluxRequired(p_rgh.name());
|
||||
mesh.setFluxRequired(alpha1.name());
|
||||
|
||||
// MULES flux from previous time-step
|
||||
surfaceScalarField alphaPhi
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"alphaPhi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
phi*fvc::interpolate(alpha1)
|
||||
);
|
||||
|
||||
// MULES compressed flux is registered in case scalarTransport FO needs it.
|
||||
surfaceScalarField alphaPhiUn
|
||||
(
|
||||
@ -150,7 +136,4 @@ surfaceScalarField alphaPhiUn
|
||||
dimensionedScalar("zero", phi.dimensions(), 0.0)
|
||||
);
|
||||
|
||||
// MULES Correction
|
||||
tmp<surfaceScalarField> talphaPhiCorr0;
|
||||
|
||||
#include "createMRF.H"
|
||||
|
||||
@ -63,6 +63,7 @@ int main(int argc, char *argv[])
|
||||
#include "createTimeControls.H"
|
||||
#include "createDyMControls.H"
|
||||
#include "createFields.H"
|
||||
#include "createAlphaFluxes.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
volScalarField rAU
|
||||
|
||||
@ -66,6 +66,7 @@ int main(int argc, char *argv[])
|
||||
#include "createTimeControls.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createFields.H"
|
||||
#include "createAlphaFluxes.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "correctPhi.H"
|
||||
|
||||
|
||||
@ -294,12 +294,11 @@ while (pimple.correct())
|
||||
forAll(phases, phasei)
|
||||
{
|
||||
phaseModel& phase = phases[phasei];
|
||||
const volScalarField& alpha = phase;
|
||||
volScalarField& rho = phase.thermo().rho();
|
||||
|
||||
if (phase.compressible())
|
||||
{
|
||||
const volScalarField& alpha = phase;
|
||||
const volScalarField& rho = phase.rho();
|
||||
|
||||
if (pimple.transonic())
|
||||
{
|
||||
surfaceScalarField phid
|
||||
@ -357,21 +356,29 @@ while (pimple.correct())
|
||||
).ptr()
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqnComps.set
|
||||
(
|
||||
phasei,
|
||||
fvm::Su(-(fvOptions(alpha, rho)&rho)/rho, p_rgh).ptr()
|
||||
);
|
||||
}
|
||||
|
||||
if (fluid.transfersMass(phase))
|
||||
if (fluid.transfersMass(phase))
|
||||
{
|
||||
if (pEqnComps.set(phasei))
|
||||
{
|
||||
if (pEqnComps.set(phasei))
|
||||
{
|
||||
pEqnComps[phasei] -= fluid.dmdt(phase)/rho;
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqnComps.set
|
||||
(
|
||||
phasei,
|
||||
fvm::Su(-fluid.dmdt(phase)/rho, p_rgh)
|
||||
);
|
||||
}
|
||||
pEqnComps[phasei] -= fluid.dmdt(phase)/rho;
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqnComps.set
|
||||
(
|
||||
phasei,
|
||||
fvm::Su(-fluid.dmdt(phase)/rho, p_rgh)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -421,7 +428,7 @@ while (pimple.correct())
|
||||
phase.phi() = phiHbyAs[phasei] + alpharAUfs[phasei]*mSfGradp;
|
||||
|
||||
// Set the phase dilatation rates
|
||||
if (phase.compressible())
|
||||
if (pEqnComps.set(phasei))
|
||||
{
|
||||
phase.divU(-pEqnComps[phasei] & p_rgh);
|
||||
}
|
||||
|
||||
@ -230,9 +230,10 @@ while (pimple.correct())
|
||||
tmp<fvScalarMatrix> pEqnComp2;
|
||||
|
||||
// Construct the compressibility parts of the pressure equation
|
||||
if (pimple.transonic())
|
||||
|
||||
if (phase1.compressible())
|
||||
{
|
||||
if (phase1.compressible())
|
||||
if (pimple.transonic())
|
||||
{
|
||||
surfaceScalarField phid1
|
||||
(
|
||||
@ -257,8 +258,24 @@ while (pimple.correct())
|
||||
deleteDemandDrivenData(pEqnComp1.ref().faceFluxCorrectionPtr());
|
||||
pEqnComp1.ref().relax();
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqnComp1 =
|
||||
(
|
||||
phase1.continuityError()
|
||||
- fvc::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), rho1)
|
||||
)/rho1
|
||||
+ (alpha1*psi1/rho1)*correction(fvm::ddt(p_rgh));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqnComp1 = fvm::Su(-(fvOptions(alpha1, rho1)&rho1)/rho1, p_rgh);
|
||||
}
|
||||
|
||||
if (phase2.compressible())
|
||||
if (phase2.compressible())
|
||||
{
|
||||
if (pimple.transonic())
|
||||
{
|
||||
surfaceScalarField phid2
|
||||
(
|
||||
@ -279,23 +296,11 @@ while (pimple.correct())
|
||||
+ fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh)
|
||||
)
|
||||
);
|
||||
|
||||
deleteDemandDrivenData(pEqnComp2.ref().faceFluxCorrectionPtr());
|
||||
pEqnComp2.ref().relax();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (phase1.compressible())
|
||||
{
|
||||
pEqnComp1 =
|
||||
(
|
||||
phase1.continuityError()
|
||||
- fvc::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), rho1)
|
||||
)/rho1
|
||||
+ (alpha1*psi1/rho1)*correction(fvm::ddt(p_rgh));
|
||||
}
|
||||
|
||||
if (phase2.compressible())
|
||||
else
|
||||
{
|
||||
pEqnComp2 =
|
||||
(
|
||||
@ -305,6 +310,10 @@ while (pimple.correct())
|
||||
+ (alpha2*psi2/rho2)*correction(fvm::ddt(p_rgh));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqnComp2 = fvm::Su(-(fvOptions(alpha2, rho2)&rho2)/rho2, p_rgh);
|
||||
}
|
||||
|
||||
if (fluid.transfersMass())
|
||||
{
|
||||
@ -390,11 +399,11 @@ while (pimple.correct())
|
||||
}
|
||||
|
||||
// Set the phase dilatation rates
|
||||
if (phase1.compressible())
|
||||
if (pEqnComp1.valid())
|
||||
{
|
||||
phase1.divU(-pEqnComp1 & p_rgh);
|
||||
}
|
||||
if (phase2.compressible())
|
||||
if (pEqnComp2.valid())
|
||||
{
|
||||
phase2.divU(-pEqnComp2 & p_rgh);
|
||||
}
|
||||
|
||||
@ -215,79 +215,91 @@ while (pimple.correct())
|
||||
tmp<fvScalarMatrix> pEqnComp1;
|
||||
tmp<fvScalarMatrix> pEqnComp2;
|
||||
|
||||
if (pimple.transonic())
|
||||
{
|
||||
surfaceScalarField phid1
|
||||
(
|
||||
IOobject::groupName("phid", phase1.name()),
|
||||
fvc::interpolate(psi1)*phi1
|
||||
);
|
||||
surfaceScalarField phid2
|
||||
(
|
||||
IOobject::groupName("phid", phase2.name()),
|
||||
fvc::interpolate(psi2)*phi2
|
||||
);
|
||||
// Construct the compressibility parts of the pressure equation
|
||||
|
||||
if (phase1.compressible())
|
||||
if (phase1.compressible())
|
||||
{
|
||||
if (pimple.transonic())
|
||||
{
|
||||
pEqnComp1 =
|
||||
surfaceScalarField phid1
|
||||
(
|
||||
phase1.continuityError()
|
||||
- fvc::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), rho1)
|
||||
)/rho1
|
||||
+ correction
|
||||
(
|
||||
(alpha1/rho1)*
|
||||
(
|
||||
psi1*fvm::ddt(p_rgh)
|
||||
+ fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh)
|
||||
)
|
||||
IOobject::groupName("phid", phase1.name()),
|
||||
fvc::interpolate(psi1)*phi1
|
||||
);
|
||||
|
||||
pEqnComp1 =
|
||||
(
|
||||
phase1.continuityError()
|
||||
- fvc::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), rho1)
|
||||
)/rho1
|
||||
+ correction
|
||||
(
|
||||
(alpha1/rho1)*
|
||||
(
|
||||
psi1*fvm::ddt(p_rgh)
|
||||
+ fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh)
|
||||
)
|
||||
);
|
||||
|
||||
deleteDemandDrivenData(pEqnComp1.ref().faceFluxCorrectionPtr());
|
||||
pEqnComp1.ref().relax();
|
||||
}
|
||||
|
||||
if (phase2.compressible())
|
||||
else
|
||||
{
|
||||
pEqnComp2 =
|
||||
(
|
||||
phase2.continuityError()
|
||||
- fvc::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), rho2)
|
||||
)/rho2
|
||||
+ correction
|
||||
(
|
||||
(alpha2/rho2)*
|
||||
pEqnComp1 =
|
||||
(
|
||||
psi2*fvm::ddt(p_rgh)
|
||||
+ fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh)
|
||||
)
|
||||
);
|
||||
deleteDemandDrivenData(pEqnComp2.ref().faceFluxCorrectionPtr());
|
||||
pEqnComp2.ref().relax();
|
||||
phase1.continuityError()
|
||||
- fvc::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), rho1)
|
||||
)/rho1
|
||||
+ (alpha1*psi1/rho1)*correction(fvm::ddt(p_rgh));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (phase1.compressible())
|
||||
{
|
||||
pEqnComp1 =
|
||||
(
|
||||
phase1.continuityError()
|
||||
- fvc::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), rho1)
|
||||
)/rho1
|
||||
+ (alpha1*psi1/rho1)*correction(fvm::ddt(p_rgh));
|
||||
}
|
||||
pEqnComp1 = fvm::Su(-(fvOptions(alpha1, rho1)&rho1)/rho1, p_rgh);
|
||||
}
|
||||
|
||||
if (phase2.compressible())
|
||||
if (phase2.compressible())
|
||||
{
|
||||
if (pimple.transonic())
|
||||
{
|
||||
surfaceScalarField phid2
|
||||
(
|
||||
IOobject::groupName("phid", phase2.name()),
|
||||
fvc::interpolate(psi2)*phi2
|
||||
);
|
||||
|
||||
pEqnComp2 =
|
||||
(
|
||||
phase2.continuityError()
|
||||
- fvc::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), rho2)
|
||||
)/rho2
|
||||
+ correction
|
||||
(
|
||||
(alpha2/rho2)*
|
||||
(
|
||||
psi2*fvm::ddt(p_rgh)
|
||||
+ fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh)
|
||||
)
|
||||
);
|
||||
|
||||
deleteDemandDrivenData(pEqnComp2.ref().faceFluxCorrectionPtr());
|
||||
pEqnComp2.ref().relax();
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqnComp2 =
|
||||
(
|
||||
phase2.continuityError()
|
||||
- fvc::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), rho2)
|
||||
)/rho2
|
||||
+ (alpha2*psi2/rho2)*correction(fvm::ddt(p_rgh));
|
||||
(
|
||||
phase2.continuityError()
|
||||
- fvc::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), rho2)
|
||||
)/rho2
|
||||
+ (alpha2*psi2/rho2)*correction(fvm::ddt(p_rgh));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqnComp2 = fvm::Su(-(fvOptions(alpha2, rho2)&rho2)/rho2, p_rgh);
|
||||
}
|
||||
|
||||
if (fluid.transfersMass())
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -73,13 +73,13 @@ Lavieville::fLiquid
|
||||
) const
|
||||
{
|
||||
return
|
||||
pos(alphaLiquid-alphaCrit_)
|
||||
pos(alphaLiquid - alphaCrit_)
|
||||
*(
|
||||
1 - 0.5*exp(-20*(alphaLiquid - alphaCrit_))
|
||||
)
|
||||
+ neg(alphaLiquid - alphaCrit_)
|
||||
*(
|
||||
pow(0.5*(alphaLiquid/alphaCrit_), 20*alphaCrit_)
|
||||
0.5*pow(alphaLiquid/alphaCrit_, 20*alphaCrit_)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -92,7 +92,11 @@ int main(int argc, char *argv[])
|
||||
Serr<< "slave sending to master "
|
||||
<< Pstream::masterNo() << endl;
|
||||
|
||||
OPstream toMaster(Pstream::blocking, Pstream::masterNo());
|
||||
OPstream toMaster
|
||||
(
|
||||
Pstream::commsTypes::blocking,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
|
||||
FixedList<label, 2> list3;
|
||||
list3[0] = 0;
|
||||
@ -109,7 +113,7 @@ int main(int argc, char *argv[])
|
||||
)
|
||||
{
|
||||
Serr << "master receiving from slave " << slave << endl;
|
||||
IPstream fromSlave(Pstream::blocking, slave);
|
||||
IPstream fromSlave(Pstream::commsTypes::blocking, slave);
|
||||
FixedList<label, 2> list3(fromSlave);
|
||||
|
||||
Serr<< list3 << endl;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -65,7 +65,7 @@ scalar sumReduce
|
||||
scalar slaveValue;
|
||||
UIPstream::read
|
||||
(
|
||||
Pstream::blocking,
|
||||
Pstream::commsTypes::blocking,
|
||||
slave,
|
||||
reinterpret_cast<char*>(&slaveValue),
|
||||
sizeof(scalar),
|
||||
@ -87,7 +87,7 @@ scalar sumReduce
|
||||
{
|
||||
UOPstream::write
|
||||
(
|
||||
UPstream::blocking,
|
||||
UPstream::commsTypes::blocking,
|
||||
slave,
|
||||
reinterpret_cast<const char*>(&sum),
|
||||
sizeof(scalar),
|
||||
@ -101,7 +101,7 @@ scalar sumReduce
|
||||
{
|
||||
UOPstream::write
|
||||
(
|
||||
UPstream::blocking,
|
||||
UPstream::commsTypes::blocking,
|
||||
UPstream::masterNo(),
|
||||
reinterpret_cast<const char*>(&localValue),
|
||||
sizeof(scalar),
|
||||
@ -113,7 +113,7 @@ scalar sumReduce
|
||||
{
|
||||
UIPstream::read
|
||||
(
|
||||
UPstream::blocking,
|
||||
UPstream::commsTypes::blocking,
|
||||
UPstream::masterNo(),
|
||||
reinterpret_cast<char*>(&sum),
|
||||
sizeof(scalar),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -65,7 +65,7 @@ int main(int argc, char *argv[])
|
||||
Pstream::myProcNo()
|
||||
);
|
||||
|
||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
|
||||
|
||||
if (Pstream::myProcNo() != Pstream::masterNo())
|
||||
{
|
||||
@ -100,7 +100,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
// Send allData back
|
||||
PstreamBuffers pBufs2(Pstream::nonBlocking);
|
||||
PstreamBuffers pBufs2(Pstream::commsTypes::nonBlocking);
|
||||
if (Pstream::myProcNo() == Pstream::masterNo())
|
||||
{
|
||||
for
|
||||
@ -149,7 +149,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Do a non-blocking send inbetween
|
||||
{
|
||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
|
||||
|
||||
for (label proci = 0; proci < Pstream::nProcs(); proci++)
|
||||
{
|
||||
|
||||
@ -134,12 +134,12 @@ void testTransfer(const T& input)
|
||||
{
|
||||
{
|
||||
Perr<< "slave sending to master " << Pstream::masterNo() << endl;
|
||||
OPstream toMaster(Pstream::blocking, Pstream::masterNo());
|
||||
OPstream toMaster(Pstream::commsTypes::blocking, Pstream::masterNo());
|
||||
toMaster << data;
|
||||
}
|
||||
|
||||
Perr<< "slave receiving from master " << Pstream::masterNo() << endl;
|
||||
IPstream fromMaster(Pstream::blocking, Pstream::masterNo());
|
||||
IPstream fromMaster(Pstream::commsTypes::blocking, Pstream::masterNo());
|
||||
fromMaster >> data;
|
||||
Perr<< data << endl;
|
||||
}
|
||||
@ -153,7 +153,7 @@ void testTransfer(const T& input)
|
||||
)
|
||||
{
|
||||
Perr<< "master receiving from slave " << slave << endl;
|
||||
IPstream fromSlave(Pstream::blocking, slave);
|
||||
IPstream fromSlave(Pstream::commsTypes::blocking, slave);
|
||||
fromSlave >> data;
|
||||
Perr<< data << endl;
|
||||
}
|
||||
@ -166,7 +166,7 @@ void testTransfer(const T& input)
|
||||
)
|
||||
{
|
||||
Perr<< "master sending to slave " << slave << endl;
|
||||
OPstream toSlave(Pstream::blocking, slave);
|
||||
OPstream toSlave(Pstream::commsTypes::blocking, slave);
|
||||
toSlave << data;
|
||||
}
|
||||
}
|
||||
@ -187,12 +187,21 @@ void testTokenized(const T& data)
|
||||
{
|
||||
{
|
||||
Perr<< "slave sending to master " << Pstream::masterNo() << endl;
|
||||
OPstream toMaster(Pstream::blocking, Pstream::masterNo());
|
||||
OPstream toMaster
|
||||
(
|
||||
Pstream::commsTypes::blocking,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
|
||||
toMaster << data;
|
||||
}
|
||||
|
||||
Perr<< "slave receiving from master " << Pstream::masterNo() << endl;
|
||||
IPstream fromMaster(Pstream::blocking, Pstream::masterNo());
|
||||
IPstream fromMaster
|
||||
(
|
||||
Pstream::commsTypes::blocking,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
|
||||
fromMaster >> tok;
|
||||
Perr<< tok.info() << endl;
|
||||
@ -207,7 +216,7 @@ void testTokenized(const T& data)
|
||||
)
|
||||
{
|
||||
Perr<< "master receiving from slave " << slave << endl;
|
||||
IPstream fromSlave(Pstream::blocking, slave);
|
||||
IPstream fromSlave(Pstream::commsTypes::blocking, slave);
|
||||
fromSlave >> tok;
|
||||
Perr<< tok.info() << endl;
|
||||
}
|
||||
@ -220,7 +229,7 @@ void testTokenized(const T& data)
|
||||
)
|
||||
{
|
||||
Perr<< "master sending to slave " << slave << endl;
|
||||
OPstream toSlave(Pstream::blocking, slave);
|
||||
OPstream toSlave(Pstream::commsTypes::blocking, slave);
|
||||
toSlave << data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -63,7 +63,7 @@ Gather<T0>::Gather(const T0& localData, const bool redistribute)
|
||||
slave++, procIndex++
|
||||
)
|
||||
{
|
||||
IPstream fromSlave(Pstream::scheduled, slave);
|
||||
IPstream fromSlave(Pstream::commsTypes::scheduled, slave);
|
||||
fromSlave >> this->operator[](procIndex);
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ Gather<T0>::Gather(const T0& localData, const bool redistribute)
|
||||
slave++, procIndex++
|
||||
)
|
||||
{
|
||||
OPstream toSlave(Pstream::scheduled, slave);
|
||||
OPstream toSlave(Pstream::commsTypes::scheduled, slave);
|
||||
|
||||
if (redistribute)
|
||||
{
|
||||
@ -92,13 +92,21 @@ Gather<T0>::Gather(const T0& localData, const bool redistribute)
|
||||
{
|
||||
// Slave: send my local data to master
|
||||
{
|
||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
||||
OPstream toMaster
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
toMaster << localData;
|
||||
}
|
||||
|
||||
// Receive data from master
|
||||
{
|
||||
IPstream fromMaster(Pstream::scheduled, Pstream::masterNo());
|
||||
IPstream fromMaster
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
if (redistribute)
|
||||
{
|
||||
fromMaster >> *this;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -641,7 +641,7 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
|
||||
labelList rotation(faces.size(), label(0));
|
||||
labelList faceMap(faces.size(), label(-1));
|
||||
|
||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
|
||||
|
||||
// Send ordering
|
||||
forAll(sortMesh.boundaryMesh(), patchi)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -430,7 +430,7 @@ void Foam::mergeAndWrite
|
||||
// Receive slave ones
|
||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||
{
|
||||
IPstream fromSlave(Pstream::scheduled, slave);
|
||||
IPstream fromSlave(Pstream::commsTypes::scheduled, slave);
|
||||
|
||||
pointField slavePts(fromSlave);
|
||||
labelList slaveIDs(fromSlave);
|
||||
@ -446,7 +446,7 @@ void Foam::mergeAndWrite
|
||||
// be improved.
|
||||
OPstream toMaster
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo(),
|
||||
myPoints.byteSize() + myIDs.byteSize()
|
||||
);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -352,7 +352,11 @@ void syncPoints
|
||||
}
|
||||
}
|
||||
|
||||
OPstream toNbr(Pstream::blocking, procPatch.neighbProcNo());
|
||||
OPstream toNbr
|
||||
(
|
||||
Pstream::commsTypes::blocking,
|
||||
procPatch.neighbProcNo()
|
||||
);
|
||||
toNbr << patchInfo;
|
||||
}
|
||||
}
|
||||
@ -380,7 +384,7 @@ void syncPoints
|
||||
// so cannot use Pstream::read.
|
||||
IPstream fromNbr
|
||||
(
|
||||
Pstream::blocking,
|
||||
Pstream::commsTypes::blocking,
|
||||
procPatch.neighbProcNo()
|
||||
);
|
||||
fromNbr >> nbrPatchInfo;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -394,7 +394,7 @@ void getInterfaceSizes
|
||||
slave++
|
||||
)
|
||||
{
|
||||
IPstream fromSlave(Pstream::blocking, slave);
|
||||
IPstream fromSlave(Pstream::commsTypes::blocking, slave);
|
||||
|
||||
EdgeMap<Map<label>> slaveSizes(fromSlave);
|
||||
|
||||
@ -439,7 +439,11 @@ void getInterfaceSizes
|
||||
{
|
||||
// Send to master
|
||||
{
|
||||
OPstream toMaster(Pstream::blocking, Pstream::masterNo());
|
||||
OPstream toMaster
|
||||
(
|
||||
Pstream::commsTypes::blocking,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
toMaster << regionsToSize;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -124,14 +124,18 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
||||
slave++
|
||||
)
|
||||
{
|
||||
OPstream toSlave(Pstream::scheduled, slave);
|
||||
OPstream toSlave(Pstream::commsTypes::scheduled, slave);
|
||||
toSlave << patchEntries;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Receive patches
|
||||
IPstream fromMaster(Pstream::scheduled, Pstream::masterNo());
|
||||
IPstream fromMaster
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
fromMaster >> patchEntries;
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -467,7 +467,7 @@ void writeProcAddressing
|
||||
// Apply face flips
|
||||
mapDistributeBase::distribute
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
List<labelPair>(),
|
||||
faceDistMap.constructSize(),
|
||||
faceDistMap.subMap(),
|
||||
@ -489,7 +489,7 @@ void writeProcAddressing
|
||||
// provide one ...
|
||||
mapDistributeBase::distribute
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
List<labelPair>(),
|
||||
patchDistMap.constructSize(),
|
||||
patchDistMap.subMap(),
|
||||
@ -520,7 +520,7 @@ void writeProcAddressing
|
||||
|
||||
mapDistributeBase::distribute
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
List<labelPair>(),
|
||||
map.nOldFaces(),
|
||||
faceDistMap.constructMap(),
|
||||
@ -649,7 +649,7 @@ void readFields
|
||||
{
|
||||
if (!haveMesh[procI])
|
||||
{
|
||||
OPstream toProc(Pstream::blocking, procI);
|
||||
OPstream toProc(Pstream::commsTypes::blocking, procI);
|
||||
toProc<< tsubfld();
|
||||
}
|
||||
}
|
||||
@ -665,7 +665,11 @@ void readFields
|
||||
const word& name = masterNames[i];
|
||||
|
||||
// Receive field
|
||||
IPstream fromMaster(Pstream::blocking, Pstream::masterNo());
|
||||
IPstream fromMaster
|
||||
(
|
||||
Pstream::commsTypes::blocking,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
dictionary fieldDict(fromMaster);
|
||||
|
||||
fields.set
|
||||
@ -723,8 +727,8 @@ void correctCoupledBoundaryConditions(fvMesh& mesh)
|
||||
typename GeoField::Boundary& bfld = fld.boundaryFieldRef();
|
||||
if
|
||||
(
|
||||
Pstream::defaultCommsType == Pstream::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::nonBlocking
|
||||
Pstream::defaultCommsType == Pstream::commsTypes::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
label nReq = Pstream::nRequests();
|
||||
@ -745,7 +749,7 @@ void correctCoupledBoundaryConditions(fvMesh& mesh)
|
||||
if
|
||||
(
|
||||
Pstream::parRun()
|
||||
&& Pstream::defaultCommsType == Pstream::nonBlocking
|
||||
&& Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
Pstream::waitRequests(nReq);
|
||||
@ -763,7 +767,7 @@ void correctCoupledBoundaryConditions(fvMesh& mesh)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::scheduled)
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
const lduSchedule& patchSchedule =
|
||||
fld.mesh().globalData().patchSchedule();
|
||||
@ -779,11 +783,11 @@ void correctCoupledBoundaryConditions(fvMesh& mesh)
|
||||
{
|
||||
if (patchSchedule[patchEvali].init)
|
||||
{
|
||||
pfld.initEvaluate(Pstream::scheduled);
|
||||
pfld.initEvaluate(Pstream::commsTypes::scheduled);
|
||||
}
|
||||
else
|
||||
{
|
||||
pfld.evaluate(Pstream::scheduled);
|
||||
pfld.evaluate(Pstream::commsTypes::scheduled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -43,8 +43,8 @@ void evaluateConstraintTypes(GeometricField<Type, fvPatchField, volMesh>& fld)
|
||||
|
||||
if
|
||||
(
|
||||
Pstream::defaultCommsType == Pstream::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::nonBlocking
|
||||
Pstream::defaultCommsType == Pstream::commsTypes::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
label nReq = Pstream::nRequests();
|
||||
@ -67,7 +67,7 @@ void evaluateConstraintTypes(GeometricField<Type, fvPatchField, volMesh>& fld)
|
||||
if
|
||||
(
|
||||
Pstream::parRun()
|
||||
&& Pstream::defaultCommsType == Pstream::nonBlocking
|
||||
&& Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
Pstream::waitRequests(nReq);
|
||||
@ -87,7 +87,7 @@ void evaluateConstraintTypes(GeometricField<Type, fvPatchField, volMesh>& fld)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::scheduled)
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
const lduSchedule& patchSchedule =
|
||||
fld.mesh().globalData().patchSchedule();
|
||||
@ -105,11 +105,11 @@ void evaluateConstraintTypes(GeometricField<Type, fvPatchField, volMesh>& fld)
|
||||
{
|
||||
if (patchSchedule[patchEvali].init)
|
||||
{
|
||||
tgtField.initEvaluate(Pstream::scheduled);
|
||||
tgtField.initEvaluate(Pstream::commsTypes::scheduled);
|
||||
}
|
||||
else
|
||||
{
|
||||
tgtField.evaluate(Pstream::scheduled);
|
||||
tgtField.evaluate(Pstream::commsTypes::scheduled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
27
etc/caseDicts/postProcessing/lagrangian/dsmcFields
Normal file
27
etc/caseDicts/postProcessing/lagrangian/dsmcFields
Normal file
@ -0,0 +1,27 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Web: www.OpenFOAM.org
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Description
|
||||
Calculate intensive fields:
|
||||
- UMean
|
||||
- translationalT
|
||||
- internalT
|
||||
- overallT
|
||||
from averaged extensive fields from a DSMC calculation.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
type dsmcFields;
|
||||
libs ("liblagrangianFunctionObjects.so");
|
||||
|
||||
fields (rhoNMean rhoMMean momentumMean linearKEMean internalEMean
|
||||
iDofMean fDMean);
|
||||
|
||||
executeControl writeTime;
|
||||
writeControl writeTime;
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -112,7 +112,7 @@ void Foam::ParSortableList<Type>::checkAndSend
|
||||
}
|
||||
|
||||
{
|
||||
OPstream toSlave(Pstream::blocking, destProci);
|
||||
OPstream toSlave(Pstream::commsTypes::blocking, destProci);
|
||||
toSlave << values << indices;
|
||||
}
|
||||
}
|
||||
@ -306,7 +306,7 @@ void Foam::ParSortableList<Type>::sort()
|
||||
Pout<< "Receiving from " << proci << endl;
|
||||
}
|
||||
|
||||
IPstream fromSlave(Pstream::blocking, proci);
|
||||
IPstream fromSlave(Pstream::commsTypes::blocking, proci);
|
||||
|
||||
fromSlave >> recValues >> recIndices;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -83,7 +83,7 @@ void Foam::PstreamBuffers::finishedSends(const bool block)
|
||||
{
|
||||
finishedSendsCalled_ = true;
|
||||
|
||||
if (commsType_ == UPstream::nonBlocking)
|
||||
if (commsType_ == UPstream::commsTypes::nonBlocking)
|
||||
{
|
||||
Pstream::exchange<DynamicList<char>, char>
|
||||
(
|
||||
@ -101,7 +101,7 @@ void Foam::PstreamBuffers::finishedSends(labelList& recvSizes, const bool block)
|
||||
{
|
||||
finishedSendsCalled_ = true;
|
||||
|
||||
if (commsType_ == UPstream::nonBlocking)
|
||||
if (commsType_ == UPstream::commsTypes::nonBlocking)
|
||||
{
|
||||
Pstream::exchangeSizes(sendBuf_, recvSizes, comm_);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,7 +35,7 @@ Description
|
||||
|
||||
Example usage:
|
||||
|
||||
PstreamBuffers pBuffers(Pstream::nonBlocking);
|
||||
PstreamBuffers pBuffers(Pstream::commsTypes::nonBlocking);
|
||||
|
||||
for (label proci = 0; proci < Pstream::nProcs(); proci++)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -113,7 +113,7 @@ Foam::UOPstream::UOPstream(const int toProcNo, PstreamBuffers& buffers)
|
||||
sendBuf_(buffers.sendBuf_[toProcNo]),
|
||||
tag_(buffers.tag_),
|
||||
comm_(buffers.comm_),
|
||||
sendAtDestruct_(buffers.commsType_ != UPstream::nonBlocking)
|
||||
sendAtDestruct_(buffers.commsType_ != UPstream::commsTypes::nonBlocking)
|
||||
{
|
||||
setOpened();
|
||||
setGood();
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright 2015-2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -62,7 +62,7 @@ class UPstream
|
||||
public:
|
||||
|
||||
//- Types of communications
|
||||
enum commsTypes
|
||||
enum class commsTypes
|
||||
{
|
||||
blocking,
|
||||
scheduled,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -65,7 +65,7 @@ void Foam::Pstream::combineGather
|
||||
T value;
|
||||
UIPstream::read
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
belowID,
|
||||
reinterpret_cast<char*>(&value),
|
||||
sizeof(T),
|
||||
@ -83,7 +83,14 @@ void Foam::Pstream::combineGather
|
||||
}
|
||||
else
|
||||
{
|
||||
IPstream fromBelow(UPstream::scheduled, belowID, 0, tag, comm);
|
||||
IPstream fromBelow
|
||||
(
|
||||
UPstream::commsTypes::scheduled,
|
||||
belowID,
|
||||
0,
|
||||
tag,
|
||||
comm
|
||||
);
|
||||
T value(fromBelow);
|
||||
|
||||
if (debug & 2)
|
||||
@ -109,7 +116,7 @@ void Foam::Pstream::combineGather
|
||||
{
|
||||
UOPstream::write
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
reinterpret_cast<const char*>(&Value),
|
||||
sizeof(T),
|
||||
@ -121,7 +128,7 @@ void Foam::Pstream::combineGather
|
||||
{
|
||||
OPstream toAbove
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
0,
|
||||
tag,
|
||||
@ -189,7 +196,7 @@ void Foam::Pstream::combineScatter
|
||||
{
|
||||
UIPstream::read
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
reinterpret_cast<char*>(&Value),
|
||||
sizeof(T),
|
||||
@ -201,7 +208,7 @@ void Foam::Pstream::combineScatter
|
||||
{
|
||||
IPstream fromAbove
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
0,
|
||||
tag,
|
||||
@ -231,7 +238,7 @@ void Foam::Pstream::combineScatter
|
||||
{
|
||||
UOPstream::write
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
belowID,
|
||||
reinterpret_cast<const char*>(&Value),
|
||||
sizeof(T),
|
||||
@ -241,7 +248,14 @@ void Foam::Pstream::combineScatter
|
||||
}
|
||||
else
|
||||
{
|
||||
OPstream toBelow(UPstream::scheduled, belowID, 0, tag, comm);
|
||||
OPstream toBelow
|
||||
(
|
||||
UPstream::commsTypes::scheduled,
|
||||
belowID,
|
||||
0,
|
||||
tag,
|
||||
comm
|
||||
);
|
||||
toBelow << Value;
|
||||
}
|
||||
}
|
||||
@ -294,7 +308,7 @@ void Foam::Pstream::listCombineGather
|
||||
|
||||
UIPstream::read
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
belowID,
|
||||
reinterpret_cast<char*>(receivedValues.begin()),
|
||||
receivedValues.byteSize(),
|
||||
@ -315,7 +329,14 @@ void Foam::Pstream::listCombineGather
|
||||
}
|
||||
else
|
||||
{
|
||||
IPstream fromBelow(UPstream::scheduled, belowID, 0, tag, comm);
|
||||
IPstream fromBelow
|
||||
(
|
||||
UPstream::commsTypes::scheduled,
|
||||
belowID,
|
||||
0,
|
||||
tag,
|
||||
comm
|
||||
);
|
||||
List<T> receivedValues(fromBelow);
|
||||
|
||||
if (debug & 2)
|
||||
@ -344,7 +365,7 @@ void Foam::Pstream::listCombineGather
|
||||
{
|
||||
UOPstream::write
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
reinterpret_cast<const char*>(Values.begin()),
|
||||
Values.byteSize(),
|
||||
@ -356,7 +377,7 @@ void Foam::Pstream::listCombineGather
|
||||
{
|
||||
OPstream toAbove
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
0,
|
||||
tag,
|
||||
@ -424,7 +445,7 @@ void Foam::Pstream::listCombineScatter
|
||||
{
|
||||
UIPstream::read
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
reinterpret_cast<char*>(Values.begin()),
|
||||
Values.byteSize(),
|
||||
@ -436,7 +457,7 @@ void Foam::Pstream::listCombineScatter
|
||||
{
|
||||
IPstream fromAbove
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
0,
|
||||
tag,
|
||||
@ -466,7 +487,7 @@ void Foam::Pstream::listCombineScatter
|
||||
{
|
||||
UOPstream::write
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
belowID,
|
||||
reinterpret_cast<const char*>(Values.begin()),
|
||||
Values.byteSize(),
|
||||
@ -476,7 +497,14 @@ void Foam::Pstream::listCombineScatter
|
||||
}
|
||||
else
|
||||
{
|
||||
OPstream toBelow(UPstream::scheduled, belowID, 0, tag, comm);
|
||||
OPstream toBelow
|
||||
(
|
||||
UPstream::commsTypes::scheduled,
|
||||
belowID,
|
||||
0,
|
||||
tag,
|
||||
comm
|
||||
);
|
||||
toBelow << Values;
|
||||
}
|
||||
}
|
||||
@ -535,7 +563,14 @@ void Foam::Pstream::mapCombineGather
|
||||
{
|
||||
label belowID = myComm.below()[belowI];
|
||||
|
||||
IPstream fromBelow(UPstream::scheduled, belowID, 0, tag, comm);
|
||||
IPstream fromBelow
|
||||
(
|
||||
UPstream::commsTypes::scheduled,
|
||||
belowID,
|
||||
0,
|
||||
tag,
|
||||
comm
|
||||
);
|
||||
Container receivedValues(fromBelow);
|
||||
|
||||
if (debug & 2)
|
||||
@ -575,7 +610,14 @@ void Foam::Pstream::mapCombineGather
|
||||
<< " data:" << Values << endl;
|
||||
}
|
||||
|
||||
OPstream toAbove(UPstream::scheduled, myComm.above(), 0, tag, comm);
|
||||
OPstream toAbove
|
||||
(
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
0,
|
||||
tag,
|
||||
comm
|
||||
);
|
||||
toAbove << Values;
|
||||
}
|
||||
}
|
||||
@ -635,7 +677,7 @@ void Foam::Pstream::mapCombineScatter
|
||||
{
|
||||
IPstream fromAbove
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
0,
|
||||
tag,
|
||||
@ -660,7 +702,14 @@ void Foam::Pstream::mapCombineScatter
|
||||
Pout<< " sending to " << belowID << " data:" << Values << endl;
|
||||
}
|
||||
|
||||
OPstream toBelow(UPstream::scheduled, belowID, 0, tag, comm);
|
||||
OPstream toBelow
|
||||
(
|
||||
UPstream::commsTypes::scheduled,
|
||||
belowID,
|
||||
0,
|
||||
tag,
|
||||
comm
|
||||
);
|
||||
toBelow << Values;
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ void Foam::Pstream::exchangeContainer
|
||||
{
|
||||
UIPstream::read
|
||||
(
|
||||
UPstream::nonBlocking,
|
||||
UPstream::commsTypes::nonBlocking,
|
||||
proci,
|
||||
reinterpret_cast<char*>(recvBufs[proci].begin()),
|
||||
recvSizes[proci]*sizeof(T),
|
||||
@ -76,7 +76,7 @@ void Foam::Pstream::exchangeContainer
|
||||
(
|
||||
!UOPstream::write
|
||||
(
|
||||
UPstream::nonBlocking,
|
||||
UPstream::commsTypes::nonBlocking,
|
||||
proci,
|
||||
reinterpret_cast<const char*>(sendBufs[proci].begin()),
|
||||
sendBufs[proci].size()*sizeof(T),
|
||||
@ -128,7 +128,7 @@ void Foam::Pstream::exchangeBuf
|
||||
{
|
||||
UIPstream::read
|
||||
(
|
||||
UPstream::nonBlocking,
|
||||
UPstream::commsTypes::nonBlocking,
|
||||
proci,
|
||||
recvBufs[proci],
|
||||
recvSizes[proci]*sizeof(T),
|
||||
@ -150,7 +150,7 @@ void Foam::Pstream::exchangeBuf
|
||||
(
|
||||
!UOPstream::write
|
||||
(
|
||||
UPstream::nonBlocking,
|
||||
UPstream::commsTypes::nonBlocking,
|
||||
proci,
|
||||
sendBufs[proci],
|
||||
sendSizes[proci]*sizeof(T),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -66,7 +66,7 @@ void Pstream::gather
|
||||
{
|
||||
UIPstream::read
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.below()[belowI],
|
||||
reinterpret_cast<char*>(&value),
|
||||
sizeof(T),
|
||||
@ -78,7 +78,7 @@ void Pstream::gather
|
||||
{
|
||||
IPstream fromBelow
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.below()[belowI],
|
||||
0,
|
||||
tag,
|
||||
@ -97,7 +97,7 @@ void Pstream::gather
|
||||
{
|
||||
UOPstream::write
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
reinterpret_cast<const char*>(&Value),
|
||||
sizeof(T),
|
||||
@ -109,7 +109,7 @@ void Pstream::gather
|
||||
{
|
||||
OPstream toAbove
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
0,
|
||||
tag,
|
||||
@ -163,7 +163,7 @@ void Pstream::scatter
|
||||
{
|
||||
UIPstream::read
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
reinterpret_cast<char*>(&Value),
|
||||
sizeof(T),
|
||||
@ -175,7 +175,7 @@ void Pstream::scatter
|
||||
{
|
||||
IPstream fromAbove
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
0,
|
||||
tag,
|
||||
@ -194,7 +194,7 @@ void Pstream::scatter
|
||||
{
|
||||
UOPstream::write
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.below()[belowI],
|
||||
reinterpret_cast<const char*>(&Value),
|
||||
sizeof(T),
|
||||
@ -206,7 +206,7 @@ void Pstream::scatter
|
||||
{
|
||||
OPstream toBelow
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.below()[belowI],
|
||||
0,
|
||||
tag,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -79,7 +79,7 @@ void Pstream::gatherList
|
||||
|
||||
UIPstream::read
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
belowID,
|
||||
reinterpret_cast<char*>(receivedValues.begin()),
|
||||
receivedValues.byteSize(),
|
||||
@ -96,7 +96,14 @@ void Pstream::gatherList
|
||||
}
|
||||
else
|
||||
{
|
||||
IPstream fromBelow(UPstream::scheduled, belowID, 0, tag, comm);
|
||||
IPstream fromBelow
|
||||
(
|
||||
UPstream::commsTypes::scheduled,
|
||||
belowID,
|
||||
0,
|
||||
tag,
|
||||
comm
|
||||
);
|
||||
fromBelow >> Values[belowID];
|
||||
|
||||
if (debug & 2)
|
||||
@ -148,7 +155,7 @@ void Pstream::gatherList
|
||||
|
||||
OPstream::write
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
reinterpret_cast<const char*>(sendingValues.begin()),
|
||||
sendingValues.byteSize(),
|
||||
@ -160,7 +167,7 @@ void Pstream::gatherList
|
||||
{
|
||||
OPstream toAbove
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
0,
|
||||
tag,
|
||||
@ -234,7 +241,7 @@ void Pstream::scatterList
|
||||
|
||||
UIPstream::read
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
reinterpret_cast<char*>(receivedValues.begin()),
|
||||
receivedValues.byteSize(),
|
||||
@ -251,7 +258,7 @@ void Pstream::scatterList
|
||||
{
|
||||
IPstream fromAbove
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
0,
|
||||
tag,
|
||||
@ -290,7 +297,7 @@ void Pstream::scatterList
|
||||
|
||||
OPstream::write
|
||||
(
|
||||
UPstream::scheduled,
|
||||
UPstream::commsTypes::scheduled,
|
||||
belowID,
|
||||
reinterpret_cast<const char*>(sendingValues.begin()),
|
||||
sendingValues.byteSize(),
|
||||
@ -300,7 +307,14 @@ void Pstream::scatterList
|
||||
}
|
||||
else
|
||||
{
|
||||
OPstream toBelow(UPstream::scheduled, belowID, 0, tag, comm);
|
||||
OPstream toBelow
|
||||
(
|
||||
UPstream::commsTypes::scheduled,
|
||||
belowID,
|
||||
0,
|
||||
tag,
|
||||
comm
|
||||
);
|
||||
|
||||
// Send data destined for all other processors below belowID
|
||||
forAll(notBelowLeaves, leafI)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -135,8 +135,12 @@ void Foam::timeSelector::addOptions
|
||||
argList::addBoolOption
|
||||
(
|
||||
"noZero",
|
||||
"exclude the '0/' dir from the times list, "
|
||||
"has precedence over the -withZero option"
|
||||
string("exclude the '0/' dir from the times list")
|
||||
+ (
|
||||
withZero
|
||||
? ", has precedence over the -withZero option"
|
||||
: ""
|
||||
)
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -334,7 +334,19 @@ public:
|
||||
) const;
|
||||
|
||||
//- Find and return a T,
|
||||
// if not found return the given default value
|
||||
// if not found throw a fatal error.
|
||||
// If recursive, search parent dictionaries.
|
||||
// If patternMatch, use regular expressions.
|
||||
template<class T>
|
||||
T lookupType
|
||||
(
|
||||
const word&,
|
||||
bool recursive=false,
|
||||
bool patternMatch=true
|
||||
) const;
|
||||
|
||||
//- Find and return a T,
|
||||
// if not found return the given default value.
|
||||
// If recursive, search parent dictionaries.
|
||||
// If patternMatch, use regular expressions.
|
||||
template<class T>
|
||||
|
||||
@ -28,6 +28,30 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class T>
|
||||
T Foam::dictionary::lookupType
|
||||
(
|
||||
const word& keyword,
|
||||
bool recursive,
|
||||
bool patternMatch
|
||||
) const
|
||||
{
|
||||
const entry* entryPtr = lookupEntryPtr(keyword, recursive, patternMatch);
|
||||
|
||||
if (entryPtr == nullptr)
|
||||
{
|
||||
FatalIOErrorInFunction
|
||||
(
|
||||
*this
|
||||
) << "keyword " << keyword << " is undefined in dictionary "
|
||||
<< name()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
return pTraits<T>(entryPtr->stream());
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
T Foam::dictionary::lookupOrDefault
|
||||
(
|
||||
|
||||
@ -104,7 +104,7 @@ bool Foam::regIOobject::read
|
||||
|
||||
IPstream fromAbove
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
0,
|
||||
Pstream::msgType(),
|
||||
@ -119,7 +119,7 @@ bool Foam::regIOobject::read
|
||||
{
|
||||
OPstream toBelow
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
myComm.below()[belowI],
|
||||
0,
|
||||
Pstream::msgType(),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -422,8 +422,8 @@ evaluate()
|
||||
|
||||
if
|
||||
(
|
||||
Pstream::defaultCommsType == Pstream::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::nonBlocking
|
||||
Pstream::defaultCommsType == Pstream::commsTypes::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
label nReq = Pstream::nRequests();
|
||||
@ -437,7 +437,7 @@ evaluate()
|
||||
if
|
||||
(
|
||||
Pstream::parRun()
|
||||
&& Pstream::defaultCommsType == Pstream::nonBlocking
|
||||
&& Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
Pstream::waitRequests(nReq);
|
||||
@ -448,7 +448,7 @@ evaluate()
|
||||
this->operator[](patchi).evaluate(Pstream::defaultCommsType);
|
||||
}
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::scheduled)
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
const lduSchedule& patchSchedule =
|
||||
bmesh_.mesh().globalData().patchSchedule();
|
||||
@ -458,12 +458,12 @@ evaluate()
|
||||
if (patchSchedule[patchEvali].init)
|
||||
{
|
||||
this->operator[](patchSchedule[patchEvali].patch)
|
||||
.initEvaluate(Pstream::scheduled);
|
||||
.initEvaluate(Pstream::commsTypes::scheduled);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->operator[](patchSchedule[patchEvali].patch)
|
||||
.evaluate(Pstream::scheduled);
|
||||
.evaluate(Pstream::commsTypes::scheduled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -124,7 +124,8 @@ public:
|
||||
//- Update the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -116,7 +116,8 @@ public:
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
) = 0;
|
||||
|
||||
//- Initialise swap of patch point values
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -162,7 +162,8 @@ public:
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -161,7 +161,8 @@ public:
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -122,14 +122,11 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
);
|
||||
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -122,14 +122,11 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
);
|
||||
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -157,7 +157,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
//- Constraint handling
|
||||
// Constraint handling
|
||||
|
||||
//- Return the constraint type this pointPatchField implements
|
||||
virtual const word& constraintType() const
|
||||
@ -171,7 +171,8 @@ public:
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -113,7 +113,7 @@ void Foam::processorCyclicPointPatchField<Type>::initSwapAddSeparated
|
||||
)
|
||||
);
|
||||
|
||||
if (commsType == Pstream::nonBlocking)
|
||||
if (commsType == Pstream::commsTypes::nonBlocking)
|
||||
{
|
||||
receiveBuf_.setSize(pf.size());
|
||||
IPstream::read
|
||||
@ -149,7 +149,7 @@ void Foam::processorCyclicPointPatchField<Type>::swapAddSeparated
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
// If nonblocking data has already been received into receiveBuf_
|
||||
if (commsType != Pstream::nonBlocking)
|
||||
if (commsType != Pstream::commsTypes::nonBlocking)
|
||||
{
|
||||
receiveBuf_.setSize(this->size());
|
||||
IPstream::read
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -166,7 +166,8 @@ public:
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -134,13 +134,11 @@ public:
|
||||
return symmetryPlanePointPatch::typeName;
|
||||
}
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Update the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
);
|
||||
//- Update the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -122,21 +122,17 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
//- Constraint handling
|
||||
//- Return the constraint type this pointPatchField implements
|
||||
virtual const word& constraintType() const
|
||||
{
|
||||
return type();
|
||||
}
|
||||
|
||||
//- Return the constraint type this pointPatchField implements
|
||||
virtual const word& constraintType() const
|
||||
{
|
||||
return type();
|
||||
}
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Update the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
);
|
||||
//- Update the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -231,7 +231,7 @@ public:
|
||||
//- Evaluate the patch field, sets Updated to false
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
);
|
||||
|
||||
//- Write
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -139,14 +139,11 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Update the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
);
|
||||
|
||||
//- Update the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
);
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -418,14 +418,16 @@ public:
|
||||
//- Initialise evaluation of the patch field (do nothing)
|
||||
virtual void initEvaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
)
|
||||
{}
|
||||
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -764,7 +764,7 @@ void Foam::argList::parse
|
||||
{
|
||||
options_.set("case", roots[slave-1]/globalCase_);
|
||||
|
||||
OPstream toSlave(Pstream::scheduled, slave);
|
||||
OPstream toSlave(Pstream::commsTypes::scheduled, slave);
|
||||
toSlave << args_ << options_;
|
||||
}
|
||||
options_.erase("case");
|
||||
@ -811,7 +811,7 @@ void Foam::argList::parse
|
||||
slave++
|
||||
)
|
||||
{
|
||||
OPstream toSlave(Pstream::scheduled, slave);
|
||||
OPstream toSlave(Pstream::commsTypes::scheduled, slave);
|
||||
toSlave << args_ << options_;
|
||||
}
|
||||
}
|
||||
@ -819,7 +819,11 @@ void Foam::argList::parse
|
||||
else
|
||||
{
|
||||
// Collect the master's argument list
|
||||
IPstream fromMaster(Pstream::scheduled, Pstream::masterNo());
|
||||
IPstream fromMaster
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
fromMaster >> args_ >> options_;
|
||||
|
||||
// Establish rootPath_/globalCase_/case_ for slave
|
||||
@ -853,7 +857,7 @@ void Foam::argList::parse
|
||||
slave++
|
||||
)
|
||||
{
|
||||
IPstream fromSlave(Pstream::scheduled, slave);
|
||||
IPstream fromSlave(Pstream::commsTypes::scheduled, slave);
|
||||
|
||||
string slaveBuild;
|
||||
string slaveMachine;
|
||||
@ -876,7 +880,11 @@ void Foam::argList::parse
|
||||
}
|
||||
else
|
||||
{
|
||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
||||
OPstream toMaster
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
toMaster << string(Foam::FOAMbuild) << hostName() << pid();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -97,7 +97,7 @@ Foam::LUscalarMatrix::LUscalarMatrix
|
||||
(
|
||||
IPstream
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
slave,
|
||||
0, // bufSize
|
||||
Pstream::msgType(),
|
||||
@ -111,7 +111,7 @@ Foam::LUscalarMatrix::LUscalarMatrix
|
||||
{
|
||||
OPstream toMaster
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo(),
|
||||
0, // bufSize
|
||||
Pstream::msgType(),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -62,7 +62,7 @@ void Foam::LUscalarMatrix::solve
|
||||
{
|
||||
IPstream::read
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
slave,
|
||||
reinterpret_cast<char*>
|
||||
(
|
||||
@ -78,7 +78,7 @@ void Foam::LUscalarMatrix::solve
|
||||
{
|
||||
OPstream::write
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo(),
|
||||
reinterpret_cast<const char*>(x.begin()),
|
||||
x.byteSize(),
|
||||
@ -106,7 +106,7 @@ void Foam::LUscalarMatrix::solve
|
||||
{
|
||||
OPstream::write
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
slave,
|
||||
reinterpret_cast<const char*>
|
||||
(
|
||||
@ -122,7 +122,7 @@ void Foam::LUscalarMatrix::solve
|
||||
{
|
||||
IPstream::read
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo(),
|
||||
reinterpret_cast<char*>(x.begin()),
|
||||
x.byteSize(),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -38,8 +38,8 @@ void Foam::LduMatrix<Type, DType, LUType>::initMatrixInterfaces
|
||||
{
|
||||
if
|
||||
(
|
||||
Pstream::defaultCommsType == Pstream::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::nonBlocking
|
||||
Pstream::defaultCommsType == Pstream::commsTypes::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
forAll(interfaces_, interfacei)
|
||||
@ -57,7 +57,7 @@ void Foam::LduMatrix<Type, DType, LUType>::initMatrixInterfaces
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::scheduled)
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
const lduSchedule& patchSchedule = this->patchSchedule();
|
||||
|
||||
@ -78,7 +78,7 @@ void Foam::LduMatrix<Type, DType, LUType>::initMatrixInterfaces
|
||||
psiif,
|
||||
interfaceCoeffs[interfacei],
|
||||
//Amultiplier<Type, LUType>(interfaceCoeffs[interfacei]),
|
||||
Pstream::blocking
|
||||
Pstream::commsTypes::blocking
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -103,12 +103,12 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces
|
||||
{
|
||||
if
|
||||
(
|
||||
Pstream::defaultCommsType == Pstream::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::nonBlocking
|
||||
Pstream::defaultCommsType == Pstream::commsTypes::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
// Block until all sends/receives have been finished
|
||||
if (Pstream::defaultCommsType == Pstream::nonBlocking)
|
||||
if (Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking)
|
||||
{
|
||||
IPstream::waitRequests();
|
||||
OPstream::waitRequests();
|
||||
@ -129,7 +129,7 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::scheduled)
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
const lduSchedule& patchSchedule = this->patchSchedule();
|
||||
|
||||
@ -148,7 +148,7 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces
|
||||
psiif,
|
||||
interfaceCoeffs[interfacei],
|
||||
//Amultiplier<Type, LUType>(interfaceCoeffs[interfacei]),
|
||||
Pstream::scheduled
|
||||
Pstream::commsTypes::scheduled
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -159,7 +159,7 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces
|
||||
psiif,
|
||||
interfaceCoeffs[interfacei],
|
||||
//Amultiplier<Type, LUType>(interfaceCoeffs[interfacei]),
|
||||
Pstream::scheduled
|
||||
Pstream::commsTypes::scheduled
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -182,7 +182,7 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces
|
||||
psiif,
|
||||
interfaceCoeffs[interfacei],
|
||||
//Amultiplier<Type, LUType>(interfaceCoeffs[interfacei]),
|
||||
Pstream::blocking
|
||||
Pstream::commsTypes::blocking
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -38,7 +38,11 @@ void Foam::processorLduInterface::send
|
||||
{
|
||||
label nBytes = f.byteSize();
|
||||
|
||||
if (commsType == Pstream::blocking || commsType == Pstream::scheduled)
|
||||
if
|
||||
(
|
||||
commsType == Pstream::commsTypes::blocking
|
||||
|| commsType == Pstream::commsTypes::scheduled
|
||||
)
|
||||
{
|
||||
OPstream::write
|
||||
(
|
||||
@ -50,7 +54,7 @@ void Foam::processorLduInterface::send
|
||||
comm()
|
||||
);
|
||||
}
|
||||
else if (commsType == Pstream::nonBlocking)
|
||||
else if (commsType == Pstream::commsTypes::nonBlocking)
|
||||
{
|
||||
resizeBuf(receiveBuf_, nBytes);
|
||||
|
||||
@ -80,7 +84,7 @@ void Foam::processorLduInterface::send
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unsupported communications type " << commsType
|
||||
<< "Unsupported communications type " << int(commsType)
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
@ -93,7 +97,11 @@ void Foam::processorLduInterface::receive
|
||||
UList<Type>& f
|
||||
) const
|
||||
{
|
||||
if (commsType == Pstream::blocking || commsType == Pstream::scheduled)
|
||||
if
|
||||
(
|
||||
commsType == Pstream::commsTypes::blocking
|
||||
|| commsType == Pstream::commsTypes::scheduled
|
||||
)
|
||||
{
|
||||
IPstream::read
|
||||
(
|
||||
@ -105,14 +113,14 @@ void Foam::processorLduInterface::receive
|
||||
comm()
|
||||
);
|
||||
}
|
||||
else if (commsType == Pstream::nonBlocking)
|
||||
else if (commsType == Pstream::commsTypes::nonBlocking)
|
||||
{
|
||||
memcpy(f.begin(), receiveBuf_.begin(), f.byteSize());
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unsupported communications type " << commsType
|
||||
<< "Unsupported communications type " << int(commsType)
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
@ -158,7 +166,11 @@ void Foam::processorLduInterface::compressedSend
|
||||
|
||||
reinterpret_cast<Type&>(fArray[nm1]) = f.last();
|
||||
|
||||
if (commsType == Pstream::blocking || commsType == Pstream::scheduled)
|
||||
if
|
||||
(
|
||||
commsType == Pstream::commsTypes::blocking
|
||||
|| commsType == Pstream::commsTypes::scheduled
|
||||
)
|
||||
{
|
||||
OPstream::write
|
||||
(
|
||||
@ -170,7 +182,7 @@ void Foam::processorLduInterface::compressedSend
|
||||
comm()
|
||||
);
|
||||
}
|
||||
else if (commsType == Pstream::nonBlocking)
|
||||
else if (commsType == Pstream::commsTypes::nonBlocking)
|
||||
{
|
||||
resizeBuf(receiveBuf_, nBytes);
|
||||
|
||||
@ -197,7 +209,7 @@ void Foam::processorLduInterface::compressedSend
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unsupported communications type " << commsType
|
||||
<< "Unsupported communications type " << int(commsType)
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
@ -222,7 +234,11 @@ void Foam::processorLduInterface::compressedReceive
|
||||
label nFloats = nm1 + nlast;
|
||||
label nBytes = nFloats*sizeof(float);
|
||||
|
||||
if (commsType == Pstream::blocking || commsType == Pstream::scheduled)
|
||||
if
|
||||
(
|
||||
commsType == Pstream::commsTypes::blocking
|
||||
|| commsType == Pstream::commsTypes::scheduled
|
||||
)
|
||||
{
|
||||
resizeBuf(receiveBuf_, nBytes);
|
||||
|
||||
@ -236,10 +252,10 @@ void Foam::processorLduInterface::compressedReceive
|
||||
comm()
|
||||
);
|
||||
}
|
||||
else if (commsType != Pstream::nonBlocking)
|
||||
else if (commsType != Pstream::commsTypes::nonBlocking)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unsupported communications type " << commsType
|
||||
<< "Unsupported communications type " << int(commsType)
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -38,8 +38,8 @@ void Foam::lduMatrix::initMatrixInterfaces
|
||||
{
|
||||
if
|
||||
(
|
||||
Pstream::defaultCommsType == Pstream::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::nonBlocking
|
||||
Pstream::defaultCommsType == Pstream::commsTypes::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
forAll(interfaces, interfacei)
|
||||
@ -57,7 +57,7 @@ void Foam::lduMatrix::initMatrixInterfaces
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::scheduled)
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
const lduSchedule& patchSchedule = this->patchSchedule();
|
||||
|
||||
@ -78,7 +78,7 @@ void Foam::lduMatrix::initMatrixInterfaces
|
||||
psiif,
|
||||
coupleCoeffs[interfacei],
|
||||
cmpt,
|
||||
Pstream::blocking
|
||||
Pstream::commsTypes::blocking
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -102,7 +102,7 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
||||
const direction cmpt
|
||||
) const
|
||||
{
|
||||
if (Pstream::defaultCommsType == Pstream::blocking)
|
||||
if (Pstream::defaultCommsType == Pstream::commsTypes::blocking)
|
||||
{
|
||||
forAll(interfaces, interfacei)
|
||||
{
|
||||
@ -119,7 +119,7 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::nonBlocking)
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking)
|
||||
{
|
||||
// Try and consume interfaces as they become available
|
||||
bool allUpdated = false;
|
||||
@ -198,7 +198,7 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::scheduled)
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
const lduSchedule& patchSchedule = this->patchSchedule();
|
||||
|
||||
@ -217,7 +217,7 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
||||
psiif,
|
||||
coupleCoeffs[interfacei],
|
||||
cmpt,
|
||||
Pstream::scheduled
|
||||
Pstream::commsTypes::scheduled
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -228,7 +228,7 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
||||
psiif,
|
||||
coupleCoeffs[interfacei],
|
||||
cmpt,
|
||||
Pstream::scheduled
|
||||
Pstream::commsTypes::scheduled
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -251,7 +251,7 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
||||
psiif,
|
||||
coupleCoeffs[interfacei],
|
||||
cmpt,
|
||||
Pstream::blocking
|
||||
Pstream::commsTypes::blocking
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -279,7 +279,7 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
|
||||
{
|
||||
fineInterfaces[inti].initInternalFieldTransfer
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
restrictMap
|
||||
);
|
||||
}
|
||||
@ -322,7 +322,7 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
|
||||
fineInterfaces[inti].interfaceInternalField(restrictMap),
|
||||
fineInterfaces[inti].internalFieldTransfer
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
restrictMap
|
||||
),
|
||||
fineLevelIndex,
|
||||
@ -488,7 +488,7 @@ void Foam::GAMGAgglomeration::procAgglomerateRestrictAddressing
|
||||
procRestrictAddressing,
|
||||
|
||||
UPstream::msgType(),
|
||||
Pstream::nonBlocking //Pstream::scheduled
|
||||
Pstream::commsTypes::nonBlocking //Pstream::commsTypes::scheduled
|
||||
);
|
||||
|
||||
|
||||
@ -645,7 +645,7 @@ void Foam::GAMGAgglomeration::combineLevels(const label curLevel)
|
||||
// label& slaveVal = vals[i];
|
||||
// IPstream::read
|
||||
// (
|
||||
// Pstream::scheduled,
|
||||
// Pstream::commsTypes::scheduled,
|
||||
// procIDs[i],
|
||||
// reinterpret_cast<char*>(&slaveVal),
|
||||
// sizeof(slaveVal),
|
||||
@ -658,7 +658,7 @@ void Foam::GAMGAgglomeration::combineLevels(const label curLevel)
|
||||
// {
|
||||
// OPstream::write
|
||||
// (
|
||||
// Pstream::scheduled,
|
||||
// Pstream::commsTypes::scheduled,
|
||||
// procIDs[0],
|
||||
// reinterpret_cast<const char*>(&myVal),
|
||||
// sizeof(myVal),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -48,7 +48,7 @@ void Foam::GAMGAgglomeration::gatherList
|
||||
{
|
||||
IPstream fromSlave
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
procIDs[i],
|
||||
0,
|
||||
tag,
|
||||
@ -62,7 +62,7 @@ void Foam::GAMGAgglomeration::gatherList
|
||||
{
|
||||
OPstream toMaster
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
procIDs[0],
|
||||
0,
|
||||
tag,
|
||||
@ -128,7 +128,7 @@ void Foam::GAMGAgglomeration::restrictField
|
||||
procIDs,
|
||||
cf,
|
||||
UPstream::msgType(),
|
||||
Pstream::nonBlocking //Pstream::scheduled
|
||||
Pstream::commsTypes::nonBlocking //Pstream::commsTypes::scheduled
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -201,7 +201,7 @@ void Foam::GAMGAgglomeration::prolongField
|
||||
cf,
|
||||
allCf,
|
||||
UPstream::msgType(),
|
||||
Pstream::nonBlocking //Pstream::scheduled
|
||||
Pstream::commsTypes::nonBlocking //Pstream::commsTypes::scheduled
|
||||
);
|
||||
|
||||
forAll(fineToCoarse, i)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -150,7 +150,7 @@ Foam::labelListList Foam::GAMGProcAgglomeration::globalCellCells
|
||||
{
|
||||
interfaces[inti].initInternalFieldTransfer
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
globalIndices
|
||||
);
|
||||
}
|
||||
@ -172,7 +172,7 @@ Foam::labelListList Foam::GAMGProcAgglomeration::globalCellCells
|
||||
(
|
||||
interfaces[inti].internalFieldTransfer
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
globalIndices
|
||||
)
|
||||
)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -318,7 +318,7 @@ void Foam::GAMGSolver::gatherMatrices
|
||||
|
||||
IPstream fromSlave
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
procIDs[proci],
|
||||
0, // bufSize
|
||||
Pstream::msgType(),
|
||||
@ -387,7 +387,7 @@ void Foam::GAMGSolver::gatherMatrices
|
||||
|
||||
OPstream toMaster
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
procIDs[0],
|
||||
0,
|
||||
Pstream::msgType(),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -67,7 +67,7 @@ void Foam::GAMGSolver::scale
|
||||
vector2D scalingVector(scalingFactorNum, scalingFactorDenom);
|
||||
A.mesh().reduce(scalingVector, sumOp<vector2D>());
|
||||
|
||||
scalar sf = scalingVector.x()/stabilise(scalingVector.y(), VSMALL);
|
||||
const scalar sf = scalingVector.x()/stabilise(scalingVector.y(), VSMALL);
|
||||
|
||||
if (debug >= 2)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -104,14 +104,18 @@ void Foam::processorGAMGInterfaceField::initInterfaceMatrixUpdate
|
||||
|
||||
procInterface_.interfaceInternalField(psiInternal, scalarSendBuf_);
|
||||
|
||||
if (commsType == Pstream::nonBlocking && !Pstream::floatTransfer)
|
||||
if
|
||||
(
|
||||
commsType == Pstream::commsTypes::nonBlocking
|
||||
&& !Pstream::floatTransfer
|
||||
)
|
||||
{
|
||||
// Fast path.
|
||||
scalarReceiveBuf_.setSize(scalarSendBuf_.size());
|
||||
outstandingRecvRequest_ = UPstream::nRequests();
|
||||
IPstream::read
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
procInterface_.neighbProcNo(),
|
||||
reinterpret_cast<char*>(scalarReceiveBuf_.begin()),
|
||||
scalarReceiveBuf_.byteSize(),
|
||||
@ -122,7 +126,7 @@ void Foam::processorGAMGInterfaceField::initInterfaceMatrixUpdate
|
||||
outstandingSendRequest_ = UPstream::nRequests();
|
||||
OPstream::write
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
procInterface_.neighbProcNo(),
|
||||
reinterpret_cast<const char*>(scalarSendBuf_.begin()),
|
||||
scalarSendBuf_.byteSize(),
|
||||
@ -160,7 +164,11 @@ void Foam::processorGAMGInterfaceField::updateInterfaceMatrix
|
||||
|
||||
const labelUList& faceCells = procInterface_.faceCells();
|
||||
|
||||
if (commsType == Pstream::nonBlocking && !Pstream::floatTransfer)
|
||||
if
|
||||
(
|
||||
commsType == Pstream::commsTypes::nonBlocking
|
||||
&& !Pstream::floatTransfer
|
||||
)
|
||||
{
|
||||
// Fast path.
|
||||
if
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -31,6 +31,9 @@ namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(PBiCGStab, 0);
|
||||
|
||||
lduMatrix::solver::addsymMatrixConstructorToTable<PBiCGStab>
|
||||
addPBiCGStabSymMatrixConstructorToTable_;
|
||||
|
||||
lduMatrix::solver::addasymMatrixConstructorToTable<PBiCGStab>
|
||||
addPBiCGStabAsymMatrixConstructorToTable_;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -142,6 +142,9 @@ public:
|
||||
//- Return const object pointer
|
||||
inline const T* operator->() const;
|
||||
|
||||
//- Take over the object pointer from parameter
|
||||
inline void operator=(T*);
|
||||
|
||||
//- Take over the object pointer from parameter
|
||||
inline void operator=(const autoPtr<T>&);
|
||||
};
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -218,6 +218,13 @@ inline const T* Foam::autoPtr<T>::operator->() const
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline void Foam::autoPtr<T>::operator=(T* p)
|
||||
{
|
||||
reset(p);
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline void Foam::autoPtr<T>::operator=(const autoPtr<T>& ap)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -124,7 +124,11 @@ Foam::ProcessorTopology<Container, ProcPatch>::ProcessorTopology
|
||||
Pstream::scatterList(*this, Pstream::msgType(), comm);
|
||||
}
|
||||
|
||||
if (Pstream::parRun() && Pstream::defaultCommsType == Pstream::scheduled)
|
||||
if
|
||||
(
|
||||
Pstream::parRun()
|
||||
&& Pstream::defaultCommsType == Pstream::commsTypes::scheduled
|
||||
)
|
||||
{
|
||||
label patchEvali = 0;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -993,7 +993,7 @@ void Foam::lduPrimitiveMesh::gather
|
||||
|
||||
IPstream fromSlave
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
procIDs[i],
|
||||
0, // bufSize
|
||||
Pstream::msgType(),
|
||||
@ -1066,7 +1066,7 @@ void Foam::lduPrimitiveMesh::gather
|
||||
|
||||
OPstream toMaster
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
procIDs[0],
|
||||
0,
|
||||
Pstream::msgType(),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -80,8 +80,8 @@ void Foam::pointBoundaryMesh::calcGeometry()
|
||||
|
||||
if
|
||||
(
|
||||
Pstream::defaultCommsType == Pstream::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::nonBlocking
|
||||
Pstream::defaultCommsType == Pstream::commsTypes::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
forAll(*this, patchi)
|
||||
@ -96,7 +96,7 @@ void Foam::pointBoundaryMesh::calcGeometry()
|
||||
operator[](patchi).calcGeometry(pBufs);
|
||||
}
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::scheduled)
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
const lduSchedule& patchSchedule = mesh().globalData().patchSchedule();
|
||||
|
||||
@ -126,8 +126,8 @@ void Foam::pointBoundaryMesh::movePoints(const pointField& p)
|
||||
|
||||
if
|
||||
(
|
||||
Pstream::defaultCommsType == Pstream::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::nonBlocking
|
||||
Pstream::defaultCommsType == Pstream::commsTypes::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
forAll(*this, patchi)
|
||||
@ -142,7 +142,7 @@ void Foam::pointBoundaryMesh::movePoints(const pointField& p)
|
||||
operator[](patchi).movePoints(pBufs, p);
|
||||
}
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::scheduled)
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
const lduSchedule& patchSchedule = mesh().globalData().patchSchedule();
|
||||
|
||||
@ -172,8 +172,8 @@ void Foam::pointBoundaryMesh::updateMesh()
|
||||
|
||||
if
|
||||
(
|
||||
Pstream::defaultCommsType == Pstream::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::nonBlocking
|
||||
Pstream::defaultCommsType == Pstream::commsTypes::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
forAll(*this, patchi)
|
||||
@ -188,7 +188,7 @@ void Foam::pointBoundaryMesh::updateMesh()
|
||||
operator[](patchi).updateMesh(pBufs);
|
||||
}
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::scheduled)
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
const lduSchedule& patchSchedule = mesh().globalData().patchSchedule();
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -161,7 +161,8 @@ public:
|
||||
const UList<Type>& fld,
|
||||
List<Type>& allFld,
|
||||
const int tag = UPstream::msgType(),
|
||||
const Pstream::commsTypes commsType=Pstream::nonBlocking
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::nonBlocking
|
||||
);
|
||||
|
||||
//- Collect data in processor order on master (== procIDs[0]).
|
||||
@ -174,7 +175,8 @@ public:
|
||||
const UList<Type>& fld,
|
||||
List<Type>& allFld,
|
||||
const int tag = UPstream::msgType(),
|
||||
const Pstream::commsTypes commsType=Pstream::nonBlocking
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::nonBlocking
|
||||
) const
|
||||
{
|
||||
gather(offsets_, comm, procIDs, fld, allFld, tag, commsType);
|
||||
@ -190,7 +192,8 @@ public:
|
||||
const labelList& procIDs,
|
||||
List<Type>& fld,
|
||||
const int tag = UPstream::msgType(),
|
||||
const Pstream::commsTypes commsType=Pstream::nonBlocking
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::nonBlocking
|
||||
);
|
||||
|
||||
//- Inplace collect data in processor order on master
|
||||
@ -202,7 +205,8 @@ public:
|
||||
const labelList& procIDs,
|
||||
List<Type>& fld,
|
||||
const int tag = UPstream::msgType(),
|
||||
const Pstream::commsTypes commsType=Pstream::nonBlocking
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::nonBlocking
|
||||
) const
|
||||
{
|
||||
gather(offsets_, comm, procIDs, fld, tag, commsType);
|
||||
@ -218,7 +222,8 @@ public:
|
||||
const UList<Type>& allFld,
|
||||
UList<Type>& fld,
|
||||
const int tag = UPstream::msgType(),
|
||||
const Pstream::commsTypes commsType=Pstream::nonBlocking
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::nonBlocking
|
||||
);
|
||||
|
||||
//- Distribute data in processor order. Requires fld to be sized!
|
||||
@ -230,7 +235,8 @@ public:
|
||||
const UList<Type>& allFld,
|
||||
UList<Type>& fld,
|
||||
const int tag = UPstream::msgType(),
|
||||
const Pstream::commsTypes commsType=Pstream::nonBlocking
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::nonBlocking
|
||||
) const
|
||||
{
|
||||
scatter(offsets_, comm, procIDs, allFld, fld, tag, commsType);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -46,7 +46,11 @@ void Foam::globalIndex::gather
|
||||
// Assign my local data
|
||||
SubList<Type>(allFld, fld.size(), 0) = fld;
|
||||
|
||||
if (commsType == Pstream::scheduled || commsType == Pstream::blocking)
|
||||
if
|
||||
(
|
||||
commsType == Pstream::commsTypes::scheduled
|
||||
|| commsType == Pstream::commsTypes::blocking
|
||||
)
|
||||
{
|
||||
for (label i = 1; i < procIDs.size(); i++)
|
||||
{
|
||||
@ -113,7 +117,11 @@ void Foam::globalIndex::gather
|
||||
}
|
||||
else
|
||||
{
|
||||
if (commsType == Pstream::scheduled || commsType == Pstream::blocking)
|
||||
if
|
||||
(
|
||||
commsType == Pstream::commsTypes::scheduled
|
||||
|| commsType == Pstream::commsTypes::blocking
|
||||
)
|
||||
{
|
||||
if (contiguous<Type>())
|
||||
{
|
||||
@ -209,7 +217,11 @@ void Foam::globalIndex::scatter
|
||||
{
|
||||
fld.deepCopy(SubList<Type>(allFld, off[1]-off[0]));
|
||||
|
||||
if (commsType == Pstream::scheduled || commsType == Pstream::blocking)
|
||||
if
|
||||
(
|
||||
commsType == Pstream::commsTypes::scheduled
|
||||
|| commsType == Pstream::commsTypes::blocking
|
||||
)
|
||||
{
|
||||
for (label i = 1; i < procIDs.size(); i++)
|
||||
{
|
||||
@ -286,7 +298,11 @@ void Foam::globalIndex::scatter
|
||||
}
|
||||
else
|
||||
{
|
||||
if (commsType == Pstream::scheduled || commsType == Pstream::blocking)
|
||||
if
|
||||
(
|
||||
commsType == Pstream::commsTypes::scheduled
|
||||
|| commsType == Pstream::commsTypes::blocking
|
||||
)
|
||||
{
|
||||
if (contiguous<Type>())
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -84,7 +84,7 @@ void Foam::globalMeshData::initProcAddr()
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
|
||||
|
||||
// Send indices of my processor patches to my neighbours
|
||||
forAll(processorPatches_, i)
|
||||
@ -401,7 +401,7 @@ void Foam::globalMeshData::calcSharedEdges() const
|
||||
)
|
||||
{
|
||||
// Receive the edges using shared points from the slave.
|
||||
IPstream fromSlave(Pstream::blocking, slave);
|
||||
IPstream fromSlave(Pstream::commsTypes::blocking, slave);
|
||||
EdgeMap<labelList> procSharedEdges(fromSlave);
|
||||
|
||||
if (debug)
|
||||
@ -450,7 +450,7 @@ void Foam::globalMeshData::calcSharedEdges() const
|
||||
)
|
||||
{
|
||||
// Receive the edges using shared points from the slave.
|
||||
OPstream toSlave(Pstream::blocking, slave);
|
||||
OPstream toSlave(Pstream::commsTypes::blocking, slave);
|
||||
toSlave << globalShared;
|
||||
}
|
||||
}
|
||||
@ -459,14 +459,20 @@ void Foam::globalMeshData::calcSharedEdges() const
|
||||
{
|
||||
// Send local edges to master
|
||||
{
|
||||
OPstream toMaster(Pstream::blocking, Pstream::masterNo());
|
||||
|
||||
OPstream toMaster
|
||||
(
|
||||
Pstream::commsTypes::blocking,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
toMaster << localShared;
|
||||
}
|
||||
// Receive merged edges from master.
|
||||
{
|
||||
IPstream fromMaster(Pstream::blocking, Pstream::masterNo());
|
||||
|
||||
IPstream fromMaster
|
||||
(
|
||||
Pstream::commsTypes::blocking,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
fromMaster >> globalShared;
|
||||
}
|
||||
}
|
||||
@ -1920,7 +1926,7 @@ Foam::pointField Foam::globalMeshData::sharedPoints() const
|
||||
slave++
|
||||
)
|
||||
{
|
||||
IPstream fromSlave(Pstream::blocking, slave);
|
||||
IPstream fromSlave(Pstream::commsTypes::blocking, slave);
|
||||
|
||||
labelList nbrSharedPointAddr;
|
||||
pointField nbrSharedPoints;
|
||||
@ -1944,7 +1950,7 @@ Foam::pointField Foam::globalMeshData::sharedPoints() const
|
||||
{
|
||||
OPstream toSlave
|
||||
(
|
||||
Pstream::blocking,
|
||||
Pstream::commsTypes::blocking,
|
||||
slave,
|
||||
sharedPoints.size()*sizeof(Zero)
|
||||
);
|
||||
@ -1956,8 +1962,11 @@ Foam::pointField Foam::globalMeshData::sharedPoints() const
|
||||
// Slave:
|
||||
// send points
|
||||
{
|
||||
OPstream toMaster(Pstream::blocking, Pstream::masterNo());
|
||||
|
||||
OPstream toMaster
|
||||
(
|
||||
Pstream::commsTypes::blocking,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
toMaster
|
||||
<< pointAddr
|
||||
<< UIndirectList<point>(mesh_.points(), pointLabels)();
|
||||
@ -1965,7 +1974,11 @@ Foam::pointField Foam::globalMeshData::sharedPoints() const
|
||||
|
||||
// Receive sharedPoints
|
||||
{
|
||||
IPstream fromMaster(Pstream::blocking, Pstream::masterNo());
|
||||
IPstream fromMaster
|
||||
(
|
||||
Pstream::commsTypes::blocking,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
fromMaster >> sharedPoints;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -901,8 +901,8 @@ void Foam::globalPoints::calculateSharedPoints
|
||||
PstreamBuffers pBufs
|
||||
(
|
||||
(
|
||||
Pstream::defaultCommsType == Pstream::scheduled
|
||||
? Pstream::nonBlocking
|
||||
Pstream::defaultCommsType == Pstream::commsTypes::scheduled
|
||||
? Pstream::commsTypes::nonBlocking
|
||||
: Pstream::defaultCommsType
|
||||
)
|
||||
);
|
||||
@ -939,8 +939,8 @@ void Foam::globalPoints::calculateSharedPoints
|
||||
PstreamBuffers pBufs
|
||||
(
|
||||
(
|
||||
Pstream::defaultCommsType == Pstream::scheduled
|
||||
? Pstream::nonBlocking
|
||||
Pstream::defaultCommsType == Pstream::commsTypes::scheduled
|
||||
? Pstream::commsTypes::nonBlocking
|
||||
: Pstream::defaultCommsType
|
||||
)
|
||||
);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -84,7 +84,7 @@ Foam::List<Foam::labelPair> Foam::mapDistributeBase::schedule
|
||||
slave++
|
||||
)
|
||||
{
|
||||
IPstream fromSlave(Pstream::scheduled, slave, 0, tag);
|
||||
IPstream fromSlave(Pstream::commsTypes::scheduled, slave, 0, tag);
|
||||
List<labelPair> nbrData(fromSlave);
|
||||
|
||||
forAll(nbrData, i)
|
||||
@ -105,20 +105,26 @@ Foam::List<Foam::labelPair> Foam::mapDistributeBase::schedule
|
||||
slave++
|
||||
)
|
||||
{
|
||||
OPstream toSlave(Pstream::scheduled, slave, 0, tag);
|
||||
OPstream toSlave(Pstream::commsTypes::scheduled, slave, 0, tag);
|
||||
toSlave << allComms;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo(), 0, tag);
|
||||
OPstream toMaster
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo(),
|
||||
0,
|
||||
tag
|
||||
);
|
||||
toMaster << allComms;
|
||||
}
|
||||
{
|
||||
IPstream fromMaster
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo(),
|
||||
0,
|
||||
tag
|
||||
@ -861,7 +867,7 @@ void Foam::mapDistributeBase::compact(const boolList& elemIsUsed, const int tag)
|
||||
recvFields[domain].setSize(map.size());
|
||||
IPstream::read
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
domain,
|
||||
reinterpret_cast<char*>(recvFields[domain].begin()),
|
||||
recvFields[domain].size()*sizeof(bool),
|
||||
@ -894,7 +900,7 @@ void Foam::mapDistributeBase::compact(const boolList& elemIsUsed, const int tag)
|
||||
|
||||
OPstream::write
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
domain,
|
||||
reinterpret_cast<const char*>(subField.begin()),
|
||||
subField.size()*sizeof(bool),
|
||||
@ -1028,7 +1034,7 @@ void Foam::mapDistributeBase::compact
|
||||
recvFields[domain].setSize(map.size());
|
||||
IPstream::read
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
domain,
|
||||
reinterpret_cast<char*>(recvFields[domain].begin()),
|
||||
recvFields[domain].size()*sizeof(bool),
|
||||
@ -1060,7 +1066,7 @@ void Foam::mapDistributeBase::compact
|
||||
|
||||
OPstream::write
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
domain,
|
||||
reinterpret_cast<const char*>(subField.begin()),
|
||||
subField.size()*sizeof(bool),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -364,8 +364,9 @@ public:
|
||||
const int tag = UPstream::msgType()
|
||||
);
|
||||
|
||||
//- Distribute data. Note:schedule only used for Pstream::scheduled
|
||||
// for now, all others just use send-to-all, receive-from-all.
|
||||
//- Distribute data. Note:schedule only used for
|
||||
// Pstream::commsTypes::scheduled for now, all others just use
|
||||
// send-to-all, receive-from-all.
|
||||
template<class T, class negateOp>
|
||||
static void distribute
|
||||
(
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -159,7 +159,7 @@ void Foam::mapDistributeBase::distribute
|
||||
return;
|
||||
}
|
||||
|
||||
if (commsType == Pstream::blocking)
|
||||
if (commsType == Pstream::commsTypes::blocking)
|
||||
{
|
||||
// Since buffered sending can reuse the field to collect the
|
||||
// received data.
|
||||
@ -171,7 +171,7 @@ void Foam::mapDistributeBase::distribute
|
||||
|
||||
if (domain != Pstream::myProcNo() && map.size())
|
||||
{
|
||||
OPstream toNbr(Pstream::blocking, domain, 0, tag);
|
||||
OPstream toNbr(Pstream::commsTypes::blocking, domain, 0, tag);
|
||||
|
||||
List<T> subField(map.size());
|
||||
forAll(subField, i)
|
||||
@ -219,7 +219,7 @@ void Foam::mapDistributeBase::distribute
|
||||
|
||||
if (domain != Pstream::myProcNo() && map.size())
|
||||
{
|
||||
IPstream fromNbr(Pstream::blocking, domain, 0, tag);
|
||||
IPstream fromNbr(Pstream::commsTypes::blocking, domain, 0, tag);
|
||||
List<T> subField(fromNbr);
|
||||
|
||||
checkReceivedSize(domain, map.size(), subField.size());
|
||||
@ -236,7 +236,7 @@ void Foam::mapDistributeBase::distribute
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (commsType == Pstream::scheduled)
|
||||
else if (commsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
// Need to make sure I don't overwrite field with received data
|
||||
// since the data might need to be sent to another processor. So
|
||||
@ -285,7 +285,13 @@ void Foam::mapDistributeBase::distribute
|
||||
{
|
||||
// I am send first, receive next
|
||||
{
|
||||
OPstream toNbr(Pstream::scheduled, recvProc, 0, tag);
|
||||
OPstream toNbr
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
recvProc,
|
||||
0,
|
||||
tag
|
||||
);
|
||||
|
||||
const labelList& map = subMap[recvProc];
|
||||
List<T> subField(map.size());
|
||||
@ -302,7 +308,13 @@ void Foam::mapDistributeBase::distribute
|
||||
toNbr << subField;
|
||||
}
|
||||
{
|
||||
IPstream fromNbr(Pstream::scheduled, recvProc, 0, tag);
|
||||
IPstream fromNbr
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
recvProc,
|
||||
0,
|
||||
tag
|
||||
);
|
||||
List<T> subField(fromNbr);
|
||||
|
||||
const labelList& map = constructMap[recvProc];
|
||||
@ -324,7 +336,13 @@ void Foam::mapDistributeBase::distribute
|
||||
{
|
||||
// I am receive first, send next
|
||||
{
|
||||
IPstream fromNbr(Pstream::scheduled, sendProc, 0, tag);
|
||||
IPstream fromNbr
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
sendProc,
|
||||
0,
|
||||
tag
|
||||
);
|
||||
List<T> subField(fromNbr);
|
||||
|
||||
const labelList& map = constructMap[sendProc];
|
||||
@ -342,7 +360,13 @@ void Foam::mapDistributeBase::distribute
|
||||
);
|
||||
}
|
||||
{
|
||||
OPstream toNbr(Pstream::scheduled, sendProc, 0, tag);
|
||||
OPstream toNbr
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
sendProc,
|
||||
0,
|
||||
tag
|
||||
);
|
||||
|
||||
const labelList& map = subMap[sendProc];
|
||||
List<T> subField(map.size());
|
||||
@ -362,13 +386,13 @@ void Foam::mapDistributeBase::distribute
|
||||
}
|
||||
field.transfer(newField);
|
||||
}
|
||||
else if (commsType == Pstream::nonBlocking)
|
||||
else if (commsType == Pstream::commsTypes::nonBlocking)
|
||||
{
|
||||
label nOutstanding = Pstream::nRequests();
|
||||
|
||||
if (!contiguous<T>())
|
||||
{
|
||||
PstreamBuffers pBufs(Pstream::nonBlocking, tag);
|
||||
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking, tag);
|
||||
|
||||
// Stream data into buffer
|
||||
for (label domain = 0; domain < Pstream::nProcs(); domain++)
|
||||
@ -484,7 +508,7 @@ void Foam::mapDistributeBase::distribute
|
||||
|
||||
OPstream::write
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
domain,
|
||||
reinterpret_cast<const char*>(subField.begin()),
|
||||
subField.byteSize(),
|
||||
@ -506,7 +530,7 @@ void Foam::mapDistributeBase::distribute
|
||||
recvFields[domain].setSize(map.size());
|
||||
IPstream::read
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
domain,
|
||||
reinterpret_cast<char*>(recvFields[domain].begin()),
|
||||
recvFields[domain].byteSize(),
|
||||
@ -591,7 +615,7 @@ void Foam::mapDistributeBase::distribute
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown communication schedule " << commsType
|
||||
<< "Unknown communication schedule " << int(commsType)
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -638,7 +662,7 @@ void Foam::mapDistributeBase::distribute
|
||||
return;
|
||||
}
|
||||
|
||||
if (commsType == Pstream::blocking)
|
||||
if (commsType == Pstream::commsTypes::blocking)
|
||||
{
|
||||
// Since buffered sending can reuse the field to collect the
|
||||
// received data.
|
||||
@ -650,7 +674,7 @@ void Foam::mapDistributeBase::distribute
|
||||
|
||||
if (domain != Pstream::myProcNo() && map.size())
|
||||
{
|
||||
OPstream toNbr(Pstream::blocking, domain, 0, tag);
|
||||
OPstream toNbr(Pstream::commsTypes::blocking, domain, 0, tag);
|
||||
List<T> subField(map.size());
|
||||
forAll(subField, i)
|
||||
{
|
||||
@ -690,7 +714,7 @@ void Foam::mapDistributeBase::distribute
|
||||
|
||||
if (domain != Pstream::myProcNo() && map.size())
|
||||
{
|
||||
IPstream fromNbr(Pstream::blocking, domain, 0, tag);
|
||||
IPstream fromNbr(Pstream::commsTypes::blocking, domain, 0, tag);
|
||||
List<T> subField(fromNbr);
|
||||
|
||||
checkReceivedSize(domain, map.size(), subField.size());
|
||||
@ -707,7 +731,7 @@ void Foam::mapDistributeBase::distribute
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (commsType == Pstream::scheduled)
|
||||
else if (commsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
// Need to make sure I don't overwrite field with received data
|
||||
// since the data might need to be sent to another processor. So
|
||||
@ -759,7 +783,13 @@ void Foam::mapDistributeBase::distribute
|
||||
{
|
||||
// I am send first, receive next
|
||||
{
|
||||
OPstream toNbr(Pstream::scheduled, recvProc, 0, tag);
|
||||
OPstream toNbr
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
recvProc,
|
||||
0,
|
||||
tag
|
||||
);
|
||||
|
||||
const labelList& map = subMap[recvProc];
|
||||
|
||||
@ -777,7 +807,13 @@ void Foam::mapDistributeBase::distribute
|
||||
toNbr << subField;
|
||||
}
|
||||
{
|
||||
IPstream fromNbr(Pstream::scheduled, recvProc, 0, tag);
|
||||
IPstream fromNbr
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
recvProc,
|
||||
0,
|
||||
tag
|
||||
);
|
||||
List<T> subField(fromNbr);
|
||||
const labelList& map = constructMap[recvProc];
|
||||
|
||||
@ -798,7 +834,13 @@ void Foam::mapDistributeBase::distribute
|
||||
{
|
||||
// I am receive first, send next
|
||||
{
|
||||
IPstream fromNbr(Pstream::scheduled, sendProc, 0, tag);
|
||||
IPstream fromNbr
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
sendProc,
|
||||
0,
|
||||
tag
|
||||
);
|
||||
List<T> subField(fromNbr);
|
||||
const labelList& map = constructMap[sendProc];
|
||||
|
||||
@ -815,7 +857,13 @@ void Foam::mapDistributeBase::distribute
|
||||
);
|
||||
}
|
||||
{
|
||||
OPstream toNbr(Pstream::scheduled, sendProc, 0, tag);
|
||||
OPstream toNbr
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
sendProc,
|
||||
0,
|
||||
tag
|
||||
);
|
||||
|
||||
const labelList& map = subMap[sendProc];
|
||||
|
||||
@ -836,13 +884,13 @@ void Foam::mapDistributeBase::distribute
|
||||
}
|
||||
field.transfer(newField);
|
||||
}
|
||||
else if (commsType == Pstream::nonBlocking)
|
||||
else if (commsType == Pstream::commsTypes::nonBlocking)
|
||||
{
|
||||
label nOutstanding = Pstream::nRequests();
|
||||
|
||||
if (!contiguous<T>())
|
||||
{
|
||||
PstreamBuffers pBufs(Pstream::nonBlocking, tag);
|
||||
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking, tag);
|
||||
|
||||
// Stream data into buffer
|
||||
for (label domain = 0; domain < Pstream::nProcs(); domain++)
|
||||
@ -961,7 +1009,7 @@ void Foam::mapDistributeBase::distribute
|
||||
|
||||
OPstream::write
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
domain,
|
||||
reinterpret_cast<const char*>(subField.begin()),
|
||||
subField.size()*sizeof(T),
|
||||
@ -983,7 +1031,7 @@ void Foam::mapDistributeBase::distribute
|
||||
recvFields[domain].setSize(map.size());
|
||||
UIPstream::read
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
domain,
|
||||
reinterpret_cast<char*>(recvFields[domain].begin()),
|
||||
recvFields[domain].size()*sizeof(T),
|
||||
@ -1067,7 +1115,7 @@ void Foam::mapDistributeBase::distribute
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown communication schedule " << commsType
|
||||
<< "Unknown communication schedule " << int(commsType)
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -1155,11 +1203,11 @@ void Foam::mapDistributeBase::distribute
|
||||
const int tag
|
||||
) const
|
||||
{
|
||||
if (Pstream::defaultCommsType == Pstream::nonBlocking)
|
||||
if (Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking)
|
||||
{
|
||||
distribute
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
List<labelPair>(),
|
||||
constructSize_,
|
||||
subMap_,
|
||||
@ -1171,11 +1219,11 @@ void Foam::mapDistributeBase::distribute
|
||||
tag
|
||||
);
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::scheduled)
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
distribute
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
schedule(),
|
||||
constructSize_,
|
||||
subMap_,
|
||||
@ -1191,7 +1239,7 @@ void Foam::mapDistributeBase::distribute
|
||||
{
|
||||
distribute
|
||||
(
|
||||
Pstream::blocking,
|
||||
Pstream::commsTypes::blocking,
|
||||
List<labelPair>(),
|
||||
constructSize_,
|
||||
subMap_,
|
||||
@ -1245,11 +1293,11 @@ void Foam::mapDistributeBase::reverseDistribute
|
||||
const int tag
|
||||
) const
|
||||
{
|
||||
if (Pstream::defaultCommsType == Pstream::nonBlocking)
|
||||
if (Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking)
|
||||
{
|
||||
distribute
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
List<labelPair>(),
|
||||
constructSize,
|
||||
constructMap_,
|
||||
@ -1261,11 +1309,11 @@ void Foam::mapDistributeBase::reverseDistribute
|
||||
tag
|
||||
);
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::scheduled)
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
distribute
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
schedule(),
|
||||
constructSize,
|
||||
constructMap_,
|
||||
@ -1281,7 +1329,7 @@ void Foam::mapDistributeBase::reverseDistribute
|
||||
{
|
||||
distribute
|
||||
(
|
||||
Pstream::blocking,
|
||||
Pstream::commsTypes::blocking,
|
||||
List<labelPair>(),
|
||||
constructSize,
|
||||
constructMap_,
|
||||
@ -1308,11 +1356,11 @@ void Foam::mapDistributeBase::reverseDistribute
|
||||
const int tag
|
||||
) const
|
||||
{
|
||||
if (Pstream::defaultCommsType == Pstream::nonBlocking)
|
||||
if (Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking)
|
||||
{
|
||||
distribute
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
List<labelPair>(),
|
||||
constructSize,
|
||||
constructMap_,
|
||||
@ -1326,11 +1374,11 @@ void Foam::mapDistributeBase::reverseDistribute
|
||||
tag
|
||||
);
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::scheduled)
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
distribute
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
schedule(),
|
||||
constructSize,
|
||||
constructMap_,
|
||||
@ -1348,7 +1396,7 @@ void Foam::mapDistributeBase::reverseDistribute
|
||||
{
|
||||
distribute
|
||||
(
|
||||
Pstream::blocking,
|
||||
Pstream::commsTypes::blocking,
|
||||
List<labelPair>(),
|
||||
constructSize,
|
||||
constructMap_,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -211,8 +211,8 @@ void Foam::polyBoundaryMesh::calcGeometry()
|
||||
|
||||
if
|
||||
(
|
||||
Pstream::defaultCommsType == Pstream::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::nonBlocking
|
||||
Pstream::defaultCommsType == Pstream::commsTypes::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
forAll(*this, patchi)
|
||||
@ -227,7 +227,7 @@ void Foam::polyBoundaryMesh::calcGeometry()
|
||||
operator[](patchi).calcGeometry(pBufs);
|
||||
}
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::scheduled)
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
const lduSchedule& patchSchedule = mesh().globalData().patchSchedule();
|
||||
|
||||
@ -998,8 +998,8 @@ void Foam::polyBoundaryMesh::movePoints(const pointField& p)
|
||||
|
||||
if
|
||||
(
|
||||
Pstream::defaultCommsType == Pstream::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::nonBlocking
|
||||
Pstream::defaultCommsType == Pstream::commsTypes::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
forAll(*this, patchi)
|
||||
@ -1014,7 +1014,7 @@ void Foam::polyBoundaryMesh::movePoints(const pointField& p)
|
||||
operator[](patchi).movePoints(pBufs, p);
|
||||
}
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::scheduled)
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
const lduSchedule& patchSchedule = mesh().globalData().patchSchedule();
|
||||
|
||||
@ -1048,8 +1048,8 @@ void Foam::polyBoundaryMesh::updateMesh()
|
||||
|
||||
if
|
||||
(
|
||||
Pstream::defaultCommsType == Pstream::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::nonBlocking
|
||||
Pstream::defaultCommsType == Pstream::commsTypes::blocking
|
||||
|| Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
forAll(*this, patchi)
|
||||
@ -1064,7 +1064,7 @@ void Foam::polyBoundaryMesh::updateMesh()
|
||||
operator[](patchi).updateMesh(pBufs);
|
||||
}
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::scheduled)
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
{
|
||||
const lduSchedule& patchSchedule = mesh().globalData().patchSchedule();
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -129,7 +129,7 @@ void Foam::syncTools::syncPointMap
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
|
||||
|
||||
// Send
|
||||
|
||||
@ -311,7 +311,7 @@ void Foam::syncTools::syncPointMap
|
||||
slave++
|
||||
)
|
||||
{
|
||||
IPstream fromSlave(Pstream::scheduled, slave);
|
||||
IPstream fromSlave(Pstream::commsTypes::scheduled, slave);
|
||||
Map<T> nbrValues(fromSlave);
|
||||
|
||||
// Merge neighbouring values with my values
|
||||
@ -335,7 +335,7 @@ void Foam::syncTools::syncPointMap
|
||||
slave++
|
||||
)
|
||||
{
|
||||
OPstream toSlave(Pstream::scheduled, slave);
|
||||
OPstream toSlave(Pstream::commsTypes::scheduled, slave);
|
||||
toSlave << sharedPointValues;
|
||||
}
|
||||
}
|
||||
@ -343,14 +343,18 @@ void Foam::syncTools::syncPointMap
|
||||
{
|
||||
// Slave: send to master
|
||||
{
|
||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
||||
OPstream toMaster
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
toMaster << sharedPointValues;
|
||||
}
|
||||
// Receive merged values
|
||||
{
|
||||
IPstream fromMaster
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
fromMaster >> sharedPointValues;
|
||||
@ -405,7 +409,7 @@ void Foam::syncTools::syncEdgeMap
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
|
||||
|
||||
// Send
|
||||
|
||||
@ -687,7 +691,7 @@ void Foam::syncTools::syncEdgeMap
|
||||
slave++
|
||||
)
|
||||
{
|
||||
IPstream fromSlave(Pstream::scheduled, slave);
|
||||
IPstream fromSlave(Pstream::commsTypes::scheduled, slave);
|
||||
EdgeMap<T> nbrValues(fromSlave);
|
||||
|
||||
// Merge neighbouring values with my values
|
||||
@ -712,7 +716,7 @@ void Foam::syncTools::syncEdgeMap
|
||||
)
|
||||
{
|
||||
|
||||
OPstream toSlave(Pstream::scheduled, slave);
|
||||
OPstream toSlave(Pstream::commsTypes::scheduled, slave);
|
||||
toSlave << sharedEdgeValues;
|
||||
}
|
||||
}
|
||||
@ -720,12 +724,20 @@ void Foam::syncTools::syncEdgeMap
|
||||
{
|
||||
// Send to master
|
||||
{
|
||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
||||
OPstream toMaster
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
toMaster << sharedEdgeValues;
|
||||
}
|
||||
// Receive merged values
|
||||
{
|
||||
IPstream fromMaster(Pstream::scheduled, Pstream::masterNo());
|
||||
IPstream fromMaster
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
fromMaster >> sharedEdgeValues;
|
||||
}
|
||||
}
|
||||
@ -799,7 +811,7 @@ void Foam::syncTools::syncEdgeMap
|
||||
//
|
||||
// if (Pstream::parRun())
|
||||
// {
|
||||
// PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||
// PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
|
||||
//
|
||||
// // Send
|
||||
//
|
||||
@ -1302,7 +1314,7 @@ void Foam::syncTools::syncBoundaryFaceList
|
||||
|
||||
if (parRun)
|
||||
{
|
||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
|
||||
|
||||
// Send
|
||||
|
||||
@ -1422,7 +1434,7 @@ void Foam::syncTools::syncFaceList
|
||||
|
||||
if (parRun)
|
||||
{
|
||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
|
||||
|
||||
// Send
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -182,7 +182,7 @@ void Foam::PatchTools::gatherAndMerge
|
||||
// Receive slave ones
|
||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||
{
|
||||
IPstream fromSlave(Pstream::scheduled, slave);
|
||||
IPstream fromSlave(Pstream::commsTypes::scheduled, slave);
|
||||
|
||||
pointField slavePoints(fromSlave);
|
||||
List<FaceType> slaveFaces(fromSlave);
|
||||
@ -210,7 +210,7 @@ void Foam::PatchTools::gatherAndMerge
|
||||
// be improved.
|
||||
OPstream toMaster
|
||||
(
|
||||
Pstream::scheduled,
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo(),
|
||||
myPoints.byteSize() + 4*sizeof(label)*myFaces.size()
|
||||
);
|
||||
|
||||
@ -0,0 +1,84 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
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 "OneConstant.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::Function1Types::OneConstant<Type>::OneConstant(const word& entryName)
|
||||
:
|
||||
Function1<Type>(entryName)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::Function1Types::OneConstant<Type>::OneConstant
|
||||
(
|
||||
const word& entryName,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
Function1<Type>(entryName)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::Function1Types::OneConstant<Type>::~OneConstant()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Type Foam::Function1Types::OneConstant<Type>::value(const scalar x) const
|
||||
{
|
||||
return pTraits<Type>::one;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Type Foam::Function1Types::OneConstant<Type>::integrate
|
||||
(
|
||||
const scalar x1,
|
||||
const scalar x2
|
||||
) const
|
||||
{
|
||||
return (x2 - x1)*pTraits<Type>::one;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::Function1Types::OneConstant<Type>::writeData(Ostream& os) const
|
||||
{
|
||||
Function1<Type>::writeData(os);
|
||||
|
||||
os << token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
120
src/OpenFOAM/primitives/functions/Function1/One/OneConstant.H
Normal file
120
src/OpenFOAM/primitives/functions/Function1/One/OneConstant.H
Normal file
@ -0,0 +1,120 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
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/>.
|
||||
|
||||
Class
|
||||
Foam::Function1Types::OneConstant
|
||||
|
||||
Description
|
||||
Templated function that returns the corresponding 1 (one).
|
||||
|
||||
Usage:
|
||||
\verbatim
|
||||
<entryName> one;
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
OneConstant.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef OneConstant_H
|
||||
#define OneConstant_H
|
||||
|
||||
#include "Function1.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace Function1Types
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class OneConstant Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class OneConstant
|
||||
:
|
||||
public Function1<Type>
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const OneConstant<Type>&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Runtime type information
|
||||
TypeName("one");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from entry name
|
||||
OneConstant(const word& entryName);
|
||||
|
||||
//- Construct from entry name and dictionary
|
||||
OneConstant(const word& entryName, const dictionary& dict);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp<Function1<Type>> clone() const
|
||||
{
|
||||
return tmp<Function1<Type>>(new OneConstant<Type>(*this));
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~OneConstant();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return constant value
|
||||
Type value(const scalar) const;
|
||||
|
||||
//- Integrate between two values
|
||||
Type integrate(const scalar x1, const scalar x2) const;
|
||||
|
||||
//- Write in dictionary format
|
||||
virtual void writeData(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Function1Types
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "OneConstant.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,77 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
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 "ZeroConstant.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::Function1Types::ZeroConstant<Type>::ZeroConstant
|
||||
(
|
||||
const word& entryName,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
Function1<Type>(entryName)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::Function1Types::ZeroConstant<Type>::~ZeroConstant()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Type Foam::Function1Types::ZeroConstant<Type>::value(const scalar x) const
|
||||
{
|
||||
return pTraits<Type>::zero;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Type Foam::Function1Types::ZeroConstant<Type>::integrate
|
||||
(
|
||||
const scalar x1,
|
||||
const scalar x2
|
||||
) const
|
||||
{
|
||||
return pTraits<Type>::zero;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::Function1Types::ZeroConstant<Type>::writeData(Ostream& os) const
|
||||
{
|
||||
Function1<Type>::writeData(os);
|
||||
|
||||
os << token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
117
src/OpenFOAM/primitives/functions/Function1/Zero/ZeroConstant.H
Normal file
117
src/OpenFOAM/primitives/functions/Function1/Zero/ZeroConstant.H
Normal file
@ -0,0 +1,117 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
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/>.
|
||||
|
||||
Class
|
||||
Foam::Function1Types::ZeroConstant
|
||||
|
||||
Description
|
||||
Templated function that returns the corresponding 0 (zero).
|
||||
|
||||
Usage:
|
||||
\verbatim
|
||||
<entryName> zero;
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
ZeroConstant.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef ZeroConstant_H
|
||||
#define ZeroConstant_H
|
||||
|
||||
#include "Function1.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace Function1Types
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ZeroConstant Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class ZeroConstant
|
||||
:
|
||||
public Function1<Type>
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const ZeroConstant<Type>&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Runtime type information
|
||||
TypeName("zero");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from entry name and dictionary
|
||||
ZeroConstant(const word& entryName, const dictionary& dict);
|
||||
|
||||
//- Construct and return a clzero
|
||||
virtual tmp<Function1<Type>> clzero() const
|
||||
{
|
||||
return tmp<Function1<Type>>(new ZeroConstant<Type>(*this));
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~ZeroConstant();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return constant value
|
||||
Type value(const scalar) const;
|
||||
|
||||
//- Integrate between two values
|
||||
Type integrate(const scalar x1, const scalar x2) const;
|
||||
|
||||
//- Write in dictionary format
|
||||
virtual void writeData(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Function1Types
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "ZeroConstant.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user