Compare commits

..

3 Commits

Author SHA1 Message Date
622f476b32 ENH: additional SHA1Digest constructors and methods
- data_bytes(), size_bytes() methods to support broadcasting or
  gather/scatter content. Additional construct from raw bytes
  to support transmitted content.
2023-03-20 11:36:50 +01:00
7389ce15ce STYLE: readOnProc/writeOnProc instead of 'valid' for IO 2023-03-16 11:20:09 +01:00
f801e99f9e STYLE: use readValueEntry in BCs. Assign Zero for refValue/refGrad 2023-03-16 11:20:08 +01:00
9651 changed files with 21772 additions and 40746 deletions

View File

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

View File

@ -96,12 +96,10 @@ echo " ${WM_PROJECT_DIR##*/}"
echo " $WM_COMPILER ${WM_COMPILER_TYPE:-system} compiler"
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
echo
# The api/patch information
sed -e 's/^/ /; s/=/ = /' ./META-INFO/api-info 2>/dev/null || true
echo " bin = $(_foamCountDirEntries "$FOAM_APPBIN") entries"
echo " lib = $(_foamCountDirEntries "$FOAM_LIBBIN") entries"
echo " api = $(etc/openfoam -show-api 2>/dev/null)"
echo " patch = $(etc/openfoam -show-patch 2>/dev/null)"
echo " bin = $(_foamCountDirEntries "$FOAM_APPBIN") entries"
echo " lib = $(_foamCountDirEntries "$FOAM_LIBBIN") entries"
echo
echo ========================================

View File

@ -5,22 +5,17 @@ It is likely incomplete...
## Contributors (alphabetical by surname)
- Horacio Aguerre
- Yu Ankun
- Tetsuo Aoyagi
- Akira Azami
- William Bainbridge
- Gabriel Barajas
- Kutalmis Bercin
- Julius Bergmann
- Ivor Clifford
- Greg Collecutt
- Jonathan Cranford
- Santiago Marquez Damian
- Sergio Ferraris
- Matej Forman
- Marian Fuchs
- Gabriel Gerlero
- Pawan Ghildiyal
- Chris Greenshields
- Bernhard Gschaider
@ -55,11 +50,8 @@ It is likely incomplete...
- Gavin Tabor
- Zeljko Tukovic
- Eugene De Villiers
- Louis Vittoz
- Vuko Vukcevic
- Yi Wang
- Norbert Weber
- Volker Weissmann
- Henry Weller
- Niklas Wikstrom
- Guanyang Xue

View File

@ -1,2 +1,2 @@
api=2306
patch=240625
api=2301
patch=230110

View File

@ -40,9 +40,9 @@ Violations of the Trademark are monitored, and will be duly prosecuted.
If OpenFOAM has already been compiled on your system, simply source
the appropriate `etc/bashrc` or `etc/cshrc` file and get started.
For example, for the OpenFOAM-v2306 version:
For example, for the OpenFOAM-v2212 version:
```
source /installation/path/OpenFOAM-v2306/etc/bashrc
source /installation/path/OpenFOAM-v2212/etc/bashrc
```
## Compiling OpenFOAM
@ -127,8 +127,8 @@ These 3rd-party sources are normally located in a directory parallel
to the OpenFOAM directory. For example,
```
/path/parent
|-- OpenFOAM-v2306
\-- ThirdParty-v2306
|-- OpenFOAM-v2212
\-- ThirdParty-v2212
```
There are, however, many cases where this simple convention is inadequate:
@ -136,7 +136,7 @@ There are, however, many cases where this simple convention is inadequate:
operating system or cluster installation provides it)
* When we have changed the OpenFOAM directory name to some arbitrary
directory name, e.g. openfoam-sandbox2306, etc..
directory name, e.g. openfoam-sandbox2212, etc..
* When we would like any additional 3rd party software to be located
inside of the OpenFOAM directory to ensure that the installation is
@ -156,9 +156,9 @@ when locating the ThirdParty directory with the following precedence:
2. PREFIX/ThirdParty-VERSION
* this corresponds to the traditional approach
3. PREFIX/ThirdParty-vAPI
* allows for an updated value of VERSION, *eg*, `v2306-myCustom`,
* allows for an updated value of VERSION, *eg*, `v2212-myCustom`,
without requiring a renamed ThirdParty. The API value would still
be `2306` and the original `ThirdParty-v2306/` would be found.
be `2212` and the original `ThirdParty-v2212/` would be found.
4. PREFIX/ThirdParty-API
* same as the previous example, but using an unadorned API value.
5. PREFIX/ThirdParty-common

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020,2023 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -132,11 +132,6 @@ void PDRkEpsilon::correct()
// Update epsilon and G at the wall
epsilon_.boundaryFieldRef().updateCoeffs();
// Push new cell values to
// coupled neighbours. Note that we want to avoid the re-updateCoeffs
// of the wallFunctions so make sure to bypass the evaluate on
// those patches and only do the coupled ones.
epsilon_.boundaryFieldRef().evaluateCoupled<coupledFvPatch>();
// Add the blockage generation term so that it is included consistently
// in both the k and epsilon equations

