Compare commits
46 Commits
develop.me
...
maintenanc
| Author | SHA1 | Date | |
|---|---|---|---|
| aa02bf904e | |||
| cd79ac6fd5 | |||
| 5619d509c5 | |||
| a52aa33069 | |||
| dd8598ecde | |||
| 964dcb5b53 | |||
| 3166fc0b73 | |||
| 89e7775f90 | |||
| 40c713c48c | |||
| 9cfdb2cc40 | |||
| b9eedb35d1 | |||
| 9c076da13a | |||
| 7782a66e88 | |||
| 4b2a4ed9ec | |||
| a031c194b8 | |||
| e5d2c89f9a | |||
| 641cb490b4 | |||
| f51edbf79e | |||
| 3357b86ab5 | |||
| e9d156ce54 | |||
| dba1bc24ca | |||
| 3c13e7eebf | |||
| 91dd591ff6 | |||
| ecef4c1473 | |||
| 15e7967fb7 | |||
| 5db18df6bc | |||
| cab600d567 | |||
| 868045b2e1 | |||
| ef652062ec | |||
| 5782af39f5 | |||
| fd49e4dd24 | |||
| 8831dfc58b | |||
| 3e29b9c3aa | |||
| cf2630dd1a | |||
| 86e593b58e | |||
| c332b2cbc8 | |||
| bd48ca4920 | |||
| be740dcb06 | |||
| 186ab01b31 | |||
| ef1324a1b0 | |||
| 108d14967a | |||
| 41e93f735f | |||
| 7670bd0e13 | |||
| 5ff5b0afc4 | |||
| 68e7c21d2f | |||
| fa026a13a1 |
9
META-INFO/.gitignore
vendored
Normal file
9
META-INFO/.gitignore
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Do not track build information
|
||||||
|
build-info
|
||||||
|
|
||||||
|
# Do not track time-stamp
|
||||||
|
time-stamp
|
||||||
|
|
||||||
|
# Do not track any manifest files
|
||||||
|
Manifest.txt
|
||||||
|
manifest.txt
|
||||||
5
META-INFO/README.md
Normal file
5
META-INFO/README.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# META-INFO
|
||||||
|
|
||||||
|
Meta-information is for OpenFOAM internal use only.
|
||||||
|
|
||||||
|
(Backport from 1812)
|
||||||
2
META-INFO/api-info
Normal file
2
META-INFO/api-info
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
api=1806
|
||||||
|
patch=200131
|
||||||
@ -12,7 +12,7 @@ PtrList<volScalarField> p_rghFluid(fluidRegions.size());
|
|||||||
PtrList<radiation::radiationModel> radiation(fluidRegions.size());
|
PtrList<radiation::radiationModel> radiation(fluidRegions.size());
|
||||||
|
|
||||||
List<scalar> initialMassFluid(fluidRegions.size());
|
List<scalar> initialMassFluid(fluidRegions.size());
|
||||||
List<label> pRefCellFluid(fluidRegions.size(), 0);
|
List<label> pRefCellFluid(fluidRegions.size(), -1);
|
||||||
List<scalar> pRefValueFluid(fluidRegions.size(), 0.0);
|
List<scalar> pRefValueFluid(fluidRegions.size(), 0.0);
|
||||||
List<bool> frozenFlowFluid(fluidRegions.size(), false);
|
List<bool> frozenFlowFluid(fluidRegions.size(), false);
|
||||||
|
|
||||||
|
|||||||
@ -107,7 +107,7 @@ Foam::radiation::localDensityAbsorptionEmission::aCont(const label bandI) const
|
|||||||
forAll(alphaNames_, i)
|
forAll(alphaNames_, i)
|
||||||
{
|
{
|
||||||
dimensionedScalar aPhase("a", dimless/dimLength, aCoeff_[i]);
|
dimensionedScalar aPhase("a", dimless/dimLength, aCoeff_[i]);
|
||||||
a += max(alpha(alphaNames_[i]), 0.0)*aPhase;
|
a += max(alpha(alphaNames_[i]), scalar(0))*aPhase;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ta;
|
return ta;
|
||||||
@ -140,7 +140,7 @@ Foam::radiation::localDensityAbsorptionEmission::eCont(const label bandI) const
|
|||||||
forAll(alphaNames_, i)
|
forAll(alphaNames_, i)
|
||||||
{
|
{
|
||||||
dimensionedScalar ePhase("e", dimless/dimLength, eCoeff_[i]);
|
dimensionedScalar ePhase("e", dimless/dimLength, eCoeff_[i]);
|
||||||
e += max(alpha(alphaNames_[i]), 0.0)*ePhase;
|
e += max(alpha(alphaNames_[i]), scalar(0))*ePhase;
|
||||||
}
|
}
|
||||||
|
|
||||||
return te;
|
return te;
|
||||||
@ -179,7 +179,7 @@ Foam::radiation::localDensityAbsorptionEmission::ECont(const label bandI) const
|
|||||||
ECoeff_[i]
|
ECoeff_[i]
|
||||||
);
|
);
|
||||||
|
|
||||||
E += max(alpha(alphaNames_[i]), 0.0)*EPhase;
|
E += max(alpha(alphaNames_[i]), scalar(0))*EPhase;
|
||||||
}
|
}
|
||||||
|
|
||||||
return tE;
|
return tE;
|
||||||
|
|||||||
@ -22,11 +22,11 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::phasePair description for mass transfer between a pair of
|
Foam::phasePair
|
||||||
phases. The direction of the mass transfer is from the phase
|
|
||||||
'from' to the phasse 'to'.
|
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
Description for mass transfer between a pair of phases. The direction of
|
||||||
|
the mass transfer is from the phase 'from' to the phasse 'to'.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
phasePair.C
|
phasePair.C
|
||||||
|
|||||||
@ -2,31 +2,32 @@
|
|||||||
if (pimple.nCorrPIMPLE() > 1)
|
if (pimple.nCorrPIMPLE() > 1)
|
||||||
{
|
{
|
||||||
// If nOuterCorrectors > 1 then for all but the first loop the advection
|
// If nOuterCorrectors > 1 then for all but the first loop the advection
|
||||||
// of alpha is done using an average, 0.5*phi+0.5*phiNew where phi is
|
// of alpha is done using an average, 0.5*phi+0.5*phiNew where phi is
|
||||||
// the flux at the beginning of the time step and phiNew is the flux
|
// the flux at the beginning of the time step and phiNew is the flux
|
||||||
// estimate at the end of the time step from the previous outer
|
// estimate at the end of the time step from the previous outer
|
||||||
// iteration. Similarly we use 0.5*U + 0.5*UNew in later iterations.
|
// iteration. Similarly we use 0.5*U + 0.5*UNew in later iterations.
|
||||||
if (pimple.firstIter())
|
if (pimple.firstIter())
|
||||||
{
|
{
|
||||||
// To recalculate the alpha1 update in subsequent iterations, we
|
// To recalculate the alpha1 update in subsequent iterations, we
|
||||||
// must store its current value before overwriting with the new
|
// must store its current value before overwriting with the new
|
||||||
// value
|
// value
|
||||||
alpha1.prevIter();
|
alpha1.storePrevIter();
|
||||||
// Storing initial phi and U for use in later outer iterations.
|
// Storing initial phi and U for use in later outer iterations.
|
||||||
phi.storePrevIter();
|
phi.storePrevIter();
|
||||||
U.storePrevIter();
|
U.storePrevIter();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Resetting alpha1 to value before advection in first PIMPLE
|
// Resetting alpha1 to value before advection in first PIMPLE
|
||||||
// iteration.
|
// iteration.
|
||||||
alpha1 = alpha1.prevIter();
|
alpha1 = alpha1.prevIter();
|
||||||
|
|
||||||
// Setting U and phi with which to advect interface.
|
// Setting U and phi with which to advect interface.
|
||||||
U = 0.5*U.prevIter() + 0.5*U;
|
U = 0.5*U.prevIter() + 0.5*U;
|
||||||
phi = 0.5*phi.prevIter() + 0.5*phi;
|
phi = 0.5*phi.prevIter() + 0.5*phi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Updating alpha1
|
// Updating alpha1
|
||||||
advector.advect();
|
advector.advect();
|
||||||
#include "rhofs.H"
|
#include "rhofs.H"
|
||||||
|
|||||||
@ -171,7 +171,7 @@ int main(int argc, char *argv[])
|
|||||||
<< "(non-const)\n";
|
<< "(non-const)\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
Info<< "Failed (expected) " << err << nl << endl;
|
Info<< "Failed (expected) " << err << nl << endl;
|
||||||
}
|
}
|
||||||
@ -193,7 +193,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "[20] is false, as expected for const-access\n";
|
Info<< "[20] is false, as expected for const-access\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
Info<< "Failed (expected) " << err << nl << endl;
|
Info<< "Failed (expected) " << err << nl << endl;
|
||||||
}
|
}
|
||||||
@ -263,7 +263,7 @@ int main(int argc, char *argv[])
|
|||||||
list1[16] = 5;
|
list1[16] = 5;
|
||||||
list1[36] = list1.max_value;
|
list1[36] = list1.max_value;
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
Info<< "Failed (expected) " << err << nl << endl;
|
Info<< "Failed (expected) " << err << nl << endl;
|
||||||
|
|
||||||
|
|||||||
@ -201,7 +201,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<<"Random position(10,5): "
|
Info<<"Random position(10,5): "
|
||||||
<< Random().position<label>(10, 5) << endl;
|
<< Random().position<label>(10, 5) << endl;
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
Info<< "Caught FatalError " << err << nl << endl;
|
Info<< "Caught FatalError " << err << nl << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,11 +56,11 @@ void doTest(const dictionary& dict)
|
|||||||
cs2.writeDict(Info, true);
|
cs2.writeDict(Info, true);
|
||||||
Info<< nl;
|
Info<< nl;
|
||||||
}
|
}
|
||||||
catch (Foam::IOerror& err)
|
catch (const Foam::IOerror& err)
|
||||||
{
|
{
|
||||||
Info<< "Caught FatalIOError " << err << nl << endl;
|
Info<< "Caught FatalIOError " << err << nl << endl;
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
Info<< "Caught FatalError " << err << nl << endl;
|
Info<< "Caught FatalError " << err << nl << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,7 +51,7 @@ void test(const Type& polynomialEqn, const scalar tol)
|
|||||||
case roots::real:
|
case roots::real:
|
||||||
v[i] = polynomialEqn.value(r[i]);
|
v[i] = polynomialEqn.value(r[i]);
|
||||||
e[i] = polynomialEqn.error(r[i]);
|
e[i] = polynomialEqn.error(r[i]);
|
||||||
ok = ok && mag(v[i]) < tol*mag(e[i]);
|
ok = ok && mag(v[i]) <= tol*mag(e[i]);
|
||||||
break;
|
break;
|
||||||
case roots::posInf:
|
case roots::posInf:
|
||||||
v[i] = + inf;
|
v[i] = + inf;
|
||||||
@ -79,8 +79,10 @@ void test(const Type& polynomialEqn, const scalar tol)
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
const int nTests = 1000000;
|
const scalar tol = 5;
|
||||||
for (int t = 0; t < nTests; ++ t)
|
|
||||||
|
const label nTests = 1000000;
|
||||||
|
for (label t = 0; t < nTests; ++ t)
|
||||||
{
|
{
|
||||||
test
|
test
|
||||||
(
|
(
|
||||||
@ -91,11 +93,26 @@ int main()
|
|||||||
randomScalar(1e-50, 1e+50),
|
randomScalar(1e-50, 1e+50),
|
||||||
randomScalar(1e-50, 1e+50)
|
randomScalar(1e-50, 1e+50)
|
||||||
),
|
),
|
||||||
100
|
tol
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Info << nTests << " random cubics tested" << endl;
|
||||||
|
|
||||||
Info << nTests << " cubics tested" << endl;
|
const label coeffMin = -9, coeffMax = 10, nCoeff = coeffMax - coeffMin;
|
||||||
|
for (label a = coeffMin; a < coeffMax; ++ a)
|
||||||
|
{
|
||||||
|
for (label b = coeffMin; b < coeffMax; ++ b)
|
||||||
|
{
|
||||||
|
for (label c = coeffMin; c < coeffMax; ++ c)
|
||||||
|
{
|
||||||
|
for (label d = coeffMin; d < coeffMax; ++ d)
|
||||||
|
{
|
||||||
|
test(cubicEqn(a, b, c, d), tol);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Info<< nCoeff*nCoeff*nCoeff*nCoeff << " integer cubics tested" << endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
19
applications/test/dictionary/testDictAPI
Normal file
19
applications/test/dictionary/testDictAPI
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1812 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object testDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
_FOAM_API $FOAM_API;
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -55,7 +55,7 @@ int main(int argc, char *argv[])
|
|||||||
<< "Error 2"
|
<< "Error 2"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
catch (Foam::error& fErr)
|
catch (const Foam::error& fErr)
|
||||||
{
|
{
|
||||||
Serr<< "Caught Foam error " << fErr << nl << endl;
|
Serr<< "Caught Foam error " << fErr << nl << endl;
|
||||||
}
|
}
|
||||||
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
|||||||
<< "Error# 3"
|
<< "Error# 3"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
catch (Foam::error& fErr)
|
catch (const Foam::error& fErr)
|
||||||
{
|
{
|
||||||
Serr<< "Caught Foam error " << fErr << nl << endl;
|
Serr<< "Caught Foam error " << fErr << nl << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,7 +58,7 @@ int main(int argc, char *argv[])
|
|||||||
labelledTri l1{ 1, 2, 3, 10, 24 };
|
labelledTri l1{ 1, 2, 3, 10, 24 };
|
||||||
Info<< "labelled:" << l1 << nl;
|
Info<< "labelled:" << l1 << nl;
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
WarningInFunction
|
WarningInFunction
|
||||||
<< "Caught FatalError " << err << nl << endl;
|
<< "Caught FatalError " << err << nl << endl;
|
||||||
|
|||||||
@ -670,9 +670,27 @@ int main(int argc, char *argv[])
|
|||||||
<< " controlDict => " << findEtcFile("controlDict") << nl
|
<< " controlDict => " << findEtcFile("controlDict") << nl
|
||||||
<< " badName => " << findEtcFile("badName") << endl;
|
<< " badName => " << findEtcFile("badName") << endl;
|
||||||
|
|
||||||
Info<< "This should emit a fatal error:" << endl;
|
{
|
||||||
Info<< " badName(die) => " << findEtcFile("badName", true) << nl
|
|
||||||
<< endl;
|
Info<< nl << "Expect a FatalError for findEtcFile() with a bad name:"
|
||||||
|
<< nl;
|
||||||
|
|
||||||
|
const bool throwingError = FatalError.throwExceptions();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Info<< " badName(die) => " << flush
|
||||||
|
<< findEtcFile("<very-badName>", true) << nl
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
catch (const Foam::error& err)
|
||||||
|
{
|
||||||
|
Info<< nl << "findEtcFile() Caught FatalError "
|
||||||
|
<< err << nl << endl;
|
||||||
|
}
|
||||||
|
FatalError.throwExceptions(throwingError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Info<< "\nEnd\n" << endl;
|
Info<< "\nEnd\n" << endl;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -75,7 +75,7 @@ unsigned testParsing
|
|||||||
{
|
{
|
||||||
val = function (str);
|
val = function (str);
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
parsed = false;
|
parsed = false;
|
||||||
errMsg = err.message();
|
errMsg = err.message();
|
||||||
|
|||||||
@ -127,7 +127,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
Info<< "Caught FatalError " << err << nl << endl;
|
Info<< "Caught FatalError " << err << nl << endl;
|
||||||
continue;
|
continue;
|
||||||
@ -164,7 +164,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "pass - null pointer is no expression" << endl;
|
Info<< "pass - null pointer is no expression" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
Info<< "Caught FatalError " << err << nl << endl;
|
Info<< "Caught FatalError " << err << nl << endl;
|
||||||
}
|
}
|
||||||
@ -181,7 +181,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "no match" << endl;
|
Info<< "no match" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
Info<< "Caught FatalError " << err << nl << endl;
|
Info<< "Caught FatalError " << err << nl << endl;
|
||||||
}
|
}
|
||||||
@ -198,7 +198,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "no match" << endl;
|
Info<< "no match" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
Info<< "Caught FatalError " << err << nl << endl;
|
Info<< "Caught FatalError " << err << nl << endl;
|
||||||
}
|
}
|
||||||
@ -215,7 +215,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "no match" << endl;
|
Info<< "no match" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
Info<< "Caught FatalError " << err << nl << endl;
|
Info<< "Caught FatalError " << err << nl << endl;
|
||||||
}
|
}
|
||||||
@ -232,7 +232,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "pass - no match on empty expression" << endl;
|
Info<< "pass - no match on empty expression" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
Info<< "Caught FatalError " << err << nl << endl;
|
Info<< "Caught FatalError " << err << nl << endl;
|
||||||
}
|
}
|
||||||
@ -249,7 +249,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "pass - no match on empty expression" << endl;
|
Info<< "pass - no match on empty expression" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
Info<< "Caught FatalError " << err << nl << endl;
|
Info<< "Caught FatalError " << err << nl << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -141,6 +141,13 @@ public:
|
|||||||
typedef indexedVertex<Gt,Vb2> Other;
|
typedef indexedVertex<Gt,Vb2> Other;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
indexedVertex(const indexedVertex&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
inline indexedVertex();
|
inline indexedVertex();
|
||||||
|
|||||||
@ -539,7 +539,7 @@ bool doCommand
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Foam::IOerror& fIOErr)
|
catch (const Foam::IOerror& fIOErr)
|
||||||
{
|
{
|
||||||
ok = false;
|
ok = false;
|
||||||
|
|
||||||
@ -550,7 +550,7 @@ bool doCommand
|
|||||||
Pout<< topoSetSource::usage(sourceType).c_str();
|
Pout<< topoSetSource::usage(sourceType).c_str();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Foam::error& fErr)
|
catch (const Foam::error& fErr)
|
||||||
{
|
{
|
||||||
ok = false;
|
ok = false;
|
||||||
|
|
||||||
|
|||||||
@ -57,11 +57,23 @@ int main(int argc, char *argv[])
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
word utilityName = argv[1];
|
word utilityName(argv[1]);
|
||||||
Foam::autoPtr<Foam::helpType> utility
|
autoPtr<helpType> utility;
|
||||||
(
|
|
||||||
helpType::New(utilityName)
|
const bool throwing = FatalError.throwExceptions();
|
||||||
);
|
try
|
||||||
|
{
|
||||||
|
utility.reset(helpType::New(utilityName));
|
||||||
|
}
|
||||||
|
catch (const Foam::error& err)
|
||||||
|
{
|
||||||
|
utility.clear();
|
||||||
|
|
||||||
|
FatalError
|
||||||
|
<< err.message().c_str() << nl
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
FatalError.throwExceptions(throwing);
|
||||||
|
|
||||||
utility().init();
|
utility().init();
|
||||||
|
|
||||||
|
|||||||
@ -867,7 +867,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
aMeshPtr.reset(new faMesh(meshRef.baseMesh()));
|
aMeshPtr.reset(new faMesh(meshRef.baseMesh()));
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
aMeshPtr.clear();
|
aMeshPtr.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -318,6 +318,9 @@ Foam::vtkPVFoam::vtkPVFoam
|
|||||||
fullCasePath = cwd();
|
fullCasePath = cwd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OPENFOAM API
|
||||||
|
setEnv("FOAM_API", std::to_string(OPENFOAM), true);
|
||||||
|
|
||||||
// The name of the executable, unless already present in the environment
|
// The name of the executable, unless already present in the environment
|
||||||
setEnv("FOAM_EXECUTABLE", "paraview", false);
|
setEnv("FOAM_EXECUTABLE", "paraview", false);
|
||||||
|
|
||||||
|
|||||||
@ -288,12 +288,12 @@ void Foam::vtkPVFoam::convertVolFields
|
|||||||
// Convert
|
// Convert
|
||||||
convertVolField(patchInterpList, fld);
|
convertVolField(patchInterpList, fld);
|
||||||
}
|
}
|
||||||
catch (Foam::IOerror& ioErr)
|
catch (const Foam::IOerror& ioErr)
|
||||||
{
|
{
|
||||||
ioErr.write(Warning, false);
|
ioErr.write(Warning, false);
|
||||||
Info << nl << endl;
|
Info << nl << endl;
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
// Bit of trickery to get the original message
|
// Bit of trickery to get the original message
|
||||||
err.write(Warning, false);
|
err.write(Warning, false);
|
||||||
@ -370,12 +370,12 @@ void Foam::vtkPVFoam::convertDimFields
|
|||||||
|
|
||||||
convertVolField(patchInterpList, volFld);
|
convertVolField(patchInterpList, volFld);
|
||||||
}
|
}
|
||||||
catch (Foam::IOerror& ioErr)
|
catch (const Foam::IOerror& ioErr)
|
||||||
{
|
{
|
||||||
ioErr.write(Warning, false);
|
ioErr.write(Warning, false);
|
||||||
Info << nl << endl;
|
Info << nl << endl;
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
// Bit of trickery to get the original message
|
// Bit of trickery to get the original message
|
||||||
err.write(Warning, false);
|
err.write(Warning, false);
|
||||||
@ -498,12 +498,12 @@ void Foam::vtkPVFoam::convertAreaFields
|
|||||||
dataset->GetCellData()->AddArray(cdata);
|
dataset->GetCellData()->AddArray(cdata);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Foam::IOerror& ioErr)
|
catch (const Foam::IOerror& ioErr)
|
||||||
{
|
{
|
||||||
ioErr.write(Warning, false);
|
ioErr.write(Warning, false);
|
||||||
Info << nl << endl;
|
Info << nl << endl;
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
// Bit of trickery to get the original message
|
// Bit of trickery to get the original message
|
||||||
err.write(Warning, false);
|
err.write(Warning, false);
|
||||||
@ -642,12 +642,12 @@ void Foam::vtkPVFoam::convertPointFields
|
|||||||
dataset->GetPointData()->AddArray(pdata);
|
dataset->GetPointData()->AddArray(pdata);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Foam::IOerror& ioErr)
|
catch (const Foam::IOerror& ioErr)
|
||||||
{
|
{
|
||||||
ioErr.write(Warning, false);
|
ioErr.write(Warning, false);
|
||||||
Info << nl << endl;
|
Info << nl << endl;
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
// Bit of trickery to get the original message
|
// Bit of trickery to get the original message
|
||||||
err.write(Warning, false);
|
err.write(Warning, false);
|
||||||
@ -843,12 +843,12 @@ void Foam::vtkPVFoam::convertLagrangianFields
|
|||||||
vtkmesh->GetCellData()->AddArray(data);
|
vtkmesh->GetCellData()->AddArray(data);
|
||||||
vtkmesh->GetPointData()->AddArray(data);
|
vtkmesh->GetPointData()->AddArray(data);
|
||||||
}
|
}
|
||||||
catch (Foam::IOerror& ioErr)
|
catch (const Foam::IOerror& ioErr)
|
||||||
{
|
{
|
||||||
ioErr.write(Warning, false);
|
ioErr.write(Warning, false);
|
||||||
Info << nl << endl;
|
Info << nl << endl;
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
// Bit of trickery to get the original message
|
// Bit of trickery to get the original message
|
||||||
err.write(Warning, false);
|
err.write(Warning, false);
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -206,6 +206,9 @@ Foam::vtkPVblockMesh::vtkPVblockMesh
|
|||||||
fullCasePath = cwd();
|
fullCasePath = cwd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OPENFOAM API
|
||||||
|
setEnv("FOAM_API", std::to_string(OPENFOAM), true);
|
||||||
|
|
||||||
// The name of the executable, unless already present in the environment
|
// The name of the executable, unless already present in the environment
|
||||||
setEnv("FOAM_EXECUTABLE", "paraview", false);
|
setEnv("FOAM_EXECUTABLE", "paraview", false);
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
|
||||||
. $WM_PROJECT_DIR/wmake/scripts/have_fftw
|
. $WM_PROJECT_DIR/wmake/scripts/have_fftw
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
if have_fftw
|
if have_fftw
|
||||||
then
|
then
|
||||||
wmake
|
wmake $targetType
|
||||||
else
|
else
|
||||||
echo "==> skip noise utility (no FFTW)"
|
echo "==> skip noise utility (no FFTW)"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -219,9 +219,9 @@ int main(int argc, char *argv[])
|
|||||||
// Report to output (avoid overwriting values from simulation)
|
// Report to output (avoid overwriting values from simulation)
|
||||||
profiling::print(Info);
|
profiling::print(Info);
|
||||||
}
|
}
|
||||||
catch (Foam::IOerror& err)
|
catch (const Foam::IOerror& err)
|
||||||
{
|
{
|
||||||
Warning<< err << endl;
|
Warning << err << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
|
||||||
. $WM_PROJECT_DIR/wmake/scripts/have_fftw
|
. $WM_PROJECT_DIR/wmake/scripts/have_fftw
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
if have_fftw
|
if have_fftw
|
||||||
then
|
then
|
||||||
wmake
|
wmake $targetType
|
||||||
else
|
else
|
||||||
echo "==> skip boxTurb utility (no FFTW)"
|
echo "==> skip boxTurb utility (no FFTW)"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
|
||||||
. $WM_PROJECT_DIR/wmake/scripts/have_cgal
|
. $WM_PROJECT_DIR/wmake/scripts/have_cgal
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
@ -14,6 +15,6 @@ else
|
|||||||
export COMP_FLAGS="-DNO_CGAL"
|
export COMP_FLAGS="-DNO_CGAL"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
wmake
|
wmake $targetType
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -2,8 +2,11 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Copyright (C) 2015 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -25,6 +28,7 @@ Typedefs
|
|||||||
CGAL3DKernel
|
CGAL3DKernel
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
A typedef for selecting inexact (faster) or exact (slower) 3D model.
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -36,13 +40,13 @@ Description
|
|||||||
#ifdef CGAL_INEXACT
|
#ifdef CGAL_INEXACT
|
||||||
|
|
||||||
// Fast kernel using a double as the storage type
|
// Fast kernel using a double as the storage type
|
||||||
#include "CGAL/Exact_predicates_inexact_constructions_kernel.h"
|
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// Very robust but expensive kernel
|
// Very robust but expensive kernel
|
||||||
#include "CGAL/Exact_predicates_exact_constructions_kernel.h"
|
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
|
||||||
typedef CGAL::Exact_predicates_exact_constructions_kernel K;
|
typedef CGAL::Exact_predicates_exact_constructions_kernel K;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -2,8 +2,10 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Copyright (C) 2015 OpenFOAM Foundation
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -63,6 +65,7 @@ struct IndexedFace
|
|||||||
Foam::label index;
|
Foam::label index;
|
||||||
Foam::label region;
|
Foam::label region;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct My_items
|
struct My_items
|
||||||
:
|
:
|
||||||
public CGAL::Polyhedron_items_3
|
public CGAL::Polyhedron_items_3
|
||||||
|
|||||||
@ -20,4 +20,5 @@ EXE_INC = \
|
|||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
-L$(CGAL_ARCH_PATH)/lib \
|
-L$(CGAL_ARCH_PATH)/lib \
|
||||||
-L$(CGAL_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
|
-L$(CGAL_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
|
||||||
|
-lsurfMesh \
|
||||||
-lmeshTools
|
-lmeshTools
|
||||||
|
|||||||
@ -2,8 +2,11 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Copyright (C) 2015 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -25,14 +28,50 @@ License
|
|||||||
|
|
||||||
#include "PolyhedronReader.H"
|
#include "PolyhedronReader.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class HDS>
|
||||||
|
void Foam::PolyhedronReader::Build_triangle<HDS>::operator()(HDS& hds)
|
||||||
|
{
|
||||||
|
// Postcondition: hds is a valid polyhedral surface.
|
||||||
|
CGAL::Polyhedron_incremental_builder_3<HDS> B(hds, true);
|
||||||
|
|
||||||
|
B.begin_surface(s_.nPoints(), s_.size());
|
||||||
|
|
||||||
|
typedef typename HDS::Vertex Vertex;
|
||||||
|
typedef typename Vertex::Point Point;
|
||||||
|
|
||||||
|
for (const auto& pt : s_.points())
|
||||||
|
{
|
||||||
|
B.add_vertex(Point(pt.x(), pt.y(), pt.z()));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const auto& f : s_)
|
||||||
|
{
|
||||||
|
B.begin_facet();
|
||||||
|
|
||||||
|
for (const label verti : f)
|
||||||
|
{
|
||||||
|
B.add_vertex_to_facet(verti);
|
||||||
|
}
|
||||||
|
|
||||||
|
B.end_facet();
|
||||||
|
}
|
||||||
|
|
||||||
|
B.end_surface();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::PolyhedronReader::PolyhedronReader(const triSurface& s, Polyhedron& p)
|
Foam::PolyhedronReader::PolyhedronReader(const triSurface& s, Polyhedron& p)
|
||||||
{
|
{
|
||||||
Build_triangle<HalfedgeDS> triangle(s);
|
Build_triangle<HalfedgeDS> triangle(s);
|
||||||
p.delegate(triangle);
|
p.delegate(triangle);
|
||||||
|
|
||||||
// Populate index and region
|
// Populate index and region
|
||||||
Foam::label nTris = 0;
|
Foam::label nTris = 0;
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
Facet_iterator fi = p.facets_begin();
|
Facet_iterator fi = p.facets_begin();
|
||||||
@ -40,8 +79,10 @@ Foam::PolyhedronReader::PolyhedronReader(const triSurface& s, Polyhedron& p)
|
|||||||
++fi
|
++fi
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
fi->index = nTris++;
|
fi->index = nTris;
|
||||||
fi->region = s[fi->index].region();
|
fi->region = s[nTris].region();
|
||||||
|
|
||||||
|
++nTris;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,8 +2,10 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Copyright (C) 2015 OpenFOAM Foundation
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -59,28 +61,21 @@ class PolyhedronReader
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Build_triangle(const triSurface& s);
|
Build_triangle(const triSurface& s)
|
||||||
|
:
|
||||||
|
s_(s)
|
||||||
|
{}
|
||||||
|
|
||||||
void operator()(HDS& hds);
|
void operator()(HDS& hds);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- No copy construct
|
|
||||||
PolyhedronReader(const PolyhedronReader&) = delete;
|
|
||||||
|
|
||||||
//- No copy assignment
|
|
||||||
void operator=(const PolyhedronReader&) = delete;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Populate polyhedron from surface
|
//- Populate polyhedron from surface
|
||||||
PolyhedronReader(const triSurface& s, Polyhedron& p);
|
PolyhedronReader(const triSurface& s, Polyhedron& p);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -90,12 +85,6 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#ifdef NoRepository
|
|
||||||
# include "PolyhedronReaderTemplates.C"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -1,72 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2015 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 "PolyhedronReader.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class HDS>
|
|
||||||
Foam::PolyhedronReader::Build_triangle<HDS>::Build_triangle
|
|
||||||
(
|
|
||||||
const triSurface& s
|
|
||||||
)
|
|
||||||
:
|
|
||||||
s_(s)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class HDS>
|
|
||||||
void Foam::PolyhedronReader::Build_triangle<HDS>::operator()(HDS& hds)
|
|
||||||
{
|
|
||||||
// Postcondition: hds is a valid polyhedral surface.
|
|
||||||
CGAL::Polyhedron_incremental_builder_3<HDS> B(hds, true);
|
|
||||||
|
|
||||||
B.begin_surface(s_.nPoints(), s_.size());
|
|
||||||
|
|
||||||
typedef typename HDS::Vertex Vertex;
|
|
||||||
typedef typename Vertex::Point Point;
|
|
||||||
|
|
||||||
const Foam::pointField& pts = s_.points();
|
|
||||||
forAll(pts, i)
|
|
||||||
{
|
|
||||||
const Foam::point& pt = pts[i];
|
|
||||||
B.add_vertex(Point(pt.x(), pt.y(), pt.z()));
|
|
||||||
}
|
|
||||||
forAll(s_, i)
|
|
||||||
{
|
|
||||||
const Foam::labelledTri& t = s_[i];
|
|
||||||
B.begin_facet();
|
|
||||||
B.add_vertex_to_facet(t[0]);
|
|
||||||
B.add_vertex_to_facet(t[1]);
|
|
||||||
B.add_vertex_to_facet(t[2]);
|
|
||||||
B.end_facet();
|
|
||||||
}
|
|
||||||
B.end_surface();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -2,8 +2,11 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -99,8 +102,10 @@ typedef CGAL::AABB_face_graph_triangle_primitive
|
|||||||
typedef CGAL::AABB_traits<K, Primitive> Traits;
|
typedef CGAL::AABB_traits<K, Primitive> Traits;
|
||||||
typedef CGAL::AABB_tree<Traits> Tree;
|
typedef CGAL::AABB_tree<Traits> Tree;
|
||||||
|
|
||||||
typedef boost::optional<Tree::Intersection_and_primitive_id<Segment>::Type>
|
typedef boost::optional
|
||||||
Segment_intersection;
|
<
|
||||||
|
Tree::Intersection_and_primitive_id<Segment>::Type
|
||||||
|
> Segment_intersection;
|
||||||
|
|
||||||
#endif // NO_CGAL
|
#endif // NO_CGAL
|
||||||
|
|
||||||
@ -632,17 +637,14 @@ labelPair edgeIntersectionsCGAL
|
|||||||
segments.clear();
|
segments.clear();
|
||||||
tree.all_intersections(segment_query, std::back_inserter(segments));
|
tree.all_intersections(segment_query, std::back_inserter(segments));
|
||||||
|
|
||||||
for
|
|
||||||
(
|
for (const Segment_intersection& intersect : segments)
|
||||||
std::vector<Segment_intersection>::const_iterator iter =
|
|
||||||
segments.begin(),
|
|
||||||
end = segments.end();
|
|
||||||
iter != end;
|
|
||||||
++iter
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
// Get intersection object
|
// Get intersection object
|
||||||
if (const Point* ptPtr = boost::get<Point>(&((*iter)->first)))
|
if
|
||||||
|
(
|
||||||
|
const Point* ptPtr = boost::get<Point>(&(intersect->first))
|
||||||
|
)
|
||||||
{
|
{
|
||||||
point pt
|
point pt
|
||||||
(
|
(
|
||||||
@ -651,7 +653,12 @@ labelPair edgeIntersectionsCGAL
|
|||||||
CGAL::to_double(ptPtr->z())
|
CGAL::to_double(ptPtr->z())
|
||||||
);
|
);
|
||||||
|
|
||||||
Polyhedron::Face_handle f = (*iter)->second;
|
#if defined (CGAL_VERSION_NR) && (CGAL_VERSION_NR < 1041400000)
|
||||||
|
Polyhedron::Face_handle f = (intersect->second);
|
||||||
|
#else
|
||||||
|
// 4.14 and later
|
||||||
|
Polyhedron::Face_handle f = (intersect->second).first;
|
||||||
|
#endif
|
||||||
|
|
||||||
intersections[edgeI].append
|
intersections[edgeI].append
|
||||||
(
|
(
|
||||||
@ -664,18 +671,24 @@ labelPair edgeIntersectionsCGAL
|
|||||||
);
|
);
|
||||||
// Intersection on edge interior
|
// Intersection on edge interior
|
||||||
classifications[edgeI].append(-1);
|
classifications[edgeI].append(-1);
|
||||||
nPoints++;
|
++nPoints;
|
||||||
}
|
}
|
||||||
else if
|
else if
|
||||||
(
|
(
|
||||||
const Segment* sPtr = boost::get<Segment>(&((*iter)->first))
|
const Segment* sPtr = boost::get<Segment>(&(intersect->first))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
#if defined (CGAL_VERSION_NR) && (CGAL_VERSION_NR < 1041400000)
|
||||||
|
Polyhedron::Face_handle f = (intersect->second);
|
||||||
|
#else
|
||||||
|
// 4.14 and later
|
||||||
|
Polyhedron::Face_handle f = (intersect->second).first;
|
||||||
|
#endif
|
||||||
|
|
||||||
//std::cout
|
//std::cout
|
||||||
// << "intersection object is a segment:" << sPtr->source()
|
// << "intersection object is a segment:" << sPtr->source()
|
||||||
// << " " << sPtr->target() << std::endl;
|
// << " " << sPtr->target() << std::endl;
|
||||||
|
|
||||||
Polyhedron::Face_handle f = (*iter)->second;
|
|
||||||
//std::cout<< "triangle:" << f->index
|
//std::cout<< "triangle:" << f->index
|
||||||
// << " region:" << f->region << std::endl;
|
// << " region:" << f->region << std::endl;
|
||||||
|
|
||||||
@ -705,7 +718,7 @@ labelPair edgeIntersectionsCGAL
|
|||||||
);
|
);
|
||||||
// Intersection aligned with face. Tbd: enums
|
// Intersection aligned with face. Tbd: enums
|
||||||
classifications[edgeI].append(2);
|
classifications[edgeI].append(2);
|
||||||
nSegments++;
|
++nSegments;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1244,7 +1257,7 @@ autoPtr<extendedFeatureEdgeMesh> createEdgeMesh
|
|||||||
label nFeatEds = inter.cutEdges().size();
|
label nFeatEds = inter.cutEdges().size();
|
||||||
|
|
||||||
DynamicList<vector> normals(2*nFeatEds);
|
DynamicList<vector> normals(2*nFeatEds);
|
||||||
vectorField edgeDirections(nFeatEds, vector::zero);
|
vectorField edgeDirections(nFeatEds, Zero);
|
||||||
DynamicList<extendedFeatureEdgeMesh::sideVolumeType> normalVolumeTypes
|
DynamicList<extendedFeatureEdgeMesh::sideVolumeType> normalVolumeTypes
|
||||||
(
|
(
|
||||||
2*nFeatEds
|
2*nFeatEds
|
||||||
|
|||||||
@ -3,9 +3,11 @@
|
|||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2008-2011, 2017-2018 OpenCFD Ltd.
|
||||||
# \\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
|
# \\/ M anipulation |
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
# | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||||
# <http://www.gnu.org/licenses/>.
|
# <http://www.gnu.org/licenses/>.
|
||||||
@ -63,6 +65,8 @@ options:
|
|||||||
-config Add config directory prefix for shell type:
|
-config Add config directory prefix for shell type:
|
||||||
with -csh* for a config.csh/ prefix
|
with -csh* for a config.csh/ prefix
|
||||||
with -sh* for a config.sh/ prefix
|
with -sh* for a config.sh/ prefix
|
||||||
|
-show-api Print api value from wmake/rules, or meta-info and exit
|
||||||
|
-show-patch Print patch value from meta-info and exit
|
||||||
-quiet (-q) Suppress all normal output
|
-quiet (-q) Suppress all normal output
|
||||||
-silent (-s) Suppress stderr, except -csh-verbose, -sh-verbose output
|
-silent (-s) Suppress stderr, except -csh-verbose, -sh-verbose output
|
||||||
-help Print the usage
|
-help Print the usage
|
||||||
@ -184,6 +188,62 @@ setVersion()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# The API locations. See wmake/wmakeBuildInfo
|
||||||
|
rulesFile="$projectDir/wmake/rules/General/general"
|
||||||
|
metaInfoDir="$projectDir/META-INFO"
|
||||||
|
|
||||||
|
# Get api from rules/General/general
|
||||||
|
#
|
||||||
|
# Failure modes:
|
||||||
|
# - No api information (can't find file etc).
|
||||||
|
# -> Fatal for building, but could be OK for a stripped down version
|
||||||
|
#
|
||||||
|
# Fallback. Get from api-info
|
||||||
|
#
|
||||||
|
getApi()
|
||||||
|
{
|
||||||
|
local value
|
||||||
|
|
||||||
|
value="$(sed -ne '/^ *#/!{ /WM_VERSION.*OPENFOAM=/{ s@^.*OPENFOAM= *\([0-9][0-9]*\).*@\1@p; q }}' $rulesFile 2>/dev/null)"
|
||||||
|
if [ -z "$value" ] && [ -f "$metaInfoDir/api-info" ]
|
||||||
|
then
|
||||||
|
# Fallback. Get from api-info
|
||||||
|
value="$(sed -ne 's@^ *api *= *\([0-9][0-9]*\).*@\1@p' $metaInfoDir/api-info 2>/dev/null)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$value" ]
|
||||||
|
then
|
||||||
|
echo "$value"
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Get patch from meta-info / api-info
|
||||||
|
#
|
||||||
|
# Failure modes:
|
||||||
|
# - No patch information (can't find file etc).
|
||||||
|
#
|
||||||
|
getPatchLevel()
|
||||||
|
{
|
||||||
|
local value
|
||||||
|
|
||||||
|
# Fallback. Get from api-info
|
||||||
|
value="$(sed -ne 's@^ *patch *= *\([0-9][0-9]*\).*@\1@p' $metaInfoDir/api-info 2>/dev/null)"
|
||||||
|
|
||||||
|
if [ -n "$value" ]
|
||||||
|
then
|
||||||
|
echo "$value"
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
optMode=ugo # Default mode is always 'ugo'
|
optMode=ugo # Default mode is always 'ugo'
|
||||||
unset shellOutput verboseOutput
|
unset shellOutput verboseOutput
|
||||||
unset optAll optConfig optList optVersion
|
unset optAll optConfig optList optVersion
|
||||||
@ -195,6 +255,16 @@ do
|
|||||||
-h | -help*)
|
-h | -help*)
|
||||||
printHelp
|
printHelp
|
||||||
;;
|
;;
|
||||||
|
-show-api)
|
||||||
|
# Show API and exit
|
||||||
|
getApi
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
-show-patch)
|
||||||
|
# Show patch level and exit
|
||||||
|
getPatchLevel
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
-a | -all)
|
-a | -all)
|
||||||
optAll=true
|
optAll=true
|
||||||
unset shellOutput verboseOutput
|
unset shellOutput verboseOutput
|
||||||
|
|||||||
@ -241,7 +241,7 @@ getAllQueries()
|
|||||||
#-- Add ones from database, present in log file
|
#-- Add ones from database, present in log file
|
||||||
# Note: just like awk, line selected with regular expression,
|
# Note: just like awk, line selected with regular expression,
|
||||||
# column with string.
|
# column with string.
|
||||||
local dbQueries=$(getDbQueryList $db)
|
local dbQueries="$(getDbQueryList $db)"
|
||||||
|
|
||||||
for var in $dbQueries
|
for var in $dbQueries
|
||||||
do
|
do
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
# \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||||
@ -36,7 +36,8 @@ usage: ${0##*/}
|
|||||||
-boost-path DIR specify 'BOOST_ARCH_PATH'
|
-boost-path DIR specify 'BOOST_ARCH_PATH'
|
||||||
-cgal ver specify 'cgal_version'
|
-cgal ver specify 'cgal_version'
|
||||||
-cgal-path DIR specify 'CGAL_ARCH_PATH'
|
-cgal-path DIR specify 'CGAL_ARCH_PATH'
|
||||||
-clang VER specify 'clang_version' for ThirdParty Clang
|
-clang VER specify 'default_clang_version' for ThirdParty Clang
|
||||||
|
-gcc VER specify 'default_gcc_version' for ThirdParty Gcc
|
||||||
-cmake VER specify 'cmake_version'
|
-cmake VER specify 'cmake_version'
|
||||||
-fftw VER specify 'fffw_version'
|
-fftw VER specify 'fffw_version'
|
||||||
-fftw-path DIR specify 'FFTW_ARCH_PATH'
|
-fftw-path DIR specify 'FFTW_ARCH_PATH'
|
||||||
@ -325,9 +326,17 @@ do
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
-clang)
|
-clang)
|
||||||
# Replace clang_version=...
|
# Replace default_clang_version=...
|
||||||
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
||||||
replace etc/config.sh/compiler clang_version "$2"
|
replace etc/config.sh/compiler default_clang_version "$2"
|
||||||
|
adjusted=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
|
-gcc)
|
||||||
|
# Replace default_gcc_version=...
|
||||||
|
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
||||||
|
replace etc/config.sh/compiler default_gcc_version "$2"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -466,19 +475,19 @@ do
|
|||||||
|
|
||||||
gmp-[4-9]* | gmp-system)
|
gmp-[4-9]* | gmp-system)
|
||||||
# gcc-related package
|
# gcc-related package
|
||||||
replace etc/config.sh/compiler gmp_version "$1"
|
replace etc/config.sh/compiler default_gmp_version "$1"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
;;
|
;;
|
||||||
|
|
||||||
mpfr-[2-9]* | mpfr-system)
|
mpfr-[2-9]* | mpfr-system)
|
||||||
# gcc-related package
|
# gcc-related package
|
||||||
replace etc/config.sh/compiler mpfr_version "$1"
|
replace etc/config.sh/compiler default_mpfr_version "$1"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
;;
|
;;
|
||||||
|
|
||||||
mpc-[0-9]* | mpc-system)
|
mpc-[0-9]* | mpc-system)
|
||||||
# gcc-related package
|
# gcc-related package
|
||||||
replace etc/config.sh/compiler mpc_version "$1"
|
replace etc/config.sh/compiler default_mpc_version "$1"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@ -96,7 +96,7 @@ else
|
|||||||
|
|
||||||
fileName="$className$Type"
|
fileName="$className$Type"
|
||||||
|
|
||||||
echo "$Script: Creating new interface file $fileName"
|
echo "$Script: Creating new code file $fileName"
|
||||||
if [ -e "$fileName" ]
|
if [ -e "$fileName" ]
|
||||||
then
|
then
|
||||||
echo " Error: file exists"
|
echo " Error: file exists"
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
# \\ / A nd | www.openfoam.com
|
||||||
# \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
# \\/ M anipulation |
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Copyright (C) 2016 OpenFOAM Foundation
|
||||||
|
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
# <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
#
|
||||||
# File
|
# File
|
||||||
# etc/config.csh/compiler
|
# etc/config.csh/compiler
|
||||||
@ -20,77 +22,117 @@
|
|||||||
|
|
||||||
switch ("$WM_COMPILER_TYPE")
|
switch ("$WM_COMPILER_TYPE")
|
||||||
case ThirdParty:
|
case ThirdParty:
|
||||||
# Default versions of GMP, MPFR, MPC - override as necessary
|
# Default versions (CLANG, GCC, GMP, MPFR, MPC) - override as necessary
|
||||||
set gmp_version=gmp-system
|
|
||||||
set mpfr_version=mpfr-system
|
set default_clang_version=llvm-3.7.1
|
||||||
set mpc_version=mpc-system
|
set default_gcc_version=gcc-4.8.5
|
||||||
|
|
||||||
|
set default_gmp_version=gmp-system
|
||||||
|
set default_mpfr_version=mpfr-system
|
||||||
|
set default_mpc_version=mpc-system
|
||||||
|
|
||||||
switch ("$WM_COMPILER")
|
switch ("$WM_COMPILER")
|
||||||
case Gcc:
|
case Gcc:
|
||||||
case Gcc48:
|
set gcc_version="$default_gcc_version"
|
||||||
|
breaksw
|
||||||
|
case Gcc48*:
|
||||||
set gcc_version=gcc-4.8.5
|
set gcc_version=gcc-4.8.5
|
||||||
breaksw
|
breaksw
|
||||||
case Gcc49:
|
case Gcc49*:
|
||||||
set gcc_version=gcc-4.9.4
|
set gcc_version=gcc-4.9.4
|
||||||
breaksw
|
breaksw
|
||||||
case Gcc51:
|
case Gcc51*:
|
||||||
set gcc_version=gcc-5.1.0
|
set gcc_version=gcc-5.1.0
|
||||||
breaksw
|
breaksw
|
||||||
case Gcc52:
|
case Gcc52*:
|
||||||
set gcc_version=gcc-5.2.0
|
set gcc_version=gcc-5.2.0
|
||||||
breaksw
|
breaksw
|
||||||
case Gcc53:
|
case Gcc53*:
|
||||||
set gcc_version=gcc-5.3.0
|
set gcc_version=gcc-5.3.0
|
||||||
breaksw
|
breaksw
|
||||||
case Gcc54:
|
case Gcc54*:
|
||||||
set gcc_version=gcc-5.4.0
|
set gcc_version=gcc-5.4.0
|
||||||
breaksw
|
breaksw
|
||||||
case Gcc55:
|
case Gcc55*:
|
||||||
set gcc_version=gcc-5.5.0
|
set gcc_version=gcc-5.5.0
|
||||||
breaksw
|
breaksw
|
||||||
case Gcc61:
|
case Gcc61*:
|
||||||
set gcc_version=gcc-6.1.0
|
set gcc_version=gcc-6.1.0
|
||||||
breaksw
|
breaksw
|
||||||
case Gcc62:
|
case Gcc62*:
|
||||||
set gcc_version=gcc-6.2.0
|
set gcc_version=gcc-6.2.0
|
||||||
breaksw
|
breaksw
|
||||||
case Gcc63:
|
case Gcc63*:
|
||||||
set gcc_version=gcc-6.3.0
|
set gcc_version=gcc-6.3.0
|
||||||
breaksw
|
breaksw
|
||||||
case Gcc64:
|
case Gcc64*:
|
||||||
set gcc_version=gcc-6.4.0
|
set gcc_version=gcc-6.4.0
|
||||||
breaksw
|
breaksw
|
||||||
case Gcc71:
|
case Gcc65*:
|
||||||
|
set gcc_version=gcc-6.5.0
|
||||||
|
breaksw
|
||||||
|
case Gcc71*:
|
||||||
set gcc_version=gcc-7.1.0
|
set gcc_version=gcc-7.1.0
|
||||||
breaksw
|
breaksw
|
||||||
case Gcc72:
|
case Gcc72*:
|
||||||
set gcc_version=gcc-7.2.0
|
set gcc_version=gcc-7.2.0
|
||||||
breaksw
|
breaksw
|
||||||
case Gcc73:
|
case Gcc73*:
|
||||||
set gcc_version=gcc-7.3.0
|
set gcc_version=gcc-7.3.0
|
||||||
breaksw
|
breaksw
|
||||||
case Gcc81:
|
case Gcc74*:
|
||||||
|
set gcc_version=gcc-7.4.0
|
||||||
|
breaksw
|
||||||
|
case Gcc81*:
|
||||||
set gcc_version=gcc-8.1.0
|
set gcc_version=gcc-8.1.0
|
||||||
breaksw
|
breaksw
|
||||||
|
case Gcc82*:
|
||||||
|
set gcc_version=gcc-8.2.0
|
||||||
|
breaksw
|
||||||
|
case Gcc83*:
|
||||||
|
set gcc_version=gcc-8.3.0
|
||||||
|
breaksw
|
||||||
|
case Gcc91*:
|
||||||
|
set gcc_version=gcc-9.1.0
|
||||||
|
breaksw
|
||||||
|
case Gcc92*:
|
||||||
|
set gcc_version=gcc-9.2.0
|
||||||
|
breaksw
|
||||||
|
|
||||||
case Clang:
|
case Clang:
|
||||||
case Clang37:
|
set clang_version="$default_clang_version"
|
||||||
|
breaksw
|
||||||
|
case Clang37*:
|
||||||
set clang_version=llvm-3.7.1
|
set clang_version=llvm-3.7.1
|
||||||
breaksw
|
breaksw
|
||||||
case Clang38:
|
case Clang38*:
|
||||||
set clang_version=llvm-3.8.1
|
set clang_version=llvm-3.8.1
|
||||||
breaksw
|
breaksw
|
||||||
case Clang39:
|
case Clang39*:
|
||||||
set clang_version=llvm-3.9.1
|
set clang_version=llvm-3.9.1
|
||||||
breaksw
|
breaksw
|
||||||
case Clang40:
|
case Clang40*:
|
||||||
set clang_version=llvm-4.0.1
|
set clang_version=llvm-4.0.1
|
||||||
breaksw
|
breaksw
|
||||||
case Clang50:
|
case Clang50*:
|
||||||
set clang_version=llvm-5.0.1
|
set clang_version=llvm-5.0.2
|
||||||
breaksw
|
breaksw
|
||||||
case Clang60:
|
case Clang60*:
|
||||||
set clang_version=llvm-6.0.0
|
set clang_version=llvm-6.0.1
|
||||||
breaksw
|
breaksw
|
||||||
|
case Clang70*:
|
||||||
|
set clang_version=llvm-7.0.1
|
||||||
|
breaksw
|
||||||
|
case Clang71*:
|
||||||
|
set clang_version=llvm-7.1.0
|
||||||
|
breaksw
|
||||||
|
case Clang80*:
|
||||||
|
set clang_version=llvm-8.0.1
|
||||||
|
breaksw
|
||||||
|
case Clang90*:
|
||||||
|
set clang_version=llvm-9.0.0
|
||||||
|
breaksw
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/bin/cat << UNKNOWN_COMPILER
|
/bin/cat << UNKNOWN_COMPILER
|
||||||
===============================================================================
|
===============================================================================
|
||||||
@ -102,7 +144,13 @@ Please check your settings
|
|||||||
UNKNOWN_COMPILER
|
UNKNOWN_COMPILER
|
||||||
breaksw
|
breaksw
|
||||||
endsw
|
endsw
|
||||||
|
|
||||||
|
# Per-compiler overrides in "compiler-$WM_COMPILER" files
|
||||||
|
_foamEtc -config "compiler-$WM_COMPILER"
|
||||||
breaksw
|
breaksw
|
||||||
endsw
|
endsw
|
||||||
|
|
||||||
|
unset default_gcc_version default_clang_version
|
||||||
|
unset default_gmp_version default_mpfr_version default_mpc_version
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -6,15 +6,17 @@
|
|||||||
# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
# <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
#
|
||||||
# File
|
# File
|
||||||
# config.csh/example/compiler
|
# config.csh/example/compiler
|
||||||
# - sourced by OpenFOAM-*/etc/config.csh/settings
|
# - sourced by OpenFOAM-*/etc/config.csh/settings
|
||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Example of fine tuning ThirdParty compiler settings for OpenFOAM
|
# Older example of fine tuning compiler settings for OpenFOAM
|
||||||
|
#
|
||||||
|
# The preferred mechanism is now with a "compiler-$WM_COMPILER" file
|
||||||
|
# in one of the etc/ directories.
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -23,7 +25,7 @@ eval `$WM_PROJECT_DIR/bin/foamEtcFile -csh -config -mode=o compiler`
|
|||||||
|
|
||||||
# Modify/override compiler settings
|
# Modify/override compiler settings
|
||||||
switch ("$WM_COMPILER")
|
switch ("$WM_COMPILER")
|
||||||
case Gcc70:
|
case Gcc70*:
|
||||||
set gcc_version=gcc-7.0.0
|
set gcc_version=gcc-7.0.0
|
||||||
set gmp_version=gmp-6.1.2
|
set gmp_version=gmp-6.1.2
|
||||||
set mpfr_version=mpfr-3.1.5
|
set mpfr_version=mpfr-3.1.5
|
||||||
|
|||||||
28
etc/config.csh/example/compiler-Gcc92
Normal file
28
etc/config.csh/example/compiler-Gcc92
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#----------------------------------*-sh-*--------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
# \\ / O peration |
|
||||||
|
# \\ / A nd | www.openfoam.com
|
||||||
|
# \\/ M anipulation |
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Copyright (C) 2020 OpenCFD Ltd.
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# License
|
||||||
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
|
#
|
||||||
|
# File
|
||||||
|
# config.csh/example/compiler-Gcc92
|
||||||
|
# - sourced by OpenFOAM-*/etc/config.csh/compiler
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Example of fine tuning compiler settings with a hook
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Modify/override compiler settings
|
||||||
|
set gcc_version=gcc-9.2.0
|
||||||
|
set gmp_version=gmp-6.2.0
|
||||||
|
set mpfr_version=mpfr-4.0.2
|
||||||
|
set mpc_version=mpc-1.1.0
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
@ -3,7 +3,7 @@
|
|||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
# \\/ M anipulation | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||||
@ -71,6 +71,7 @@ unsetenv WM_THIRD_PARTY_DIR
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Unset FOAM_* environment variables
|
# Unset FOAM_* environment variables
|
||||||
|
|
||||||
|
unsetenv FOAM_API
|
||||||
unsetenv FOAM_APPBIN
|
unsetenv FOAM_APPBIN
|
||||||
unsetenv FOAM_APP
|
unsetenv FOAM_APP
|
||||||
unsetenv FOAM_CODE_TEMPLATES
|
unsetenv FOAM_CODE_TEMPLATES
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | www.openfoam.com
|
||||||
# \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
# \\/ M anipulation |
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
# <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
#
|
||||||
# File
|
# File
|
||||||
# etc/config.sh/compiler
|
# etc/config.sh/compiler
|
||||||
@ -20,75 +22,56 @@
|
|||||||
|
|
||||||
case "$WM_COMPILER_TYPE" in
|
case "$WM_COMPILER_TYPE" in
|
||||||
ThirdParty)
|
ThirdParty)
|
||||||
# Default versions of GMP, MPFR, MPC - override as necessary
|
# Default versions (CLANG, GCC, GMP, MPFR, MPC) - override as necessary
|
||||||
gmp_version=gmp-system
|
|
||||||
mpfr_version=mpfr-system
|
default_clang_version=llvm-3.7.1
|
||||||
mpc_version=mpc-system
|
default_gcc_version=gcc-4.8.5
|
||||||
|
|
||||||
|
default_gmp_version=gmp-system
|
||||||
|
default_mpfr_version=mpfr-system
|
||||||
|
default_mpc_version=mpc-system
|
||||||
|
|
||||||
|
gmp_version="$default_gmp_version"
|
||||||
|
mpfr_version="$default_mpfr_version"
|
||||||
|
mpc_version="$default_mpc_version"
|
||||||
|
|
||||||
case "$WM_COMPILER" in
|
case "$WM_COMPILER" in
|
||||||
Gcc | Gcc48)
|
Gcc) gcc_version="$default_gcc_version" ;;
|
||||||
gcc_version=gcc-4.8.5
|
Gcc48*) gcc_version=gcc-4.8.5 ;;
|
||||||
;;
|
Gcc49*) gcc_version=gcc-4.9.4 ;;
|
||||||
Gcc49)
|
Gcc51*) gcc_version=gcc-5.1.0 ;;
|
||||||
gcc_version=gcc-4.9.4
|
Gcc52*) gcc_version=gcc-5.2.0 ;;
|
||||||
;;
|
Gcc53*) gcc_version=gcc-5.3.0 ;;
|
||||||
Gcc51)
|
Gcc54*) gcc_version=gcc-5.4.0 ;;
|
||||||
gcc_version=gcc-5.1.0
|
Gcc55*) gcc_version=gcc-5.5.0 ;;
|
||||||
;;
|
Gcc61*) gcc_version=gcc-6.1.0 ;;
|
||||||
Gcc52)
|
Gcc62*) gcc_version=gcc-6.2.0 ;;
|
||||||
gcc_version=gcc-5.2.0
|
Gcc63*) gcc_version=gcc-6.3.0 ;;
|
||||||
;;
|
Gcc64*) gcc_version=gcc-6.4.0 ;;
|
||||||
Gcc53)
|
Gcc65*) gcc_version=gcc-6.5.0 ;;
|
||||||
gcc_version=gcc-5.3.0
|
Gcc71*) gcc_version=gcc-7.1.0 ;;
|
||||||
;;
|
Gcc72*) gcc_version=gcc-7.2.0 ;;
|
||||||
Gcc54)
|
Gcc73*) gcc_version=gcc-7.3.0 ;;
|
||||||
gcc_version=gcc-5.4.0
|
Gcc74*) gcc_version=gcc-7.4.0 ;;
|
||||||
;;
|
Gcc75*) gcc_version=gcc-7.5.0 ;;
|
||||||
Gcc55)
|
Gcc81*) gcc_version=gcc-8.1.0 ;;
|
||||||
gcc_version=gcc-5.5.0
|
Gcc82*) gcc_version=gcc-8.2.0 ;;
|
||||||
;;
|
Gcc83*) gcc_version=gcc-8.3.0 ;;
|
||||||
Gcc61)
|
Gcc91*) gcc_version=gcc-9.1.0 ;;
|
||||||
gcc_version=gcc-6.1.0
|
Gcc92*) gcc_version=gcc-9.2.0 ;;
|
||||||
;;
|
|
||||||
Gcc62)
|
Clang) clang_version="$default_clang_version" ;;
|
||||||
gcc_version=gcc-6.2.0
|
Clang37*) clang_version=llvm-3.7.1 ;;
|
||||||
;;
|
Clang38*) clang_version=llvm-3.8.1 ;;
|
||||||
Gcc63)
|
Clang39*) clang_version=llvm-3.9.1 ;;
|
||||||
gcc_version=gcc-6.3.0
|
Clang40*) clang_version=llvm-4.0.1 ;;
|
||||||
;;
|
Clang50*) clang_version=llvm-5.0.2 ;;
|
||||||
Gcc64)
|
Clang60*) clang_version=llvm-6.0.1 ;;
|
||||||
gcc_version=gcc-6.4.0
|
Clang70*) clang_version=llvm-7.0.1 ;;
|
||||||
;;
|
Clang71*) clang_version=llvm-7.1.0 ;;
|
||||||
Gcc71)
|
Clang80*) clang_version=llvm-8.0.1 ;;
|
||||||
gcc_version=gcc-7.1.0
|
Clang90*) clang_version=llvm-9.0.0 ;;
|
||||||
;;
|
|
||||||
Gcc72)
|
|
||||||
gcc_version=gcc-7.2.0
|
|
||||||
;;
|
|
||||||
Gcc73)
|
|
||||||
gcc_version=gcc-7.3.0
|
|
||||||
;;
|
|
||||||
Gcc81)
|
|
||||||
gcc_version=gcc-8.1.0
|
|
||||||
;;
|
|
||||||
Clang | Clang37)
|
|
||||||
clang_version=llvm-3.7.1
|
|
||||||
;;
|
|
||||||
Clang38)
|
|
||||||
clang_version=llvm-3.8.1
|
|
||||||
;;
|
|
||||||
Clang39)
|
|
||||||
clang_version=llvm-3.9.1
|
|
||||||
;;
|
|
||||||
Clang40)
|
|
||||||
clang_version=llvm-4.0.1
|
|
||||||
;;
|
|
||||||
Clang50)
|
|
||||||
clang_version=llvm-5.0.1
|
|
||||||
;;
|
|
||||||
Clang60)
|
|
||||||
clang_version=llvm-6.0.0
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
/bin/cat << UNKNOWN_COMPILER 1>&2
|
/bin/cat << UNKNOWN_COMPILER 1>&2
|
||||||
===============================================================================
|
===============================================================================
|
||||||
@ -100,7 +83,13 @@ Please check your settings
|
|||||||
UNKNOWN_COMPILER
|
UNKNOWN_COMPILER
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# Per-compiler overrides in "compiler-$WM_COMPILER" files
|
||||||
|
_foamEtc -config "compiler-$WM_COMPILER"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
unset default_gcc_version default_clang_version
|
||||||
|
unset default_gmp_version default_mpfr_version default_mpc_version
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -6,15 +6,17 @@
|
|||||||
# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
# <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
#
|
||||||
# File
|
# File
|
||||||
# config.sh/example/compiler
|
# config.sh/example/compiler
|
||||||
# - sourced by OpenFOAM-*/etc/config.sh/settings
|
# - sourced by OpenFOAM-*/etc/config.sh/settings
|
||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Example of fine tuning compiler versions and settings for OpenFOAM
|
# Older example of fine tuning compiler settings for OpenFOAM.
|
||||||
|
#
|
||||||
|
# The preferred mechanism is now with a "compiler-$WM_COMPILER" file
|
||||||
|
# in one of the etc/ directories.
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -23,18 +25,12 @@ eval $($WM_PROJECT_DIR/bin/foamEtcFile -sh -config -mode=o compiler)
|
|||||||
|
|
||||||
# Modify/override compiler settings
|
# Modify/override compiler settings
|
||||||
case "$WM_COMPILER" in
|
case "$WM_COMPILER" in
|
||||||
Gcc70)
|
Gcc70*)
|
||||||
gcc_version=gcc-7.0.0
|
gcc_version=gcc-7.0.0
|
||||||
gmp_version=gmp-6.1.2
|
gmp_version=gmp-6.1.2
|
||||||
mpfr_version=mpfr-3.1.5
|
mpfr_version=mpfr-3.1.5
|
||||||
mpc_version=mpc-1.0.3
|
mpc_version=mpc-1.0.3
|
||||||
;;
|
;;
|
||||||
Gcc48u)
|
|
||||||
# Example of using the system GCC 4.8 in Ubuntu 15.10. Keep in mind you
|
|
||||||
# will also need to create the respective directory in "wmake/rules"
|
|
||||||
export WM_CC='gcc-4.8'
|
|
||||||
export WM_CXX='g++-4.8'
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
28
etc/config.sh/example/compiler-Gcc92
Normal file
28
etc/config.sh/example/compiler-Gcc92
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#----------------------------------*-sh-*--------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
# \\ / O peration |
|
||||||
|
# \\ / A nd | www.openfoam.com
|
||||||
|
# \\/ M anipulation |
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Copyright (C) 2020 OpenCFD Ltd.
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# License
|
||||||
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
|
#
|
||||||
|
# File
|
||||||
|
# config.sh/example/compiler-Gcc92
|
||||||
|
# - sourced by OpenFOAM-*/etc/config.sh/compiler
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Example of fine tuning compiler settings with a hook
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Modify/override compiler settings
|
||||||
|
gcc_version=gcc-9.2.0
|
||||||
|
gmp_version=gmp-6.2.0
|
||||||
|
mpfr_version=mpfr-4.0.2
|
||||||
|
mpc_version=mpc-1.1.0
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
@ -3,7 +3,7 @@
|
|||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
# \\/ M anipulation | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||||
@ -62,6 +62,7 @@ unset WM_THIRD_PARTY_DIR
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Unset FOAM_* environment variables
|
# Unset FOAM_* environment variables
|
||||||
|
|
||||||
|
unset FOAM_API
|
||||||
unset FOAM_APPBIN
|
unset FOAM_APPBIN
|
||||||
unset FOAM_APP
|
unset FOAM_APP
|
||||||
unset FOAM_CODE_TEMPLATES
|
unset FOAM_CODE_TEMPLATES
|
||||||
|
|||||||
@ -1267,7 +1267,7 @@ bool Foam::ping
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fill sockaddr_in structure with dest address and port
|
// Fill sockaddr_in structure with dest address and port
|
||||||
memset(reinterpret_cast<char *>(&destAddr), '\0', sizeof(destAddr));
|
std::memset(reinterpret_cast<char *>(&destAddr), '\0', sizeof(destAddr));
|
||||||
destAddr.sin_family = AF_INET;
|
destAddr.sin_family = AF_INET;
|
||||||
destAddr.sin_port = htons(ushort(destPort));
|
destAddr.sin_port = htons(ushort(destPort));
|
||||||
destAddr.sin_addr.s_addr = addr;
|
destAddr.sin_addr.s_addr = addr;
|
||||||
|
|||||||
@ -155,7 +155,7 @@ public:
|
|||||||
// \code
|
// \code
|
||||||
// (numElem / elem_per_block)
|
// (numElem / elem_per_block)
|
||||||
// + (numElem % elem_per_block) ? 1 : 0
|
// + (numElem % elem_per_block) ? 1 : 0
|
||||||
// \code
|
// \endcode
|
||||||
// But avoiding the modulus operation
|
// But avoiding the modulus operation
|
||||||
static constexpr label num_blocks(label numElem)
|
static constexpr label num_blocks(label numElem)
|
||||||
{
|
{
|
||||||
@ -435,6 +435,12 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
reference(const reference&) = default;
|
||||||
|
|
||||||
|
//- Move construct
|
||||||
|
reference(reference&&) = default;
|
||||||
|
|
||||||
//- Value assignment
|
//- Value assignment
|
||||||
inline void operator=(const reference& other);
|
inline void operator=(const reference& other);
|
||||||
|
|
||||||
@ -471,7 +477,6 @@ public:
|
|||||||
Ostream& os,
|
Ostream& os,
|
||||||
const PackedList<Width>& list
|
const PackedList<Width>& list
|
||||||
);
|
);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -159,9 +159,6 @@ Foam::bitSet& Foam::bitSet::orEq(const bitSet& other, const bool strict)
|
|||||||
<< "Perform |= on dissimilar sized bitSets: "
|
<< "Perform |= on dissimilar sized bitSets: "
|
||||||
<< size() << " vs. " << other.size() << nl;
|
<< size() << " vs. " << other.size() << nl;
|
||||||
}
|
}
|
||||||
{
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
label minpos = -1; // Min trim point
|
label minpos = -1; // Min trim point
|
||||||
|
|
||||||
|
|||||||
@ -400,6 +400,12 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
reference(const reference&) = default;
|
||||||
|
|
||||||
|
//- Move construct
|
||||||
|
reference(reference&&) = default;
|
||||||
|
|
||||||
//- Flip the bit at the position, no range-checking
|
//- Flip the bit at the position, no range-checking
|
||||||
inline void flip();
|
inline void flip();
|
||||||
|
|
||||||
|
|||||||
@ -816,8 +816,11 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null (end iterator)
|
//- Default construct (end iterator)
|
||||||
inline const_iterator() = default;
|
const_iterator() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
const_iterator(const const_iterator&) = default;
|
||||||
|
|
||||||
//- Copy construct from similar access type
|
//- Copy construct from similar access type
|
||||||
inline explicit const_iterator(const Iterator<true>& iter)
|
inline explicit const_iterator(const Iterator<true>& iter)
|
||||||
|
|||||||
@ -230,6 +230,9 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
iterator(const iterator&) = default;
|
||||||
|
|
||||||
//- Construct for a node on a list
|
//- Construct for a node on a list
|
||||||
inline iterator(DLListBase* list, link* item);
|
inline iterator(DLListBase* list, link* item);
|
||||||
|
|
||||||
|
|||||||
@ -206,6 +206,9 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
iterator(const iterator&) = default;
|
||||||
|
|
||||||
//- Construct for a node on the list
|
//- Construct for a node on the list
|
||||||
inline iterator(SLListBase* list, link* item);
|
inline iterator(SLListBase* list, link* item);
|
||||||
|
|
||||||
|
|||||||
@ -135,21 +135,26 @@ Foam::List<T>::List(const UList<T>& a)
|
|||||||
:
|
:
|
||||||
UList<T>(nullptr, a.size_)
|
UList<T>(nullptr, a.size_)
|
||||||
{
|
{
|
||||||
if (this->size_)
|
const label len = this->size_;
|
||||||
|
|
||||||
|
if (len)
|
||||||
{
|
{
|
||||||
alloc();
|
alloc();
|
||||||
|
|
||||||
#ifdef USEMEMCPY
|
#ifdef USEMEMCPY
|
||||||
if (contiguous<T>())
|
if (contiguous<T>())
|
||||||
{
|
{
|
||||||
memcpy(this->v_, a.v_, this->byteSize());
|
std::memcpy
|
||||||
|
(
|
||||||
|
static_cast<void*>(this->v_), a.v_, this->byteSize()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
List_ACCESS(T, (*this), vp);
|
List_ACCESS(T, (*this), vp);
|
||||||
List_CONST_ACCESS(T, a, ap);
|
List_CONST_ACCESS(T, a, ap);
|
||||||
List_FOR_ALL((*this), i)
|
for (label i = 0; i < len; ++i)
|
||||||
{
|
{
|
||||||
vp[i] = ap[i];
|
vp[i] = ap[i];
|
||||||
}
|
}
|
||||||
@ -163,21 +168,26 @@ Foam::List<T>::List(const List<T>& a)
|
|||||||
:
|
:
|
||||||
UList<T>(nullptr, a.size_)
|
UList<T>(nullptr, a.size_)
|
||||||
{
|
{
|
||||||
if (this->size_)
|
const label len = this->size_;
|
||||||
|
|
||||||
|
if (len)
|
||||||
{
|
{
|
||||||
alloc();
|
alloc();
|
||||||
|
|
||||||
#ifdef USEMEMCPY
|
#ifdef USEMEMCPY
|
||||||
if (contiguous<T>())
|
if (contiguous<T>())
|
||||||
{
|
{
|
||||||
memcpy(this->v_, a.v_, this->byteSize());
|
std::memcpy
|
||||||
|
(
|
||||||
|
static_cast<void*>(this->v_), a.v_, this->byteSize()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
List_ACCESS(T, (*this), vp);
|
List_ACCESS(T, (*this), vp);
|
||||||
List_CONST_ACCESS(T, a, ap);
|
List_CONST_ACCESS(T, a, ap);
|
||||||
List_FOR_ALL((*this), i)
|
for (label i = 0; i < len; ++i)
|
||||||
{
|
{
|
||||||
vp[i] = ap[i];
|
vp[i] = ap[i];
|
||||||
}
|
}
|
||||||
@ -197,22 +207,29 @@ Foam::List<T>::List(List<T>& a, bool reuse)
|
|||||||
this->v_ = a.v_;
|
this->v_ = a.v_;
|
||||||
a.v_ = nullptr;
|
a.v_ = nullptr;
|
||||||
a.size_ = 0;
|
a.size_ = 0;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (this->size_)
|
|
||||||
|
const label len = this->size_;
|
||||||
|
|
||||||
|
if (len)
|
||||||
{
|
{
|
||||||
alloc();
|
alloc();
|
||||||
|
|
||||||
#ifdef USEMEMCPY
|
#ifdef USEMEMCPY
|
||||||
if (contiguous<T>())
|
if (contiguous<T>())
|
||||||
{
|
{
|
||||||
memcpy(this->v_, a.v_, this->byteSize());
|
std::memcpy
|
||||||
|
(
|
||||||
|
static_cast<void*>(this->v_), a.v_, this->byteSize()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
List_ACCESS(T, (*this), vp);
|
List_ACCESS(T, (*this), vp);
|
||||||
List_CONST_ACCESS(T, a, ap);
|
List_CONST_ACCESS(T, a, ap);
|
||||||
List_FOR_ALL((*this), i)
|
for (label i = 0; i < len; ++i)
|
||||||
{
|
{
|
||||||
vp[i] = ap[i];
|
vp[i] = ap[i];
|
||||||
}
|
}
|
||||||
@ -380,7 +397,7 @@ void Foam::List<T>::setSize(const label newSize)
|
|||||||
#ifdef USEMEMCPY
|
#ifdef USEMEMCPY
|
||||||
if (contiguous<T>())
|
if (contiguous<T>())
|
||||||
{
|
{
|
||||||
memcpy(nv, this->v_, overlap*sizeof(T));
|
std::memcpy(nv, this->v_, overlap*sizeof(T));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
@ -462,19 +479,24 @@ void Foam::List<T>::operator=(const UList<T>& a)
|
|||||||
{
|
{
|
||||||
reAlloc(a.size_);
|
reAlloc(a.size_);
|
||||||
|
|
||||||
if (this->size_)
|
const label len = this->size_;
|
||||||
|
|
||||||
|
if (len)
|
||||||
{
|
{
|
||||||
#ifdef USEMEMCPY
|
#ifdef USEMEMCPY
|
||||||
if (contiguous<T>())
|
if (contiguous<T>())
|
||||||
{
|
{
|
||||||
memcpy(this->v_, a.v_, this->byteSize());
|
std::memcpy
|
||||||
|
(
|
||||||
|
static_cast<void*>(this->v_), a.v_, this->byteSize()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
List_ACCESS(T, (*this), vp);
|
List_ACCESS(T, (*this), vp);
|
||||||
List_CONST_ACCESS(T, a, ap);
|
List_CONST_ACCESS(T, a, ap);
|
||||||
List_FOR_ALL((*this), i)
|
for (label i = 0; i < len; ++i)
|
||||||
{
|
{
|
||||||
vp[i] = ap[i];
|
vp[i] = ap[i];
|
||||||
}
|
}
|
||||||
@ -548,7 +570,7 @@ void Foam::List<T>::operator=(const BiIndirectList<T>& lst)
|
|||||||
{
|
{
|
||||||
List_ACCESS(T, (*this), vp);
|
List_ACCESS(T, (*this), vp);
|
||||||
|
|
||||||
for (label i=0; i<len; ++i)
|
for (label i=0; i < len; ++i)
|
||||||
{
|
{
|
||||||
vp[i] = lst[i];
|
vp[i] = lst[i];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,6 +64,12 @@ public:
|
|||||||
inline static const SubList<T>& null();
|
inline static const SubList<T>& null();
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
SubList(const SubList&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from UList and sub-list size
|
//- Construct from UList and sub-list size
|
||||||
|
|||||||
@ -114,6 +114,12 @@ public:
|
|||||||
//- Copy construct from the values list and the addressing array
|
//- Copy construct from the values list and the addressing array
|
||||||
inline UIndirectList(const UList<T>& values, const labelUList& addr);
|
inline UIndirectList(const UList<T>& values, const labelUList& addr);
|
||||||
|
|
||||||
|
//- Copy construct (shallow copy of values and addressing arrays)
|
||||||
|
UIndirectList(const UIndirectList<T>& list)
|
||||||
|
:
|
||||||
|
UIndirectList<T>(list.values_, list.addressing_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -138,7 +138,10 @@ void Foam::UList<T>::deepCopy(const UList<T>& list)
|
|||||||
#ifdef USEMEMCPY
|
#ifdef USEMEMCPY
|
||||||
if (contiguous<T>())
|
if (contiguous<T>())
|
||||||
{
|
{
|
||||||
memcpy(this->v_, list.v_, this->byteSize());
|
std::memcpy
|
||||||
|
(
|
||||||
|
static_cast<void*>(this->v_), list.v_, this->byteSize()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -214,6 +214,12 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
UList(const UList<T>&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Null constructor
|
//- Null constructor
|
||||||
|
|||||||
@ -339,12 +339,6 @@ Foam::IOobject::IOobject
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::IOobject::~IOobject()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const Foam::objectRegistry& Foam::IOobject::db() const
|
const Foam::objectRegistry& Foam::IOobject::db() const
|
||||||
|
|||||||
@ -220,6 +220,15 @@ public:
|
|||||||
static inline word groupName(StringType name, const word& group);
|
static inline word groupName(StringType name, const word& group);
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
IOobject(const IOobject&) = default;
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~IOobject() = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from name, instance, registry, io options
|
//- Construct from name, instance, registry, io options
|
||||||
@ -289,10 +298,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~IOobject();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// General access
|
// General access
|
||||||
|
|||||||
@ -189,10 +189,9 @@ Foam::IOobjectList::IOobjectList
|
|||||||
// Use object with local scope and current instance (no searching)
|
// Use object with local scope and current instance (no searching)
|
||||||
ok = objectPtr->typeHeaderOk<IOList<label>>(false, false);
|
ok = objectPtr->typeHeaderOk<IOList<label>>(false, false);
|
||||||
}
|
}
|
||||||
catch (Foam::IOerror& err)
|
catch (const Foam::IOerror& err)
|
||||||
{
|
{
|
||||||
Warning
|
Warning << err << nl << endl;
|
||||||
<< err << nl << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FatalIOError.throwExceptions(throwingIOerr);
|
FatalIOError.throwExceptions(throwingIOerr);
|
||||||
|
|||||||
@ -75,12 +75,6 @@ Foam::baseIOdictionary::baseIOdictionary
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::baseIOdictionary::~baseIOdictionary()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Members Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Members Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const Foam::word& Foam::baseIOdictionary::name() const
|
const Foam::word& Foam::baseIOdictionary::name() const
|
||||||
|
|||||||
@ -66,6 +66,18 @@ public:
|
|||||||
TypeName("dictionary");
|
TypeName("dictionary");
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
baseIOdictionary(const baseIOdictionary&) = default;
|
||||||
|
|
||||||
|
//- Move construct
|
||||||
|
baseIOdictionary(baseIOdictionary&&) = default;
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~baseIOdictionary() = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct given an IOobject
|
//- Construct given an IOobject
|
||||||
@ -78,11 +90,7 @@ public:
|
|||||||
baseIOdictionary(const IOobject&, Istream&);
|
baseIOdictionary(const IOobject&, Istream&);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
// Member Functions
|
||||||
virtual ~baseIOdictionary();
|
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
|
||||||
|
|
||||||
//- Return complete path + object name if the file exists
|
//- Return complete path + object name if the file exists
|
||||||
// either in the case/processor or case otherwise null
|
// either in the case/processor or case otherwise null
|
||||||
|
|||||||
@ -170,7 +170,7 @@ void Foam::IFstream::rewind()
|
|||||||
{
|
{
|
||||||
gzPtr = dynamic_cast<igzstream*>(allocatedPtr_);
|
gzPtr = dynamic_cast<igzstream*>(allocatedPtr_);
|
||||||
}
|
}
|
||||||
catch (std::bad_cast&)
|
catch (const std::bad_cast&)
|
||||||
{
|
{
|
||||||
gzPtr = nullptr;
|
gzPtr = nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -137,6 +137,15 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
IOstream(const IOstream&) = default;
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~IOstream() = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct with specified stream option
|
//- Construct with specified stream option
|
||||||
@ -162,10 +171,6 @@ public:
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~IOstream() = default;
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|||||||
@ -70,6 +70,15 @@ class Istream
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
Istream(const Istream&) = default;
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~Istream() = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct and set stream status
|
//- Construct and set stream status
|
||||||
@ -85,11 +94,7 @@ public:
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
// Member Functions
|
||||||
virtual ~Istream() = default;
|
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
|
||||||
|
|
||||||
// Read functions
|
// Read functions
|
||||||
|
|
||||||
|
|||||||
@ -72,6 +72,15 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
Ostream(const Ostream&) = default;
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~Ostream() = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct and set stream status
|
//- Construct and set stream status
|
||||||
@ -87,11 +96,7 @@ public:
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
// Member Functions
|
||||||
virtual ~Ostream() = default;
|
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
|
||||||
|
|
||||||
// Write functions
|
// Write functions
|
||||||
|
|
||||||
|
|||||||
@ -59,14 +59,17 @@ class OSstream
|
|||||||
std::ostream& os_;
|
std::ostream& os_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
public:
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
OSstream(const OSstream&) = default;
|
||||||
|
|
||||||
//- No copy assignment
|
//- No copy assignment
|
||||||
void operator=(const OSstream&) = delete;
|
void operator=(const OSstream&) = delete;
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct as wrapper around std::ostream and set stream status
|
//- Construct as wrapper around std::ostream and set stream status
|
||||||
|
|||||||
@ -301,4 +301,32 @@ void Foam::ITstream::rewind()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::ITstream::operator=(const ITstream& is)
|
||||||
|
{
|
||||||
|
Istream::operator=(is);
|
||||||
|
tokenList::operator=(is);
|
||||||
|
name_ = is.name_;
|
||||||
|
|
||||||
|
rewind();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::ITstream::operator=(const tokenList& toks)
|
||||||
|
{
|
||||||
|
tokenList::operator=(toks);
|
||||||
|
|
||||||
|
rewind();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::ITstream::operator=(tokenList&& toks)
|
||||||
|
{
|
||||||
|
tokenList::operator=(std::move(toks));
|
||||||
|
|
||||||
|
rewind();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -270,10 +270,22 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Print
|
// Output
|
||||||
|
|
||||||
//- Print description of stream to Ostream
|
//- Print stream description to Ostream
|
||||||
void print(Ostream& os) const;
|
void print(Ostream& os) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Member Operators
|
||||||
|
|
||||||
|
//- Copy assignment, with rewind()
|
||||||
|
void operator=(const ITstream& is);
|
||||||
|
|
||||||
|
//- Copy assignment of tokens, with rewind()
|
||||||
|
void operator=(const tokenList& toks);
|
||||||
|
|
||||||
|
//- Move assignment of tokens, with rewind()
|
||||||
|
void operator=(tokenList&& toks);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -168,7 +168,7 @@ Foam::label Foam::primitiveEntry::startLineNumber() const
|
|||||||
|
|
||||||
if (tokens.size())
|
if (tokens.size())
|
||||||
{
|
{
|
||||||
tokens.first().lineNumber();
|
return tokens.first().lineNumber();
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@ -52,7 +52,7 @@ Foam::IOerror::IOerror(const dictionary& errDict)
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::IOerror::~IOerror() throw()
|
Foam::IOerror::~IOerror() noexcept
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -125,7 +125,7 @@ Foam::error::error(const error& err)
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::error::~error() throw()
|
Foam::error::~error() noexcept
|
||||||
{
|
{
|
||||||
delete messageStreamPtr_;
|
delete messageStreamPtr_;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -97,7 +97,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~error() throw();
|
virtual ~error() noexcept;
|
||||||
|
|
||||||
|
|
||||||
// Static Member Functions
|
// Static Member Functions
|
||||||
@ -248,7 +248,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~IOerror() throw();
|
virtual ~IOerror() noexcept;
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|||||||
@ -32,7 +32,7 @@ Description
|
|||||||
field and derived quantities. Alternatively, the same actions can be
|
field and derived quantities. Alternatively, the same actions can be
|
||||||
executed after the simulation using the \c -postProcess command-line option.
|
executed after the simulation using the \c -postProcess command-line option.
|
||||||
|
|
||||||
\subsection secFunctionObjects Using function objects
|
\section secFunctionObjects Using function objects
|
||||||
|
|
||||||
FunctionObjects are selected by additional entries in the
|
FunctionObjects are selected by additional entries in the
|
||||||
$FOAM_CASE/system/controlDict dictionary. Each object is listed in the \c
|
$FOAM_CASE/system/controlDict dictionary. Each object is listed in the \c
|
||||||
|
|||||||
@ -820,12 +820,12 @@ bool Foam::functionObjectList::read()
|
|||||||
foPtr = functionObject::New(key, time_, dict);
|
foPtr = functionObject::New(key, time_, dict);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Foam::IOerror& ioErr)
|
catch (const Foam::IOerror& ioErr)
|
||||||
{
|
{
|
||||||
Info<< ioErr << nl << endl;
|
Info<< ioErr << nl << endl;
|
||||||
::exit(1);
|
::exit(1);
|
||||||
}
|
}
|
||||||
catch (Foam::error& err)
|
catch (const Foam::error& err)
|
||||||
{
|
{
|
||||||
// Bit of trickery to get the original message
|
// Bit of trickery to get the original message
|
||||||
err.write(Warning, false);
|
err.write(Warning, false);
|
||||||
|
|||||||
@ -149,7 +149,7 @@ if (argList::postProcess(argc, argv))
|
|||||||
// Report to output (avoid overwriting values from simulation)
|
// Report to output (avoid overwriting values from simulation)
|
||||||
profiling::print(Info);
|
profiling::print(Info);
|
||||||
}
|
}
|
||||||
catch (IOerror& err)
|
catch (const IOerror& err)
|
||||||
{
|
{
|
||||||
Warning<< err << endl;
|
Warning<< err << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -88,7 +88,7 @@ inline To& dynamicCast(From& r)
|
|||||||
{
|
{
|
||||||
return dynamic_cast<To&>(r);
|
return dynamic_cast<To&>(r);
|
||||||
}
|
}
|
||||||
catch (std::bad_cast&)
|
catch (const std::bad_cast&)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Attempt to cast type " << typeid(r).name()
|
<< "Attempt to cast type " << typeid(r).name()
|
||||||
@ -109,7 +109,7 @@ inline To& refCast(From& r)
|
|||||||
{
|
{
|
||||||
return dynamic_cast<To&>(r);
|
return dynamic_cast<To&>(r);
|
||||||
}
|
}
|
||||||
catch (std::bad_cast&)
|
catch (const std::bad_cast&)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Attempt to cast type " << r.type()
|
<< "Attempt to cast type " << r.type()
|
||||||
|
|||||||
@ -63,6 +63,12 @@ public:
|
|||||||
TypeName("value");
|
TypeName("value");
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
valuePointPatchField(const valuePointPatchField&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
//- Construct from patch and internal field
|
||||||
|
|||||||
@ -660,6 +660,9 @@ void Foam::argList::getRootCase()
|
|||||||
// The name of the executable, unless already present in the environment
|
// The name of the executable, unless already present in the environment
|
||||||
setEnv("FOAM_EXECUTABLE", executable_, false);
|
setEnv("FOAM_EXECUTABLE", executable_, false);
|
||||||
|
|
||||||
|
// OPENFOAM API
|
||||||
|
setEnv("FOAM_API", std::to_string(OPENFOAM), true);
|
||||||
|
|
||||||
// Set the case and case-name as an environment variable
|
// Set the case and case-name as an environment variable
|
||||||
if (rootPath_.isAbsolute())
|
if (rootPath_.isAbsolute())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -57,6 +57,8 @@ Description
|
|||||||
may be present for some solvers or utilities.
|
may be present for some solvers or utilities.
|
||||||
|
|
||||||
Environment variables set by argList or by Time:
|
Environment variables set by argList or by Time:
|
||||||
|
- \par FOAM_API
|
||||||
|
The value of the OPENFOAM compiler define
|
||||||
- \par FOAM_CASE
|
- \par FOAM_CASE
|
||||||
The path of the global case.
|
The path of the global case.
|
||||||
It is the same for serial and parallel jobs.
|
It is the same for serial and parallel jobs.
|
||||||
|
|||||||
@ -29,9 +29,9 @@ Description
|
|||||||
|
|
||||||
In parallel it will assume ranks are sorted according to hostname
|
In parallel it will assume ranks are sorted according to hostname
|
||||||
and the lowest rank per hostname will be the IO rank. The output directories
|
and the lowest rank per hostname will be the IO rank. The output directories
|
||||||
will get a unique name processors<N>_<low>-<high> where N is the overall
|
will get a unique name processors\<N\>_\<low\>-\<high\> where N is the
|
||||||
number of processors and low and high is the range of ranks contained
|
overall number of processors and low and high is the range of ranks
|
||||||
in the files. Each of these subsets uses its own communicator.
|
contained in the files. Each of these subsets uses its own communicator.
|
||||||
|
|
||||||
Instead of using the hostnames the IO ranks can be assigned using the
|
Instead of using the hostnames the IO ranks can be assigned using the
|
||||||
FOAM_IORANKS environment variable (also when running non-parallel), e.g.
|
FOAM_IORANKS environment variable (also when running non-parallel), e.g.
|
||||||
|
|||||||
@ -28,8 +28,9 @@ Description
|
|||||||
fileOperations that performs all file operations on the master processor.
|
fileOperations that performs all file operations on the master processor.
|
||||||
Requires the calls to be parallel synchronised!
|
Requires the calls to be parallel synchronised!
|
||||||
|
|
||||||
Limitations: - no /processor in filename
|
Limitations
|
||||||
- no /uniform/ in the filename
|
- no /processor in filename
|
||||||
|
- no /uniform/ in the filename
|
||||||
|
|
||||||
The main logic is in ::filePath which returns a
|
The main logic is in ::filePath which returns a
|
||||||
- same path on all processors. This can either be a global file
|
- same path on all processors. This can either be a global file
|
||||||
@ -40,12 +41,12 @@ Description
|
|||||||
- different path on all processors (processor0/0/p)
|
- different path on all processors (processor0/0/p)
|
||||||
|
|
||||||
system/controlDict:
|
system/controlDict:
|
||||||
filePath worldmaster: <globalRoot>/system/controlDict
|
filePath worldmaster: \<globalRoot\>/system/controlDict
|
||||||
localmaster: ,,
|
localmaster: ,,
|
||||||
slave : ,,
|
slave : ,,
|
||||||
|
|
||||||
processor0/uniform/time
|
processor0/uniform/time
|
||||||
filePath worldmaster: <globalRoot>/processorXXX/uniform/time
|
filePath worldmaster: \<globalRoot\>/processorXXX/uniform/time
|
||||||
localmaster: ,,
|
localmaster: ,,
|
||||||
slave : ,,
|
slave : ,,
|
||||||
|
|
||||||
|
|||||||
@ -2,8 +2,11 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -53,7 +56,7 @@ void Foam::interpolation2DTable<Type>::readTable()
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::interpolation2DTable<Type>::interpolation2DTable()
|
Foam::interpolation2DTable<Type>::interpolation2DTable()
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, List<Tuple2<scalar, Type>>>>(),
|
List<value_type>(),
|
||||||
bounding_(bounds::normalBounding::WARN),
|
bounding_(bounds::normalBounding::WARN),
|
||||||
fileName_("fileNameIsUndefined"),
|
fileName_("fileNameIsUndefined"),
|
||||||
reader_(nullptr)
|
reader_(nullptr)
|
||||||
@ -68,7 +71,7 @@ Foam::interpolation2DTable<Type>::interpolation2DTable
|
|||||||
const fileName& fName
|
const fileName& fName
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, List<Tuple2<scalar, Type>>>>(values),
|
List<value_type>(values),
|
||||||
bounding_(bounding),
|
bounding_(bounding),
|
||||||
fileName_(fName),
|
fileName_(fName),
|
||||||
reader_(nullptr)
|
reader_(nullptr)
|
||||||
@ -78,7 +81,7 @@ Foam::interpolation2DTable<Type>::interpolation2DTable
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::interpolation2DTable<Type>::interpolation2DTable(const fileName& fName)
|
Foam::interpolation2DTable<Type>::interpolation2DTable(const fileName& fName)
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, List<Tuple2<scalar, Type>>>>(),
|
List<value_type>(),
|
||||||
bounding_(bounds::normalBounding::WARN),
|
bounding_(bounds::normalBounding::WARN),
|
||||||
fileName_(fName),
|
fileName_(fName),
|
||||||
reader_(new openFoamTableReader<Type>(dictionary()))
|
reader_(new openFoamTableReader<Type>(dictionary()))
|
||||||
@ -90,7 +93,7 @@ Foam::interpolation2DTable<Type>::interpolation2DTable(const fileName& fName)
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::interpolation2DTable<Type>::interpolation2DTable(const dictionary& dict)
|
Foam::interpolation2DTable<Type>::interpolation2DTable(const dictionary& dict)
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, List<Tuple2<scalar, Type>>>>(),
|
List<value_type>(),
|
||||||
bounding_
|
bounding_
|
||||||
(
|
(
|
||||||
bounds::normalBoundingNames.lookupOrFailsafe
|
bounds::normalBoundingNames.lookupOrFailsafe
|
||||||
@ -110,13 +113,13 @@ Foam::interpolation2DTable<Type>::interpolation2DTable(const dictionary& dict)
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::interpolation2DTable<Type>::interpolation2DTable
|
Foam::interpolation2DTable<Type>::interpolation2DTable
|
||||||
(
|
(
|
||||||
const interpolation2DTable& interpTable
|
const interpolation2DTable& tbl
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, List<Tuple2<scalar, Type>>>>(interpTable),
|
List<value_type>(tbl),
|
||||||
bounding_(interpTable.bounding_),
|
bounding_(tbl.bounding_),
|
||||||
fileName_(interpTable.fileName_),
|
fileName_(tbl.fileName_),
|
||||||
reader_(interpTable.reader_) // note: steals reader. Used in write().
|
reader_(tbl.reader_.clone())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -308,6 +311,24 @@ Foam::label Foam::interpolation2DTable<Type>::Xi
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::interpolation2DTable<Type>::operator=
|
||||||
|
(
|
||||||
|
const interpolation2DTable<Type>& rhs
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (this == &rhs)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
static_cast<List<value_type>&>(*this) = rhs;
|
||||||
|
bounding_ = rhs.bounding_;
|
||||||
|
fileName_ = rhs.fileName_;
|
||||||
|
reader_.reset(rhs.reader_.clone());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Type Foam::interpolation2DTable<Type>::operator()
|
Type Foam::interpolation2DTable<Type>::operator()
|
||||||
(
|
(
|
||||||
|
|||||||
@ -2,8 +2,11 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -55,17 +58,7 @@ class interpolation2DTable
|
|||||||
:
|
:
|
||||||
public List<Tuple2<scalar, List<Tuple2<scalar, Type>>>>
|
public List<Tuple2<scalar, List<Tuple2<scalar, Type>>>>
|
||||||
{
|
{
|
||||||
public:
|
// Private Data
|
||||||
|
|
||||||
// Public data types
|
|
||||||
|
|
||||||
//- Convenience typedef
|
|
||||||
typedef List<Tuple2<scalar, List<Tuple2<scalar, Type>>>> table;
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Handling for out-of-bound values
|
//- Handling for out-of-bound values
|
||||||
bounds::normalBounding bounding_;
|
bounds::normalBounding bounding_;
|
||||||
@ -101,6 +94,15 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Public Data Types
|
||||||
|
|
||||||
|
//- The element data type
|
||||||
|
typedef Tuple2<scalar, List<Tuple2<scalar, Type>>> value_type;
|
||||||
|
|
||||||
|
//- Convenience typedef
|
||||||
|
typedef List<Tuple2<scalar, List<Tuple2<scalar, Type>>>> table;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Construct null
|
||||||
@ -120,8 +122,8 @@ public:
|
|||||||
//- Construct by reading file name and outOfBounds from dictionary
|
//- Construct by reading file name and outOfBounds from dictionary
|
||||||
interpolation2DTable(const dictionary& dict);
|
interpolation2DTable(const dictionary& dict);
|
||||||
|
|
||||||
//- Construct copy
|
//- Copy construct
|
||||||
interpolation2DTable(const interpolation2DTable& interpTable);
|
interpolation2DTable(const interpolation2DTable& tbl);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
@ -139,6 +141,9 @@ public:
|
|||||||
//- Return an element of constant List<Tuple2<scalar, Type>>
|
//- Return an element of constant List<Tuple2<scalar, Type>>
|
||||||
const List<Tuple2<scalar, Type>>& operator[](const label) const;
|
const List<Tuple2<scalar, Type>>& operator[](const label) const;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
void operator=(const interpolation2DTable<Type>& rhs);
|
||||||
|
|
||||||
//- Return an interpolated value
|
//- Return an interpolated value
|
||||||
Type operator()(const scalar valueX, const scalar valueY) const;
|
Type operator()(const scalar valueX, const scalar valueY) const;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -2,8 +2,11 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -57,7 +60,7 @@ void Foam::interpolationTable<Type>::readTable()
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::interpolationTable<Type>::interpolationTable()
|
Foam::interpolationTable<Type>::interpolationTable()
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, Type>>(),
|
List<value_type>(),
|
||||||
bounding_(bounds::repeatableBounding::WARN),
|
bounding_(bounds::repeatableBounding::WARN),
|
||||||
fileName_("fileNameIsUndefined"),
|
fileName_("fileNameIsUndefined"),
|
||||||
reader_(nullptr)
|
reader_(nullptr)
|
||||||
@ -72,7 +75,7 @@ Foam::interpolationTable<Type>::interpolationTable
|
|||||||
const fileName& fName
|
const fileName& fName
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, Type>>(values),
|
List<value_type>(values),
|
||||||
bounding_(bounding),
|
bounding_(bounding),
|
||||||
fileName_(fName),
|
fileName_(fName),
|
||||||
reader_(nullptr)
|
reader_(nullptr)
|
||||||
@ -82,7 +85,7 @@ Foam::interpolationTable<Type>::interpolationTable
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::interpolationTable<Type>::interpolationTable(const fileName& fName)
|
Foam::interpolationTable<Type>::interpolationTable(const fileName& fName)
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, Type>>(),
|
List<value_type>(),
|
||||||
bounding_(bounds::repeatableBounding::WARN),
|
bounding_(bounds::repeatableBounding::WARN),
|
||||||
fileName_(fName),
|
fileName_(fName),
|
||||||
reader_(new openFoamTableReader<Type>(dictionary()))
|
reader_(new openFoamTableReader<Type>(dictionary()))
|
||||||
@ -94,7 +97,7 @@ Foam::interpolationTable<Type>::interpolationTable(const fileName& fName)
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::interpolationTable<Type>::interpolationTable(const dictionary& dict)
|
Foam::interpolationTable<Type>::interpolationTable(const dictionary& dict)
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, Type>>(),
|
List<value_type>(),
|
||||||
bounding_
|
bounding_
|
||||||
(
|
(
|
||||||
bounds::repeatableBoundingNames.lookupOrFailsafe
|
bounds::repeatableBoundingNames.lookupOrFailsafe
|
||||||
@ -114,17 +117,16 @@ Foam::interpolationTable<Type>::interpolationTable(const dictionary& dict)
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::interpolationTable<Type>::interpolationTable
|
Foam::interpolationTable<Type>::interpolationTable
|
||||||
(
|
(
|
||||||
const interpolationTable& interpTable
|
const interpolationTable& tbl
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, Type>>(interpTable),
|
List<value_type>(tbl),
|
||||||
bounding_(interpTable.bounding_),
|
bounding_(tbl.bounding_),
|
||||||
fileName_(interpTable.fileName_),
|
fileName_(tbl.fileName_),
|
||||||
reader_(interpTable.reader_) // note: steals reader. Used in write().
|
reader_(tbl.reader_.clone())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
@ -315,6 +317,24 @@ Type Foam::interpolationTable<Type>::rateOfChange(const scalar value) const
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::interpolationTable<Type>::operator=
|
||||||
|
(
|
||||||
|
const interpolationTable<Type>& rhs
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (this == &rhs)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
static_cast<List<value_type>&>(*this) = rhs;
|
||||||
|
bounding_ = rhs.bounding_;
|
||||||
|
fileName_ = rhs.fileName_;
|
||||||
|
reader_.reset(rhs.reader_.clone());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
const Foam::Tuple2<Foam::scalar, Type>&
|
const Foam::Tuple2<Foam::scalar, Type>&
|
||||||
Foam::interpolationTable<Type>::operator[](const label i) const
|
Foam::interpolationTable<Type>::operator[](const label i) const
|
||||||
|
|||||||
@ -2,8 +2,10 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -102,6 +104,15 @@ class interpolationTable
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Public Data Types
|
||||||
|
|
||||||
|
//- The element data type
|
||||||
|
typedef Tuple2<scalar, Type> value_type;
|
||||||
|
|
||||||
|
//- The mapped data type
|
||||||
|
typedef Type mapped_type;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Construct null
|
||||||
@ -123,8 +134,8 @@ public:
|
|||||||
// This is a specialised constructor used by patchFields
|
// This is a specialised constructor used by patchFields
|
||||||
interpolationTable(const dictionary& dict);
|
interpolationTable(const dictionary& dict);
|
||||||
|
|
||||||
//- Construct copy
|
//- Copy construct
|
||||||
interpolationTable(const interpolationTable& interpTable);
|
interpolationTable(const interpolationTable& tbl);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
@ -143,6 +154,9 @@ public:
|
|||||||
|
|
||||||
// Member Operators
|
// Member Operators
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
void operator=(const interpolationTable<Type>& rhs);
|
||||||
|
|
||||||
//- Return an element of constant Tuple2<scalar, Type>
|
//- Return an element of constant Tuple2<scalar, Type>
|
||||||
const Tuple2<scalar, Type>& operator[](const label) const;
|
const Tuple2<scalar, Type>& operator[](const label) const;
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,7 @@ void Foam::processorLduInterface::send
|
|||||||
(
|
(
|
||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
reinterpret_cast<const char*>(f.begin()),
|
reinterpret_cast<const char*>(f.cdata()),
|
||||||
nBytes,
|
nBytes,
|
||||||
tag(),
|
tag(),
|
||||||
comm()
|
comm()
|
||||||
@ -62,20 +62,23 @@ void Foam::processorLduInterface::send
|
|||||||
(
|
(
|
||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
receiveBuf_.begin(),
|
receiveBuf_.data(),
|
||||||
nBytes,
|
nBytes,
|
||||||
tag(),
|
tag(),
|
||||||
comm()
|
comm()
|
||||||
);
|
);
|
||||||
|
|
||||||
resizeBuf(sendBuf_, nBytes);
|
resizeBuf(sendBuf_, nBytes);
|
||||||
memcpy(sendBuf_.begin(), f.begin(), nBytes);
|
std::memcpy
|
||||||
|
(
|
||||||
|
static_cast<void*>(sendBuf_.data()), f.cdata(), nBytes
|
||||||
|
);
|
||||||
|
|
||||||
OPstream::write
|
OPstream::write
|
||||||
(
|
(
|
||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
sendBuf_.begin(),
|
sendBuf_.cdata(),
|
||||||
nBytes,
|
nBytes,
|
||||||
tag(),
|
tag(),
|
||||||
comm()
|
comm()
|
||||||
@ -107,7 +110,7 @@ void Foam::processorLduInterface::receive
|
|||||||
(
|
(
|
||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
reinterpret_cast<char*>(f.begin()),
|
reinterpret_cast<char*>(f.data()),
|
||||||
f.byteSize(),
|
f.byteSize(),
|
||||||
tag(),
|
tag(),
|
||||||
comm()
|
comm()
|
||||||
@ -115,7 +118,10 @@ void Foam::processorLduInterface::receive
|
|||||||
}
|
}
|
||||||
else if (commsType == Pstream::commsTypes::nonBlocking)
|
else if (commsType == Pstream::commsTypes::nonBlocking)
|
||||||
{
|
{
|
||||||
memcpy(f.begin(), receiveBuf_.begin(), f.byteSize());
|
std::memcpy
|
||||||
|
(
|
||||||
|
static_cast<void*>(f.data()), receiveBuf_.cdata(), f.byteSize()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -154,10 +160,10 @@ void Foam::processorLduInterface::compressedSend
|
|||||||
label nFloats = nm1 + nlast;
|
label nFloats = nm1 + nlast;
|
||||||
label nBytes = nFloats*sizeof(float);
|
label nBytes = nFloats*sizeof(float);
|
||||||
|
|
||||||
const scalar *sArray = reinterpret_cast<const scalar*>(f.begin());
|
const scalar *sArray = reinterpret_cast<const scalar*>(f.cdata());
|
||||||
const scalar *slast = &sArray[nm1];
|
const scalar *slast = &sArray[nm1];
|
||||||
resizeBuf(sendBuf_, nBytes);
|
resizeBuf(sendBuf_, nBytes);
|
||||||
float *fArray = reinterpret_cast<float*>(sendBuf_.begin());
|
float *fArray = reinterpret_cast<float*>(sendBuf_.data());
|
||||||
|
|
||||||
for (label i=0; i<nm1; i++)
|
for (label i=0; i<nm1; i++)
|
||||||
{
|
{
|
||||||
@ -176,7 +182,7 @@ void Foam::processorLduInterface::compressedSend
|
|||||||
(
|
(
|
||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
sendBuf_.begin(),
|
sendBuf_.cdata(),
|
||||||
nBytes,
|
nBytes,
|
||||||
tag(),
|
tag(),
|
||||||
comm()
|
comm()
|
||||||
@ -190,7 +196,7 @@ void Foam::processorLduInterface::compressedSend
|
|||||||
(
|
(
|
||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
receiveBuf_.begin(),
|
receiveBuf_.data(),
|
||||||
nBytes,
|
nBytes,
|
||||||
tag(),
|
tag(),
|
||||||
comm()
|
comm()
|
||||||
@ -200,7 +206,7 @@ void Foam::processorLduInterface::compressedSend
|
|||||||
(
|
(
|
||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
sendBuf_.begin(),
|
sendBuf_.cdata(),
|
||||||
nBytes,
|
nBytes,
|
||||||
tag(),
|
tag(),
|
||||||
comm()
|
comm()
|
||||||
@ -246,7 +252,7 @@ void Foam::processorLduInterface::compressedReceive
|
|||||||
(
|
(
|
||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
receiveBuf_.begin(),
|
receiveBuf_.data(),
|
||||||
nBytes,
|
nBytes,
|
||||||
tag(),
|
tag(),
|
||||||
comm()
|
comm()
|
||||||
@ -260,9 +266,9 @@ void Foam::processorLduInterface::compressedReceive
|
|||||||
}
|
}
|
||||||
|
|
||||||
const float *fArray =
|
const float *fArray =
|
||||||
reinterpret_cast<const float*>(receiveBuf_.begin());
|
reinterpret_cast<const float*>(receiveBuf_.cdata());
|
||||||
f.last() = reinterpret_cast<const Type&>(fArray[nm1]);
|
f.last() = reinterpret_cast<const Type&>(fArray[nm1]);
|
||||||
scalar *sArray = reinterpret_cast<scalar*>(f.begin());
|
scalar *sArray = reinterpret_cast<scalar*>(f.data());
|
||||||
const scalar *slast = &sArray[nm1];
|
const scalar *slast = &sArray[nm1];
|
||||||
|
|
||||||
for (label i=0; i<nm1; i++)
|
for (label i=0; i<nm1; i++)
|
||||||
|
|||||||
@ -72,12 +72,6 @@ Foam::patchIdentifier::patchIdentifier
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::patchIdentifier::~patchIdentifier()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::patchIdentifier::inGroup(const word& name) const
|
bool Foam::patchIdentifier::inGroup(const word& name) const
|
||||||
|
|||||||
@ -73,6 +73,18 @@ class patchIdentifier
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
patchIdentifier(const patchIdentifier&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
patchIdentifier& operator=(const patchIdentifier&) = default;
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~patchIdentifier() = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
@ -100,10 +112,6 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~patchIdentifier();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the patch name
|
//- Return the patch name
|
||||||
|
|||||||
@ -80,6 +80,15 @@ public:
|
|||||||
static const word emptyType;
|
static const word emptyType;
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
surfZoneIdentifier(const surfZoneIdentifier&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
surfZoneIdentifier& operator=(const surfZoneIdentifier&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Construct null
|
||||||
|
|||||||
@ -330,6 +330,25 @@ Foam::tmp<Foam::vectorField> Foam::polyPatch::faceCellCentres() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::polyPatch::areaFraction() const
|
||||||
|
{
|
||||||
|
tmp<scalarField> tfraction(new scalarField(size()));
|
||||||
|
scalarField& fraction = tfraction.ref();
|
||||||
|
|
||||||
|
const vectorField::subField faceAreas = this->faceAreas();
|
||||||
|
const pointField& points = this->points();
|
||||||
|
|
||||||
|
forAll(*this, facei)
|
||||||
|
{
|
||||||
|
const face& curFace = this->operator[](facei);
|
||||||
|
fraction[facei] =
|
||||||
|
mag(faceAreas[facei])/(curFace.mag(points) + ROOTVSMALL);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tfraction;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const Foam::labelUList& Foam::polyPatch::faceCells() const
|
const Foam::labelUList& Foam::polyPatch::faceCells() const
|
||||||
{
|
{
|
||||||
if (!faceCellsPtr_)
|
if (!faceCellsPtr_)
|
||||||
|
|||||||
@ -372,6 +372,10 @@ public:
|
|||||||
//- Return face cell centres
|
//- Return face cell centres
|
||||||
tmp<vectorField> faceCellCentres() const;
|
tmp<vectorField> faceCellCentres() const;
|
||||||
|
|
||||||
|
//- Return the area fraction as the ratio of the stored face area
|
||||||
|
//- and the area given by the face points
|
||||||
|
tmp<scalarField> areaFraction() const;
|
||||||
|
|
||||||
|
|
||||||
// Addressing into mesh
|
// Addressing into mesh
|
||||||
|
|
||||||
|
|||||||
@ -231,6 +231,7 @@ public:
|
|||||||
//
|
//
|
||||||
// if (nOrig == zones.size()) { existing... } else { new... }
|
// if (nOrig == zones.size()) { existing... } else { new... }
|
||||||
// \endcode
|
// \endcode
|
||||||
|
// \param zoneName the name of the zone
|
||||||
// \param verbose report if an existing zone was selected or
|
// \param verbose report if an existing zone was selected or
|
||||||
// a new zone was created.
|
// a new zone was created.
|
||||||
// \return non-const reference to the existing or new zone
|
// \return non-const reference to the existing or new zone
|
||||||
|
|||||||
@ -68,7 +68,7 @@ inline Foam::Pair<T>::Pair(const FixedList<T, 2>& lst)
|
|||||||
template<class T>
|
template<class T>
|
||||||
inline Foam::Pair<T>::Pair(const T& f, const T& s, const bool doSort)
|
inline Foam::Pair<T>::Pair(const T& f, const T& s, const bool doSort)
|
||||||
{
|
{
|
||||||
if (doSort && f < s)
|
if (doSort && s < f)
|
||||||
{
|
{
|
||||||
first() = s;
|
first() = s;
|
||||||
second() = f;
|
second() = f;
|
||||||
@ -88,7 +88,6 @@ inline Foam::Pair<T>::Pair(const FixedList<T, 2>& lst, const bool doSort)
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
inline Foam::Pair<T>::Pair(Istream& is)
|
inline Foam::Pair<T>::Pair(Istream& is)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -77,10 +77,19 @@ public:
|
|||||||
enum components { XX, XY, XZ, YY, YZ, ZZ };
|
enum components { XX, XY, XZ, YY, YZ, ZZ };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline SymmTensor();
|
SymmTensor() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
SymmTensor(const SymmTensor&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
SymmTensor& operator=(const SymmTensor&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline SymmTensor(const Foam::zero);
|
inline SymmTensor(const Foam::zero);
|
||||||
|
|||||||
@ -28,11 +28,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::SymmTensor<Cmpt>::SymmTensor()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::SymmTensor<Cmpt>::SymmTensor(const Foam::zero)
|
inline Foam::SymmTensor<Cmpt>::SymmTensor(const Foam::zero)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -77,10 +77,19 @@ public:
|
|||||||
enum components { XX, XY, YY };
|
enum components { XX, XY, YY };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline SymmTensor2D();
|
SymmTensor2D() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
SymmTensor2D(const SymmTensor2D&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
SymmTensor2D& operator=(const SymmTensor2D&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline SymmTensor2D(const Foam::zero);
|
inline SymmTensor2D(const Foam::zero);
|
||||||
|
|||||||
@ -28,11 +28,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::SymmTensor2D<Cmpt>::SymmTensor2D()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::SymmTensor2D<Cmpt>::SymmTensor2D(const Foam::zero)
|
inline Foam::SymmTensor2D<Cmpt>::SymmTensor2D(const Foam::zero)
|
||||||
:
|
:
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user