View File

@ -223,7 +223,7 @@ if (ign.ignited())
volScalarField R(Gstar*XiEqStar/(XiEqStar - scalar(1)));
volScalarField G(R*(XiEq - scalar(1.001))/XiEq);
//R *= (Gstar + 2*mag(devSymm(fvc::grad(U))))/Gstar;
//R *= (Gstar + 2*mag(dev(symm(fvc::grad(U)))))/Gstar;
// Solve for the flame wrinkling
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -105,8 +105,7 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
if (!this->readValueEntry(dict))
{
// Fallback: set to the internal field
fvPatchField<scalar>::patchInternalField(*this);
fvPatchField<scalar>::operator=(patchInternalField());
}
refValue() = *this;

View File

@ -29,7 +29,7 @@ if (mesh.changing())
wordList pcorrTypes
(
p.boundaryField().size(),
fvPatchFieldBase::zeroGradientType()
zeroGradientFvPatchScalarField::typeName
);
// Set BCs of pcorr to fixed-value for patches at which p is fixed

View File

@ -87,13 +87,7 @@ int main(int argc, char *argv[])
(
fam::ddt(h, Us)
+ fam::div(phi2s, Us)
+ fam::Sp
(
0.0125
*frictionFactor.internalField()
*mag(Us.internalField()),
Us
)
+ fam::Sp(0.0125*frictionFactor*mag(Us), Us)
==
Gs*h
- fam::Sp(Sd, Us)

View File

@ -47,7 +47,6 @@ forAll(Us, faceI)
Us[faceI].z() =
Uinf.value()*0.25*R[faceI].x()*R[faceI].z()/sqr(mag(R[faceI]));
}
Us.boundaryFieldRef().evaluateCoupled<coupledFaPatch>();
Us -= aMesh.faceAreaNormals()*(aMesh.faceAreaNormals() & Us);

View File

@ -29,7 +29,7 @@ if (mesh.changing())
wordList pcorrTypes
(
p.boundaryField().size(),
fvPatchFieldBase::zeroGradientType()
zeroGradientFvPatchScalarField::typeName
);
// Set BCs of pcorr to fixed-value for patches at which p is fixed

View File

@ -108,7 +108,7 @@ forAll(fluidRegions, i)
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
dimensionedScalar(word::null, dimLength, Zero)
dimensionedScalar("hRef", dimLength, Zero) // uses name
)
);

View File

@ -1,5 +1,5 @@
derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.C
solid/solidRegionDiffNo.C
../solid/solidRegionDiffNo.C
chtMultiRegionTwoPhaseEulerFoam.C
EXE = $(FOAM_APPBIN)/chtMultiRegionTwoPhaseEulerFoam

View File

@ -221,7 +221,7 @@ forAll(fluidRegions, i)
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
dimensionedScalar(word::null, dimLength, Zero)
dimensionedScalar("hRef", dimLength, Zero)
)
);

View File

@ -13,11 +13,11 @@ forAll(cumulativeContErrIO, i)
"cumulativeContErr",
runTime.timeName(),
"uniform",
mesh.thisDb(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
dimensionedScalar(word::null, dimless, Zero)
dimensionedScalar(dimless, Zero)
)
);
}

View File

@ -112,7 +112,7 @@ forAll(fluidRegions, i)
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
dimensionedScalar(word::null, dimLength, Zero)
dimensionedScalar("hRef", dimLength, Zero) // uses name
)
);

View File

@ -13,11 +13,11 @@ forAll(cumulativeContErrIO, i)
"cumulativeContErr",
runTime.timeName(),
"uniform",
mesh.thisDb(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
dimensionedScalar(word::null, dimless, Zero)
dimensionedScalar(dimless, Zero)
)
);
}

View File

@ -57,7 +57,7 @@
),
solidRegions[i],
dimensionedSymmTensor(tkappaByCp().dimensions(), Zero),
fvPatchFieldBase::zeroGradientType()
zeroGradientFvPatchSymmTensorField::typeName
)
);

View File

@ -34,7 +34,7 @@ if (!thermo.isotropic())
),
mesh,
dimensionedSymmTensor(tkappaByCp().dimensions(), Zero),
fvPatchFieldBase::zeroGradientType()
zeroGradientFvPatchSymmTensorField::typeName
)
);
volSymmTensorField& aniAlpha = *taniAlpha;

View File

@ -24,7 +24,7 @@ if (mesh.changing())
wordList pcorrTypes
(
p.boundaryField().size(),
fvPatchFieldBase::zeroGradientType()
zeroGradientFvPatchScalarField::typeName
);
// Set BCs of pcorr to fixed-value for patches at which p is fixed

View File

@ -130,7 +130,7 @@ int main(int argc, char *argv[])
),
mesh,
dimensionedVector(cloudSU.dimensions()/dimVolume, Zero),
fvPatchFieldBase::zeroGradientType()
zeroGradientFvPatchVectorField::typeName
);
cloudVolSUSu.primitiveFieldRef() = -cloudSU.source()/mesh.V();

View File

@ -111,7 +111,7 @@ int main(int argc, char *argv[])
),
mesh,
dimensionedVector(cloudSU.dimensions()/dimVolume, Zero),
fvPatchFieldBase::zeroGradientType()
zeroGradientFvPatchVectorField::typeName
);
cloudVolSUSu.primitiveFieldRef() = -cloudSU.source()/mesh.V();

View File

@ -141,7 +141,7 @@ int main(int argc, char *argv[])
),
mesh,
dimensionedVector(cloudSU.dimensions()/dimVolume, Zero),
fvPatchFieldBase::zeroGradientType()
zeroGradientFvPatchVectorField::typeName
);
cloudVolSUSu.primitiveFieldRef() = -cloudSU.source()/mesh.V();

View File

@ -64,7 +64,8 @@ volScalarField mu
mesh,
IOobject::READ_IF_PRESENT
),
mixture.mu()
mixture.mu(),
calculatedFvPatchScalarField::typeName
);
@ -138,7 +139,7 @@ volScalarField alphac
),
mesh,
dimensionedScalar(dimless, Zero),
fvPatchFieldBase::zeroGradientType()
zeroGradientFvPatchScalarField::typeName
);
alphac.oldTime();

View File

@ -1,7 +1,7 @@
wordList pcorrTypes
(
p.boundaryField().size(),
fvPatchFieldBase::zeroGradientType()
zeroGradientFvPatchScalarField::typeName
);
for (label i=0; i<p.boundaryField().size(); i++)

View File

@ -140,7 +140,7 @@ Foam::fv::VoFSolidificationMeltingSource::VoFSolidificationMeltingSource
),
mesh,
dimensionedScalar(dimless, Zero),
fvPatchFieldBase::zeroGradientType()
zeroGradientFvPatchScalarField::typeName
),
curTimeIndex_(-1)
{

View File

@ -105,7 +105,8 @@ incompressibleTwoPhaseInteractingMixture
U_.db()
),
U_.mesh(),
dimensionedScalar(dimensionSet(1, -1, -1, 0, 0), Zero)
dimensionedScalar(dimensionSet(1, -1, -1, 0, 0), Zero),
calculatedFvPatchScalarField::typeName
)
{
correct();

View File

@ -48,7 +48,7 @@ Foam::wordList Foam::relativeVelocityModel::UdmPatchFieldTypes() const
wordList UdmTypes
(
U.boundaryField().size(),
fvPatchFieldBase::calculatedType()
calculatedFvPatchScalarField::typeName
);
forAll(U.boundaryField(), i)

View File

@ -119,7 +119,8 @@ Foam::incompressibleThreePhaseMixture::incompressibleThreePhaseMixture
U.db()
),
U.mesh(),
dimensionedScalar(dimensionSet(0, 2, -1, 0, 0), Zero)
dimensionedScalar(dimensionSet(0, 2, -1, 0, 0), Zero),
calculatedFvPatchScalarField::typeName
),
nuModel1_

View File

@ -27,7 +27,7 @@
wordList pcorrTypes
(
p_rgh.boundaryField().size(),
fvPatchFieldBase::zeroGradientType()
zeroGradientFvPatchScalarField::typeName
);
for (label i=0; i<p_rgh.boundaryField().size(); i++)

View File

@ -76,7 +76,7 @@
mesh
),
fluid.dragCoeff(phase, dragCoeffs())/phase.rho(),
fvPatchFieldBase::zeroGradientType()
zeroGradientFvPatchScalarField::typeName
);
dragCoeffi.correctBoundaryConditions();

View File

@ -47,7 +47,7 @@ tractionDisplacementFvPatchVectorField
traction_(p.size(), Zero),
pressure_(p.size(), Zero)
{
extrapolateInternal();
fvPatchVectorField::operator=(patchInternalField());
gradient() = Zero;
}
@ -79,7 +79,7 @@ tractionDisplacementFvPatchVectorField
traction_("traction", dict, p.size()),
pressure_("pressure", dict, p.size())
{
extrapolateInternal();
fvPatchVectorField::operator=(patchInternalField());
gradient() = Zero;
}

View File

@ -47,7 +47,7 @@ tractionDisplacementCorrectionFvPatchVectorField
traction_(p.size(), Zero),
pressure_(p.size(), Zero)
{
extrapolateInternal();
fvPatchVectorField::operator=(patchInternalField());
gradient() = Zero;
}
@ -79,7 +79,7 @@ tractionDisplacementCorrectionFvPatchVectorField
traction_("traction", dict, p.size()),
pressure_("pressure", dict, p.size())
{
extrapolateInternal();
fvPatchVectorField::operator=(patchInternalField());
gradient() = Zero;
}

View File

@ -27,14 +27,6 @@ License
#include "dummyLib.H"
#include <iostream>
// Include MPI without any C++ bindings
#ifndef MPICH_SKIP_MPICXX
#define MPICH_SKIP_MPICXX
#endif
#ifndef OMPI_SKIP_MPICXX
#define OMPI_SKIP_MPICXX
#endif
#include <mpi.h>
// * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * * //

View File

@ -112,20 +112,13 @@ int main(int argc, char *argv[])
argList::addBoolOption("iter");
argList::addBoolOption("swap");
argList::addBoolOption("default", "reinstate default tests");
argList::addBoolOption("no-wait", "test with skipping request waits");
argList::addNote("runs default tests or specified ones only");
#include "setRootCase.H"
const bool optNowaiting = args.found("no-wait");
// Run default tests, unless only specific tests are requested
const bool defaultTests =
(
args.found("default")
|| args.options().empty()
|| (optNowaiting && args.options().size())
);
args.found("default") || args.options().empty();
typedef FixedList<scalar,2> scalar2Type;
@ -314,53 +307,27 @@ int main(int argc, char *argv[])
List<FixedList<label, 2>> list6{{0, 1}, {2, 3}};
Info<< "list6: " << list6 << nl;
if (UPstream::parRun())
if (Pstream::parRun())
{
// Fixed buffer would also work, but want to test using UList
List<labelPair> buffer;
DynamicList<UPstream::Request> requests;
const label numProcs = UPstream::nProcs();
const label startOfRequests = UPstream::nRequests();
// NOTE: also test a mix of local and global requests...
UPstream::Request singleRequest;
if (UPstream::master())
if (Pstream::master())
{
// Use local requests here
requests.reserve(numProcs);
buffer.resize(numProcs);
buffer.resize(UPstream::nProcs());
buffer[0] = labelPair(0, UPstream::myProcNo());
for (const int proci : UPstream::subProcs())
for (const int proci : Pstream::subProcs())
{
UIPstream::read
(
requests.emplace_back(),
UPstream::commsTypes::nonBlocking,
proci,
buffer.slice(proci, 1)
);
}
if (requests.size() > 1)
{
// Or just wait for as a single request...
singleRequest = requests.back();
requests.pop_back();
}
if (requests.size() > 2)
{
// Peel off a few from local -> global
// the order will not matter (is MPI_Waitall)
UPstream::addRequest(requests.back()); requests.pop_back();
UPstream::addRequest(requests.back()); requests.pop_back();
}
}
else
{
@ -369,34 +336,16 @@ int main(int argc, char *argv[])
Perr<< "Sending to master: " << buffer << endl;
// Capture the request and transfer to the global list
// (for testing)
UOPstream::write
(
singleRequest,
UPstream::commsTypes::nonBlocking,
UPstream::masterNo(),
buffer.slice(0, 1) // OK
/// buffer // Also OK
);
// if (singleRequest.good())
{
UPstream::addRequest(singleRequest);
}
}
Pout<< "Pending requests [" << numProcs << " procs] global="
<< (UPstream::nRequests() - startOfRequests)
<< " local=" << requests.size()
<< " single=" << singleRequest.good() << nl;
if (!optNowaiting)
{
UPstream::waitRequests(startOfRequests);
}
UPstream::waitRequests(requests);
UPstream::waitRequest(singleRequest);
UPstream::waitRequests(startOfRequests);
Info<< "Gathered: " << buffer << endl;
}

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -325,22 +325,6 @@ int main(int argc, char *argv[])
{
list1.set(i, new Scalar(1.3*i));
}
{
auto ptr = autoPtr<Scalar>::New(10);
Info<< "add: " << Foam::name(ptr.get());
list1.set(0, ptr);
Info<< "ptrlist: " << Foam::name(list1.get(0)) << nl;
Info<< "now: " << Foam::name(ptr.get()) << nl;
ptr = autoPtr<Scalar>::New(20);
list1.append(ptr);
// Delete method: list1.push_back(ptr);
// list1.push_back(std::move(ptr));
}
PtrList<Scalar> list2(15);
Info<< "Emplace set " << list2.size() << " values" << nl;

View File

@ -370,7 +370,7 @@ void test_global_funcs(Type)
Type(126)
)
);
cmp(" Square of Frobenius norm = ", magSqr(sT), scalar(205));
cmp(" Square of Frobenius norm = ", magSqr(sT), Type(205));
}

View File

@ -325,7 +325,7 @@ void test_global_funcs(Type)
Type(13)
)
);
cmp(" Square of Frobenius norm = ", magSqr(sT), scalar(17.999999999999996));
cmp(" Square of Frobenius norm = ", magSqr(sT), Type(17.999999999999996));
cmp
(
" Outer-product of a Vector2D with itself = ",

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2023 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -124,9 +124,6 @@ int main(int argc, char *argv[])
argList::addDryRunOption("Just for testing");
argList::addVerboseOption("Increase verbosity");
// Check -verbose before initialisation
UPstream::debug = argList::verbose(argc, argv);
#include "setRootCase.H"
Pout<< "command-line ("

View File

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

View File

@ -1,2 +0,0 @@
/* EXE_INC = */
/* EXE_LIBS = */

View File

@ -1,97 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Test file/directory broadcasting
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "OSspecific.H"
#include "fileOperation.H"
#include "Pstream.H"
#include "Switch.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
argList::noBanner();
argList::noFunctionObjects();
argList::noCheckProcessorDirectories();
argList::addNote("Test broadcast file via MPI");
argList::addArgument("srcFile");
argList::addBoolOption("even", "Broadcast to even directories only");
argList::addBoolOption("relative", "Copy relative to output dir");
#include "setRootCase.H"
const auto srcFile = args.get<fileName>(1);
// const auto dstFile = args.get<fileName>(2);
fileName dstFile("proc" + Foam::name(UPstream::myProcNo()));
const bool writeOnProc =
(
!args.found("even") || 0 == (UPstream::myProcNo() % 2)
);
if (args.found("relative"))
{
// if (writeOnProc)
// {
// Foam::mkDir(dstFile);
// }
}
else
{
dstFile /= srcFile + ".copy";
}
Pout<< "writing: " << writeOnProc << " : " << dstFile << endl;
const auto& fp = fileHandler();
fp.broadcastCopy
(
UPstream::worldComm,
writeOnProc,
srcFile,
dstFile
);
Info<< "\nEnd\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -34,9 +34,6 @@ Description
#include "complex.H"
#include "complexFields.H"
#include "scalarField.H"
#include "diagTensor.H"
#include "symmTensor.H"
#include "symmTensor2D.H"
#include "ListOps.H"
#include "ops.H"
@ -167,72 +164,6 @@ int main(int argc, char *argv[])
<< " => " << imags << nl;
}
{
SymmTensor<complex> st1(SymmTensor<complex>::uniform({3, 4}));
Info<< "symmTensor: " << st1 << nl
<< " tr: " << tr(st1) << nl
<< " diagSqr: " << st1.diagSqr() << nl
<< " magSqr: " << magSqr(st1) << nl
<< " mag: " << mag(st1) << nl;
SymmTensor<scalar> st2(SymmTensor<scalar>::uniform(5));
Info<< "symmTensor: " << st2 << nl
<< " tr: " << tr(st2) << nl
<< " diagSqr: " << st2.diagSqr() << nl
<< " magSqr: " << magSqr(st2) << nl
<< " mag: " << mag(st2) << nl;
st2 = Zero;
DiagTensor<complex> dt1(SphericalTensor<complex>({3, 4}));
Info<< "diagTensor: " << dt1 << nl
<< " tr: " << tr(dt1) << nl
<< " diagSqr: " << dt1.diagSqr() << nl
<< " magSqr: " << magSqr(dt1) << nl
<< " mag: " << mag(dt1) << nl;
// A bit ugly...
st1 = SphericalTensor<complex>({3, 4});
Info<< "symmTensor: " << st1 << nl
<< " tr: " << tr(st1) << nl
<< " diagSqr: " << st1.diagSqr() << nl
<< " magSqr: " << magSqr(st1) << nl
<< " mag: " << mag(st1) << nl;
}
{
SymmTensor2D<complex> st1(SymmTensor2D<complex>::uniform({3, 4}));
Info<< "symmTensor: " << st1 << nl
<< " tr: " << tr(st1) << nl
<< " diagSqr: " << st1.diagSqr() << nl
<< " magSqr: " << magSqr(st1) << nl
<< " mag: " << mag(st1) << nl;
}
{
Tensor<complex> st1(Tensor<complex>::uniform({3, 4}));
Info<< "tensor: " << st1 << nl
<< " tr: " << tr(st1) << nl
<< " diagSqr: " << st1.diagSqr() << nl
<< " magSqr: " << magSqr(st1) << nl
<< " mag: " << mag(st1) << endl;
Tensor<scalar> st2(Tensor<scalar>::uniform(5));
Info<< "Tensor: " << st2 << nl
<< " tr: " << tr(st2) << nl
<< " diagSqr: " << st2.diagSqr() << nl
<< " magSqr: " << magSqr(st2) << nl
<< " mag: " << mag(st2) << endl;
}
complexField fld1(3, complex(2.0, 1.0));
complexField fld2(fld1);

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -41,6 +41,7 @@ Description
#include "mapPolyMesh.H"
#include "polyTopoChange.H"
#include "fvCFD.H"
#include "zeroGradientFvPatchFields.H"
#include "Random.H"
using namespace Foam;
@ -92,7 +93,7 @@ int main(int argc, char *argv[])
),
mesh,
dimensionedScalar("one", dimless, 1.0),
fvPatchFieldBase::zeroGradientType()
zeroGradientFvPatchScalarField::typeName
);
Info<< "Writing one field "
<< one.name() << " in " << runTime.timeName() << endl;
@ -130,7 +131,8 @@ int main(int argc, char *argv[])
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("one", dimless, 1.0)
dimensionedScalar("one", dimless, 1.0),
calculatedFvsPatchScalarField::typeName
);
Info<< "Writing surface one field "
<< surfaceOne.name() << " in " << runTime.timeName() << endl;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

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

View File

@ -1,2 +0,0 @@
/* EXE_INC = */
/* EXE_LIBS = */

View File

@ -1,79 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
Test-fileHandler-dummy
Description
Simple test of dummy fileOperation
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "fileName.H"
#include "fileOperation.H"
#include "Switch.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
argList::noBanner();
argList::noCheckProcessorDirectories();
argList::addBoolOption
(
"force",
"Force use of dummy handler (and provoke NotImplemented)"
);
#include "setRootCase.H"
const bool optForce = args.found("force");
const auto& dummy = fileOperation::null();
Info<< "default handler: " << fileHandler() << endl;
Info<< "dummy handler: " << dummy() << endl;
Switch hasFile(Switch::INVALID);
if (optForce || (dummy && dummy().good()))
{
hasFile = dummy().isFile("foo");
}
Info<< "check file: " << hasFile << endl;
Info<< "\nEnd\n" << endl;
return 0;
}
// ************************************************************************* //

View File

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

View File

@ -1,2 +0,0 @@
/* EXE_INC = */
/* EXE_LIBS = */

View File

@ -1,20 +0,0 @@
Test that -ioRanks selections perform as expected and that sub-rank
selection is also doing the correct thing.
For example,
mpirun -np 10 --oversubscribe Test-fileHandler-ranks1 -parallel -ioRanks host
mpirun -np 10 --oversubscribe Test-fileHandler-ranks1 -parallel -ioRanks '(0 3 14)'
mpirun -np 10 --oversubscribe Test-fileHandler-ranks1 -parallel -ioRanks 14,15,2,0,10,15,0,0,0,
mpirun -np 10 --oversubscribe Test-fileHandler-ranks1 -parallel -ioRanks '0,3,10'
mpirun -np 10 --oversubscribe Test-fileHandler-ranks1 -parallel -ioRanks '0,3,11'
mpirun -np 10 --oversubscribe Test-fileHandler-ranks1 -parallel -ioRanks '0,3,14'
mpirun -np 10 --oversubscribe Test-fileHandler-ranks1 -parallel -ioRanks '0,3,15'
mpirun -np 10 --oversubscribe Test-fileHandler-ranks1 -parallel -ioRanks '0,3,12,115'
mpirun -np 10 --oversubscribe Test-fileHandler-ranks1 -parallel -ioRanks '0,3,10,12,115'
mpirun -np 10 --oversubscribe Test-fileHandler-ranks1 -parallel -ioRanks host -pick '1,2,3,4'
mpirun -np 10 --oversubscribe Test-fileHandler-ranks1 -parallel -pick '2,4,6,8'
mpirun -np 10 --oversubscribe Test-fileHandler-ranks1 -parallel -ioRanks '0,3' -pick '2,4,6,8'
mpirun -np 10 --oversubscribe Test-fileHandler-ranks1 -parallel -ioRanks '0,4' -pick '2,4,6,8'
mpirun -np 10 --oversubscribe Test-fileHandler-ranks1 -parallel -ioRanks '0,6' -pick '2,4,6,8'
mpirun -np 10 --oversubscribe Test-fileHandler-ranks1 -parallel -ioRanks '0,6' -pick '2,4,6,8'

View File

@ -1,249 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
Test-fileHandler-ranks1
Description
Test IO ranks and ranks selection
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "fileName.H"
#include "fileOperation.H"
#include "IOstreams.H"
#include "ITstream.H"
#include "OSspecific.H"
#include "Pstream.H"
#include "SHA1.H"
#include "stringOps.H"
using namespace Foam;
// Parse space, comma, semicolon separated list of integers, floats etc...
template<class PrimitiveType>
static List<PrimitiveType> splitStringToList(const std::string& str)
{
const SubStrings<std::string> items = stringOps::splitAny(str, " ,;");
DynamicList<PrimitiveType> values(items.size());
for (const auto& item : items)
{
const std::string s(item.str());
PrimitiveType val;
if (Foam::read(s, val))
{
values.push_back(val);
}
else
{
// Report errors? Could get noisy...
}
}
return List<PrimitiveType>(std::move(values));
}
//- Construct by parsing string for scalar ranges
// The individual items are space, comma or semicolon delimited.
static labelList parseIOranks
(
const Foam::string& str,
label numProcs = -1
)
{
bool byHostName = false;
labelList ranks;
// Info<< "parsing: " << str << endl;
if (!str.empty())
{
if (str.contains('('))
{
// Looks like a list - tokenise it
ITstream is(str);
if (!is.empty())
{
is >> ranks;
}
}
else if (str == "host")
{
// Select by host
byHostName = true;
}
else
{
// Manual parse
ranks = splitStringToList<label>(str);
}
}
if (ranks.size())
{
// Never trust user input.
// Sort and eliminate any duplicates
std::sort(ranks.begin(), ranks.end());
auto last = std::unique(ranks.begin(), ranks.end());
label newLen = label(last - ranks.begin());
// Detect any values that are too large
if (numProcs > 0)
{
auto iter = std::find_if
(
ranks.begin(),
last,
[=](label proci) { return proci >= numProcs; }
);
if (last != iter)
{
newLen = label(iter - ranks.begin());
}
}
ranks.resize(newLen);
}
else if (byHostName)
{
// Use hostname
// Lowest rank per hostname is the IO rank
numProcs = UPstream::nProcs(UPstream::worldComm);
List<SHA1Digest> digests;
if (UPstream::master(UPstream::worldComm))
{
digests.resize(numProcs);
}
// Could also add lowercase etc, but since hostName()
// will be consistent within the same node, there is no need.
SHA1Digest myDigest(SHA1(hostName()).digest());
// The fixed-length digest allows use of MPI_Gather
UPstream::mpiGather
(
myDigest.cdata_bytes(), // Send
digests.data_bytes(), // Recv
SHA1Digest::max_size(), // Num send/recv per rank
UPstream::worldComm
);
if (UPstream::master(UPstream::worldComm))
{
DynamicList<label> dynRanks(numProcs);
dynRanks.push_back(0); // Always include master
label previ = 0;
for (label proci = 1; proci < digests.size(); ++proci)
{
if (digests[proci] != digests[previ])
{
dynRanks.push_back(proci);
previ = proci;
}
}
ranks.transfer(dynRanks);
}
Pstream::broadcast(ranks, UPstream::worldComm);
}
return ranks;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
argList::noBanner();
argList::noCheckProcessorDirectories();
argList::addOption("io-ranks", "list", "shadow for -ioRanks (testing)");
argList::addOption("pick", "list", "limited subset of procs");
labelList ioRanks;
// Pre-check
for (int argi = 1; argi < argc; ++argi)
{
if (strcmp(argv[argi], "-io-ranks") == 0)
{
if (argi < argc-1)
{
ioRanks = parseIOranks(argv[argi+1]);
break;
}
}
}
#include "setRootCase.H"
bitSet useProc;
if (args.found("pick"))
{
useProc = bitSet
(
UPstream::nProcs(),
parseIOranks(args.get<string>("pick"))
);
}
Info<< "procs: " << UPstream::nProcs() << endl;
Info<< "io-ranks: " << flatOutput(ioRanks) << endl;
Info<< "-ioRanks: "
<< flatOutput(fileOperation::getGlobalIORanks()) << endl;
Info<< "pick: " << flatOutput(useProc.toc()) << endl;
// labelList subRanks = fileOperation::getGlobalSubRanks(useProc);
//
// Pout<< "sub ranks: "
// << flatOutput(fileOperation::getGlobalSubRanks(useProc)) << endl;
Info<< "\nEnd\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -6,7 +6,6 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -39,28 +38,18 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::addBoolOption("setTime", "Time::setTime(..) for each instance");
argList::noParallel();
// timeSelector::addOptions();
timeSelector::addOptions(true, true);
#include "setRootCase.H"
Info<< "Using fileHandler: " << fileHandler().type() << endl;
#include "createTime.H"
Info<< "Times found:" << runTime.times() << endl;
instantList timeDirs = timeSelector::select0(runTime, args);
Pout<< "Times selected:" << timeDirs << endl;
if (args.found("setTime"))
{
forAll(timeDirs, timei)
{
runTime.setTime(timeDirs[timei], timei);
}
}
Info<< "Times selected:" << timeDirs << endl;
Info<< "\nEnd\n" << endl;
return 0;

View File

@ -200,7 +200,7 @@ int main(int argc, char *argv[])
// Less frequently used - reduce some clutter
argList::setAdvanced("decomposeParDict");
argList::addVerboseOption();
argList::addVerboseOption("Additional verbosity");
#include "addAllRegionOptions.H"

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -41,6 +41,7 @@ Description
#include "mapPolyMesh.H"
#include "polyTopoChange.H"
#include "Random.H"
#include "zeroGradientFvPatchFields.H"
#include "calculatedPointPatchFields.H"
#include "pointConstraints.H"
#include "fvCFD.H"
@ -98,7 +99,7 @@ int main(int argc, char *argv[])
),
mesh,
dimensionedScalar("one", dimless, 1.0),
fvPatchFieldBase::zeroGradientType()
zeroGradientFvPatchScalarField::typeName
);
Info<< "Writing one field "
<< one.name() << " in " << runTime.timeName() << endl;
@ -136,7 +137,8 @@ int main(int argc, char *argv[])
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("one", dimless, 1.0)
dimensionedScalar("one", dimless, 1.0),
calculatedFvsPatchScalarField::typeName
);
Info<< "Writing surface one field "
<< surfaceOne.name() << " in " << runTime.timeName() << endl;
@ -155,7 +157,8 @@ int main(int argc, char *argv[])
IOobject::AUTO_WRITE
),
pointMesh::New(mesh),
dimensionedScalar("one", dimless, 1.0)
dimensionedScalar("one", dimless, 1.0),
calculatedPointPatchScalarField::typeName
);
pointX.primitiveFieldRef() = mesh.points().component(0);
pointX.correctBoundaryConditions();

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

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