Compare commits
44 Commits
develop.me
...
maintenanc
| Author | SHA1 | Date | |
|---|---|---|---|
| f65a95a68e | |||
| 344237b289 | |||
| b1d6297976 | |||
| 008d015689 | |||
| 0fcd1446c5 | |||
| 70451e680c | |||
| 5768a7e9c8 | |||
| 56de3901e2 | |||
| 36453aa9af | |||
| dd06e6448c | |||
| 74ff53cd88 | |||
| 173ce8511f | |||
| e93f3f6812 | |||
| 1949a31efb | |||
| eb3f7dfe74 | |||
| 2a3fd5afb4 | |||
| 06f14de0cd | |||
| 1ead175957 | |||
| 2fe9481262 | |||
| 76270c07a0 | |||
| 9d5585d37a | |||
| e1201d735f | |||
| 9aea491e58 | |||
| 00709429a5 | |||
| 864271b118 | |||
| 5790fbe2a4 | |||
| 10b9467f68 | |||
| f89de2b65c | |||
| cd2787d452 | |||
| 625f5f6cbb | |||
| d19515bfb8 | |||
| 1ea4fc986b | |||
| e3ac8fb4f4 | |||
| be6756f322 | |||
| f85e798532 | |||
| 240342b508 | |||
| 4ffea147dc | |||
| 4e884c03d2 | |||
| 6c7ae09251 | |||
| 7795f32fa6 | |||
| 14410a736a | |||
| 76137138ae | |||
| 1f83f48f3c | |||
| bc58837658 |
7
Allwmake
7
Allwmake
@ -63,11 +63,14 @@ echo
|
|||||||
applications/Allwmake $targetType $*
|
applications/Allwmake $targetType $*
|
||||||
|
|
||||||
# Additional components/modules
|
# Additional components/modules
|
||||||
if [ -d "$WM_PROJECT_DIR/modules" ]
|
if [ "$FOAM_MODULE_PREFIX" = false ] || [ "$FOAM_MODULE_PREFIX" = none ]
|
||||||
then
|
then
|
||||||
echo "========================================"
|
echo "========================================"
|
||||||
echo "Compile OpenFOAM modules"
|
echo "OpenFOAM modules disabled (prefix=${FOAM_MODULE_PREFIX})"
|
||||||
echo
|
echo
|
||||||
|
elif [ -d "$WM_PROJECT_DIR/modules" ]
|
||||||
|
then
|
||||||
|
echo "Compile OpenFOAM modules"
|
||||||
(cd "$WM_PROJECT_DIR/modules" 2>/dev/null && wmake -all)
|
(cd "$WM_PROJECT_DIR/modules" 2>/dev/null && wmake -all)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
api=1912
|
api=1912
|
||||||
patch=200626
|
patch=220610
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -62,13 +63,13 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
/ time().caseName() + ".msh"
|
/ time().caseName() + ".msh"
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Writing Header" << endl;
|
Info<< "Writing Fluent Mesh" << endl;
|
||||||
|
|
||||||
fluentMeshFile
|
fluentMeshFile
|
||||||
<< "(0 \"FOAM to Fluent Mesh File\")" << std::endl << std::endl
|
<< "(0 \"OpenFOAM to Fluent Mesh File\")" << nl << nl
|
||||||
<< "(0 \"Dimension:\")" << std::endl
|
<< "(0 \"Dimension:\")" << nl
|
||||||
<< "(2 3)" << std::endl << std::endl
|
<< "(2 3)" << nl << nl
|
||||||
<< "(0 \"Grid dimensions:\")" << std::endl;
|
<< "(0 \"Grid dimensions:\")" << nl;
|
||||||
|
|
||||||
// Writing number of points
|
// Writing number of points
|
||||||
fluentMeshFile
|
fluentMeshFile
|
||||||
@ -217,8 +218,8 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
|
|
||||||
// Writing cells
|
// Writing cells
|
||||||
fluentMeshFile
|
fluentMeshFile
|
||||||
<< "(12 (1 1 "
|
<< "(12 (1 1 " << nCells() << " 1 0)" << nl
|
||||||
<< nCells() << " 1 0)(" << std::endl;
|
<< '(';
|
||||||
|
|
||||||
const cellModel& hex = cellModel::ref(cellModel::HEX);
|
const cellModel& hex = cellModel::ref(cellModel::HEX);
|
||||||
const cellModel& prism = cellModel::ref(cellModel::PRISM);
|
const cellModel& prism = cellModel::ref(cellModel::PRISM);
|
||||||
@ -227,44 +228,59 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
|
|
||||||
const cellShapeList& cells = cellShapes();
|
const cellShapeList& cells = cellShapes();
|
||||||
|
|
||||||
bool hasWarned = false;
|
label nPolys = 0;
|
||||||
|
|
||||||
|
int nElemPerLine = 25; // Start with linebreak and indent
|
||||||
|
|
||||||
forAll(cells, celli)
|
forAll(cells, celli)
|
||||||
{
|
{
|
||||||
|
if (nElemPerLine == 25)
|
||||||
|
{
|
||||||
|
// 25 elements per line with initial indent (readability)
|
||||||
|
fluentMeshFile << "\n ";
|
||||||
|
nElemPerLine = 0;
|
||||||
|
}
|
||||||
|
else if (!(nElemPerLine % 5))
|
||||||
|
{
|
||||||
|
// Format in blocks of 5 (readability)
|
||||||
|
fluentMeshFile << token::SPACE;
|
||||||
|
}
|
||||||
|
fluentMeshFile << token::SPACE;
|
||||||
|
++nElemPerLine;
|
||||||
|
|
||||||
|
|
||||||
if (cells[celli].model() == tet)
|
if (cells[celli].model() == tet)
|
||||||
{
|
{
|
||||||
fluentMeshFile << " " << 2;
|
fluentMeshFile << 2;
|
||||||
}
|
}
|
||||||
else if (cells[celli].model() == hex)
|
else if (cells[celli].model() == hex)
|
||||||
{
|
{
|
||||||
fluentMeshFile << " " << 4;
|
fluentMeshFile << 4;
|
||||||
}
|
}
|
||||||
else if (cells[celli].model() == pyr)
|
else if (cells[celli].model() == pyr)
|
||||||
{
|
{
|
||||||
fluentMeshFile << " " << 5;
|
fluentMeshFile << 5;
|
||||||
}
|
}
|
||||||
else if (cells[celli].model() == prism)
|
else if (cells[celli].model() == prism)
|
||||||
{
|
{
|
||||||
fluentMeshFile << " " << 6;
|
fluentMeshFile << 6;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!hasWarned)
|
fluentMeshFile << 7;
|
||||||
{
|
++nPolys;
|
||||||
hasWarned = true;
|
|
||||||
|
|
||||||
WarningInFunction
|
|
||||||
<< "foamMeshToFluent: cell shape for cell "
|
|
||||||
<< celli << " only supported by Fluent polyhedral meshes."
|
|
||||||
<< nl
|
|
||||||
<< " Suppressing any further messages for polyhedral"
|
|
||||||
<< " cells." << endl;
|
|
||||||
}
|
|
||||||
fluentMeshFile << " " << 7;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fluentMeshFile << ")())" << std::endl;
|
fluentMeshFile
|
||||||
|
<< nl << "))" << nl;
|
||||||
|
|
||||||
|
|
||||||
|
if (nPolys)
|
||||||
|
{
|
||||||
|
Info<< "Mesh had " << nPolys << " polyhedrals." << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Return to dec
|
// Return to dec
|
||||||
fluentMeshFile.setf(ios::dec, ios::basefield);
|
fluentMeshFile.setf(ios::dec, ios::basefield);
|
||||||
|
|||||||
@ -169,14 +169,22 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
"translate",
|
"translate",
|
||||||
"vector",
|
"vector",
|
||||||
"Translate by specified <vector> - eg, '(1 0 0)' before rotations"
|
"Translate by specified <vector> before rotations"
|
||||||
|
);
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"auto-centre",
|
||||||
|
"Use bounding box centre as centre for rotations"
|
||||||
);
|
);
|
||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
"origin",
|
"centre",
|
||||||
"point",
|
"point",
|
||||||
"Use specified <point> as origin for rotations"
|
"Use specified <point> as centre for rotations"
|
||||||
);
|
);
|
||||||
|
argList::addOptionCompat("auto-centre", {"auto-origin", 2206});
|
||||||
|
argList::addOptionCompat("centre", {"origin", 2206});
|
||||||
|
|
||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
"rotate",
|
"rotate",
|
||||||
@ -290,18 +298,24 @@ int main(int argc, char *argv[])
|
|||||||
if (args.readIfPresent("translate", v))
|
if (args.readIfPresent("translate", v))
|
||||||
{
|
{
|
||||||
Info<< "Translating points by " << v << endl;
|
Info<< "Translating points by " << v << endl;
|
||||||
|
|
||||||
points += v;
|
points += v;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector origin;
|
vector rotationCentre;
|
||||||
const bool useOrigin = args.readIfPresent("origin", origin);
|
bool useRotationCentre = args.readIfPresent("centre", rotationCentre);
|
||||||
if (useOrigin)
|
if (args.found("auto-centre") && !useRotationCentre)
|
||||||
{
|
{
|
||||||
Info<< "Set origin for rotations to " << origin << endl;
|
useRotationCentre = true;
|
||||||
points -= origin;
|
rotationCentre = boundBox(points).centre();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (useRotationCentre)
|
||||||
|
{
|
||||||
|
Info<< "Set centre of rotation to " << rotationCentre << endl;
|
||||||
|
points -= rotationCentre;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (args.found("rotate"))
|
if (args.found("rotate"))
|
||||||
{
|
{
|
||||||
Pair<vector> n1n2
|
Pair<vector> n1n2
|
||||||
@ -380,6 +394,13 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (useRotationCentre)
|
||||||
|
{
|
||||||
|
Info<< "Unset centre of rotation from " << rotationCentre << endl;
|
||||||
|
points += rotationCentre;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
List<scalar> scaling;
|
List<scalar> scaling;
|
||||||
if (args.readListIfPresent("scale", scaling))
|
if (args.readListIfPresent("scale", scaling))
|
||||||
{
|
{
|
||||||
@ -410,12 +431,6 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useOrigin)
|
|
||||||
{
|
|
||||||
Info<< "Unset origin for rotations from " << origin << endl;
|
|
||||||
points += origin;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Set the precision of the points data to 10
|
// Set the precision of the points data to 10
|
||||||
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
|
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
|
||||||
|
|||||||
@ -73,10 +73,10 @@ if (doLagrangian)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forAllConstIters(theseCloudFields, fieldIter)
|
// Field order may differ on individual processors, so sort by name
|
||||||
|
for (const word& fieldName : theseCloudFields.sortedToc())
|
||||||
{
|
{
|
||||||
const word& fieldName = fieldIter.key();
|
const word& fieldType = theseCloudFields[fieldName];
|
||||||
const word& fieldType = fieldIter.val();
|
|
||||||
|
|
||||||
IOobject fieldObject
|
IOobject fieldObject
|
||||||
(
|
(
|
||||||
@ -94,9 +94,13 @@ if (doLagrangian)
|
|||||||
// but that combination does not work.
|
// but that combination does not work.
|
||||||
// So check the header and sync globally
|
// So check the header and sync globally
|
||||||
|
|
||||||
|
const bool parRun = Pstream::parRun();
|
||||||
|
Pstream::parRun() = false;
|
||||||
|
|
||||||
fieldExists =
|
fieldExists =
|
||||||
fieldObject.typeHeaderOk<IOField<scalar>>(false);
|
fieldObject.typeHeaderOk<IOField<scalar>>(false);
|
||||||
|
|
||||||
|
Pstream::parRun() = parRun;
|
||||||
reduce(fieldExists, orOp<bool>());
|
reduce(fieldExists, orOp<bool>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -678,7 +678,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
const word& opt
|
const char * const opt
|
||||||
: { "cellSet", "cellZone", "faceSet", "pointSet" }
|
: { "cellSet", "cellZone", "faceSet", "pointSet" }
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -898,7 +898,7 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (exprDictPtr.valid())
|
else
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "No command-line or dictionary??" << nl << endl
|
<< "No command-line or dictionary??" << nl << endl
|
||||||
|
|||||||
@ -92,7 +92,7 @@ bool setCellFieldType
|
|||||||
|
|
||||||
fieldType field(fieldHeader, mesh, false);
|
fieldType field(fieldHeader, mesh, false);
|
||||||
|
|
||||||
const Type& value = pTraits<Type>(fieldValueStream);
|
const Type value = pTraits<Type>(fieldValueStream);
|
||||||
|
|
||||||
if (selectedCells.size() == field.size())
|
if (selectedCells.size() == field.size())
|
||||||
{
|
{
|
||||||
@ -244,7 +244,7 @@ bool setFaceFieldType
|
|||||||
|
|
||||||
fieldType field(fieldHeader, mesh);
|
fieldType field(fieldHeader, mesh);
|
||||||
|
|
||||||
const Type& value = pTraits<Type>(fieldValueStream);
|
const Type value = pTraits<Type>(fieldValueStream);
|
||||||
|
|
||||||
// Create flat list of selected faces and their value.
|
// Create flat list of selected faces and their value.
|
||||||
Field<Type> allBoundaryValues(mesh.nBoundaryFaces());
|
Field<Type> allBoundaryValues(mesh.nBoundaryFaces());
|
||||||
|
|||||||
@ -82,12 +82,20 @@ int main(int argc, char *argv[])
|
|||||||
"vector",
|
"vector",
|
||||||
"Translate by specified <vector> - eg, '(1 0 0)' before rotations"
|
"Translate by specified <vector> - eg, '(1 0 0)' before rotations"
|
||||||
);
|
);
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"auto-centre",
|
||||||
|
"Use bounding box centre as centre for rotations"
|
||||||
|
);
|
||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
"origin",
|
"centre",
|
||||||
"point",
|
"point",
|
||||||
"Use specified <point> as origin for rotations"
|
"Use specified <point> as centre for rotations"
|
||||||
);
|
);
|
||||||
|
argList::addOptionCompat("auto-centre", {"auto-origin", 2206});
|
||||||
|
argList::addOptionCompat("centre", {"origin", 2206});
|
||||||
|
|
||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
"rotate",
|
"rotate",
|
||||||
@ -165,18 +173,24 @@ int main(int argc, char *argv[])
|
|||||||
if (args.readIfPresent("translate", v))
|
if (args.readIfPresent("translate", v))
|
||||||
{
|
{
|
||||||
Info<< "Translating points by " << v << endl;
|
Info<< "Translating points by " << v << endl;
|
||||||
|
|
||||||
points += v;
|
points += v;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector origin;
|
vector rotationCentre;
|
||||||
const bool useOrigin = args.readIfPresent("origin", origin);
|
bool useRotationCentre = args.readIfPresent("centre", rotationCentre);
|
||||||
if (useOrigin)
|
if (args.found("auto-centre") && !useRotationCentre)
|
||||||
{
|
{
|
||||||
Info<< "Set origin for rotations to " << origin << endl;
|
useRotationCentre = true;
|
||||||
points -= origin;
|
rotationCentre = boundBox(points).centre();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (useRotationCentre)
|
||||||
|
{
|
||||||
|
Info<< "Set centre of rotation to " << rotationCentre << endl;
|
||||||
|
points -= rotationCentre;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (args.found("rotate"))
|
if (args.found("rotate"))
|
||||||
{
|
{
|
||||||
Pair<vector> n1n2
|
Pair<vector> n1n2
|
||||||
@ -235,6 +249,13 @@ int main(int argc, char *argv[])
|
|||||||
points = transform(rot, points);
|
points = transform(rot, points);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (useRotationCentre)
|
||||||
|
{
|
||||||
|
Info<< "Unset centre of rotation from " << rotationCentre << endl;
|
||||||
|
points += rotationCentre;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
List<scalar> scaling;
|
List<scalar> scaling;
|
||||||
if (args.readListIfPresent("scale", scaling))
|
if (args.readListIfPresent("scale", scaling))
|
||||||
{
|
{
|
||||||
@ -265,11 +286,6 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useOrigin)
|
|
||||||
{
|
|
||||||
Info<< "Unset origin for rotations from " << origin << endl;
|
|
||||||
points += origin;
|
|
||||||
}
|
|
||||||
|
|
||||||
surf1.movePoints(points);
|
surf1.movePoints(points);
|
||||||
surf1.write(outFileName);
|
surf1.write(outFileName);
|
||||||
|
|||||||
430
bin/tools/install-dirs
Executable file
430
bin/tools/install-dirs
Executable file
@ -0,0 +1,430 @@
|
|||||||
|
#!/bin/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.
|
||||||
|
#
|
||||||
|
# Script
|
||||||
|
# install-dirs
|
||||||
|
#
|
||||||
|
# Example usage
|
||||||
|
# install-dirs -prefix=/opt/openfoam/openfoamVER -core
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Simple installer to copy architecture-independent directories.
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
printHelp() {
|
||||||
|
cat<<USAGE
|
||||||
|
|
||||||
|
Usage: ${0##*/} [OPTION]
|
||||||
|
|
||||||
|
input options:
|
||||||
|
-source=SOURCE Source directory
|
||||||
|
[\$WM_PROJECT_DIR ${WM_PROJECT_DIR:-''}]
|
||||||
|
-platform=PLATFORM OpenFOAM platform name [\$WM_OPTIONS ${WM_OPTIONS:-''}]
|
||||||
|
-foam-mpi=FOAM_MPI OpenFOAM mpi name [\$FOAM_MPI ${FOAM_MPI:-''}]
|
||||||
|
|
||||||
|
target options:
|
||||||
|
-prefix=PREFIX Top-level installation directory in PREFIX ['']
|
||||||
|
|
||||||
|
selections:
|
||||||
|
-[no-]common [do not] install (bin, etc, META-INFO)
|
||||||
|
-[no-]devel [do not] install (applications, src, wmake)
|
||||||
|
-[no-]doc [do not] install (doc)
|
||||||
|
-[no-]tut [do not] install (tutorials)
|
||||||
|
-no-app, -no-apps do not install (applications)
|
||||||
|
-no-src do not install (src)
|
||||||
|
-no-wmake do not install (wmake)
|
||||||
|
|
||||||
|
bundled selections:
|
||||||
|
-core Select: -common -devel
|
||||||
|
-default Select: -common -devel -doc -tut
|
||||||
|
|
||||||
|
tuning options:
|
||||||
|
-collate Collate modules (doc, tutorials)
|
||||||
|
-collate-doc Collate modules (doc) into doc/modules
|
||||||
|
-collate-tut Collate modules (tutorials) into tutorials/modules
|
||||||
|
|
||||||
|
general options:
|
||||||
|
-dry-run, -n Do not perform any operations
|
||||||
|
-force, -f Ignored
|
||||||
|
-verbose, -v Additional verbosity
|
||||||
|
-help Print the help and exit
|
||||||
|
|
||||||
|
|
||||||
|
Simple installer to copy OpenFOAM non-binary directories.
|
||||||
|
|
||||||
|
Example,
|
||||||
|
${0##*/} -prefix=/opt/openfoamVER
|
||||||
|
|
||||||
|
USAGE
|
||||||
|
exit 0 # A clean exit
|
||||||
|
}
|
||||||
|
|
||||||
|
unset optDryRun hadError
|
||||||
|
# Report error and exit
|
||||||
|
die()
|
||||||
|
{
|
||||||
|
exec 1>&2
|
||||||
|
echo
|
||||||
|
echo "Error encountered:"
|
||||||
|
while [ "$#" -ge 1 ]; do echo " $1"; shift; done
|
||||||
|
echo
|
||||||
|
echo "See '${0##*/} -help' for usage"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Report error and exit
|
||||||
|
warnOrDie()
|
||||||
|
{
|
||||||
|
if [ -n "$optDryRun" ]
|
||||||
|
then
|
||||||
|
hadError=true
|
||||||
|
while [ "$#" -ge 1 ]; do echo "Error: $1" 1>&2; shift; done
|
||||||
|
else
|
||||||
|
die "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Get the option's value (argument), or die on missing or empty value
|
||||||
|
# $1 option=value
|
||||||
|
getOptionValue()
|
||||||
|
{
|
||||||
|
local value="${1#*=}"
|
||||||
|
# Remove any surrounding double quotes
|
||||||
|
value="${value%\"}"
|
||||||
|
value="${value#\"}"
|
||||||
|
|
||||||
|
[ -n "$value" ] || die "'${1%=}' option requires a value"
|
||||||
|
echo "$value"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Test for '-no-' or '-without-' prefix. Return "false" or "true"
|
||||||
|
# $1 option
|
||||||
|
# [$2] truth value <true>
|
||||||
|
getBoolOption()
|
||||||
|
{
|
||||||
|
case "$1" in
|
||||||
|
(-no-* | -without-*) echo "false" ;;
|
||||||
|
(*) echo "${2:-true}" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
# Defaults from current OpenFOAM environment
|
||||||
|
sourceDir="$WM_PROJECT_DIR"
|
||||||
|
platform="$WM_OPTIONS"
|
||||||
|
foam_mpi="$FOAM_MPI"
|
||||||
|
|
||||||
|
unset install_common install_devel
|
||||||
|
unset install_app install_src install_wmake
|
||||||
|
unset install_doc optCollate_doc
|
||||||
|
unset install_tut optCollate_tut
|
||||||
|
unset optCollate
|
||||||
|
|
||||||
|
unset prefix exec_prefix bindir libdir libdir_mpi optVerbose
|
||||||
|
|
||||||
|
# Parse options
|
||||||
|
while [ "$#" -gt 0 ]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
-h | -help*) printHelp ;;
|
||||||
|
-n | -dry-run) optDryRun="(dry-run) " ;;
|
||||||
|
-v | -verbose) optVerbose=true ;;
|
||||||
|
-f | -force) echo "Ignored option: ${1%%=*}" 1>&2 ;;
|
||||||
|
|
||||||
|
# Inputs
|
||||||
|
-source=*) sourceDir="$(getOptionValue "$1")" ;;
|
||||||
|
-platform=*) echo "Ignored option: ${1%%=*}" 1>&2 ;;
|
||||||
|
-foam-mpi=*) echo "Ignored option: ${1%%=*}" 1>&2 ;;
|
||||||
|
|
||||||
|
# Targets
|
||||||
|
-prefix=*) prefix="$(getOptionValue "$1")" ;;
|
||||||
|
-exec-prefix=*) echo "Ignored option: ${1%%=*}" 1>&2 ;;
|
||||||
|
|
||||||
|
# Selections
|
||||||
|
-common | -no-common) install_common="$(getBoolOption "$1")" ;;
|
||||||
|
-devel | -no-devel) install_devel="$(getBoolOption "$1")" ;;
|
||||||
|
-doc | -no-doc) install_doc="$(getBoolOption "$1")" ;;
|
||||||
|
-tut | -no-tut) install_tut="$(getBoolOption "$1")" ;;
|
||||||
|
-no-app | -no-apps) install_app="$(getBoolOption "$1")" ;;
|
||||||
|
-no-src) install_src="$(getBoolOption "$1")" ;;
|
||||||
|
-no-wmake) install_wmake="$(getBoolOption "$1")" ;;
|
||||||
|
|
||||||
|
-core)
|
||||||
|
install_common=true
|
||||||
|
install_devel=true
|
||||||
|
;;
|
||||||
|
|
||||||
|
-default | -all)
|
||||||
|
[ "$1" = "-all" ] && echo "Compat: treat $1 like -default" 1>&2
|
||||||
|
install_common=true
|
||||||
|
install_devel=true
|
||||||
|
install_doc=true
|
||||||
|
install_tut=true
|
||||||
|
;;
|
||||||
|
|
||||||
|
-collate | -no-collate)
|
||||||
|
optCollate="$(getBoolOption "$1")"
|
||||||
|
if [ "${optCollate:-false}" = false ]
|
||||||
|
then
|
||||||
|
unset optCollate optCollate_doc optCollate_tut
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
-collate-doc) optCollate_doc=true ;;
|
||||||
|
-collate-tut) optCollate_tut=true ;;
|
||||||
|
|
||||||
|
(*) die "Unknown option/argument: $1" ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
[ "${install_common:-false}" = false ] && unset install_common
|
||||||
|
if [ "${install_devel:-false}" = false ]
|
||||||
|
then
|
||||||
|
unset install_devel install_app install_src install_wmake
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${install_doc:-false}" = false ]
|
||||||
|
then
|
||||||
|
unset install_doc
|
||||||
|
elif [ "$optCollate_doc" = true ] || [ "$optCollate" = true ]
|
||||||
|
then
|
||||||
|
install_doc=collate
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${install_tut:-false}" = false ]
|
||||||
|
then
|
||||||
|
unset install_tut
|
||||||
|
elif [ "$optCollate_tut" = true ] || [ "$optCollate" = true ]
|
||||||
|
then
|
||||||
|
install_tut=collate
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Input checks
|
||||||
|
[ -d "$sourceDir" ] || warnOrDie "Invalid -source directory: $sourceDir"
|
||||||
|
|
||||||
|
# Installation sanity check
|
||||||
|
[ -n "$prefix" ] || warnOrDie "Must specify -prefix"
|
||||||
|
|
||||||
|
if [ -n "$hadError" ]
|
||||||
|
then
|
||||||
|
echo "Errors encounters in dry-run. Stopping" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${install_common}${install_devel}${install_doc}${install_tut}" ]
|
||||||
|
then
|
||||||
|
exec 1>&2
|
||||||
|
echo "Nothing specified to install"
|
||||||
|
echo
|
||||||
|
echo "See '${0##*/} -help' for usage"
|
||||||
|
echo
|
||||||
|
exit 0 # Treat as not an error
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Report settings
|
||||||
|
echo "Preparing install with the following parameters" 1>&2
|
||||||
|
echo "source:" 1>&2
|
||||||
|
echo " directory $sourceDir" 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
echo "target" 1>&2
|
||||||
|
echo " prefix ${prefix-[]}" 1>&2
|
||||||
|
##echo " binary ${install_binary:-[disabled]}" 1>&2
|
||||||
|
echo " common ${install_common:-[disabled]}" 1>&2
|
||||||
|
echo -n " devel " 1>&2
|
||||||
|
if [ -n "$install_devel" ]
|
||||||
|
then
|
||||||
|
echo -n "true" 1>&2
|
||||||
|
[ "$install_app" = false ] && echo -n " [app=disabled]" 1>&2
|
||||||
|
[ "$install_src" = false ] && echo -n " [src=disabled]" 1>&2
|
||||||
|
[ "$install_wmake" = false ] && echo -n " [wmake=disabled]" 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
else
|
||||||
|
echo "[disabled]" 1>&2
|
||||||
|
fi
|
||||||
|
echo " doc ${install_doc:-[disabled]}" 1>&2
|
||||||
|
echo " tut ${install_tut:-[disabled]}" 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Proper umask
|
||||||
|
umask 022
|
||||||
|
|
||||||
|
# The commands
|
||||||
|
copy_cmd="cp -a ${optVerbose:+-v}"
|
||||||
|
mkdir_cmd="mkdir -p"
|
||||||
|
|
||||||
|
if [ -n "$optDryRun" ]
|
||||||
|
then
|
||||||
|
if [ -n "$optVerbose" ]
|
||||||
|
then
|
||||||
|
copy_cmd="echo cp -a"
|
||||||
|
mkdir_cmd="echo mkdir -p"
|
||||||
|
else
|
||||||
|
copy_cmd="true"
|
||||||
|
mkdir_cmd="true"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Copy file or directory to <prefix>
|
||||||
|
doCopy()
|
||||||
|
{
|
||||||
|
$mkdir_cmd "$prefix" 2>/dev/null
|
||||||
|
|
||||||
|
for i in "$@"
|
||||||
|
do
|
||||||
|
if [ -e "$sourceDir/$i" ]
|
||||||
|
then
|
||||||
|
$copy_cmd "$sourceDir/$i" "$prefix"
|
||||||
|
nCopied="x$nCopied"
|
||||||
|
else
|
||||||
|
echo "Missing? $sourceDir/$i" 1>&2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "${optDryRun}${#nCopied} items copied" 1>&2
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Collate (doc | tutorials)
|
||||||
|
# Eg,
|
||||||
|
# modules/{NAME}/tutorials
|
||||||
|
# => tutorials/modules/{NAME}
|
||||||
|
collateModuleFiles()
|
||||||
|
{
|
||||||
|
local subDir="$1"
|
||||||
|
local subTarget="$prefix/$subDir/modules"
|
||||||
|
|
||||||
|
if [ -d "$sourceDir/modules" ]
|
||||||
|
then
|
||||||
|
(
|
||||||
|
cd "$sourceDir/modules" || exit
|
||||||
|
|
||||||
|
$mkdir_cmd "$subTarget"
|
||||||
|
|
||||||
|
for i in $(find . -mindepth 2 -maxdepth 2 -name "$subDir" -type d)
|
||||||
|
do
|
||||||
|
$mkdir_cmd "$subTarget/${i%/*}"
|
||||||
|
$copy_cmd "$i"/* "$subTarget/${i%/*}"
|
||||||
|
done
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# common
|
||||||
|
# ----
|
||||||
|
message="${optDryRun}Install common:"
|
||||||
|
if [ -n "$install_common" ]
|
||||||
|
then
|
||||||
|
echo "${message} bin etc META-INFO" 1>&2
|
||||||
|
doCopy bin etc META-INFO
|
||||||
|
else
|
||||||
|
echo "${message} [disabled]" 1>&2
|
||||||
|
fi
|
||||||
|
# ----
|
||||||
|
|
||||||
|
|
||||||
|
# develop (or source)
|
||||||
|
# ----
|
||||||
|
message="${optDryRun}Install devel:" 1>&2
|
||||||
|
unset dirNames blockMessage
|
||||||
|
if [ -n "$install_devel" ]
|
||||||
|
then
|
||||||
|
if [ "$install_wmake" = false ]
|
||||||
|
then
|
||||||
|
blockMessage="$blockMessage [wmake=disabled]"
|
||||||
|
else
|
||||||
|
dirNames="$dirNames wmake"
|
||||||
|
fi
|
||||||
|
if [ "$install_src" = false ]
|
||||||
|
then
|
||||||
|
blockMessage="$blockMessage [src=disabled]"
|
||||||
|
else
|
||||||
|
dirNames="$dirNames src"
|
||||||
|
fi
|
||||||
|
if [ "$install_app" = false ]
|
||||||
|
then
|
||||||
|
blockMessage="$blockMessage [app=disabled]"
|
||||||
|
else
|
||||||
|
dirNames="$dirNames applications"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$dirNames" ]
|
||||||
|
then
|
||||||
|
echo "${message}${dirNames}${blockMessage}" 1>&2
|
||||||
|
doCopy $dirNames # Unquoted - uses word splitting
|
||||||
|
else
|
||||||
|
echo "${message} [disabled]" 1>&2
|
||||||
|
fi
|
||||||
|
# ----
|
||||||
|
|
||||||
|
|
||||||
|
# doc
|
||||||
|
# ----
|
||||||
|
message="${optDryRun}Install doc:" 1>&2
|
||||||
|
if [ -n "$install_doc" ]
|
||||||
|
then
|
||||||
|
echo "${message}" 1>&2
|
||||||
|
doCopy doc
|
||||||
|
|
||||||
|
if [ "$install_doc" = collate ]
|
||||||
|
then
|
||||||
|
echo "${optDryRun}Collate module doc:" 1>&2
|
||||||
|
collateModuleFiles doc
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "${message} [disabled]" 1>&2
|
||||||
|
fi
|
||||||
|
# ----
|
||||||
|
|
||||||
|
|
||||||
|
# tutorials
|
||||||
|
# ----
|
||||||
|
message="${optDryRun}Install tutorials:" 1>&2
|
||||||
|
if [ -n "$install_tut" ]
|
||||||
|
then
|
||||||
|
echo "${message}" 1>&2
|
||||||
|
doCopy tutorials
|
||||||
|
|
||||||
|
if [ "$install_tut" = collate ]
|
||||||
|
then
|
||||||
|
echo "${optDryRun}Collate module tutorials:" 1>&2
|
||||||
|
collateModuleFiles tutorials
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "${message} [disabled]" 1>&2
|
||||||
|
fi
|
||||||
|
# ----
|
||||||
|
|
||||||
|
|
||||||
|
if [ -n "$optDryRun" ]
|
||||||
|
then
|
||||||
|
[ -n "$optVerbose" ] && echo 1>&2
|
||||||
|
echo "${optDryRun}Done" 1>&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
exit 0 # clean exit
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
375
bin/tools/install-platform
Executable file
375
bin/tools/install-platform
Executable file
@ -0,0 +1,375 @@
|
|||||||
|
#!/bin/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.
|
||||||
|
#
|
||||||
|
# Script
|
||||||
|
# install-platform
|
||||||
|
#
|
||||||
|
# Example usage
|
||||||
|
# install-platform -prefix=/opt/openfoam/openfoamVER
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Simple installer to copy OpenFOAM binary bin/, lib/ (platforms)
|
||||||
|
# directories.
|
||||||
|
#
|
||||||
|
# Note
|
||||||
|
# The platforms/tools directory still must be handled separately
|
||||||
|
#
|
||||||
|
# Layout of OpenFOAM platforms
|
||||||
|
#
|
||||||
|
# platforms
|
||||||
|
# |-- <WM_OPTIONS>
|
||||||
|
# |-- bin
|
||||||
|
# | |-- ...
|
||||||
|
# `-- lib
|
||||||
|
# |-- ...
|
||||||
|
# |-- dummy
|
||||||
|
# | `-- ...
|
||||||
|
# |-- sys-openmpi
|
||||||
|
# | |-- libPstream.so
|
||||||
|
# | `-- libptscotchDecomp.so
|
||||||
|
# `-- paraview-MAJ.MIN
|
||||||
|
# `-- ...
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
printHelp() {
|
||||||
|
cat<<USAGE
|
||||||
|
|
||||||
|
Usage: ${0##*/} [OPTION]
|
||||||
|
|
||||||
|
input options:
|
||||||
|
-source=SOURCE Source directory
|
||||||
|
[\$WM_PROJECT_DIR ${WM_PROJECT_DIR:-''}]
|
||||||
|
-platform=PLATFORM OpenFOAM platform name [\$WM_OPTIONS ${WM_OPTIONS:-''}]
|
||||||
|
-foam-mpi=FOAM_MPI OpenFOAM mpi name [\$FOAM_MPI ${FOAM_MPI:-''}]
|
||||||
|
|
||||||
|
target options:
|
||||||
|
-prefix=PREFIX Top-level installation directory in PREFIX ['']
|
||||||
|
-exec-prefix=EPREFIX Architecture-dependent in EPREFIX
|
||||||
|
[PREFIX/platforms/PLATFORM]
|
||||||
|
-bindir=DIR bin directory [EPREFIX/bin]
|
||||||
|
-libdir=DIR lib directory [EPREFIX/lib]
|
||||||
|
-mpi-libdir=DIR mpi libdir [<libdir>/FOAM_MPI]
|
||||||
|
|
||||||
|
tuning options:
|
||||||
|
-no-bin Do not install bin directory
|
||||||
|
-no-lib Do not install lib directory
|
||||||
|
-no-mpi Do not install mpi lib directory
|
||||||
|
-mpi-only Only install mpi lib directory
|
||||||
|
-mpi-mkdir Create foam-mpi directory within libdir
|
||||||
|
|
||||||
|
general options:
|
||||||
|
-dry-run, -n Do not perform any operations
|
||||||
|
-force, -f Ignored
|
||||||
|
-verbose, -v Additional verbosity
|
||||||
|
-help Print the help and exit
|
||||||
|
|
||||||
|
|
||||||
|
Simple installer to copy OpenFOAM binary bin/, lib/ (platforms) directories.
|
||||||
|
|
||||||
|
Example,
|
||||||
|
${0##*/} -prefix=/opt/openfoamVER
|
||||||
|
|
||||||
|
USAGE
|
||||||
|
exit 0 # A clean exit
|
||||||
|
}
|
||||||
|
|
||||||
|
unset optDryRun hadError
|
||||||
|
# Report error and exit
|
||||||
|
die()
|
||||||
|
{
|
||||||
|
exec 1>&2
|
||||||
|
echo
|
||||||
|
echo "Error encountered:"
|
||||||
|
while [ "$#" -ge 1 ]; do echo " $1"; shift; done
|
||||||
|
echo
|
||||||
|
echo "See '${0##*/} -help' for usage"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Report error and exit
|
||||||
|
warnOrDie()
|
||||||
|
{
|
||||||
|
if [ -n "$optDryRun" ]
|
||||||
|
then
|
||||||
|
hadError=true
|
||||||
|
while [ "$#" -ge 1 ]; do echo "Error: $1" 1>&2; shift; done
|
||||||
|
else
|
||||||
|
die "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Get the option's value (argument), or die on missing or empty value
|
||||||
|
# $1 option=value
|
||||||
|
getOptionValue()
|
||||||
|
{
|
||||||
|
local value="${1#*=}"
|
||||||
|
# Remove any surrounding double quotes
|
||||||
|
value="${value%\"}"
|
||||||
|
value="${value#\"}"
|
||||||
|
|
||||||
|
[ -n "$value" ] || die "'${1%=}' option requires a value"
|
||||||
|
echo "$value"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Test for '-no-' or '-without-' prefix. Return "false" or "true"
|
||||||
|
# $1 option
|
||||||
|
# [$2] truth value <true>
|
||||||
|
getBoolOption()
|
||||||
|
{
|
||||||
|
case "$1" in
|
||||||
|
(-no-* | -without-*) echo "false" ;;
|
||||||
|
(*) echo "${2:-true}" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
# Defaults from current OpenFOAM environment
|
||||||
|
sourceDir="$WM_PROJECT_DIR"
|
||||||
|
platform="$WM_OPTIONS"
|
||||||
|
foam_mpi="$FOAM_MPI"
|
||||||
|
|
||||||
|
unset install_bin install_lib
|
||||||
|
unset optMkdir_mpi
|
||||||
|
install_mpi=true
|
||||||
|
|
||||||
|
unset prefix exec_prefix bindir libdir libdir_mpi optVerbose
|
||||||
|
|
||||||
|
# Parse options
|
||||||
|
while [ "$#" -gt 0 ]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
-h | -help*) printHelp ;;
|
||||||
|
-n | -dry-run) optDryRun="(dry-run) " ;;
|
||||||
|
-v | -verbose) optVerbose=true ;;
|
||||||
|
-f | -force) echo "Ignored option: ${1%%=*}" 1>&2 ;;
|
||||||
|
|
||||||
|
# Inputs
|
||||||
|
-source=*) sourceDir="$(getOptionValue "$1")" ;;
|
||||||
|
-platform=*) platform="$(getOptionValue "$1")" ;;
|
||||||
|
-foam-mpi=*) foam_mpi="$(getOptionValue "$1")" ;;
|
||||||
|
|
||||||
|
# Targets
|
||||||
|
-prefix=*) prefix="$(getOptionValue "$1")" ;;
|
||||||
|
-exec-prefix=*) exec_prefix="$(getOptionValue "$1")" ;;
|
||||||
|
|
||||||
|
-bindir=*) bindir="$(getOptionValue "$1")" ;;
|
||||||
|
-libdir=*) libdir="$(getOptionValue "$1")" ;;
|
||||||
|
-mpi-libdir=*) libdir_mpi="$(getOptionValue "$1")" ;;
|
||||||
|
|
||||||
|
-no-bin) install_bin=false ;;
|
||||||
|
-no-lib) install_lib=false ;;
|
||||||
|
-no-mpi) install_mpi=false ;;
|
||||||
|
-mpi-only) install_mpi=exclusive ;;
|
||||||
|
-mpi-mkdir) optMkdir_mpi=true ;;
|
||||||
|
|
||||||
|
(*) die "Unknown option/argument: $1" ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Default <exec_prefix> based on <prefix>
|
||||||
|
if [ -z "$exec_prefix" ] && [ -n "$prefix" ]
|
||||||
|
then
|
||||||
|
exec_prefix="$prefix/platforms/$platform"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Default <bindir>, <libdir> based on <exec_prefix>
|
||||||
|
if [ -n "$exec_prefix" ]
|
||||||
|
then
|
||||||
|
[ -n "$bindir" ] || bindir="$exec_prefix/bin"
|
||||||
|
[ -n "$libdir" ] || libdir="$exec_prefix/lib"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Default <mpi-libdir> based on <libdir> and <foam-mpi>
|
||||||
|
if [ -z "$libdir_mpi" ] && [ -n "$libdir" ]
|
||||||
|
then
|
||||||
|
libdir_mpi="$libdir/$foam_mpi"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Exclusions
|
||||||
|
if [ "$install_bin" = false ] || [ "$install_mpi" = exclusive ]
|
||||||
|
then
|
||||||
|
unset bindir
|
||||||
|
fi
|
||||||
|
if [ "$install_lib" = false ] || [ "$install_mpi" = exclusive ]
|
||||||
|
then
|
||||||
|
unset libdir
|
||||||
|
fi
|
||||||
|
if [ "$install_mpi" = false ]
|
||||||
|
then
|
||||||
|
unset libdir_mpi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Input checks
|
||||||
|
|
||||||
|
sourcePlatform="$sourceDir/platforms/$platform"
|
||||||
|
|
||||||
|
[ -d "$sourceDir" ] || warnOrDie "Invalid -source directory: $sourceDir"
|
||||||
|
[ -n "$platform" ] || warnOrDie "No -platform detected or specified"
|
||||||
|
[ -n "$foam_mpi" ] || warnOrDie "No -foam-mpi detected or specified"
|
||||||
|
|
||||||
|
[ -d "$sourcePlatform" ] || \
|
||||||
|
warnOrDie "Missing platforms directory for: $platform"
|
||||||
|
|
||||||
|
|
||||||
|
# Installation sanity check
|
||||||
|
[ -n "$bindir$libdir$libdir_mpi" ] || \
|
||||||
|
warnOrDie "Must specify at least one of -prefix, -exec-prefix, -bindir, -libdir, -mpi-libdir"
|
||||||
|
|
||||||
|
|
||||||
|
if [ -n "$hadError" ]
|
||||||
|
then
|
||||||
|
echo "Errors encounters in dry-run. Stopping" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Report settings
|
||||||
|
echo "Preparing install with the following parameters" 1>&2
|
||||||
|
echo "source:" 1>&2
|
||||||
|
echo " directory $sourceDir" 1>&2
|
||||||
|
echo " platform $platform" 1>&2
|
||||||
|
echo " foam-mpi $foam_mpi" 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
echo "target (mpi-install: $install_mpi)" 1>&2
|
||||||
|
echo " prefix ${prefix-[]}" 1>&2
|
||||||
|
echo " exec-prefix ${exec_prefix:-[]}" 1>&2
|
||||||
|
echo " bindir ${bindir:-[]}" 1>&2
|
||||||
|
echo " libdir ${libdir:-[]}" 1>&2
|
||||||
|
echo " libdir(mpi) ${libdir_mpi:-[]}" 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Proper umask
|
||||||
|
umask 022
|
||||||
|
|
||||||
|
# The commands
|
||||||
|
copy_cmd="cp -a ${optVerbose:+-v}"
|
||||||
|
mkdir_cmd="mkdir -p"
|
||||||
|
|
||||||
|
if [ -n "$optDryRun" ]
|
||||||
|
then
|
||||||
|
if [ -n "$optVerbose" ]
|
||||||
|
then
|
||||||
|
copy_cmd="echo cp -a"
|
||||||
|
mkdir_cmd="echo mkdir -p"
|
||||||
|
else
|
||||||
|
copy_cmd="true"
|
||||||
|
mkdir_cmd="true"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# bin/
|
||||||
|
# ----
|
||||||
|
message="${optDryRun}Install bindir:"
|
||||||
|
if [ -n "$bindir" ]
|
||||||
|
then
|
||||||
|
input="$sourcePlatform/bin"
|
||||||
|
|
||||||
|
echo "From $input" 1>&2
|
||||||
|
echo "${message} $bindir" 1>&2
|
||||||
|
|
||||||
|
$mkdir_cmd "$bindir" 2>/dev/null
|
||||||
|
|
||||||
|
for i in "$input/"*
|
||||||
|
do
|
||||||
|
if [ -e "$i" ]
|
||||||
|
then
|
||||||
|
$copy_cmd "$i" "$bindir"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "${message} [disabled]" 1>&2
|
||||||
|
fi
|
||||||
|
# ----
|
||||||
|
|
||||||
|
|
||||||
|
# lib/ without mpi
|
||||||
|
# ----
|
||||||
|
message="${optDryRun}Install libdir(non-mpi):"
|
||||||
|
if [ -n "$libdir" ]
|
||||||
|
then
|
||||||
|
input="$sourcePlatform/lib"
|
||||||
|
|
||||||
|
echo "From $input" 1>&2
|
||||||
|
echo "${message} $libdir" 1>&2
|
||||||
|
|
||||||
|
$mkdir_cmd "$libdir" 2>/dev/null
|
||||||
|
|
||||||
|
for i in "$input/"*
|
||||||
|
do
|
||||||
|
if [ "${i##*/}" = "$foam_mpi" ]
|
||||||
|
then
|
||||||
|
if [ "$optMkdir_mpi" = true ]
|
||||||
|
then
|
||||||
|
$mkdir_cmd "$libdir/$foam_mpi"
|
||||||
|
fi
|
||||||
|
elif [ -e "$i" ]
|
||||||
|
then
|
||||||
|
$copy_cmd "$i" "$libdir"
|
||||||
|
else
|
||||||
|
echo "bogus lib entry? $i" 1>&2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "${message} [disabled]" 1>&2
|
||||||
|
fi
|
||||||
|
# ----
|
||||||
|
|
||||||
|
|
||||||
|
# lib/mpi
|
||||||
|
# ----
|
||||||
|
message="${optDryRun}Install libdir(mpi):"
|
||||||
|
if [ -n "$libdir_mpi" ]
|
||||||
|
then
|
||||||
|
input="$sourcePlatform/lib/$foam_mpi"
|
||||||
|
|
||||||
|
echo "From $input" 1>&2
|
||||||
|
echo "${message} $libdir_mpi" 1>&2
|
||||||
|
|
||||||
|
$mkdir_cmd "$libdir_mpi" 2>/dev/null
|
||||||
|
|
||||||
|
for i in "$input"/*
|
||||||
|
do
|
||||||
|
if [ -e "$i" ]
|
||||||
|
then
|
||||||
|
# Always verbose (not many files anyhow)
|
||||||
|
$copy_cmd -v "$i" "$libdir_mpi"
|
||||||
|
else
|
||||||
|
echo "bogus mpi-lib entry? $i" 1>&2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "${message} [disabled]" 1>&2
|
||||||
|
fi
|
||||||
|
# ----
|
||||||
|
|
||||||
|
|
||||||
|
if [ -n "$optDryRun" ]
|
||||||
|
then
|
||||||
|
[ -n "$optVerbose" ] && echo 1>&2
|
||||||
|
echo "${optDryRun}Done" 1>&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
exit 0 # A clean exit
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
75
bin/tools/update-mpi-links.in
Normal file
75
bin/tools/update-mpi-links.in
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
FOAM_MPI="@FOAM_MPI@"
|
||||||
|
FOAM_SYSTEM_MPI_LIBBIN="@FOAM_SYSTEM_MPI_LIBBIN@"
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / 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.
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Update of links from system mpi lib/ to local lib/mpi-name
|
||||||
|
#
|
||||||
|
# Note
|
||||||
|
# Normally located as a trigger within the platforms/ directory
|
||||||
|
# Uses hard-coded values (eg, generated with autoconfig).
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
|
||||||
|
# Local values
|
||||||
|
FOAM_LIBBIN="$(pwd -P)/lib"
|
||||||
|
FOAM_MPI_LIBBIN="$FOAM_LIBBIN/$FOAM_MPI"
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
echo "Link OpenFOAM ($FOAM_MPI) from system locations"
|
||||||
|
echo "Target: $FOAM_MPI_LIBBIN"
|
||||||
|
echo "Source: $FOAM_SYSTEM_MPI_LIBBIN"
|
||||||
|
|
||||||
|
if [ -z "$FOAM_MPI" ]
|
||||||
|
then
|
||||||
|
echo "FOAM_MPI not defined - skipping"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if [ -z "$FOAM_SYSTEM_MPI_LIBBIN" ]
|
||||||
|
then
|
||||||
|
echo "FOAM_SYSTEM_MPI_LIBBIN not defined - skipping"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if [ ! -d "$FOAM_SYSTEM_MPI_LIBBIN" ]
|
||||||
|
then
|
||||||
|
echo "No system mpi lib: $FOAM_SYSTEM_MPI_LIBBIN"
|
||||||
|
echo "... not updating"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if [ ! -d "$FOAM_LIBBIN" ]
|
||||||
|
then
|
||||||
|
echo "Missing $FOAM_LIBBIN"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
mkdir -p "$FOAM_MPI_LIBBIN"
|
||||||
|
|
||||||
|
# Create symlinks
|
||||||
|
(
|
||||||
|
cd "$FOAM_MPI_LIBBIN" || exit
|
||||||
|
|
||||||
|
for i in "$FOAM_SYSTEM_MPI_LIBBIN"/*
|
||||||
|
do
|
||||||
|
if [ -f "$i" ]
|
||||||
|
then
|
||||||
|
ln -svf "$i" "${i##*/}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
)
|
||||||
|
|
||||||
|
exit 0 # clean exit
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -49,7 +49,7 @@ Foam::autoPtr<Foam::ODESolver> Foam::ODESolver::New
|
|||||||
"ODESolver",
|
"ODESolver",
|
||||||
solverType,
|
solverType,
|
||||||
*dictionaryConstructorTablePtr_
|
*dictionaryConstructorTablePtr_
|
||||||
) << exit(FatalError);
|
) << exit(FatalIOError);
|
||||||
}
|
}
|
||||||
|
|
||||||
return autoPtr<ODESolver>(cstrIter()(odes, dict));
|
return autoPtr<ODESolver>(cstrIter()(odes, dict));
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2018 OpenCFD Ltd.
|
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -86,7 +86,19 @@ inline bool Foam::HashPtrTable<T, Key, Hash>::set
|
|||||||
T* ptr
|
T* ptr
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return this->parent_type::set(key, ptr);
|
// Newer: const T* old = this->get(key);
|
||||||
|
|
||||||
|
iterator iter(this->find(key));
|
||||||
|
const T* old = (iter.good() ? iter.val() : nullptr);
|
||||||
|
|
||||||
|
const bool ok = this->parent_type::set(key, ptr);
|
||||||
|
|
||||||
|
if (ok && old != ptr)
|
||||||
|
{
|
||||||
|
delete const_cast<T*>(old);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -50,6 +50,7 @@ void Foam::List<T>::doResize(const label newSize)
|
|||||||
{
|
{
|
||||||
if (newSize > 0)
|
if (newSize > 0)
|
||||||
{
|
{
|
||||||
|
// With sign-check to avoid spurious -Walloc-size-larger-than
|
||||||
T* nv = new T[newSize];
|
T* nv = new T[newSize];
|
||||||
|
|
||||||
const label overlap = min(this->size_, newSize);
|
const label overlap = min(this->size_, newSize);
|
||||||
|
|||||||
@ -31,8 +31,9 @@ License
|
|||||||
template<class T>
|
template<class T>
|
||||||
inline void Foam::List<T>::doAlloc()
|
inline void Foam::List<T>::doAlloc()
|
||||||
{
|
{
|
||||||
if (this->size_)
|
if (this->size_ > 0)
|
||||||
{
|
{
|
||||||
|
// With sign-check to avoid spurious -Walloc-size-larger-than
|
||||||
this->v_ = new T[this->size_];
|
this->v_ = new T[this->size_];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -79,7 +79,7 @@ void Foam::sortedOrder
|
|||||||
template<class T>
|
template<class T>
|
||||||
void Foam::sort(UPtrList<T>& list)
|
void Foam::sort(UPtrList<T>& list)
|
||||||
{
|
{
|
||||||
labelList order(input.size());
|
labelList order(list.size());
|
||||||
sortedOrder(list, order);
|
sortedOrder(list, order);
|
||||||
list.sortOrder(order, false); // false = allow nullptr
|
list.sortOrder(order, false); // false = allow nullptr
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ void Foam::sort(UPtrList<T>& list)
|
|||||||
template<class T, class Compare>
|
template<class T, class Compare>
|
||||||
void Foam::sort(UPtrList<T>& list, const Compare& comp)
|
void Foam::sort(UPtrList<T>& list, const Compare& comp)
|
||||||
{
|
{
|
||||||
labelList order(input.size());
|
labelList order(list.size());
|
||||||
sortedOrder(list, order, comp);
|
sortedOrder(list, order, comp);
|
||||||
list.sortOrder(order, false); // false = allow nullptr
|
list.sortOrder(order, false); // false = allow nullptr
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,8 +32,8 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef OSHA1stream_H
|
#ifndef Foam_OSHA1stream_H
|
||||||
#define OSHA1stream_H
|
#define Foam_OSHA1stream_H
|
||||||
|
|
||||||
#include "OSstream.H"
|
#include "OSstream.H"
|
||||||
#include "SHA1.H"
|
#include "SHA1.H"
|
||||||
@ -63,10 +63,17 @@ class osha1stream
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
//- Handle overflow
|
||||||
|
virtual int overflow(int c = EOF)
|
||||||
|
{
|
||||||
|
if (c != EOF) sha1_.append(c);
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
//- Put sequence of characters
|
//- Put sequence of characters
|
||||||
virtual std::streamsize xsputn(const char* s, std::streamsize n)
|
virtual std::streamsize xsputn(const char* s, std::streamsize n)
|
||||||
{
|
{
|
||||||
sha1_.append(s, n);
|
if (n) sha1_.append(s, n);
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -158,7 +158,7 @@ Foam::tokenList Foam::functionEntries::evalEntry::evaluate
|
|||||||
OTstream toks;
|
OTstream toks;
|
||||||
result.writeValue(toks);
|
result.writeValue(toks);
|
||||||
|
|
||||||
return std::move(toks);
|
return tokenList(std::move(toks.tokens()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -26,7 +26,7 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
||||||
@ -55,20 +55,22 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
|||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
actualPatchType == word::null
|
actualPatchType.empty()
|
||||||
|| actualPatchType != p.type()
|
|| actualPatchType != p.type()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (pfPtr().constraintType() != p.constraintType())
|
if (pfPtr().constraintType() != p.constraintType())
|
||||||
{
|
{
|
||||||
// Use default constraint type
|
// Incompatible (constraint-wise) with the patch type
|
||||||
|
// - use default constraint type
|
||||||
|
|
||||||
auto patchTypeCstrIter =
|
auto patchTypeCstrIter =
|
||||||
pointPatchConstructorTablePtr_->cfind(p.type());
|
pointPatchConstructorTablePtr_->cfind(p.type());
|
||||||
|
|
||||||
if (!patchTypeCstrIter.found())
|
if (!patchTypeCstrIter.found())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "inconsistent patch and patchField types for \n"
|
<< "Inconsistent patch and patchField types for\n"
|
||||||
<< " patch type " << p.type()
|
<< " patch type " << p.type()
|
||||||
<< " and patchField type " << patchFieldType
|
<< " and patchField type " << patchFieldType
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
@ -138,20 +140,17 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
|||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
!dict.found("patchType")
|
!dict.found("patchType")
|
||||||
|| dict.get<word>("patchType") != p.type()
|
|| dict.get<word>("patchType") != p.type()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (pfPtr().constraintType() == p.constraintType())
|
if (pfPtr().constraintType() != p.constraintType())
|
||||||
{
|
{
|
||||||
// Compatible (constraint-wise) with the patch type
|
// Incompatible (constraint-wise) with the patch type
|
||||||
return pfPtr;
|
// - use default constraint type
|
||||||
}
|
|
||||||
else
|
auto patchTypeCstrIter =
|
||||||
{
|
dictionaryConstructorTablePtr_->cfind(p.type());
|
||||||
// Use default constraint type
|
|
||||||
auto patchTypeCstrIter
|
|
||||||
= dictionaryConstructorTablePtr_->cfind(p.type());
|
|
||||||
|
|
||||||
if (!patchTypeCstrIter.found())
|
if (!patchTypeCstrIter.found())
|
||||||
{
|
{
|
||||||
@ -166,7 +165,7 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return cstrIter()(p, iF, dict);
|
return pfPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2015-2019 OpenCFD Ltd.
|
Copyright (C) 2015-2021 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -1184,7 +1184,7 @@ void Foam::argList::parse
|
|||||||
{
|
{
|
||||||
parRunControl_.distributed(true);
|
parRunControl_.distributed(true);
|
||||||
source = "-roots";
|
source = "-roots";
|
||||||
if (roots.size() != 1)
|
if (roots.size() > 1)
|
||||||
{
|
{
|
||||||
dictNProcs = roots.size()+1;
|
dictNProcs = roots.size()+1;
|
||||||
}
|
}
|
||||||
@ -1193,6 +1193,7 @@ void Foam::argList::parse
|
|||||||
{
|
{
|
||||||
roots.resize(Pstream::nProcs()-1, fileName::null);
|
roots.resize(Pstream::nProcs()-1, fileName::null);
|
||||||
|
|
||||||
|
parRunControl_.distributed(true);
|
||||||
source = "-hostRoots";
|
source = "-hostRoots";
|
||||||
ITstream is(source, options_["hostRoots"]);
|
ITstream is(source, options_["hostRoots"]);
|
||||||
|
|
||||||
@ -1231,7 +1232,7 @@ void Foam::argList::parse
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (roots.size() != 1)
|
if (roots.size() > 1)
|
||||||
{
|
{
|
||||||
dictNProcs = roots.size()+1;
|
dictNProcs = roots.size()+1;
|
||||||
}
|
}
|
||||||
@ -1259,6 +1260,12 @@ void Foam::argList::parse
|
|||||||
{
|
{
|
||||||
parRunControl_.distributed(true);
|
parRunControl_.distributed(true);
|
||||||
decompDict.readEntry("roots", roots);
|
decompDict.readEntry("roots", roots);
|
||||||
|
if (roots.empty())
|
||||||
|
{
|
||||||
|
DetailInfo
|
||||||
|
<< "WARNING: running distributed"
|
||||||
|
<< " but did not specify roots!" << nl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1326,8 +1333,8 @@ void Foam::argList::parse
|
|||||||
{
|
{
|
||||||
options_.set("case", roots[slave-1]/globalCase_);
|
options_.set("case", roots[slave-1]/globalCase_);
|
||||||
|
|
||||||
OPstream toSlave(Pstream::commsTypes::scheduled, slave);
|
OPstream toProc(Pstream::commsTypes::scheduled, slave);
|
||||||
toSlave << args_ << options_ << roots.size();
|
toProc << args_ << options_ << parRunControl_.distributed();
|
||||||
}
|
}
|
||||||
options_.erase("case");
|
options_.erase("case");
|
||||||
|
|
||||||
@ -1377,24 +1384,24 @@ void Foam::argList::parse
|
|||||||
slave++
|
slave++
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
OPstream toSlave(Pstream::commsTypes::scheduled, slave);
|
OPstream toProc(Pstream::commsTypes::scheduled, slave);
|
||||||
toSlave << args_ << options_ << roots.size();
|
toProc << args_ << options_ << parRunControl_.distributed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Collect the master's argument list
|
// Collect the master's argument list
|
||||||
label nroots;
|
bool isDistributed;
|
||||||
|
|
||||||
IPstream fromMaster
|
IPstream fromMaster
|
||||||
(
|
(
|
||||||
Pstream::commsTypes::scheduled,
|
Pstream::commsTypes::scheduled,
|
||||||
Pstream::masterNo()
|
Pstream::masterNo()
|
||||||
);
|
);
|
||||||
fromMaster >> args_ >> options_ >> nroots;
|
fromMaster >> args_ >> options_ >> isDistributed;
|
||||||
|
|
||||||
parRunControl_.distributed(nroots);
|
parRunControl_.distributed(isDistributed);
|
||||||
|
|
||||||
// Establish rootPath_/globalCase_/case_ for slave
|
// Establish rootPath_/globalCase_/case_ for slave
|
||||||
setCasePaths();
|
setCasePaths();
|
||||||
|
|||||||
@ -202,7 +202,8 @@ inline Foam::Matrix<Form, Type>::Matrix
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mRows_(Mb.m()),
|
mRows_(Mb.m()),
|
||||||
nCols_(Mb.n())
|
nCols_(Mb.n()),
|
||||||
|
v_(nullptr)
|
||||||
{
|
{
|
||||||
doAlloc();
|
doAlloc();
|
||||||
|
|
||||||
@ -224,7 +225,8 @@ inline Foam::Matrix<Form, Type>::Matrix
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mRows_(Mb.m()),
|
mRows_(Mb.m()),
|
||||||
nCols_(Mb.n())
|
nCols_(Mb.n()),
|
||||||
|
v_(nullptr)
|
||||||
{
|
{
|
||||||
doAlloc();
|
doAlloc();
|
||||||
|
|
||||||
|
|||||||
@ -35,8 +35,9 @@ inline void Foam::Matrix<Form, Type>::doAlloc()
|
|||||||
{
|
{
|
||||||
const label len = size();
|
const label len = size();
|
||||||
|
|
||||||
if (len)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
|
// With sign-check to avoid spurious -Walloc-size-larger-than
|
||||||
v_ = new Type[len];
|
v_ = new Type[len];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -86,7 +86,7 @@ Foam::mapPolyMesh::mapPolyMesh(const polyMesh& mesh)
|
|||||||
|
|
||||||
forAll(faceZoneFaceMap_, zonei)
|
forAll(faceZoneFaceMap_, zonei)
|
||||||
{
|
{
|
||||||
pointZoneMap_[zonei] = identity(mesh.faceZones()[zonei].size());
|
faceZoneFaceMap_[zonei] = identity(mesh.faceZones()[zonei].size());
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(cellZoneMap_, zonei)
|
forAll(cellZoneMap_, zonei)
|
||||||
|
|||||||
@ -45,6 +45,9 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "mathematicalConstants.H"
|
#include "mathematicalConstants.H"
|
||||||
|
#include "error.H"
|
||||||
|
#include <cmath>
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
using namespace Foam::constant::mathematical;
|
using namespace Foam::constant::mathematical;
|
||||||
|
|
||||||
|
|||||||
@ -43,6 +43,10 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "mathematicalConstants.H"
|
#include "mathematicalConstants.H"
|
||||||
|
#include "error.H"
|
||||||
|
#include <cmath>
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
using namespace Foam::constant::mathematical;
|
using namespace Foam::constant::mathematical;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -514,6 +514,10 @@ inline Foam::Tensor<Cmpt> Foam::Tensor<Cmpt>::T() const
|
|||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
// Workaround for gcc (11+) that fails to handle tensor dot vector
|
||||||
|
__attribute__((optimize("no-tree-vectorize")))
|
||||||
|
#endif
|
||||||
inline Foam::Tensor<Cmpt>
|
inline Foam::Tensor<Cmpt>
|
||||||
Foam::Tensor<Cmpt>::inner(const Tensor<Cmpt>& t2) const
|
Foam::Tensor<Cmpt>::inner(const Tensor<Cmpt>& t2) const
|
||||||
{
|
{
|
||||||
@ -537,6 +541,10 @@ Foam::Tensor<Cmpt>::inner(const Tensor<Cmpt>& t2) const
|
|||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
// Workaround for gcc (11+) that fails to handle tensor dot vector
|
||||||
|
__attribute__((optimize("no-tree-vectorize")))
|
||||||
|
#endif
|
||||||
inline Foam::Tensor<Cmpt>
|
inline Foam::Tensor<Cmpt>
|
||||||
Foam::Tensor<Cmpt>::schur(const Tensor<Cmpt>& t2) const
|
Foam::Tensor<Cmpt>::schur(const Tensor<Cmpt>& t2) const
|
||||||
{
|
{
|
||||||
@ -641,7 +649,11 @@ operator&(const Tensor<Cmpt>& t1, const Tensor<Cmpt>& t2)
|
|||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline typename innerProduct<Tensor<Cmpt>, Vector<Cmpt>>::type
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
// Workaround for gcc (11+) that fails to handle tensor dot vector
|
||||||
|
__attribute__((optimize("no-tree-vectorize")))
|
||||||
|
#endif
|
||||||
|
inline Vector<Cmpt>
|
||||||
operator&(const Tensor<Cmpt>& t, const Vector<Cmpt>& v)
|
operator&(const Tensor<Cmpt>& t, const Vector<Cmpt>& v)
|
||||||
{
|
{
|
||||||
return Vector<Cmpt>
|
return Vector<Cmpt>
|
||||||
@ -654,7 +666,11 @@ operator&(const Tensor<Cmpt>& t, const Vector<Cmpt>& v)
|
|||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline typename innerProduct<Vector<Cmpt>, Tensor<Cmpt>>::type
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
// Workaround for gcc (11+) that fails to handle tensor dot vector
|
||||||
|
__attribute__((optimize("no-tree-vectorize")))
|
||||||
|
#endif
|
||||||
|
inline Vector<Cmpt>
|
||||||
operator&(const Vector<Cmpt>& v, const Tensor<Cmpt>& t)
|
operator&(const Vector<Cmpt>& v, const Tensor<Cmpt>& t)
|
||||||
{
|
{
|
||||||
return Vector<Cmpt>
|
return Vector<Cmpt>
|
||||||
@ -922,6 +938,10 @@ operator-(const Tensor<Cmpt>& t1, const SphericalTensor<Cmpt>& st2)
|
|||||||
|
|
||||||
//- Inner-product between a spherical tensor and a tensor
|
//- Inner-product between a spherical tensor and a tensor
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
// Workaround for gcc (11+) that fails to handle tensor dot vector
|
||||||
|
__attribute__((optimize("no-tree-vectorize")))
|
||||||
|
#endif
|
||||||
inline Tensor<Cmpt>
|
inline Tensor<Cmpt>
|
||||||
operator&(const SphericalTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
|
operator&(const SphericalTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
|
||||||
{
|
{
|
||||||
@ -936,6 +956,10 @@ operator&(const SphericalTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
|
|||||||
|
|
||||||
//- Inner-product between a tensor and a spherical tensor
|
//- Inner-product between a tensor and a spherical tensor
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
// Workaround for gcc (11+) that fails to handle tensor dot vector
|
||||||
|
__attribute__((optimize("no-tree-vectorize")))
|
||||||
|
#endif
|
||||||
inline Tensor<Cmpt>
|
inline Tensor<Cmpt>
|
||||||
operator&(const Tensor<Cmpt>& t1, const SphericalTensor<Cmpt>& st2)
|
operator&(const Tensor<Cmpt>& t1, const SphericalTensor<Cmpt>& st2)
|
||||||
{
|
{
|
||||||
@ -1058,6 +1082,10 @@ operator-(const Tensor<Cmpt>& t1, const SymmTensor<Cmpt>& st2)
|
|||||||
|
|
||||||
//- Inner-product between a symmetric tensor and a tensor
|
//- Inner-product between a symmetric tensor and a tensor
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
// Workaround for gcc (11+) that fails to handle tensor dot vector
|
||||||
|
__attribute__((optimize("no-tree-vectorize")))
|
||||||
|
#endif
|
||||||
inline Tensor<Cmpt>
|
inline Tensor<Cmpt>
|
||||||
operator&(const SymmTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
|
operator&(const SymmTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
|
||||||
{
|
{
|
||||||
@ -1080,6 +1108,10 @@ operator&(const SymmTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
|
|||||||
|
|
||||||
//- Inner-product between a tensor and a symmetric tensor
|
//- Inner-product between a tensor and a symmetric tensor
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
// Workaround for gcc (11+) that fails to handle tensor dot vector
|
||||||
|
__attribute__((optimize("no-tree-vectorize")))
|
||||||
|
#endif
|
||||||
inline Tensor<Cmpt>
|
inline Tensor<Cmpt>
|
||||||
operator&(const Tensor<Cmpt>& t1, const SymmTensor<Cmpt>& st2)
|
operator&(const Tensor<Cmpt>& t1, const SymmTensor<Cmpt>& st2)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -42,8 +42,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef SHA1_H
|
#ifndef Foam_SHA1_H
|
||||||
#define SHA1_H
|
#define Foam_SHA1_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -113,6 +113,9 @@ public:
|
|||||||
//- Reset the hashed data before appending more
|
//- Reset the hashed data before appending more
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
//- Append single character
|
||||||
|
inline void append(char c);
|
||||||
|
|
||||||
//- Append data for processing
|
//- Append data for processing
|
||||||
inline SHA1& append(const char* str);
|
inline SHA1& append(const char* str);
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011 OpenFOAM Foundation
|
Copyright (C) 2011 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -53,6 +53,12 @@ inline Foam::SHA1::SHA1(const std::string& str)
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
inline void Foam::SHA1::append(char c)
|
||||||
|
{
|
||||||
|
processBytes(&c, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::SHA1& Foam::SHA1::append(const char* data, size_t len)
|
inline Foam::SHA1& Foam::SHA1::append(const char* data, size_t len)
|
||||||
{
|
{
|
||||||
processBytes(data, len);
|
processBytes(data, len);
|
||||||
|
|||||||
@ -29,6 +29,7 @@ License
|
|||||||
#include "word.H"
|
#include "word.H"
|
||||||
#include "debug.H"
|
#include "debug.H"
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
#include <cstdint>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -969,7 +969,17 @@ void Foam::UPstream::allocatePstreamCommunicator
|
|||||||
|
|
||||||
void Foam::UPstream::freePstreamCommunicator(const label communicator)
|
void Foam::UPstream::freePstreamCommunicator(const label communicator)
|
||||||
{
|
{
|
||||||
if (communicator != UPstream::worldComm)
|
// Not touching the first communicator (WORLD)
|
||||||
|
// or anything out-of bounds.
|
||||||
|
//
|
||||||
|
// No UPstream communicator indices when MPI is initialized outside
|
||||||
|
// of OpenFOAM - thus needs a bounds check too!
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
communicator > 0
|
||||||
|
&& (communicator < PstreamGlobals::MPICommunicators_.size())
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if (PstreamGlobals::MPICommunicators_[communicator] != MPI_COMM_NULL)
|
if (PstreamGlobals::MPICommunicators_[communicator] != MPI_COMM_NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2010-2018 Bernhard Gschaider <bgschaid@hfd-research.com>
|
Copyright (C) 2010-2018 Bernhard Gschaider <bgschaid@hfd-research.com>
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -261,7 +261,14 @@ Foam::tmp<GeomField> Foam::expressions::fvExprDriver::getOrReadFieldImpl
|
|||||||
|
|
||||||
tfield.reset
|
tfield.reset
|
||||||
(
|
(
|
||||||
GeomField::New(name, meshRef, dimensioned<Type>(Zero))
|
GeomField::New
|
||||||
|
(
|
||||||
|
name,
|
||||||
|
meshRef,
|
||||||
|
dimensioned<Type>(Zero),
|
||||||
|
// Patch is zeroGradient (volFields) or calculated (other)
|
||||||
|
defaultBoundaryType(GeomField::null())
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
GeomField& fld = tfield.ref();
|
GeomField& fld = tfield.ref();
|
||||||
|
|||||||
@ -5,8 +5,8 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Original code Copyright (C) 2011-2018 Bernhard Gschaider
|
Copyright (C) 2011-2018 Bernhard Gschaider
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -31,6 +31,7 @@ License
|
|||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
#include "fvPatch.H"
|
#include "fvPatch.H"
|
||||||
#include "pointMesh.H"
|
#include "pointMesh.H"
|
||||||
|
#include "stringOps.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -118,7 +119,6 @@ Foam::expressions::patchExprFieldBase::patchExprFieldBase
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// No gradient expression - same as Zero
|
// No gradient expression - same as Zero
|
||||||
|
|
||||||
if (debug_)
|
if (debug_)
|
||||||
{
|
{
|
||||||
Info<< "No gradientExpr" << nl;
|
Info<< "No gradientExpr" << nl;
|
||||||
@ -127,7 +127,14 @@ Foam::expressions::patchExprFieldBase::patchExprFieldBase
|
|||||||
|
|
||||||
if (dict.readIfPresent("fractionExpr", expr))
|
if (dict.readIfPresent("fractionExpr", expr))
|
||||||
{
|
{
|
||||||
if (!expr.empty() && expr != "0")
|
stringOps::inplaceTrim(expr);
|
||||||
|
|
||||||
|
if (expr == "0" || expr == "1")
|
||||||
|
{
|
||||||
|
// Special cases, handled with more efficiency
|
||||||
|
fracExpr_ = expr;
|
||||||
|
}
|
||||||
|
else if (!expr.empty())
|
||||||
{
|
{
|
||||||
if (isPointVal)
|
if (isPointVal)
|
||||||
{
|
{
|
||||||
@ -137,11 +144,9 @@ Foam::expressions::patchExprFieldBase::patchExprFieldBase
|
|||||||
fracExpr_ = expressions::exprString(expr, dict);
|
fracExpr_ = expressions::exprString(expr, dict);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
// No fraction expression? - defer treatment to inherited BC
|
||||||
// No fraction expression - same as 1 (one)
|
// Mixed BC may elect to simply ignore gradient expression
|
||||||
// Mixed BC may elect to simply ignore gradient expression
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,8 +5,8 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Original code Copyright (C) 2009-2018 Bernhard Gschaider
|
Copyright (C) 2009-2018 Bernhard Gschaider
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -89,7 +89,7 @@ Foam::exprFixedValueFvPatchField<Type>::exprFixedValueFvPatchField
|
|||||||
setDebug();
|
setDebug();
|
||||||
DebugInFunction << nl;
|
DebugInFunction << nl;
|
||||||
|
|
||||||
// Basic sanity
|
// Require valueExpr
|
||||||
if (this->valueExpr_.empty())
|
if (this->valueExpr_.empty())
|
||||||
{
|
{
|
||||||
FatalIOErrorInFunction(dict)
|
FatalIOErrorInFunction(dict)
|
||||||
@ -97,6 +97,7 @@ Foam::exprFixedValueFvPatchField<Type>::exprFixedValueFvPatchField
|
|||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
driver_.readDict(dict);
|
driver_.readDict(dict);
|
||||||
|
|
||||||
if (dict.found("value"))
|
if (dict.found("value"))
|
||||||
@ -110,11 +111,12 @@ Foam::exprFixedValueFvPatchField<Type>::exprFixedValueFvPatchField
|
|||||||
{
|
{
|
||||||
(*this) == this->patchInternalField();
|
(*this) == this->patchInternalField();
|
||||||
|
|
||||||
|
#ifdef FULLDEBUG
|
||||||
WarningInFunction
|
WarningInFunction
|
||||||
<< "No value defined for "
|
<< "No value defined for "
|
||||||
<< this->internalField().name() << " on "
|
<< this->internalField().name() << " on "
|
||||||
<< this->patch().name() << " - setting to internalField value "
|
<< this->patch().name() << " - using patch internal field" << endl;
|
||||||
<< nl;
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->evalOnConstruct_)
|
if (this->evalOnConstruct_)
|
||||||
@ -161,31 +163,29 @@ Foam::exprFixedValueFvPatchField<Type>::exprFixedValueFvPatchField
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::exprFixedValueFvPatchField<Type>::updateCoeffs()
|
void Foam::exprFixedValueFvPatchField<Type>::updateCoeffs()
|
||||||
{
|
{
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
InfoInFunction
|
|
||||||
<< "Value: " << this->valueExpr_ << nl
|
|
||||||
<< "Variables: ";
|
|
||||||
driver_.writeVariableStrings(Info) << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this->updated())
|
if (this->updated())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DebugInFunction
|
if (debug)
|
||||||
<< "updating" << nl;
|
{
|
||||||
|
InfoInFunction
|
||||||
|
<< "Value: " << this->valueExpr_ << nl
|
||||||
|
<< "Variables: ";
|
||||||
|
driver_.writeVariableStrings(Info) << nl;
|
||||||
|
Info<< "... updating" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Expression evaluation
|
// Expression evaluation
|
||||||
{
|
{
|
||||||
|
bool evalValue = (!this->valueExpr_.empty() && this->valueExpr_ != "0");
|
||||||
|
|
||||||
|
|
||||||
driver_.clearVariables();
|
driver_.clearVariables();
|
||||||
|
|
||||||
if (this->valueExpr_.empty())
|
if (evalValue)
|
||||||
{
|
|
||||||
(*this) == Zero;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
tmp<Field<Type>> tresult(driver_.evaluate<Type>(this->valueExpr_));
|
tmp<Field<Type>> tresult(driver_.evaluate<Type>(this->valueExpr_));
|
||||||
|
|
||||||
@ -196,6 +196,10 @@ void Foam::exprFixedValueFvPatchField<Type>::updateCoeffs()
|
|||||||
|
|
||||||
(*this) == tresult;
|
(*this) == tresult;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
(*this) == Zero;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fixedValueFvPatchField<Type>::updateCoeffs();
|
fixedValueFvPatchField<Type>::updateCoeffs();
|
||||||
|
|||||||
@ -5,8 +5,8 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Original code Copyright (C) 2009-2018 Bernhard Gschaider
|
Copyright (C) 2009-2018 Bernhard Gschaider
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -91,20 +91,51 @@ Foam::exprMixedFvPatchField<Type>::exprMixedFvPatchField
|
|||||||
setDebug();
|
setDebug();
|
||||||
DebugInFunction << nl;
|
DebugInFunction << nl;
|
||||||
|
|
||||||
// Basic sanity checks
|
// Require one or both of valueExpr, gradientExpr
|
||||||
if (this->valueExpr_.empty() && this->gradExpr_.empty())
|
if (this->valueExpr_.empty() && this->gradExpr_.empty())
|
||||||
{
|
{
|
||||||
if (this->valueExpr_.empty())
|
FatalIOErrorInFunction(dict)
|
||||||
|
<< "For " << this->internalField().name() << " on "
|
||||||
|
<< this->patch().name() << nl
|
||||||
|
<< "Require either or both: valueExpr and gradientExpr" << nl
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->fracExpr_.empty())
|
||||||
|
{
|
||||||
|
// No fractionExpr. Expect only one of valueExpr or gradientExpr
|
||||||
|
if (!this->valueExpr_.empty() && !this->gradExpr_.empty())
|
||||||
{
|
{
|
||||||
FatalIOErrorInFunction(dict)
|
IOWarningInFunction(dict)
|
||||||
<< "The valueExpr was not defined!" << nl
|
<< "For " << this->internalField().name() << " on "
|
||||||
<< exit(FatalIOError);
|
<< this->patch().name() << nl
|
||||||
|
<< "Recommend using fractionExpr when specifying both"
|
||||||
|
<< " valueExpr and gradientExpr. Assuming a value of 1."
|
||||||
|
<< nl << endl;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if (this->fracExpr_ == "0")
|
||||||
|
{
|
||||||
|
// Gradient only. Expect gradientExpr
|
||||||
if (this->gradExpr_.empty())
|
if (this->gradExpr_.empty())
|
||||||
{
|
{
|
||||||
FatalIOErrorInFunction(dict)
|
IOWarningInFunction(dict)
|
||||||
<< "The gradientExpr was not defined!" << nl
|
<< "For " << this->internalField().name() << " on "
|
||||||
<< exit(FatalIOError);
|
<< this->patch().name() << nl
|
||||||
|
<< "Gradient only, but did not specify gradientExpr."
|
||||||
|
<< nl << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (this->fracExpr_ == "1")
|
||||||
|
{
|
||||||
|
// Value only. Expect valueExpr
|
||||||
|
if (this->valueExpr_.empty())
|
||||||
|
{
|
||||||
|
IOWarningInFunction(dict)
|
||||||
|
<< "For " << this->internalField().name() << " on "
|
||||||
|
<< this->patch().name() << nl
|
||||||
|
<< "Value only, but did not specify valueExpr."
|
||||||
|
<< nl << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,14 +145,12 @@ Foam::exprMixedFvPatchField<Type>::exprMixedFvPatchField
|
|||||||
// Similar to fvPatchField constructor, which we have bypassed
|
// Similar to fvPatchField constructor, which we have bypassed
|
||||||
dict.readIfPresent("patchType", this->patchType());
|
dict.readIfPresent("patchType", this->patchType());
|
||||||
|
|
||||||
|
bool needsRefValue = true;
|
||||||
if (dict.found("refValue"))
|
if (dict.found("refValue"))
|
||||||
{
|
{
|
||||||
|
needsRefValue = false;
|
||||||
this->refValue() = Field<Type>("refValue", dict, p.size());
|
this->refValue() = Field<Type>("refValue", dict, p.size());
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
this->refValue() = this->patchInternalField();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dict.found("value"))
|
if (dict.found("value"))
|
||||||
{
|
{
|
||||||
@ -130,22 +159,27 @@ Foam::exprMixedFvPatchField<Type>::exprMixedFvPatchField
|
|||||||
Field<Type>("value", dict, p.size())
|
Field<Type>("value", dict, p.size())
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!dict.found("refValue"))
|
if (needsRefValue)
|
||||||
{
|
{
|
||||||
// Ensure refValue has a sensible value for the "update" below
|
// Ensure refValue has a sensible value for the "update" below
|
||||||
this->refValue() = Field<Type>("value", dict, p.size());
|
this->refValue() = static_cast<const Field<Type>&>(*this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (needsRefValue)
|
||||||
|
{
|
||||||
|
this->refValue() = this->patchInternalField();
|
||||||
|
}
|
||||||
|
|
||||||
fvPatchField<Type>::operator=(this->refValue());
|
fvPatchField<Type>::operator=(this->refValue());
|
||||||
|
|
||||||
|
#ifdef FULLDEBUG
|
||||||
WarningInFunction
|
WarningInFunction
|
||||||
<< "No value defined for "
|
<< "No value defined for "
|
||||||
<< this->internalField().name()
|
<< this->internalField().name() << " on "
|
||||||
<< " on " << this->patch().name() << " therefore using "
|
<< this->patch().name() << " - using patch internal field" << endl;
|
||||||
<< "the internal field next to the patch"
|
#endif
|
||||||
<< endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -164,7 +198,7 @@ Foam::exprMixedFvPatchField<Type>::exprMixedFvPatchField
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->valueFraction() = 1;
|
this->valueFraction() = scalar(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -234,6 +268,11 @@ Foam::exprMixedFvPatchField<Type>::exprMixedFvPatchField
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::exprMixedFvPatchField<Type>::updateCoeffs()
|
void Foam::exprMixedFvPatchField<Type>::updateCoeffs()
|
||||||
{
|
{
|
||||||
|
if (this->updated())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
InfoInFunction
|
InfoInFunction
|
||||||
@ -241,45 +280,67 @@ void Foam::exprMixedFvPatchField<Type>::updateCoeffs()
|
|||||||
<< "Gradient: " << this->gradExpr_ << nl
|
<< "Gradient: " << this->gradExpr_ << nl
|
||||||
<< "Fraction: " << this->fracExpr_ << nl
|
<< "Fraction: " << this->fracExpr_ << nl
|
||||||
<< "Variables: ";
|
<< "Variables: ";
|
||||||
|
driver_.writeVariableStrings(Info) << nl;
|
||||||
driver_.writeVariableStrings(Info) << endl;
|
Info<< "... updating" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->updated())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
DebugInFunction << " - updating" << nl;
|
|
||||||
|
|
||||||
|
|
||||||
// Expression evaluation
|
// Expression evaluation
|
||||||
{
|
{
|
||||||
driver_.clearVariables();
|
bool evalValue = (!this->valueExpr_.empty() && this->valueExpr_ != "0");
|
||||||
|
bool evalGrad = (!this->gradExpr_.empty() && this->gradExpr_ != "0");
|
||||||
|
bool evalFrac = (!this->fracExpr_.empty());
|
||||||
|
scalar fraction = 1;
|
||||||
|
|
||||||
|
// Have one or both of valueExpr, gradientExpr (checked in constructor)
|
||||||
|
|
||||||
if (this->valueExpr_.empty())
|
if (this->valueExpr_.empty())
|
||||||
{
|
{
|
||||||
this->refValue() = Zero;
|
// No value expression -> gradient only
|
||||||
|
fraction = 0;
|
||||||
|
evalValue = false;
|
||||||
|
evalFrac = false;
|
||||||
}
|
}
|
||||||
else
|
else if (this->gradExpr_.empty())
|
||||||
{
|
|
||||||
this->refValue() = driver_.evaluate<Type>(this->valueExpr_);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool evalGrad = !this->gradExpr_.empty();
|
|
||||||
|
|
||||||
if (this->fracExpr_.empty() || this->fracExpr_ == "1")
|
|
||||||
{
|
{
|
||||||
|
// No gradient expression -> value only
|
||||||
|
fraction = 1;
|
||||||
evalGrad = false;
|
evalGrad = false;
|
||||||
this->valueFraction() = scalar(1);
|
evalFrac = false;
|
||||||
|
}
|
||||||
|
else if (this->fracExpr_.empty())
|
||||||
|
{
|
||||||
|
// No fractionExpr, but has both valueExpr and gradientExpr
|
||||||
|
// -> treat as value only (warning in constructor)
|
||||||
|
fraction = 1;
|
||||||
|
evalGrad = false;
|
||||||
|
evalFrac = false;
|
||||||
}
|
}
|
||||||
else if (this->fracExpr_ == "0")
|
else if (this->fracExpr_ == "0")
|
||||||
{
|
{
|
||||||
this->valueFraction() = Zero;
|
// Gradient only
|
||||||
|
fraction = 0;
|
||||||
|
evalValue = false;
|
||||||
|
evalFrac = false;
|
||||||
|
}
|
||||||
|
else if (this->fracExpr_ == "1")
|
||||||
|
{
|
||||||
|
// Value only
|
||||||
|
fraction = 1;
|
||||||
|
evalGrad = false;
|
||||||
|
evalFrac = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
driver_.clearVariables();
|
||||||
|
|
||||||
|
if (evalValue)
|
||||||
|
{
|
||||||
|
this->refValue() = driver_.evaluate<Type>(this->valueExpr_);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->valueFraction() = driver_.evaluate<scalar>(this->fracExpr_);
|
this->refValue() = Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (evalGrad)
|
if (evalGrad)
|
||||||
@ -290,6 +351,15 @@ void Foam::exprMixedFvPatchField<Type>::updateCoeffs()
|
|||||||
{
|
{
|
||||||
this->refGrad() = Zero;
|
this->refGrad() = Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (evalFrac)
|
||||||
|
{
|
||||||
|
this->valueFraction() = driver_.evaluate<scalar>(this->fracExpr_);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->valueFraction() = fraction;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mixedFvPatchField<Type>::updateCoeffs();
|
mixedFvPatchField<Type>::updateCoeffs();
|
||||||
|
|||||||
@ -166,35 +166,38 @@ Foam::turbulentDigitalFilterInletFvPatchVectorField::patchIndexPairs()
|
|||||||
void Foam::turbulentDigitalFilterInletFvPatchVectorField::
|
void Foam::turbulentDigitalFilterInletFvPatchVectorField::
|
||||||
checkRTensorRealisable() const
|
checkRTensorRealisable() const
|
||||||
{
|
{
|
||||||
const vectorField& faceCentres = this->patch().patch().faceCentres();
|
label badFacei = -1;
|
||||||
|
|
||||||
forAll(R_, facei)
|
forAll(R_, facei)
|
||||||
{
|
{
|
||||||
if (R_[facei].xx() <= 0)
|
if (R_[facei].xx() <= 0)
|
||||||
{
|
{
|
||||||
|
badFacei = facei;
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Reynolds stress tensor component Rxx cannot be negative"
|
<< "Reynolds stress tensor component Rxx cannot be negative"
|
||||||
"or zero, where Rxx = " << R_[facei].xx() << " at the face "
|
<< " or zero, where Rxx = " << R_[facei].xx();
|
||||||
"centre = " << faceCentres[facei] << exit(FatalError);
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (R_[facei].yy() < 0 || R_[facei].zz() < 0)
|
if (R_[facei].yy() < 0 || R_[facei].zz() < 0)
|
||||||
{
|
{
|
||||||
|
badFacei = facei;
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Reynolds stress tensor components Ryy or Rzz cannot be"
|
<< "Reynolds stress tensor components Ryy or Rzz cannot be"
|
||||||
<< "negative where Ryy = " << R_[facei].yy() << ", and Rzz = "
|
<< " negative where Ryy = " << R_[facei].yy()
|
||||||
<< R_[facei].zz() << " at the face centre = "
|
<< ", and Rzz = " << R_[facei].zz();
|
||||||
<< faceCentres[facei] << exit(FatalError);
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar term0 = R_[facei].xx()*R_[facei].yy() - sqr(R_[facei].xy());
|
scalar term0 = R_[facei].xx()*R_[facei].yy() - sqr(R_[facei].xy());
|
||||||
|
|
||||||
if (term0 <= 0)
|
if (term0 <= 0)
|
||||||
{
|
{
|
||||||
|
badFacei = facei;
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Reynolds stress tensor component group, Rxx*Ryy - Rxy^2"
|
<< "Reynolds stress tensor component group, Rxx*Ryy - Rxy^2"
|
||||||
<< "cannot be negative or zero at the face centre = "
|
<< " cannot be negative or zero";
|
||||||
<< faceCentres[facei] << exit(FatalError);
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar term1 = R_[facei].zz() - sqr(R_[facei].xz())/R_[facei].xx();
|
scalar term1 = R_[facei].zz() - sqr(R_[facei].xz())/R_[facei].xx();
|
||||||
@ -205,18 +208,24 @@ checkRTensorRealisable() const
|
|||||||
|
|
||||||
if (term3 < 0)
|
if (term3 < 0)
|
||||||
{
|
{
|
||||||
|
badFacei = facei;
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Reynolds stress tensor component group,"
|
<< "Reynolds stress tensor component group, "
|
||||||
<< "Rzz - Rxz^2/Rxx - (Ryz - Rxy*Rxz/(Rxx*(Rxx*Ryy - Rxy^2)))^2"
|
<< "Rzz - Rxz^2/Rxx - (Ryz - Rxy*Rxz/(Rxx*(Rxx*Ryy - Rxy^2)))^2"
|
||||||
<< "cannot be negative at the face centre = "
|
<< " cannot be negative";
|
||||||
<< faceCentres[facei] << exit(FatalError);
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FULLDEBUG
|
if (badFacei >= 0)
|
||||||
Info<< "Ends: checkRTensorRealisable()."
|
{
|
||||||
<< " Reynolds tensor (on patch) is consistent." << nl;
|
FatalError
|
||||||
#endif
|
<< " at the face centre = "
|
||||||
|
<< this->patch().patch().faceCentres()[badFacei]
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< " # Reynolds stress tensor on patch is consistent #" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -68,7 +68,7 @@ Foam::surfaceInterpolationScheme<Type>::New
|
|||||||
"discretisation",
|
"discretisation",
|
||||||
schemeName,
|
schemeName,
|
||||||
*MeshConstructorTablePtr_
|
*MeshConstructorTablePtr_
|
||||||
) << exit(FatalError);
|
) << exit(FatalIOError);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cstrIter()(mesh, schemeData);
|
return cstrIter()(mesh, schemeData);
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -892,6 +892,16 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::read
|
|||||||
mesh_,
|
mesh_,
|
||||||
dict.subDict("sampledSurfaceDict")
|
dict.subDict("sampledSurfaceDict")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (sampledPtr_->interpolate())
|
||||||
|
{
|
||||||
|
// Should probably ignore interpolate entirely,
|
||||||
|
// but the oldest isoSurface algorithm requires it!
|
||||||
|
WarningInFunction
|
||||||
|
<< type() << ' ' << name() << ": "
|
||||||
|
<< "sampledSurface with interpolate = true "
|
||||||
|
<< "is likely incorrect" << nl << nl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< type() << " " << name() << ":" << nl
|
Info<< type() << " " << name() << ":" << nl
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2015-2019 OpenCFD Ltd.
|
Copyright (C) 2015-2021 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -388,6 +388,15 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::writeValues
|
|||||||
false // serial - already merged
|
false // serial - already merged
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Point data? Should probably disallow
|
||||||
|
if (sampledPtr_)
|
||||||
|
{
|
||||||
|
surfaceWriterPtr_->isPointData() =
|
||||||
|
sampledPtr_->interpolate();
|
||||||
|
}
|
||||||
|
|
||||||
|
surfaceWriterPtr_->nFields() = 1; // Needed for VTK legacy
|
||||||
|
|
||||||
surfaceWriterPtr_->write(fieldName, allValues);
|
surfaceWriterPtr_->write(fieldName, allValues);
|
||||||
|
|
||||||
surfaceWriterPtr_->clear();
|
surfaceWriterPtr_->clear();
|
||||||
|
|||||||
@ -79,7 +79,7 @@ void Foam::functionObjects::nearWallFields::calcAddressing()
|
|||||||
const vectorField nf(patch.nf());
|
const vectorField nf(patch.nf());
|
||||||
const vectorField faceCellCentres(patch.patch().faceCellCentres());
|
const vectorField faceCellCentres(patch.patch().faceCellCentres());
|
||||||
const labelUList& faceCells = patch.patch().faceCells();
|
const labelUList& faceCells = patch.patch().faceCells();
|
||||||
const vectorField::subField& faceCentres = patch.patch().faceCentres();
|
const vectorField::subField faceCentres = patch.patch().faceCentres();
|
||||||
|
|
||||||
forAll(patch, patchFacei)
|
forAll(patch, patchFacei)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -419,8 +419,6 @@ void Foam::ParticleCollector<CloudType>::write()
|
|||||||
massTotal_[facei] += mass_[facei];
|
massTotal_[facei] += mass_[facei];
|
||||||
}
|
}
|
||||||
|
|
||||||
const label proci = Pstream::myProcNo();
|
|
||||||
|
|
||||||
Info<< type() << " output:" << nl;
|
Info<< type() << " output:" << nl;
|
||||||
|
|
||||||
Field<scalar> faceMassTotal(mass_.size(), Zero);
|
Field<scalar> faceMassTotal(mass_.size(), Zero);
|
||||||
@ -434,15 +432,11 @@ void Foam::ParticleCollector<CloudType>::write()
|
|||||||
scalar sumAverageMFR = 0.0;
|
scalar sumAverageMFR = 0.0;
|
||||||
forAll(faces_, facei)
|
forAll(faces_, facei)
|
||||||
{
|
{
|
||||||
scalarList allProcMass(Pstream::nProcs());
|
faceMassTotal[facei] +=
|
||||||
allProcMass[proci] = massTotal_[facei];
|
returnReduce(massTotal_[facei], sumOp<scalar>());
|
||||||
Pstream::gatherList(allProcMass);
|
|
||||||
faceMassTotal[facei] += sum(allProcMass);
|
|
||||||
|
|
||||||
scalarList allProcMassFlowRate(Pstream::nProcs());
|
faceMassFlowRate[facei] +=
|
||||||
allProcMassFlowRate[proci] = massFlowRate_[facei];
|
returnReduce(massFlowRate_[facei], sumOp<scalar>());
|
||||||
Pstream::gatherList(allProcMassFlowRate);
|
|
||||||
faceMassFlowRate[facei] += sum(allProcMassFlowRate);
|
|
||||||
|
|
||||||
sumTotalMass += faceMassTotal[facei];
|
sumTotalMass += faceMassTotal[facei];
|
||||||
sumAverageMFR += faceMassFlowRate[facei];
|
sumAverageMFR += faceMassFlowRate[facei];
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2015 OpenFOAM Foundation
|
Copyright (C) 2015 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -129,6 +129,11 @@ Foam::Istream& Foam::operator>>(Istream& is, gradingDescriptor& gd)
|
|||||||
is.readEnd("gradingDescriptor");
|
is.readEnd("gradingDescriptor");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gd.expansionRatio_ < 0)
|
||||||
|
{
|
||||||
|
gd.expansionRatio_ = 1.0/(-gd.expansionRatio_);
|
||||||
|
}
|
||||||
|
|
||||||
is.check(FUNCTION_NAME);
|
is.check(FUNCTION_NAME);
|
||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2015 OpenFOAM Foundation
|
Copyright (C) 2015 OpenFOAM Foundation
|
||||||
Copyright (C) 2016-2017 OpenCFD Ltd.
|
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -396,22 +396,43 @@ Foam::AABBTree<Type>::AABBTree
|
|||||||
// transfer flattened tree to persistent storage
|
// transfer flattened tree to persistent storage
|
||||||
DynamicList<treeBoundBox> boundBoxes(2*bbs.size());
|
DynamicList<treeBoundBox> boundBoxes(2*bbs.size());
|
||||||
DynamicList<labelList> addressing(2*addr.size());
|
DynamicList<labelList> addressing(2*addr.size());
|
||||||
|
|
||||||
forAll(nodes, nodeI)
|
forAll(nodes, nodeI)
|
||||||
{
|
{
|
||||||
if (nodes[nodeI].first() < 0)
|
if (nodes[nodeI].first() < 0)
|
||||||
{
|
{
|
||||||
boundBoxes.append(bbs[nodeI].first());
|
boundBoxes.append(bbs[nodeI].first());
|
||||||
addressing.append(addr[nodeI + 1]);
|
addressing.append(addr[-(nodes[nodeI].first() + 1)]);
|
||||||
}
|
}
|
||||||
if (nodes[nodeI].second() < 0)
|
if (nodes[nodeI].second() < 0)
|
||||||
{
|
{
|
||||||
boundBoxes.append(bbs[nodeI].second());
|
boundBoxes.append(bbs[nodeI].second());
|
||||||
addressing.append(addr[nodeI + 1]);
|
addressing.append(addr[-(nodes[nodeI].second() + 1)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boundBoxes_.transfer(boundBoxes);
|
boundBoxes_.transfer(boundBoxes);
|
||||||
addressing_.transfer(addressing);
|
addressing_.transfer(addressing);
|
||||||
|
|
||||||
|
|
||||||
|
if (0)
|
||||||
|
{
|
||||||
|
bitSet checked(objects.size());
|
||||||
|
for (const auto& box : addressing_)
|
||||||
|
{
|
||||||
|
for (const auto& id : box)
|
||||||
|
{
|
||||||
|
checked.set(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const label unsetSize = checked.count(false);
|
||||||
|
|
||||||
|
if (unsetSize)
|
||||||
|
{
|
||||||
|
Info<< "*** Problem: IDs not set: " << unsetSize << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -142,8 +142,7 @@ public:
|
|||||||
AABBTree();
|
AABBTree();
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
// equalBinSize: divide into equal number of elements or
|
// equalBinSize: divide into equal number of elements or equal span
|
||||||
// equal span
|
|
||||||
AABBTree
|
AABBTree
|
||||||
(
|
(
|
||||||
const UList<Type>& objects,
|
const UList<Type>& objects,
|
||||||
@ -171,7 +170,7 @@ public:
|
|||||||
bool pointInside(const point& pt) const;
|
bool pointInside(const point& pt) const;
|
||||||
|
|
||||||
//- Determine whether a bounding box overlaps the tree bounding
|
//- Determine whether a bounding box overlaps the tree bounding
|
||||||
// boxes
|
//- boxes
|
||||||
bool overlaps(const boundBox& bbIn) const;
|
bool overlaps(const boundBox& bbIn) const;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -155,7 +155,7 @@ bool Foam::vtk::writePointSet
|
|||||||
|
|
||||||
if (parallel)
|
if (parallel)
|
||||||
{
|
{
|
||||||
vtk::writeListParallel(format(), mesh.points(), pointLabels);
|
vtk::writeListParallel(format.ref(), mesh.points(), pointLabels);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -290,6 +290,7 @@ Foam::scalar surfaceNoise::writeSurfaceData
|
|||||||
false // serial - already merged
|
false // serial - already merged
|
||||||
);
|
);
|
||||||
|
|
||||||
|
writerPtr_->nFields() = 1; // Legacy VTK
|
||||||
writerPtr_->write(title, allData);
|
writerPtr_->write(title, allData);
|
||||||
|
|
||||||
writerPtr_->endTime();
|
writerPtr_->endTime();
|
||||||
@ -321,6 +322,7 @@ Foam::scalar surfaceNoise::writeSurfaceData
|
|||||||
false // serial - already merged
|
false // serial - already merged
|
||||||
);
|
);
|
||||||
|
|
||||||
|
writerPtr_->nFields() = 1; // Legacy VTK
|
||||||
writerPtr_->write(title, data);
|
writerPtr_->write(title, data);
|
||||||
|
|
||||||
writerPtr_->endTime();
|
writerPtr_->endTime();
|
||||||
|
|||||||
@ -155,7 +155,7 @@ void Foam::meshToMesh::mapInternalTgtToSrc
|
|||||||
const bool secondOrder
|
const bool secondOrder
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
mapSrcToTgt(field, cop, result.primitiveFieldRef());
|
mapTgtToSrc(field, cop, result.primitiveFieldRef());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ void Foam::meshToMesh::mapInternalTgtToSrc
|
|||||||
const bool secondOrder
|
const bool secondOrder
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
mapSrcToTgt(field, cop, result.primitiveFieldRef());
|
mapTgtToSrc(field, cop, result.primitiveFieldRef());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ void Foam::meshToMesh::mapInternalTgtToSrc
|
|||||||
const bool secondOrder
|
const bool secondOrder
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
mapSrcToTgt(field, cop, result.primitiveFieldRef());
|
mapTgtToSrc(field, cop, result.primitiveFieldRef());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ void Foam::meshToMesh::mapInternalTgtToSrc
|
|||||||
const bool secondOrder
|
const bool secondOrder
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
mapSrcToTgt(field, cop, result.primitiveFieldRef());
|
mapTgtToSrc(field, cop, result.primitiveFieldRef());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -207,7 +207,7 @@ void Foam::meshToMesh::mapInternalTgtToSrc
|
|||||||
const bool secondOrder
|
const bool secondOrder
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
mapSrcToTgt(field, cop, result.primitiveFieldRef());
|
mapTgtToSrc(field, cop, result.primitiveFieldRef());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -220,7 +220,7 @@ void Foam::meshToMesh::mapInternalTgtToSrc
|
|||||||
const bool secondOrder
|
const bool secondOrder
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
mapSrcToTgt(field, cop, result.primitiveFieldRef());
|
mapTgtToSrc(field, cop, result.primitiveFieldRef());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -875,15 +875,15 @@ Foam::meshToMesh::mapTgtToSrc
|
|||||||
label srcPatchi = srcPatchID_[i];
|
label srcPatchi = srcPatchID_[i];
|
||||||
label tgtPatchi = tgtPatchID_[i];
|
label tgtPatchi = tgtPatchID_[i];
|
||||||
|
|
||||||
if (!srcPatchFields.set(tgtPatchi))
|
if (!srcPatchFields.set(srcPatchi))
|
||||||
{
|
{
|
||||||
srcPatchFields.set
|
srcPatchFields.set
|
||||||
(
|
(
|
||||||
srcPatchi,
|
srcPatchi,
|
||||||
fvPatchField<Type>::New
|
fvPatchField<Type>::New
|
||||||
(
|
(
|
||||||
tgtBfld[srcPatchi],
|
tgtBfld[tgtPatchi],
|
||||||
srcMesh.boundary()[tgtPatchi],
|
srcMesh.boundary()[srcPatchi],
|
||||||
DimensionedField<Type, volMesh>::null(),
|
DimensionedField<Type, volMesh>::null(),
|
||||||
directFvPatchFieldMapper
|
directFvPatchFieldMapper
|
||||||
(
|
(
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -107,7 +107,7 @@ void Foam::polySurface::storeField
|
|||||||
|
|
||||||
if (dimfield)
|
if (dimfield)
|
||||||
{
|
{
|
||||||
dimfield->dimensions() = dims;
|
dimfield->dimensions().reset(dims); // Dimensions may have changed
|
||||||
dimfield->field() = values;
|
dimfield->field() = values;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -148,7 +148,7 @@ void Foam::polySurface::storeField
|
|||||||
|
|
||||||
if (dimfield)
|
if (dimfield)
|
||||||
{
|
{
|
||||||
dimfield->dimensions() = dims;
|
dimfield->dimensions().reset(dims); // Dimensions may have changed
|
||||||
dimfield->field() = std::move(values);
|
dimfield->field() = std::move(values);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -45,7 +45,7 @@ void Foam::surfMesh::storeField
|
|||||||
|
|
||||||
if (dimfield)
|
if (dimfield)
|
||||||
{
|
{
|
||||||
dimfield->dimensions() = dims;
|
dimfield->dimensions().reset(dims); // Dimensions may have changed
|
||||||
dimfield->field() = values;
|
dimfield->field() = values;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -85,7 +85,7 @@ void Foam::surfMesh::storeField
|
|||||||
|
|
||||||
if (dimfield)
|
if (dimfield)
|
||||||
{
|
{
|
||||||
dimfield->dimensions() = dims;
|
dimfield->dimensions().reset(dims); // Dimensions may have changed
|
||||||
dimfield->field() = std::move(values);
|
dimfield->field() = std::move(values);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -416,11 +416,11 @@ bool Foam::surfaceWriter::empty() const
|
|||||||
|
|
||||||
Foam::label Foam::surfaceWriter::size() const
|
Foam::label Foam::surfaceWriter::size() const
|
||||||
{
|
{
|
||||||
const bool value =
|
const label value =
|
||||||
(
|
(
|
||||||
useComponents_
|
useComponents_
|
||||||
? surfComp_.faces().empty()
|
? surfComp_.faces().size()
|
||||||
: surf_.get().faces().empty()
|
: surf_.get().faces().size()
|
||||||
);
|
);
|
||||||
|
|
||||||
return (parallel_ ? returnReduce(value, sumOp<label>()) : value);
|
return (parallel_ ? returnReduce(value, sumOp<label>()) : value);
|
||||||
|
|||||||
@ -140,17 +140,6 @@ Foam::radiation::radiativeIntensityRay::radiativeIntensityRay
|
|||||||
|
|
||||||
if (mesh_.nSolutionD() == 2)
|
if (mesh_.nSolutionD() == 2)
|
||||||
{
|
{
|
||||||
// Omega for 2D
|
|
||||||
omega_ = deltaPhi;
|
|
||||||
|
|
||||||
// dAve for 2D
|
|
||||||
dAve_ = vector
|
|
||||||
(
|
|
||||||
2*sinPhi*Foam::sin(0.5*deltaPhi),
|
|
||||||
2*cosPhi*Foam::sin(0.5*deltaPhi),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
vector meshDir(Zero);
|
vector meshDir(Zero);
|
||||||
if (dom_.meshOrientation() != vector::zero)
|
if (dom_.meshOrientation() != vector::zero)
|
||||||
{
|
{
|
||||||
@ -172,7 +161,6 @@ Foam::radiation::radiativeIntensityRay::radiativeIntensityRay
|
|||||||
|
|
||||||
dAve_ = coordRot & dAve_;
|
dAve_ = coordRot & dAve_;
|
||||||
d_ = coordRot & d_;
|
d_ = coordRot & d_;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (mesh_.nSolutionD() == 1)
|
else if (mesh_.nSolutionD() == 1)
|
||||||
{
|
{
|
||||||
@ -195,9 +183,6 @@ Foam::radiation::radiativeIntensityRay::radiativeIntensityRay
|
|||||||
|
|
||||||
dAve_ = (dAve_ & normal)*meshDir;
|
dAve_ = (dAve_ & normal)*meshDir;
|
||||||
d_ = (d_ & normal)*meshDir;
|
d_ = (d_ & normal)*meshDir;
|
||||||
|
|
||||||
// Omega normalization for 1D
|
|
||||||
omega_ /= 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
autoPtr<volScalarField> IDefaultPtr;
|
autoPtr<volScalarField> IDefaultPtr;
|
||||||
|
|||||||
@ -136,7 +136,7 @@ void Foam::faceReflecting::initialise(const dictionary& coeffs)
|
|||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchI];
|
||||||
const pointField& cf = pp.faceCentres();
|
const vectorField::subField cf = pp.faceCentres();
|
||||||
|
|
||||||
if (!pp.coupled() && !isA<cyclicAMIPolyPatch>(pp))
|
if (!pp.coupled() && !isA<cyclicAMIPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -155,7 +155,7 @@ void Foam::faceShading::calculate()
|
|||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchI];
|
||||||
const pointField& cf = pp.faceCentres();
|
const vectorField::subField cf = pp.faceCentres();
|
||||||
|
|
||||||
if (!pp.coupled() && !isA<cyclicAMIPolyPatch>(pp))
|
if (!pp.coupled() && !isA<cyclicAMIPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -72,16 +72,16 @@ Foam::liquidProperties::liquidProperties
|
|||||||
Foam::liquidProperties::liquidProperties(const dictionary& dict)
|
Foam::liquidProperties::liquidProperties(const dictionary& dict)
|
||||||
:
|
:
|
||||||
thermophysicalProperties(dict),
|
thermophysicalProperties(dict),
|
||||||
Tc_(dict.get<label>("Tc")),
|
Tc_(dict.get<scalar>("Tc")),
|
||||||
Pc_(dict.get<label>("Pc")),
|
Pc_(dict.get<scalar>("Pc")),
|
||||||
Vc_(dict.get<label>("Vc")),
|
Vc_(dict.get<scalar>("Vc")),
|
||||||
Zc_(dict.get<label>("Zc")),
|
Zc_(dict.get<scalar>("Zc")),
|
||||||
Tt_(dict.get<label>("Tt")),
|
Tt_(dict.get<scalar>("Tt")),
|
||||||
Pt_(dict.get<label>("Pt")),
|
Pt_(dict.get<scalar>("Pt")),
|
||||||
Tb_(dict.get<label>("Tb")),
|
Tb_(dict.get<scalar>("Tb")),
|
||||||
dipm_(dict.get<label>("dipm")),
|
dipm_(dict.get<scalar>("dipm")),
|
||||||
omega_(dict.get<label>("omega")),
|
omega_(dict.get<scalar>("omega")),
|
||||||
delta_(dict.get<label>("delta"))
|
delta_(dict.get<scalar>("delta"))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2018-2019 OpenCFD Ltd.
|
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -77,7 +77,7 @@ void Foam::solidProperties::readIfPresent(const dictionary& dict)
|
|||||||
dict.readIfPresent("rho", rho_);
|
dict.readIfPresent("rho", rho_);
|
||||||
dict.readIfPresent("Cp", Cp_);
|
dict.readIfPresent("Cp", Cp_);
|
||||||
dict.readIfPresentCompat("kappa", {{"K", 1612}}, kappa_);
|
dict.readIfPresentCompat("kappa", {{"K", 1612}}, kappa_);
|
||||||
dict.readIfPresent("Hf_", Hf_);
|
dict.readIfPresent("Hf", Hf_);
|
||||||
dict.readIfPresent("emissivity", emissivity_);
|
dict.readIfPresent("emissivity", emissivity_);
|
||||||
dict.readIfPresent("W", W_);
|
dict.readIfPresent("W", W_);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2015 IH-Cantabria
|
Copyright (C) 2015 IH-Cantabria
|
||||||
Copyright (C) 2016-2017 OpenCFD Ltd.
|
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -63,7 +63,7 @@ protected:
|
|||||||
scalar waveAngle_;
|
scalar waveAngle_;
|
||||||
|
|
||||||
//-
|
//-
|
||||||
const scalarField& x_;
|
const scalarField x_;
|
||||||
|
|
||||||
const scalar x0_;
|
const scalar x0_;
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ include $(RULES)/c++$(WM_COMPILE_OPTION)
|
|||||||
|
|
||||||
c++FLAGS = $(c++ARCH) $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS)
|
c++FLAGS = $(c++ARCH) $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS)
|
||||||
|
|
||||||
Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -Wno-alloc-size-larger-than -c $< -o $@
|
Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
|
||||||
cxxtoo = $(Ctoo)
|
cxxtoo = $(Ctoo)
|
||||||
cctoo = $(Ctoo)
|
cctoo = $(Ctoo)
|
||||||
cpptoo = $(Ctoo)
|
cpptoo = $(Ctoo)
|
||||||
|
|||||||
@ -6,11 +6,10 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2014-2017 OpenFOAM Foundation
|
# Copyright (C) 2014-2017 OpenFOAM Foundation
|
||||||
# Copyright (C) 2019 OpenCFD Ltd.
|
# Copyright (C) 2019-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
|
||||||
# wmake/scripts/AllwmakeParseArguments
|
# wmake/scripts/AllwmakeParseArguments
|
||||||
@ -22,14 +21,35 @@
|
|||||||
# # Parse the arguments by sourcing this script
|
# # Parse the arguments by sourcing this script
|
||||||
# . ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
|
# . ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
|
||||||
#
|
#
|
||||||
|
# Parsed options (make)
|
||||||
|
# -k | -keep-going | -non-stop
|
||||||
|
# -j | -jN | -j N
|
||||||
|
#
|
||||||
|
# Parsed options (wmake)
|
||||||
|
# -debug
|
||||||
|
# -q | -queue
|
||||||
|
# -module-prefix=...
|
||||||
|
# Exports FOAM_MODULE_PREFIX value.
|
||||||
|
# Unsets FOAM_MODULE_APPBIN, FOAM_MODULE_LIBBIN.
|
||||||
|
# Handles (user|group|openfoam) or (u|g|o) as per foamEtcFile,
|
||||||
|
# or absolute/relative paths
|
||||||
|
#
|
||||||
|
# Parsed options (special)
|
||||||
|
# -l | -log | -log=FILE
|
||||||
|
# -prefix=... same as -module-prefix=...
|
||||||
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# Check environment
|
||||||
if [ -z "$WM_PROJECT_DIR" ]
|
[ -d "$WM_PROJECT_DIR" ] || {
|
||||||
then
|
exec 1>&2
|
||||||
echo "$Script error: The OpenFOAM environment is not set."
|
echo "$0"
|
||||||
echo " Check the OpenFOAM entries in your dot-files and source them."
|
echo "Error encountered:"
|
||||||
|
echo " The OpenFOAM environment not set or incorrect."
|
||||||
|
echo " Check your setup."
|
||||||
|
echo
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
}
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
exec 1>&2
|
exec 1>&2
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||||
@ -40,13 +60,18 @@ Executing ${0##*/} is equivalent to
|
|||||||
|
|
||||||
wmake -all [OPTIONS]
|
wmake -all [OPTIONS]
|
||||||
|
|
||||||
With these additional options:
|
With additional options:
|
||||||
-l | -log | -log=name
|
-l | -log Tee output to log.\$WM_OPTIONS
|
||||||
|
-log=FILE Tee output to given filename
|
||||||
|
-prefix=... Define FOAM_MODULE_PREFIX (same as wmake -module-prefix)
|
||||||
|
-no-recursion Prevent recursive call (do NOT call 'wmake -all')
|
||||||
|
-fromWmake Same as -no-recursion
|
||||||
|
|
||||||
|
See
|
||||||
|
wmake -help (or wmake -help-full)
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
|
exit 0 # clean exit
|
||||||
wmake -help
|
|
||||||
exit 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -54,7 +79,8 @@ USAGE
|
|||||||
# Parse the arguments and options
|
# Parse the arguments and options
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
unset fromWmake optDebug optLog optQueue
|
unset optDebug optLog optNonRecursive optQueue
|
||||||
|
unset optWmakeFrontend
|
||||||
|
|
||||||
for arg in "$@"
|
for arg in "$@"
|
||||||
do
|
do
|
||||||
@ -65,41 +91,81 @@ do
|
|||||||
-h | -help*)
|
-h | -help*)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
-fromWmake)
|
|
||||||
# If called from wmake (to avoid recursion)
|
-no-recurs* | -fromWmake)
|
||||||
fromWmake=true
|
# Avoid recursion (eg, if called from wmake)
|
||||||
|
optNonRecursive=true
|
||||||
|
# Pass onwards to other Allwmake scripts
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
-module-prefix=* | -prefix=* | --prefix=*)
|
||||||
|
# As per setModulePrefix (wmakeFunctions)
|
||||||
|
export FOAM_MODULE_PREFIX="${arg#*=}"
|
||||||
|
case "$FOAM_MODULE_PREFIX" in
|
||||||
|
# Prefix: user
|
||||||
|
(u | user) FOAM_MODULE_PREFIX="${FOAM_USER_LIBBIN%/*}" ;;
|
||||||
|
|
||||||
|
# Prefix: group
|
||||||
|
(g | group) FOAM_MODULE_PREFIX="${FOAM_SITE_LIBBIN%/*}" ;;
|
||||||
|
|
||||||
|
# Prefix: openfoam (other)
|
||||||
|
(o | openfoam) FOAM_MODULE_PREFIX="${FOAM_LIBBIN%/*}" ;;
|
||||||
|
|
||||||
|
# Prefix: false | none (ie, 'disabled')
|
||||||
|
(false | none) FOAM_MODULE_PREFIX=false ;;
|
||||||
|
|
||||||
|
# Prefix: directory (absolute or relative)
|
||||||
|
(*)
|
||||||
|
: "${FOAM_MODULE_PREFIX:=/usr/local}" # Fallback (autoconf-like)
|
||||||
|
|
||||||
|
# Require absolute path
|
||||||
|
[ "${FOAM_MODULE_PREFIX#/}" != "${FOAM_MODULE_PREFIX}" ] || \
|
||||||
|
FOAM_MODULE_PREFIX="${PWD}/${FOAM_MODULE_PREFIX}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Avoid potential conflicts
|
||||||
|
unset FOAM_MODULE_APPBIN FOAM_MODULE_LIBBIN
|
||||||
|
echo "Module prefix = ${FOAM_MODULE_PREFIX:-[]}" 1>&2
|
||||||
|
continue # Argument handled, remove it
|
||||||
|
;;
|
||||||
|
|
||||||
-k | -keep-going | -non-stop)
|
-k | -keep-going | -non-stop)
|
||||||
# Keep going, ignoring errors
|
# Keep going, ignoring errors
|
||||||
export WM_CONTINUE_ON_ERROR=true
|
export WM_CONTINUE_ON_ERROR=true
|
||||||
continue # Permanently remove arg
|
continue # Argument handled, remove it
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-l | -log)
|
-l | -log)
|
||||||
optLog="log.${WM_OPTIONS:-Allwmake}"
|
optLog="log.${WM_OPTIONS:-build}"
|
||||||
continue # Permanently remove arg
|
continue # Argument handled, remove it
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-log=*)
|
-log=*)
|
||||||
optLog="${arg##*=}"
|
optLog="${arg##*=}"
|
||||||
if [ -d "$optLog" ]
|
if [ -d "$optLog" ]
|
||||||
then
|
then
|
||||||
optLog="${optLog%/}/log.${WM_OPTIONS:-Allwmake}"
|
optLog="${optLog%/}/log.${WM_OPTIONS:-build}"
|
||||||
elif [ -z "$optLog" ]
|
elif [ -z "$optLog" ]
|
||||||
then
|
then
|
||||||
optLog="log.${WM_OPTIONS:-Allwmake}"
|
optLog="log.${WM_OPTIONS:-build}"
|
||||||
fi
|
fi
|
||||||
continue # Permanently remove arg
|
continue # Argument handled, remove it
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-debug)
|
-debug)
|
||||||
optDebug="-debug"
|
optDebug="-debug"
|
||||||
continue # Permanently remove arg
|
continue # Argument handled, remove it
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-q | -queue)
|
-q | -queue)
|
||||||
optQueue="-queue"
|
optQueue="-queue"
|
||||||
continue # Permanently remove arg
|
continue # Argument handled, remove it
|
||||||
;;
|
;;
|
||||||
|
|
||||||
lib | libo | libso | dep | objects)
|
lib | libo | libso | dep | objects)
|
||||||
# Target type
|
# Target type
|
||||||
targetType=$arg
|
targetType="$arg"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@ -112,20 +178,22 @@ done
|
|||||||
# Execute wmake -all if not called from wmake
|
# Execute wmake -all if not called from wmake
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
if [ -z "$fromWmake" ]
|
if [ -z "$optNonRecursive" ]
|
||||||
then
|
then
|
||||||
if [ -z "$optLog" ]
|
if [ -z "$optLog" ]
|
||||||
then
|
then
|
||||||
exec wmake -all $optQueue $*
|
exec wmake $optWmakeFrontend -all \
|
||||||
|
$optDebug $optQueue $*
|
||||||
exit $? # Unneeded, but just in case something went wrong
|
exit $? # Unneeded, but just in case something went wrong
|
||||||
else
|
else
|
||||||
echo "Logging wmake -all output to '$optLog'" 1>&2
|
echo "Logging wmake -all output to '$optLog'" 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
exec wmake -all $optDebug $optQueue $* 2>&1 | /usr/bin/tee $optLog
|
exec wmake $optWmakeFrontend -all \
|
||||||
|
$optDebug $optQueue $* 2>&1 | /usr/bin/tee $optLog
|
||||||
# Need to cleanup after the tee
|
# Need to cleanup after the tee
|
||||||
rc=$? # Error code from tee (not wmake), but not entirely important
|
rc=$? # Error code from tee (not wmake), but not entirely important
|
||||||
echo "Done logging to '$optLog'" 1>&2
|
echo "Done logging to '$optLog'" 1>&2
|
||||||
exit $rc
|
exit "$rc"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -144,7 +212,8 @@ fi
|
|||||||
# Cleanup local variables and functions
|
# Cleanup local variables and functions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
unset fromWmake optDebug optLog optQueue
|
unset optWmakeFrontend
|
||||||
|
unset optNonRecursive optDebug optLog optQueue
|
||||||
unset -f usage
|
unset -f usage
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -37,76 +37,6 @@ export CXXFLAGS="$(wmake -show-cxxflags)"
|
|||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
#
|
|
||||||
# Save build/configure parameter information (dependency) into sentinel file
|
|
||||||
#
|
|
||||||
# 1 - sentinelFile
|
|
||||||
# 2... build/configure parameters
|
|
||||||
#
|
|
||||||
storeDependency()
|
|
||||||
{
|
|
||||||
local sentinel="$1"
|
|
||||||
local depend
|
|
||||||
shift
|
|
||||||
|
|
||||||
if [ -n "$sentinel" ]
|
|
||||||
then
|
|
||||||
mkdir -p "$(dirname "$sentinel")"
|
|
||||||
|
|
||||||
echo '# Build/configure parameters' >| "$sentinel"
|
|
||||||
|
|
||||||
for depend
|
|
||||||
do
|
|
||||||
echo "-- $depend"
|
|
||||||
done >> "$sentinel"
|
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Check sentinel file(s) to handle changed build/configure parameters
|
|
||||||
# such as paraview / vtk version changes
|
|
||||||
#
|
|
||||||
# 1 - sourceDir
|
|
||||||
# 2... build/configure parameters
|
|
||||||
#
|
|
||||||
sameDependency()
|
|
||||||
{
|
|
||||||
local sourceDir="$1"
|
|
||||||
shift
|
|
||||||
local depend objectsDir
|
|
||||||
local compare=0
|
|
||||||
|
|
||||||
# Where generated files are stored
|
|
||||||
objectsDir=$(findObjectDir "$sourceDir") || exit 1 # Fatal
|
|
||||||
local sentinel="$objectsDir/ThirdParty"
|
|
||||||
|
|
||||||
if [ -f "$sentinel" ]
|
|
||||||
then
|
|
||||||
# Create an .update version
|
|
||||||
storeDependency "${sentinel}.update" $@
|
|
||||||
cmp "${sentinel}" "${sentinel}.update" >/dev/null 2>&1
|
|
||||||
compare=$?
|
|
||||||
|
|
||||||
if [ "$compare" -ne 0 ]
|
|
||||||
then
|
|
||||||
echo "build/configure parameters changed between builds" 1>&2
|
|
||||||
fi
|
|
||||||
|
|
||||||
else
|
|
||||||
# No sentinel file: First time, or failed compilation?
|
|
||||||
if [ -f "$objectsDir/CMakeCache.txt" ]
|
|
||||||
then
|
|
||||||
echo "previous build was incomplete" 1>&2
|
|
||||||
compare=1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "$sentinel"
|
|
||||||
return "$compare"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Resolve the location of cmake (if needed) and call with output
|
# Resolve the location of cmake (if needed) and call with output
|
||||||
# suppressed according to WM_QUIET
|
# suppressed according to WM_QUIET
|
||||||
@ -151,7 +81,7 @@ cmakeVersioned()
|
|||||||
|
|
||||||
mkdir -p "$objectsDir" \
|
mkdir -p "$objectsDir" \
|
||||||
&& ( cd "$objectsDir" && call_cmake "$@" "$sourceDir" && \
|
&& ( cd "$objectsDir" && call_cmake "$@" "$sourceDir" && \
|
||||||
make "-j${WM_NCOMPPROCS:-1}" ) \
|
make ) \
|
||||||
&& storeDependency "$sentinel" "$depend" $@
|
&& storeDependency "$sentinel" "$depend" $@
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,7 +108,7 @@ cmakeVersionedInstall()
|
|||||||
|
|
||||||
mkdir -p "$objectsDir" \
|
mkdir -p "$objectsDir" \
|
||||||
&& ( cd "$objectsDir" && call_cmake "$@" "$sourceDir" && \
|
&& ( cd "$objectsDir" && call_cmake "$@" "$sourceDir" && \
|
||||||
make "-j${WM_NCOMPPROCS:-1}" install ) \
|
make install ) \
|
||||||
&& storeDependency "$sentinel" "$depend" $@
|
&& storeDependency "$sentinel" "$depend" $@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,8 @@
|
|||||||
# ADIOS2_ARCH_PATH
|
# ADIOS2_ARCH_PATH
|
||||||
#
|
#
|
||||||
# Functions provided
|
# Functions provided
|
||||||
# have_adios2, no_adios2, echo_adios2, hint_adios2, query_adios2
|
# have_adios2, no_adios2, echo_adios2, query_adios2, search_adios2
|
||||||
|
# hint_adios2
|
||||||
#
|
#
|
||||||
# Variables set on success
|
# Variables set on success
|
||||||
# HAVE_ADIOS2
|
# HAVE_ADIOS2
|
||||||
@ -33,7 +34,7 @@
|
|||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Reset variables
|
# Reset
|
||||||
no_adios2()
|
no_adios2()
|
||||||
{
|
{
|
||||||
unset HAVE_ADIOS2 ADIOS2_INC_DIR ADIOS2_LIB_DIR
|
unset HAVE_ADIOS2 ADIOS2_INC_DIR ADIOS2_LIB_DIR
|
||||||
@ -44,9 +45,9 @@ no_adios2()
|
|||||||
echo_adios2()
|
echo_adios2()
|
||||||
{
|
{
|
||||||
echo "adios2=${HAVE_ADIOS2:-false}"
|
echo "adios2=${HAVE_ADIOS2:-false}"
|
||||||
echo "root=$ADIOS2_ARCH_PATH"
|
echo "root=\"$ADIOS2_ARCH_PATH\""
|
||||||
echo "include=$ADIOS2_INC_DIR"
|
echo "include=\"$ADIOS2_INC_DIR\""
|
||||||
echo "library=$ADIOS2_LIB_DIR"
|
echo "library=\"$ADIOS2_LIB_DIR\""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -55,9 +56,7 @@ hint_adios2()
|
|||||||
{
|
{
|
||||||
/bin/cat<<INFORMATION 1>&2
|
/bin/cat<<INFORMATION 1>&2
|
||||||
==> adios2 not found?
|
==> adios2 not found?
|
||||||
|
Define manually, enable in OpenFOAM etc/bashrc, or try the following [POSIX]:
|
||||||
Enable in the OpenFOAM etc/bashrc, define manually or try with the
|
|
||||||
following (POSIX shell):
|
|
||||||
|
|
||||||
eval \$(foamEtcFile -sh -config adios2 -- -force)
|
eval \$(foamEtcFile -sh -config adios2 -- -force)
|
||||||
|
|
||||||
@ -66,43 +65,19 @@ INFORMATION
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Query settings
|
# Search
|
||||||
query_adios2()
|
# $1 : prefix (*_ARCH_PATH, system, ...)
|
||||||
{
|
#
|
||||||
local config="config.sh/adios2"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
_process_query adios2 "$ADIOS2_ARCH_PATH"
|
|
||||||
else
|
|
||||||
echo "(no $config settings)" 1>&2
|
|
||||||
echo "adios2=unknown"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# On success, return 0 and export variables
|
# On success, return 0 and export variables
|
||||||
# -> HAVE_ADIOS2, ADIOS2_INC_DIR, ADIOS2_LIB_DIR
|
# -> HAVE_ADIOS2, ADIOS2_INC_DIR, ADIOS2_LIB_DIR
|
||||||
have_adios2()
|
search_adios2()
|
||||||
{
|
{
|
||||||
local warn # warn="==> skip adios2"
|
local warn # warn="==> skip adios2"
|
||||||
local config="config.sh/adios2"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
else
|
|
||||||
[ -n "$warn" ] && echo "$warn (no $config settings)"
|
|
||||||
return 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Expected location, include/library names
|
|
||||||
local prefix="$ADIOS2_ARCH_PATH"
|
|
||||||
local incName="adios2.h"
|
local incName="adios2.h"
|
||||||
local libName="libadios2"
|
local libName="libadios2"
|
||||||
|
local libName2="libadios2_cxx11_mpi"
|
||||||
|
|
||||||
|
local prefix="${1:-system}"
|
||||||
local header library
|
local header library
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
@ -132,6 +107,7 @@ have_adios2()
|
|||||||
# Library
|
# Library
|
||||||
[ -n "$library" ] \
|
[ -n "$library" ] \
|
||||||
|| library=$(findLibrary -prefix="$prefix" -name="$libName") \
|
|| library=$(findLibrary -prefix="$prefix" -name="$libName") \
|
||||||
|
|| library=$(findLibrary -prefix="$prefix" -name="$libName2") \
|
||||||
|| {
|
|| {
|
||||||
[ -n "$warn" ] && echo "$warn (no library)"
|
[ -n "$warn" ] && echo "$warn (no library)"
|
||||||
return 2
|
return 2
|
||||||
@ -147,7 +123,45 @@ have_adios2()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Reset variables
|
# Output as per search_* function
|
||||||
|
have_adios2()
|
||||||
|
{
|
||||||
|
local warn # warn="==> skip adios2"
|
||||||
|
local config="config.sh/adios2"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
else
|
||||||
|
[ -n "$warn" ] && echo "$warn (no $config)"
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
search_adios2 "$ADIOS2_ARCH_PATH"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Query settings
|
||||||
|
query_adios2()
|
||||||
|
{
|
||||||
|
local config="config.sh/adios2"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
_process_query adios2 "$ADIOS2_ARCH_PATH"
|
||||||
|
else
|
||||||
|
echo "(no $config)" 1>&2
|
||||||
|
echo "adios2=unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Reset
|
||||||
no_adios2
|
no_adios2
|
||||||
|
|
||||||
# Test/query
|
# Test/query
|
||||||
@ -159,6 +173,9 @@ case "$1" in
|
|||||||
-query)
|
-query)
|
||||||
query_adios2
|
query_adios2
|
||||||
;;
|
;;
|
||||||
|
-hint)
|
||||||
|
hint_adios2
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
# or config.sh/CGAL (when BOOST_ARCH_PATH is empty)
|
# or config.sh/CGAL (when BOOST_ARCH_PATH is empty)
|
||||||
#
|
#
|
||||||
# Functions provided
|
# Functions provided
|
||||||
# have_boost, no_boost, echo_boost, query_boost
|
# have_boost, no_boost, echo_boost, query_boost, search_boost
|
||||||
#
|
#
|
||||||
# Variables set on success
|
# Variables set on success
|
||||||
# HAVE_BOOST
|
# HAVE_BOOST
|
||||||
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Reset variables
|
# Reset
|
||||||
no_boost()
|
no_boost()
|
||||||
{
|
{
|
||||||
unset HAVE_BOOST BOOST_INC_DIR BOOST_LIB_DIR
|
unset HAVE_BOOST BOOST_INC_DIR BOOST_LIB_DIR
|
||||||
@ -45,53 +45,24 @@ no_boost()
|
|||||||
echo_boost()
|
echo_boost()
|
||||||
{
|
{
|
||||||
echo "boost=${HAVE_BOOST:-false}"
|
echo "boost=${HAVE_BOOST:-false}"
|
||||||
echo "root=$BOOST_ARCH_PATH"
|
echo "root=\"$BOOST_ARCH_PATH\""
|
||||||
echo "include=$BOOST_INC_DIR"
|
echo "include=\"$BOOST_INC_DIR\""
|
||||||
echo "library=$BOOST_LIB_DIR"
|
echo "library=\"$BOOST_LIB_DIR\""
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Query settings (from CGAL setup)
|
|
||||||
query_boost()
|
|
||||||
{
|
|
||||||
local config="config.sh/CGAL"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
_process_query boost "$BOOST_ARCH_PATH"
|
|
||||||
else
|
|
||||||
echo "(no $config settings)" 1>&2
|
|
||||||
echo "boost=unknown"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Search
|
||||||
|
# $1 : prefix (*_ARCH_PATH, system, ...)
|
||||||
|
#
|
||||||
# On success, return 0 and export variables
|
# On success, return 0 and export variables
|
||||||
# -> HAVE_BOOST, BOOST_INC_DIR, BOOST_LIB_DIR
|
# -> HAVE_BOOST, BOOST_INC_DIR, BOOST_LIB_DIR
|
||||||
have_boost()
|
search_boost()
|
||||||
{
|
{
|
||||||
local warn # warn="==> skip boost"
|
local warn # warn="==> skip boost"
|
||||||
local config="config.sh/CGAL"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
# Setup - current environment if set
|
|
||||||
if [ -z "$BOOST_ARCH_PATH" ]
|
|
||||||
then
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
else
|
|
||||||
[ -n "$warn" ] && echo "$warn (no $config settings)"
|
|
||||||
return 2
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Expected location, include/library names
|
|
||||||
local prefix="$BOOST_ARCH_PATH"
|
|
||||||
local incName="boost/version.hpp"
|
local incName="boost/version.hpp"
|
||||||
local libName="libboost_system"
|
local libName="libboost_system"
|
||||||
|
|
||||||
|
local prefix="${1:-system}"
|
||||||
local header library
|
local header library
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
@ -138,7 +109,49 @@ have_boost()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Reset variables
|
# Output as per search_* function
|
||||||
|
have_boost()
|
||||||
|
{
|
||||||
|
local warn # warn="==> skip boost"
|
||||||
|
local config="config.sh/CGAL"
|
||||||
|
local file
|
||||||
|
|
||||||
|
# Setup - current environment if set
|
||||||
|
if [ -z "$BOOST_ARCH_PATH" ]
|
||||||
|
then
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
else
|
||||||
|
[ -n "$warn" ] && echo "$warn (no $config)"
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
search_boost "$BOOST_ARCH_PATH"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Query settings (from CGAL setup)
|
||||||
|
query_boost()
|
||||||
|
{
|
||||||
|
local config="config.sh/CGAL"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
_process_query boost "$BOOST_ARCH_PATH"
|
||||||
|
else
|
||||||
|
echo "(no $config)" 1>&2
|
||||||
|
echo "boost=unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Reset
|
||||||
no_boost
|
no_boost
|
||||||
|
|
||||||
# Test/query
|
# Test/query
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
# config.sh/ccmio
|
# config.sh/ccmio
|
||||||
#
|
#
|
||||||
# Functions provided
|
# Functions provided
|
||||||
# have_ccmio, no_ccmio, echo_ccmio, query_ccmio
|
# have_ccmio, no_ccmio, echo_ccmio, query_ccmio, search_ccmio
|
||||||
#
|
#
|
||||||
# Variables set on success
|
# Variables set on success
|
||||||
# HAVE_CCMIO
|
# HAVE_CCMIO
|
||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Reset variables
|
# Reset
|
||||||
no_ccmio()
|
no_ccmio()
|
||||||
{
|
{
|
||||||
unset HAVE_CCMIO CCMIO_INC_DIR CCMIO_LIB_DIR
|
unset HAVE_CCMIO CCMIO_INC_DIR CCMIO_LIB_DIR
|
||||||
@ -44,50 +44,25 @@ no_ccmio()
|
|||||||
echo_ccmio()
|
echo_ccmio()
|
||||||
{
|
{
|
||||||
echo "ccmio=${HAVE_CCMIO:-false}"
|
echo "ccmio=${HAVE_CCMIO:-false}"
|
||||||
echo "root=$CCMIO_ARCH_PATH"
|
echo "root=\"$CCMIO_ARCH_PATH\""
|
||||||
echo "include=$CCMIO_INC_DIR"
|
echo "include=\"$CCMIO_INC_DIR\""
|
||||||
echo "library=$CCMIO_LIB_DIR"
|
echo "library=\"$CCMIO_LIB_DIR\""
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Query settings
|
|
||||||
query_ccmio()
|
|
||||||
{
|
|
||||||
local config="config.sh/ccmio"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
_process_query ccmio "$CCMIO_ARCH_PATH"
|
|
||||||
else
|
|
||||||
echo "(no $config settings)" 1>&2
|
|
||||||
echo "ccmio=unknown"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Search
|
||||||
|
# $1 : prefix (*_ARCH_PATH, system, ...)
|
||||||
|
#
|
||||||
# On success, return 0 and export variables
|
# On success, return 0 and export variables
|
||||||
# -> HAVE_CCMIO, CCMIO_INC_DIR, CCMIO_LIB_DIR
|
# -> HAVE_CCMIO, CCMIO_INC_DIR, CCMIO_LIB_DIR
|
||||||
have_ccmio()
|
search_ccmio()
|
||||||
{
|
{
|
||||||
local warn="==> skip ccmio"
|
local warn="==> skip ccmio"
|
||||||
local config="config.sh/ccmio"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
else
|
|
||||||
[ -n "$warn" ] && echo "$warn (no $config settings)"
|
|
||||||
return 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Expected location, include/library names
|
|
||||||
# Link with static libccmio only (fewer issues)
|
|
||||||
local prefix="$CCMIO_ARCH_PATH"
|
|
||||||
local incName="libccmio/ccmio.h"
|
local incName="libccmio/ccmio.h"
|
||||||
local libName="libccmio.a"
|
local libName="libccmio.a"
|
||||||
|
# Link with static libccmio only (fewer issues)
|
||||||
|
|
||||||
|
local prefix="${1:-system}"
|
||||||
local header library
|
local header library
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
@ -153,7 +128,45 @@ have_ccmio()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Reset variables
|
# Output as per search_* function
|
||||||
|
have_ccmio()
|
||||||
|
{
|
||||||
|
local warn="==> skip ccmio"
|
||||||
|
local config="config.sh/ccmio"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
else
|
||||||
|
[ -n "$warn" ] && echo "$warn (no $config)"
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
search_ccmio "$CCMIO_ARCH_PATH"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Query settings
|
||||||
|
query_ccmio()
|
||||||
|
{
|
||||||
|
local config="config.sh/ccmio"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
_process_query ccmio "$CCMIO_ARCH_PATH"
|
||||||
|
else
|
||||||
|
echo "(no $config)" 1>&2
|
||||||
|
echo "ccmio=unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Reset
|
||||||
no_ccmio
|
no_ccmio
|
||||||
|
|
||||||
# Test/query
|
# Test/query
|
||||||
|
|||||||
@ -25,19 +25,23 @@
|
|||||||
#
|
#
|
||||||
# Variables set on success
|
# Variables set on success
|
||||||
# HAVE_CGAL
|
# HAVE_CGAL
|
||||||
|
# CGAL_FLAVOUR (header, library, ...)
|
||||||
# CGAL_ARCH_PATH
|
# CGAL_ARCH_PATH
|
||||||
# CGAL_INC_DIR
|
# CGAL_INC_DIR
|
||||||
# CGAL_LIB_DIR
|
# CGAL_LIB_DIR
|
||||||
#
|
#
|
||||||
|
# Uses
|
||||||
|
# BOOST_ARCH_PATH and have_boost::search_boost()
|
||||||
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions # General system functions
|
. ${WM_PROJECT_DIR:?}/wmake/scripts/have_boost # boost + system functions
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Reset variables
|
# Reset
|
||||||
no_cgal()
|
no_cgal()
|
||||||
{
|
{
|
||||||
unset HAVE_CGAL CGAL_INC_DIR CGAL_LIB_DIR
|
unset HAVE_CGAL CGAL_FLAVOUR CGAL_INC_DIR CGAL_LIB_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -45,54 +49,26 @@ no_cgal()
|
|||||||
echo_cgal()
|
echo_cgal()
|
||||||
{
|
{
|
||||||
echo "cgal=${HAVE_CGAL:-false}"
|
echo "cgal=${HAVE_CGAL:-false}"
|
||||||
echo "root=$CGAL_ARCH_PATH"
|
echo "flavour=$CGAL_FLAVOUR"
|
||||||
echo "include=$CGAL_INC_DIR"
|
echo "root=\"$CGAL_ARCH_PATH\""
|
||||||
echo "library=$CGAL_LIB_DIR"
|
echo "include=\"$CGAL_INC_DIR\""
|
||||||
}
|
echo "library=\"$CGAL_LIB_DIR\""
|
||||||
|
|
||||||
|
|
||||||
# Query settings (from CGAL setup)
|
|
||||||
query_cgal()
|
|
||||||
{
|
|
||||||
local config="config.sh/CGAL"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
_process_query cgal "$CGAL_ARCH_PATH"
|
|
||||||
else
|
|
||||||
echo "(no $config settings)" 1>&2
|
|
||||||
echo "cgal=unknown"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Search
|
||||||
|
# $1 : prefix (*_ARCH_PATH, system, ...)
|
||||||
|
#
|
||||||
# On success, return 0 and export variables
|
# On success, return 0 and export variables
|
||||||
# -> HAVE_CGAL, CGAL_INC_DIR, CGAL_LIB_DIR
|
# -> HAVE_CGAL, CGAL_INC_DIR, CGAL_LIB_DIR, CGAL_FLAVOUR
|
||||||
have_cgal()
|
search_cgal()
|
||||||
{
|
{
|
||||||
local warn # warn="==> skip cgal"
|
local warn # warn="==> skip cgal"
|
||||||
local config="config.sh/CGAL"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
# Setup - current environment if set
|
|
||||||
if [ -z "$CGAL_ARCH_PATH" ]
|
|
||||||
then
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
else
|
|
||||||
[ -n "$warn" ] && echo "$warn (no $config settings)"
|
|
||||||
return 2
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Expected location, include/library names
|
|
||||||
local prefix="$CGAL_ARCH_PATH"
|
|
||||||
local incName="CGAL/version.h"
|
local incName="CGAL/version.h"
|
||||||
local libName="libCGAL"
|
local libName="libCGAL"
|
||||||
local header library
|
|
||||||
|
local prefix="${1:-system}"
|
||||||
|
local header library flavour
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
if isNone "$prefix"
|
if isNone "$prefix"
|
||||||
@ -118,12 +94,13 @@ have_cgal()
|
|||||||
return 2
|
return 2
|
||||||
}
|
}
|
||||||
|
|
||||||
# Library
|
# Library may be optional - eg, header-only
|
||||||
[ -n "$library" ] \
|
[ -n "$library" ] \
|
||||||
|| library=$(findLibrary -prefix="$prefix" -name="$libName") \
|
|| library=$(findLibrary -prefix="$prefix" -name="$libName") \
|
||||||
|| {
|
|| {
|
||||||
[ -n "$warn" ] && echo "$warn (no library)"
|
[ -n "$warn" ] && echo "==> cgal (no library)"
|
||||||
return 2
|
unset library
|
||||||
|
flavour="header" # Header only
|
||||||
}
|
}
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
@ -132,13 +109,59 @@ have_cgal()
|
|||||||
|
|
||||||
# OK
|
# OK
|
||||||
export HAVE_CGAL=true
|
export HAVE_CGAL=true
|
||||||
|
export CGAL_FLAVOUR="${flavour:-library}"
|
||||||
export CGAL_ARCH_PATH="$prefix"
|
export CGAL_ARCH_PATH="$prefix"
|
||||||
export CGAL_INC_DIR="${header%/*}" # Basename
|
export CGAL_INC_DIR="${header%/*}" # Basename
|
||||||
export CGAL_LIB_DIR="${library%/*}" # Basename
|
export CGAL_LIB_DIR="${library%/*}" # Basename
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Reset variables
|
# Output as per search_* function
|
||||||
|
have_cgal()
|
||||||
|
{
|
||||||
|
local warn # warn="==> skip cgal"
|
||||||
|
local config="config.sh/CGAL"
|
||||||
|
local file
|
||||||
|
|
||||||
|
# Setup - current environment if set
|
||||||
|
if [ -z "$CGAL_ARCH_PATH" ]
|
||||||
|
then
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
else
|
||||||
|
[ -n "$warn" ] && echo "$warn (no $config)"
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Need boost for cgal
|
||||||
|
search_boost "$BOOST_ARCH_PATH"
|
||||||
|
|
||||||
|
search_cgal "$CGAL_ARCH_PATH"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Query settings (from CGAL setup)
|
||||||
|
query_cgal()
|
||||||
|
{
|
||||||
|
local config="config.sh/CGAL"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
_process_query cgal "$CGAL_ARCH_PATH"
|
||||||
|
else
|
||||||
|
echo "(no $config)" 1>&2
|
||||||
|
echo "cgal=unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Reset
|
||||||
no_cgal
|
no_cgal
|
||||||
|
|
||||||
# Test/query
|
# Test/query
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
# CMAKE_ARCH_PATH that may specify a possible cmake/bin directory.
|
# CMAKE_ARCH_PATH that may specify a possible cmake/bin directory.
|
||||||
#
|
#
|
||||||
# Functions provided
|
# Functions provided
|
||||||
# have_cmake, no_cmake, echo_cmake
|
# have_cmake, no_cmake, echo_cmake, search_cmake
|
||||||
#
|
#
|
||||||
# Variables set on success
|
# Variables set on success
|
||||||
# HAVE_CMAKE
|
# HAVE_CMAKE
|
||||||
@ -32,10 +32,10 @@
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Reset variables
|
# Reset
|
||||||
no_cmake()
|
no_cmake()
|
||||||
{
|
{
|
||||||
unset HAVE_CMAKE CMAKE_EXE
|
unset HAVE_CMAKE CMAKE_EXE CMAKE_ARCH_PATH
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -47,13 +47,49 @@ echo_cmake()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Search
|
||||||
|
# $1 : prefix (*_ARCH_PATH, system, ...)
|
||||||
#
|
#
|
||||||
# Try to locate cmake according to values specified in <etc/config.sh/cmake>
|
# Locate cmake according to values specified in <etc/config.sh/cmake>
|
||||||
# or just use what is found on the path.
|
# or just use what is found on the path.
|
||||||
#
|
#
|
||||||
# On success: return the resolved value as output.
|
# On success: return the resolved value as output.
|
||||||
# On failure: set executable as "false" and return with 1
|
# On failure: set executable as "false" and return with 1
|
||||||
#
|
search_cmake()
|
||||||
|
{
|
||||||
|
# Treat previous queries as "sticky"
|
||||||
|
if [ -n "$CMAKE_EXE" ]
|
||||||
|
then
|
||||||
|
test "$CMAKE_EXE" != "false"
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
local prefix="${1:-/usr}"
|
||||||
|
local candidate="$prefix"/bin/cmake
|
||||||
|
local foundExe
|
||||||
|
|
||||||
|
if [ -f "$candidate" ] && [ -x "$candidate" ]
|
||||||
|
then
|
||||||
|
foundExe="$candidate"
|
||||||
|
elif candidate="$(command -v cmake 2>/dev/null)"
|
||||||
|
then
|
||||||
|
# Resolved from PATH
|
||||||
|
foundExe="$candidate"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$foundExe" ]
|
||||||
|
then
|
||||||
|
export CMAKE_EXE="false" # Avoid repeated calls?
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# OK
|
||||||
|
export HAVE_CMAKE=true
|
||||||
|
export CMAKE_EXE="$foundExe"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Output as per search_* function
|
||||||
have_cmake()
|
have_cmake()
|
||||||
{
|
{
|
||||||
# Treat previous queries as "sticky"
|
# Treat previous queries as "sticky"
|
||||||
@ -64,48 +100,22 @@ have_cmake()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
local config="config.sh/cmake"
|
local config="config.sh/cmake"
|
||||||
|
local file
|
||||||
unset CMAKE_ARCH_PATH
|
unset CMAKE_ARCH_PATH
|
||||||
local settings candidate foundExe
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config" 2>/dev/null)"
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config" 2>/dev/null)"
|
||||||
then
|
then
|
||||||
. "$settings"
|
. "$file"
|
||||||
|
|
||||||
if [ -d "$CMAKE_ARCH_PATH" ]
|
|
||||||
then
|
|
||||||
candidate="$CMAKE_ARCH_PATH"/bin/cmake
|
|
||||||
if [ -f "$candidate" ] && [ -x "$candidate" ]
|
|
||||||
then
|
|
||||||
foundExe="$candidate"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$foundExe" ]
|
search_cmake "$CMAKE_ARCH_PATH"
|
||||||
then
|
|
||||||
# Default: resolve from PATH
|
|
||||||
if candidate="$(command -v cmake 2>/dev/null)"
|
|
||||||
then
|
|
||||||
foundExe="$candidate"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$foundExe" ]
|
|
||||||
then
|
|
||||||
# OK
|
|
||||||
export HAVE_CMAKE=true
|
|
||||||
export CMAKE_EXE="$foundExe"
|
|
||||||
else
|
|
||||||
# Failure
|
|
||||||
export CMAKE_EXE="false" # Avoid repeated calls?
|
|
||||||
return 2
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Reset variables
|
#------------------------------------------------------------------------------
|
||||||
no_cmake
|
|
||||||
|
|
||||||
|
# Reset
|
||||||
|
no_cmake
|
||||||
|
|
||||||
# Test/query
|
# Test/query
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -118,5 +128,4 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
# or config.sh/FFTW (when FFTW_ARCH_PATH is empty)
|
# or config.sh/FFTW (when FFTW_ARCH_PATH is empty)
|
||||||
#
|
#
|
||||||
# Functions provided
|
# Functions provided
|
||||||
# have_fftw, no_fftw, echo_fftw, query_fftw
|
# have_fftw, no_fftw, echo_fftw, query_fftw, search_fftw
|
||||||
#
|
#
|
||||||
# Variables set on success
|
# Variables set on success
|
||||||
# HAVE_FFTW
|
# HAVE_FFTW
|
||||||
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Reset variables
|
# Reset
|
||||||
no_fftw()
|
no_fftw()
|
||||||
{
|
{
|
||||||
unset HAVE_FFTW FFTW_INC_DIR FFTW_LIB_DIR
|
unset HAVE_FFTW FFTW_INC_DIR FFTW_LIB_DIR
|
||||||
@ -45,53 +45,25 @@ no_fftw()
|
|||||||
echo_fftw()
|
echo_fftw()
|
||||||
{
|
{
|
||||||
echo "fftw=${HAVE_FFTW:-false}"
|
echo "fftw=${HAVE_FFTW:-false}"
|
||||||
echo "root=$FFTW_ARCH_PATH"
|
echo "root=\"$FFTW_ARCH_PATH\""
|
||||||
echo "include=$FFTW_INC_DIR"
|
echo "include=\"$FFTW_INC_DIR\""
|
||||||
echo "library=$FFTW_LIB_DIR"
|
echo "library=\"$FFTW_LIB_DIR\""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Query settings
|
|
||||||
query_fftw()
|
|
||||||
{
|
|
||||||
local config="config.sh/FFTW"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
_process_query fftw "$FFTW_ARCH_PATH"
|
|
||||||
else
|
|
||||||
echo "(no $config settings)" 1>&2
|
|
||||||
echo "fftw=unknown"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
# Search
|
||||||
|
# $1 : prefix (*_ARCH_PATH, system, ...)
|
||||||
|
#
|
||||||
# On success, return 0 and export variables
|
# On success, return 0 and export variables
|
||||||
# -> HAVE_FFTW, FFTW_INC_DIR, FFTW_LIB_DIR
|
# -> HAVE_FFTW, FFTW_INC_DIR, FFTW_LIB_DIR
|
||||||
have_fftw()
|
search_fftw()
|
||||||
{
|
{
|
||||||
local warn # warn="==> skip fftw"
|
local warn # warn="==> skip fftw"
|
||||||
local config="config.sh/FFTW"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
# Setup - current environment if set
|
|
||||||
if [ -z "$FFTW_ARCH_PATH" ]
|
|
||||||
then
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
else
|
|
||||||
[ -n "$warn" ] && echo "$warn (no $config settings)"
|
|
||||||
return 2
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Expected location, include/library names
|
|
||||||
local prefix="$FFTW_ARCH_PATH"
|
|
||||||
local incName="fftw3.h"
|
local incName="fftw3.h"
|
||||||
local libName="libfftw3"
|
local libName="libfftw3"
|
||||||
|
|
||||||
|
local prefix="${1:-system}"
|
||||||
local header library
|
local header library
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
@ -136,7 +108,49 @@ have_fftw()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Reset variables
|
# Output as per search_* function
|
||||||
|
have_fftw()
|
||||||
|
{
|
||||||
|
local warn # warn="==> skip fftw"
|
||||||
|
local config="config.sh/FFTW"
|
||||||
|
local file
|
||||||
|
|
||||||
|
# Setup - current environment if set
|
||||||
|
if [ -z "$FFTW_ARCH_PATH" ]
|
||||||
|
then
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
else
|
||||||
|
[ -n "$warn" ] && echo "$warn (no $config)"
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
search_fftw "$FFTW_ARCH_PATH"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Query settings
|
||||||
|
query_fftw()
|
||||||
|
{
|
||||||
|
local config="config.sh/FFTW"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
_process_query fftw "$FFTW_ARCH_PATH"
|
||||||
|
else
|
||||||
|
echo "(no $config)" 1>&2
|
||||||
|
echo "fftw=unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Reset
|
||||||
no_fftw
|
no_fftw
|
||||||
|
|
||||||
# Test/query
|
# Test/query
|
||||||
|
|||||||
@ -21,7 +21,8 @@
|
|||||||
# or config.sh/hypre
|
# or config.sh/hypre
|
||||||
#
|
#
|
||||||
# Functions provided
|
# Functions provided
|
||||||
# have_hypre, no_hypre, echo_hypre, query_hypre
|
# have_hypre, no_hypre, echo_hypre, query_hypre, search_hypre
|
||||||
|
# hint_hypre
|
||||||
#
|
#
|
||||||
# Variables set on success
|
# Variables set on success
|
||||||
# HAVE_HYPRE
|
# HAVE_HYPRE
|
||||||
@ -34,7 +35,7 @@
|
|||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Reset variables
|
# Reset
|
||||||
no_hypre()
|
no_hypre()
|
||||||
{
|
{
|
||||||
unset HAVE_HYPRE HYPRE_INC_DIR HYPRE_LIB_DIR
|
unset HAVE_HYPRE HYPRE_INC_DIR HYPRE_LIB_DIR
|
||||||
@ -45,53 +46,38 @@ no_hypre()
|
|||||||
echo_hypre()
|
echo_hypre()
|
||||||
{
|
{
|
||||||
echo "hypre=${HAVE_HYPRE:-false}"
|
echo "hypre=${HAVE_HYPRE:-false}"
|
||||||
echo "root=$HYPRE_ARCH_PATH"
|
echo "root=\"$HYPRE_ARCH_PATH\""
|
||||||
echo "include=$HYPRE_INC_DIR"
|
echo "include=\"$HYPRE_INC_DIR\""
|
||||||
echo "library=$HYPRE_LIB_DIR"
|
echo "library=\"$HYPRE_LIB_DIR\""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Query settings
|
# Hint for enabling
|
||||||
query_hypre()
|
hint_hypre()
|
||||||
{
|
{
|
||||||
local config="config.sh/hypre"
|
/bin/cat<<INFORMATION 1>&2
|
||||||
local settings
|
==> hypre not found?
|
||||||
|
Define manually, enable in OpenFOAM etc/bashrc, or try the following [POSIX]:
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
eval \$(foamEtcFile -sh -config hypre -- -force)
|
||||||
then
|
|
||||||
. "$settings"
|
==
|
||||||
_process_query hypre "$HYPRE_ARCH_PATH"
|
INFORMATION
|
||||||
else
|
|
||||||
echo "(no $config settings)" 1>&2
|
|
||||||
echo "hypre=unknown"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Search
|
||||||
|
# $1 : prefix (*_ARCH_PATH, system, ...)
|
||||||
|
#
|
||||||
# On success, return 0 and export variables
|
# On success, return 0 and export variables
|
||||||
# -> HAVE_HYPRE, HYPRE_INC_DIR, HYPRE_LIB_DIR
|
# -> HAVE_HYPRE, HYPRE_INC_DIR, HYPRE_LIB_DIR
|
||||||
have_hypre()
|
search_hypre()
|
||||||
{
|
{
|
||||||
local warn="==> skip hypre"
|
local warn="==> skip hypre"
|
||||||
local config="config.sh/hypre"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
# Setup - prefer current environment value? (TDB)
|
|
||||||
if [ ! -d "$HYPRE_ARCH_PATH" ]
|
|
||||||
then
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
else
|
|
||||||
[ -n "$warn" ] && echo "$warn (no $config settings)"
|
|
||||||
return 2
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Expected location, include/library names
|
|
||||||
local prefix="$HYPRE_ARCH_PATH"
|
|
||||||
local incName="HYPRE.h"
|
local incName="HYPRE.h"
|
||||||
local libName="libHYPRE"
|
local libName="libHYPRE"
|
||||||
|
|
||||||
|
local prefix="${1:-system}"
|
||||||
local header library
|
local header library
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
@ -136,7 +122,52 @@ have_hypre()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Reset variables
|
# Output as per search_* function
|
||||||
|
have_hypre()
|
||||||
|
{
|
||||||
|
local warn="==> skip hypre"
|
||||||
|
local config="config.sh/hypre"
|
||||||
|
local file
|
||||||
|
|
||||||
|
# Setup - prefer current environment value
|
||||||
|
if [ -d "$HYPRE_ARCH_PATH" ] || [ "$HYPRE_ARCH_PATH" = system ]
|
||||||
|
then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
# Use config file
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
else
|
||||||
|
[ -n "$warn" ] && echo "$warn (no $config)"
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
search_hypre "$HYPRE_ARCH_PATH"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Query settings
|
||||||
|
query_hypre()
|
||||||
|
{
|
||||||
|
local config="config.sh/hypre"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
_process_query hypre "$HYPRE_ARCH_PATH"
|
||||||
|
else
|
||||||
|
echo "(no $config)" 1>&2
|
||||||
|
echo "hypre=unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Reset
|
||||||
no_hypre
|
no_hypre
|
||||||
|
|
||||||
# Test/query
|
# Test/query
|
||||||
@ -148,6 +179,9 @@ case "$1" in
|
|||||||
-query)
|
-query)
|
||||||
query_hypre
|
query_hypre
|
||||||
;;
|
;;
|
||||||
|
-hint)
|
||||||
|
hint_hypre
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
# config.sh/kahip
|
# config.sh/kahip
|
||||||
#
|
#
|
||||||
# Functions provided
|
# Functions provided
|
||||||
# have_kahip, no_kahip, echo_kahip, query_kahip
|
# have_kahip, no_kahip, echo_kahip, query_kahip, search_kahip
|
||||||
#
|
#
|
||||||
# Variables set on success
|
# Variables set on success
|
||||||
# HAVE_KAHIP
|
# HAVE_KAHIP
|
||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Reset variables
|
# Reset
|
||||||
no_kahip()
|
no_kahip()
|
||||||
{
|
{
|
||||||
unset HAVE_KAHIP KAHIP_ARCH_PATH KAHIP_INC_DIR KAHIP_LIB_DIR
|
unset HAVE_KAHIP KAHIP_ARCH_PATH KAHIP_INC_DIR KAHIP_LIB_DIR
|
||||||
@ -45,49 +45,24 @@ no_kahip()
|
|||||||
echo_kahip()
|
echo_kahip()
|
||||||
{
|
{
|
||||||
echo "kahip=${HAVE_KAHIP:-false}"
|
echo "kahip=${HAVE_KAHIP:-false}"
|
||||||
echo "root=$KAHIP_ARCH_PATH"
|
echo "root=\"$KAHIP_ARCH_PATH\""
|
||||||
echo "include=$KAHIP_INC_DIR"
|
echo "include=\"$KAHIP_INC_DIR\""
|
||||||
echo "library=$KAHIP_LIB_DIR"
|
echo "library=\"$KAHIP_LIB_DIR\""
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Query settings
|
|
||||||
query_kahip()
|
|
||||||
{
|
|
||||||
local config="config.sh/kahip"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
_process_query kahip "$KAHIP_ARCH_PATH"
|
|
||||||
else
|
|
||||||
echo "(no $config settings)" 1>&2
|
|
||||||
echo "kahip=unknown"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Search
|
||||||
|
# $1 : prefix (*_ARCH_PATH, system, ...)
|
||||||
|
#
|
||||||
# On success, return 0 and export variables
|
# On success, return 0 and export variables
|
||||||
# -> HAVE_KAHIP, KAHIP_ARCH_PATH, KAHIP_INC_DIR, KAHIP_LIB_DIR
|
# -> HAVE_KAHIP, KAHIP_ARCH_PATH, KAHIP_INC_DIR, KAHIP_LIB_DIR
|
||||||
have_kahip()
|
search_kahip()
|
||||||
{
|
{
|
||||||
local warn="==> skip kahip"
|
local warn="==> skip kahip"
|
||||||
local config="config.sh/kahip"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
else
|
|
||||||
[ -n "$warn" ] && echo "$warn (no $config settings)"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Expected location, include/library names
|
|
||||||
local prefix="$KAHIP_ARCH_PATH"
|
|
||||||
local incName="kaHIP_interface.h"
|
local incName="kaHIP_interface.h"
|
||||||
local libName="libkahip"
|
local libName="libkahip"
|
||||||
|
|
||||||
|
local prefix="${1:-system}"
|
||||||
local header library
|
local header library
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
@ -124,7 +99,7 @@ have_kahip()
|
|||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
|
|
||||||
# kahip itself is 32-bit int, but our interface itself handles some
|
# kahip itself is 32-bit int, but our interface handles some
|
||||||
# 64-bit conversion (mesh size).
|
# 64-bit conversion (mesh size).
|
||||||
|
|
||||||
echo "kahip (label=32) - $prefix"
|
echo "kahip (label=32) - $prefix"
|
||||||
@ -135,7 +110,45 @@ have_kahip()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Reset variables
|
# Output as per search_* function
|
||||||
|
have_kahip()
|
||||||
|
{
|
||||||
|
local warn="==> skip kahip"
|
||||||
|
local config="config.sh/kahip"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
else
|
||||||
|
[ -n "$warn" ] && echo "$warn (no $config)"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
search_kahip "$KAHIP_ARCH_PATH"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Query settings
|
||||||
|
query_kahip()
|
||||||
|
{
|
||||||
|
local config="config.sh/kahip"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
_process_query kahip "$KAHIP_ARCH_PATH"
|
||||||
|
else
|
||||||
|
echo "(no $config)" 1>&2
|
||||||
|
echo "kahip=unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Reset
|
||||||
no_kahip
|
no_kahip
|
||||||
|
|
||||||
# Test/query
|
# Test/query
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
# config.sh/metis
|
# config.sh/metis
|
||||||
#
|
#
|
||||||
# Functions provided
|
# Functions provided
|
||||||
# have_metis, no_metis, echo_metis, query_metis
|
# have_metis, no_metis, echo_metis, query_metis, search_metis
|
||||||
#
|
#
|
||||||
# Variables set on success
|
# Variables set on success
|
||||||
# HAVE_METIS
|
# HAVE_METIS
|
||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Reset variables
|
# Reset
|
||||||
no_metis()
|
no_metis()
|
||||||
{
|
{
|
||||||
unset HAVE_METIS METIS_ARCH_PATH METIS_INC_DIR METIS_LIB_DIR
|
unset HAVE_METIS METIS_ARCH_PATH METIS_INC_DIR METIS_LIB_DIR
|
||||||
@ -45,49 +45,24 @@ no_metis()
|
|||||||
echo_metis()
|
echo_metis()
|
||||||
{
|
{
|
||||||
echo "metis=${HAVE_METIS:-false}"
|
echo "metis=${HAVE_METIS:-false}"
|
||||||
echo "root=$METIS_ARCH_PATH"
|
echo "root=\"$METIS_ARCH_PATH\""
|
||||||
echo "include=$METIS_INC_DIR"
|
echo "include=\"$METIS_INC_DIR\""
|
||||||
echo "library=$METIS_LIB_DIR"
|
echo "library=\"$METIS_LIB_DIR\""
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Query settings
|
|
||||||
query_metis()
|
|
||||||
{
|
|
||||||
local config="config.sh/metis"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
_process_query metis "$METIS_ARCH_PATH"
|
|
||||||
else
|
|
||||||
echo "(no $config settings)" 1>&2
|
|
||||||
echo "metis=unknown"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Search
|
||||||
|
# $1 : prefix (*_ARCH_PATH, system, ...)
|
||||||
|
#
|
||||||
# On success, return 0 and export variables
|
# On success, return 0 and export variables
|
||||||
# -> HAVE_METIS, METIS_ARCH_PATH, METIS_INC_DIR, METIS_LIB_DIR
|
# -> HAVE_METIS, METIS_ARCH_PATH, METIS_INC_DIR, METIS_LIB_DIR
|
||||||
have_metis()
|
search_metis()
|
||||||
{
|
{
|
||||||
local warn="==> skip metis"
|
local warn="==> skip metis"
|
||||||
local config="config.sh/metis"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
else
|
|
||||||
[ -n "$warn" ] && echo "$warn (no $config settings)"
|
|
||||||
return 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Expected location, include/library names
|
|
||||||
local prefix="$METIS_ARCH_PATH"
|
|
||||||
local incName="metis.h"
|
local incName="metis.h"
|
||||||
local libName="libmetis"
|
local libName="libmetis"
|
||||||
|
|
||||||
|
local prefix="${1:-system}"
|
||||||
local header library
|
local header library
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
@ -142,6 +117,44 @@ have_metis()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Output as per search_* function
|
||||||
|
have_metis()
|
||||||
|
{
|
||||||
|
local warn="==> skip metis"
|
||||||
|
local config="config.sh/metis"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
else
|
||||||
|
[ -n "$warn" ] && echo "$warn (no $config)"
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
search_metis "$METIS_ARCH_PATH"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Query settings
|
||||||
|
query_metis()
|
||||||
|
{
|
||||||
|
local config="config.sh/metis"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
_process_query metis "$METIS_ARCH_PATH"
|
||||||
|
else
|
||||||
|
echo "(no $config)" 1>&2
|
||||||
|
echo "metis=unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Reset variables
|
# Reset variables
|
||||||
no_metis
|
no_metis
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
# config.sh/mgridgen
|
# config.sh/mgridgen
|
||||||
#
|
#
|
||||||
# Functions provided
|
# Functions provided
|
||||||
# have_mgridgen, no_mgridgen, echo_mgridgen, query_mgridgen
|
# have_mgridgen, no_mgridgen, echo_mgridgen, query_mgridgen, search_mgridgen
|
||||||
#
|
#
|
||||||
# Variables set on success
|
# Variables set on success
|
||||||
# HAVE_MGRIDGEN
|
# HAVE_MGRIDGEN
|
||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Reset variables
|
# Reset
|
||||||
no_mgridgen()
|
no_mgridgen()
|
||||||
{
|
{
|
||||||
unset HAVE_MGRIDGEN MGRIDGEN_ARCH_PATH MGRIDGEN_INC_DIR MGRIDGEN_LIB_DIR
|
unset HAVE_MGRIDGEN MGRIDGEN_ARCH_PATH MGRIDGEN_INC_DIR MGRIDGEN_LIB_DIR
|
||||||
@ -45,50 +45,25 @@ no_mgridgen()
|
|||||||
echo_mgridgen()
|
echo_mgridgen()
|
||||||
{
|
{
|
||||||
echo "mgridgen=${HAVE_MGRIDGEN:-false}"
|
echo "mgridgen=${HAVE_MGRIDGEN:-false}"
|
||||||
echo "root=$MGRIDGEN_ARCH_PATH"
|
echo "root=\"$MGRIDGEN_ARCH_PATH\""
|
||||||
echo "include=$MGRIDGEN_INC_DIR"
|
echo "include=\"$MGRIDGEN_INC_DIR\""
|
||||||
echo "library=$MGRIDGEN_LIB_DIR"
|
echo "library=\"$MGRIDGEN_LIB_DIR\""
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Query settings
|
|
||||||
query_mgridgen()
|
|
||||||
{
|
|
||||||
local config="config.sh/mgridgen"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
_process_query mgridgen "$MGRIDGEN_ARCH_PATH"
|
|
||||||
else
|
|
||||||
echo "(no $config settings)" 1>&2
|
|
||||||
echo "mgridgen=unknown"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Search
|
||||||
|
# $1 : prefix (*_ARCH_PATH, system, ...)
|
||||||
|
#
|
||||||
# On success, return 0 and export variables
|
# On success, return 0 and export variables
|
||||||
# -> HAVE_MGRIDGEN, MGRIDGEN_ARCH_PATH, MGRIDGEN_INC_DIR, MGRIDGEN_LIB_DIR
|
# -> HAVE_MGRIDGEN, MGRIDGEN_ARCH_PATH, MGRIDGEN_INC_DIR, MGRIDGEN_LIB_DIR
|
||||||
have_mgridgen()
|
search_mgridgen()
|
||||||
{
|
{
|
||||||
local warn="==> skip mgridgen"
|
local warn="==> skip mgridgen"
|
||||||
local config="config.sh/mgridgen"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
else
|
|
||||||
#silent# [ -n "$warn" ] && echo "$warn (no $config settings)"
|
|
||||||
return 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Expected location, include/library names
|
|
||||||
local prefix="$MGRIDGEN_ARCH_PATH"
|
|
||||||
local incName="mgridgen.h"
|
local incName="mgridgen.h"
|
||||||
local libName="libMGridGen"
|
local libName="libMGridGen"
|
||||||
local libName2="libmgrid"
|
local libName2="libmgrid"
|
||||||
|
|
||||||
|
local prefix="${1:-system}"
|
||||||
local header library
|
local header library
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
@ -177,7 +152,45 @@ have_mgridgen()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Reset variables
|
# Output as per search_* function
|
||||||
|
have_mgridgen()
|
||||||
|
{
|
||||||
|
local warn="==> skip mgridgen"
|
||||||
|
local config="config.sh/mgridgen"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
else
|
||||||
|
#silent# [ -n "$warn" ] && echo "$warn (no $config)"
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
search_mgridgen "$MGRIDGEN_ARCH_PATH"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Query settings
|
||||||
|
query_mgridgen()
|
||||||
|
{
|
||||||
|
local config="config.sh/mgridgen"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
_process_query mgridgen "$MGRIDGEN_ARCH_PATH"
|
||||||
|
else
|
||||||
|
echo "(no $config)" 1>&2
|
||||||
|
echo "mgridgen=unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Reset
|
||||||
no_mgridgen
|
no_mgridgen
|
||||||
|
|
||||||
# Test/query
|
# Test/query
|
||||||
|
|||||||
@ -18,10 +18,12 @@
|
|||||||
#
|
#
|
||||||
# Requires
|
# Requires
|
||||||
# PETSC_ARCH_PATH
|
# PETSC_ARCH_PATH
|
||||||
|
# or PETSC_DIR, PETSC_ARCH
|
||||||
# or config.sh/petsc
|
# or config.sh/petsc
|
||||||
#
|
#
|
||||||
# Functions provided
|
# Functions provided
|
||||||
# have_petsc, no_petsc, echo_petsc, hint_petsc, query_petsc
|
# have_petsc, no_petsc, echo_petsc, query_petsc, search_petsc
|
||||||
|
# hint_petsc
|
||||||
#
|
#
|
||||||
# Variables set on success
|
# Variables set on success
|
||||||
# HAVE_PETSC
|
# HAVE_PETSC
|
||||||
@ -34,7 +36,7 @@
|
|||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Reset variables
|
# Reset
|
||||||
no_petsc()
|
no_petsc()
|
||||||
{
|
{
|
||||||
unset HAVE_PETSC PETSC_INC_DIR PETSC_LIB_DIR
|
unset HAVE_PETSC PETSC_INC_DIR PETSC_LIB_DIR
|
||||||
@ -45,9 +47,9 @@ no_petsc()
|
|||||||
echo_petsc()
|
echo_petsc()
|
||||||
{
|
{
|
||||||
echo "petsc=${HAVE_PETSC:-false}"
|
echo "petsc=${HAVE_PETSC:-false}"
|
||||||
echo "root=$PETSC_ARCH_PATH"
|
echo "root=\"$PETSC_ARCH_PATH\""
|
||||||
echo "include=$PETSC_INC_DIR"
|
echo "include=\"$PETSC_INC_DIR\""
|
||||||
echo "library=$PETSC_LIB_DIR"
|
echo "library=\"$PETSC_LIB_DIR\""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -56,9 +58,7 @@ hint_petsc()
|
|||||||
{
|
{
|
||||||
/bin/cat<<INFORMATION 1>&2
|
/bin/cat<<INFORMATION 1>&2
|
||||||
==> petsc not found?
|
==> petsc not found?
|
||||||
|
Define manually, enable in OpenFOAM etc/bashrc, or try the following [POSIX]:
|
||||||
Enable in the OpenFOAM etc/bashrc, define manually or try with the
|
|
||||||
following (POSIX shell):
|
|
||||||
|
|
||||||
eval \$(foamEtcFile -sh -config petsc -- -force)
|
eval \$(foamEtcFile -sh -config petsc -- -force)
|
||||||
|
|
||||||
@ -67,49 +67,29 @@ INFORMATION
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Query settings
|
|
||||||
query_petsc()
|
|
||||||
{
|
|
||||||
local config="config.sh/petsc"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
_process_query petsc "$PETSC_ARCH_PATH"
|
|
||||||
else
|
|
||||||
echo "(no $config settings)" 1>&2
|
|
||||||
echo "petsc=unknown"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# On success, return 0 and export variables
|
# On success, return 0 and export variables
|
||||||
# -> HAVE_PETSC, PETSC_INC_DIR, PETSC_LIB_DIR
|
# -> HAVE_PETSC, PETSC_INC_DIR, PETSC_LIB_DIR
|
||||||
have_petsc()
|
#
|
||||||
|
# $1 = prefix (eg, PETSC_DIR, PETSC_ARCH_PATH)
|
||||||
|
# $2 = [arch] (eg, PETSC_ARCH)
|
||||||
|
#
|
||||||
|
# Gets ugly with in-source installation.
|
||||||
|
# 1) In the simple case, petsc is installed with --prefix
|
||||||
|
# we find PREFIX/{include,lib}
|
||||||
|
#
|
||||||
|
# 2) With in-source installation,
|
||||||
|
# headers in PETSC_DIR/include and PETSC_DIR/PETSC_ARCH/include
|
||||||
|
# library is PETSC_DIR/PETSC_ARCH/lib*
|
||||||
|
search_petsc()
|
||||||
{
|
{
|
||||||
local warn="==> skip petsc"
|
local warn="==> skip petsc"
|
||||||
local config="config.sh/petsc"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
# Setup - prefer current environment value? (TDB)
|
|
||||||
if [ ! -d "$PETSC_ARCH_PATH" ]
|
|
||||||
then
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
else
|
|
||||||
[ -n "$warn" ] && echo "$warn (no $config settings)"
|
|
||||||
return 2
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Expected location, include/library names
|
|
||||||
local prefix="$PETSC_ARCH_PATH"
|
|
||||||
local incName="petsc.h"
|
local incName="petsc.h"
|
||||||
local libName="libpetsc"
|
local libName="libpetsc"
|
||||||
local pkgName="PETSc"
|
local pkgName="PETSc"
|
||||||
local header library
|
|
||||||
|
local prefix="${1:-system}"
|
||||||
|
local arch="$2"
|
||||||
|
local header library includeDirs libraryDirs
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
if isNone "$prefix"
|
if isNone "$prefix"
|
||||||
@ -128,34 +108,56 @@ have_petsc()
|
|||||||
# No system header, attempt discovery with pkg-config
|
# No system header, attempt discovery with pkg-config
|
||||||
if [ -z "$header" ] && pkg-config --exists "$pkgName" 2>/dev/null
|
if [ -z "$header" ] && pkg-config --exists "$pkgName" 2>/dev/null
|
||||||
then
|
then
|
||||||
header=$(pkg-config --cflags-only-I "$pkgName" | sed -e 's/^-[IL]//')
|
includeDirs=$(pkg-config --cflags-only-I "$pkgName" | sed -e 's/^-[IL]//; s/[ ]-[IL]/ /;')
|
||||||
library=$(pkg-config --libs-only-L "$pkgName" | sed -e 's/^-[IL]//')
|
libraryDirs=$(pkg-config --libs-only-L "$pkgName" | sed -e 's/^-[IL]//; s/[ ]-[IL]/ /;')
|
||||||
|
|
||||||
prefix="${header%/*}" # Basename
|
prefix="${includeDirs% *}" # First entry (ie, split on space)
|
||||||
|
prefix="${prefix%/*}" # Basename
|
||||||
# Artifically adjust names (for later)
|
|
||||||
[ -n "$header" ] && header="$header/$incName"
|
|
||||||
[ -n "$library" ] && library="$library/$libName"
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
unset prefix
|
unset prefix
|
||||||
fi
|
fi
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
|
|
||||||
# Header
|
# Header -> directory
|
||||||
[ -n "$header" ] || {
|
if [ -z "$includeDirs" ]
|
||||||
[ -n "$warn" ] && echo "$warn (no header)"
|
then
|
||||||
return 2
|
includeDirs="${header%/*}" # Basename
|
||||||
}
|
|
||||||
|
|
||||||
# Library
|
# Header
|
||||||
[ -n "$library" ] \
|
[ -n "$header" ] || {
|
||||||
|| library=$(findLibrary -prefix="$prefix" -name="$libName") \
|
[ -n "$warn" ] && echo "$warn (no header)"
|
||||||
|| {
|
return 2
|
||||||
[ -n "$warn" ] && echo "$warn (no library)"
|
}
|
||||||
return 2
|
fi
|
||||||
}
|
|
||||||
|
|
||||||
|
# Library -> directory
|
||||||
|
if [ -z "$libraryDirs" ]
|
||||||
|
then
|
||||||
|
if [ -n "$arch" ] && [ -d "$prefix/$arch" ]
|
||||||
|
then
|
||||||
|
# Prepend with petsc-arch/include
|
||||||
|
if [ -d "$prefix/$arch/include" ]
|
||||||
|
then
|
||||||
|
includeDirs="$prefix/$arch/include${includeDirs:+ }$includeDirs"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Prefer with petsc-arch/lib
|
||||||
|
if [ -z "$library" ]
|
||||||
|
then
|
||||||
|
library=$(findLibrary -prefix="$prefix/$arch" -name="$libName")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ -n "$library" ] \
|
||||||
|
|| library=$(findLibrary -prefix="$prefix" -name="$libName") \
|
||||||
|
|| {
|
||||||
|
[ -n "$warn" ] && echo "$warn (no library)"
|
||||||
|
return 2
|
||||||
|
}
|
||||||
|
|
||||||
|
libraryDirs="${library%/*}" # Basename
|
||||||
|
fi
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
|
|
||||||
# TODO: check size of petsc integer vs label, real vs double?
|
# TODO: check size of petsc integer vs label, real vs double?
|
||||||
@ -163,12 +165,64 @@ have_petsc()
|
|||||||
# OK
|
# OK
|
||||||
export HAVE_PETSC=true
|
export HAVE_PETSC=true
|
||||||
export PETSC_ARCH_PATH="$prefix"
|
export PETSC_ARCH_PATH="$prefix"
|
||||||
export PETSC_INC_DIR="${header%/*}" # Basename
|
export PETSC_INC_DIR="$includeDirs"
|
||||||
export PETSC_LIB_DIR="${library%/*}" # Basename
|
export PETSC_LIB_DIR="$libraryDirs"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Reset variables
|
# On success, return 0 and export variables
|
||||||
|
# -> HAVE_PETSC, PETSC_INC_DIR, PETSC_LIB_DIR
|
||||||
|
have_petsc()
|
||||||
|
{
|
||||||
|
local warn="==> skip petsc"
|
||||||
|
local config="config.sh/petsc"
|
||||||
|
local file
|
||||||
|
|
||||||
|
# Setup - prefer current environment value
|
||||||
|
if [ -d "$PETSC_ARCH_PATH" ] || [ "$PETSC_ARCH_PATH" = system ]
|
||||||
|
then
|
||||||
|
# OpenFOAM prefix naming, possibly with petsc-arch
|
||||||
|
search_petsc "$PETSC_ARCH_PATH" $PETSC_ARCH
|
||||||
|
|
||||||
|
elif [ -d "$PETSC_DIR" ]
|
||||||
|
then
|
||||||
|
# petsc-dir, petsc-arch naming
|
||||||
|
search_petsc "$PETSC_DIR" $PETSC_ARCH
|
||||||
|
|
||||||
|
else
|
||||||
|
# Use config file
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
else
|
||||||
|
[ -n "$warn" ] && echo "$warn (no $config)"
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
|
search_petsc "$PETSC_ARCH_PATH"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Query settings
|
||||||
|
query_petsc()
|
||||||
|
{
|
||||||
|
local config="config.sh/petsc"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
_process_query petsc "$PETSC_ARCH_PATH"
|
||||||
|
else
|
||||||
|
echo "(no $config)" 1>&2
|
||||||
|
echo "petsc=unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Reset
|
||||||
no_petsc
|
no_petsc
|
||||||
|
|
||||||
# Test/query
|
# Test/query
|
||||||
@ -180,6 +234,9 @@ case "$1" in
|
|||||||
-query)
|
-query)
|
||||||
query_petsc
|
query_petsc
|
||||||
;;
|
;;
|
||||||
|
-hint)
|
||||||
|
hint_petsc
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
# None
|
# None
|
||||||
#
|
#
|
||||||
# Functions provided
|
# Functions provided
|
||||||
# have_readline, no_readline, echo_readline
|
# have_readline, no_readline, echo_readline, search_readline
|
||||||
#
|
#
|
||||||
# Variables set on success
|
# Variables set on success
|
||||||
# HAVE_LIBREADLINE - as per GNU autoconf
|
# HAVE_LIBREADLINE - as per GNU autoconf
|
||||||
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Reset variables
|
# Reset
|
||||||
no_readline()
|
no_readline()
|
||||||
{
|
{
|
||||||
unset HAVE_LIBREADLINE READLINE_INC_DIR READLINE_LIB_DIR
|
unset HAVE_LIBREADLINE READLINE_INC_DIR READLINE_LIB_DIR
|
||||||
@ -43,22 +43,23 @@ no_readline()
|
|||||||
echo_readline()
|
echo_readline()
|
||||||
{
|
{
|
||||||
echo "readline=${HAVE_LIBREADLINE:-false}"
|
echo "readline=${HAVE_LIBREADLINE:-false}"
|
||||||
echo "include=$READLINE_INC_DIR"
|
echo "include=\"$READLINE_INC_DIR\""
|
||||||
echo "library=$READLINE_LIB_DIR"
|
echo "library=\"$READLINE_LIB_DIR\""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Search
|
||||||
|
# $1 : prefix (*_ARCH_PATH, system, ...)
|
||||||
|
#
|
||||||
# On success, return 0 and export variables
|
# On success, return 0 and export variables
|
||||||
# -> HAVE_LIBREADLINE, READLINE_INC_DIR, READLINE_LIB_DIR
|
# -> HAVE_LIBREADLINE, READLINE_INC_DIR, READLINE_LIB_DIR
|
||||||
have_readline()
|
search_readline()
|
||||||
{
|
{
|
||||||
local warn # warn="==> skip readline"
|
local warn # warn="==> skip readline"
|
||||||
local settings
|
|
||||||
|
|
||||||
# Expected location, include/library names
|
|
||||||
local prefix=system
|
|
||||||
local incName="readline/readline.h"
|
local incName="readline/readline.h"
|
||||||
local libName="libreadline"
|
local libName="libreadline"
|
||||||
|
|
||||||
|
local prefix="${1:-system}"
|
||||||
local header library
|
local header library
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
@ -104,7 +105,16 @@ have_readline()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Reset variables
|
# Output as per search_* function
|
||||||
|
have_readline()
|
||||||
|
{
|
||||||
|
search_readline system
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Reset
|
||||||
no_readline
|
no_readline
|
||||||
|
|
||||||
# Test/query
|
# Test/query
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
# config.sh/scotch
|
# config.sh/scotch
|
||||||
#
|
#
|
||||||
# Functions provided
|
# Functions provided
|
||||||
# have_scotch, no_scotch, echo_scotch, query_scotch
|
# have_ptscotch, search_ptscotch
|
||||||
#
|
#
|
||||||
# Variables set on success
|
# Variables set on success
|
||||||
# HAVE_SCOTCH
|
# HAVE_SCOTCH
|
||||||
@ -28,12 +28,62 @@
|
|||||||
# SCOTCH_INC_DIR
|
# SCOTCH_INC_DIR
|
||||||
# SCOTCH_LIB_DIR
|
# SCOTCH_LIB_DIR
|
||||||
#
|
#
|
||||||
|
# Functions provided [Must call have_scotch first]
|
||||||
|
# have_ptscotch, search_ptscotch
|
||||||
|
#
|
||||||
|
# Variables set on success
|
||||||
|
# HAVE_PTSCOTCH
|
||||||
|
# PTSCOTCH_ARCH_PATH
|
||||||
|
# PTSCOTCH_INC_DIR
|
||||||
|
# PTSCOTCH_LIB_DIR
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# System files can be hiding in a large variety of locations
|
||||||
|
#
|
||||||
|
# ArchLinux
|
||||||
|
# ---------
|
||||||
|
# scotch include=/usr/include/ptscotch
|
||||||
|
#
|
||||||
|
# ptscotch include=/usr/include/ptscotch
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Debian/Ubuntu
|
||||||
|
# -------------
|
||||||
|
# scotch include=/usr/include/scotch-int32
|
||||||
|
# scotch library=/usr/lib/x86_64-linux-gnu
|
||||||
|
#
|
||||||
|
# ptscotch include=/usr/include/scotch-int32
|
||||||
|
# ptscotch library=/usr/lib/x86_64-linux-gnu
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# RedHat
|
||||||
|
# ------
|
||||||
|
# scotch include=/usr/include
|
||||||
|
# scotch library=/usr/lib64
|
||||||
|
#
|
||||||
|
# ptscotch include=/usr/include/openmpi-x86_64
|
||||||
|
# ptscotch library=/usr/lib64/openmpi/lib
|
||||||
|
#
|
||||||
|
# when MPI_ARCH_PATH=/usr/lib64/openmpi
|
||||||
|
# and mpicc --showme:compile -> -I/usr/include/openmpi-x86_64
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# openSUSE
|
||||||
|
# --------
|
||||||
|
# scotch include=/usr/include
|
||||||
|
# scotch library=/usr/lib64
|
||||||
|
#
|
||||||
|
# ptscotch include=/usr/lib64/mpi/gcc/openmpi2/include
|
||||||
|
# ptscotch library=/usr/lib64/mpi/gcc/openmpi2/lib64
|
||||||
|
#
|
||||||
|
# when MPI_ARCH_PATH=/usr/lib64/mpi/gcc/openmpi2
|
||||||
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions # General system functions
|
. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions # General system functions
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Reset variables
|
# Reset
|
||||||
no_scotch()
|
no_scotch()
|
||||||
{
|
{
|
||||||
unset HAVE_SCOTCH SCOTCH_ARCH_PATH SCOTCH_INC_DIR SCOTCH_LIB_DIR
|
unset HAVE_SCOTCH SCOTCH_ARCH_PATH SCOTCH_INC_DIR SCOTCH_LIB_DIR
|
||||||
@ -46,55 +96,30 @@ no_scotch()
|
|||||||
echo_scotch()
|
echo_scotch()
|
||||||
{
|
{
|
||||||
echo "scotch=${HAVE_SCOTCH:-false}"
|
echo "scotch=${HAVE_SCOTCH:-false}"
|
||||||
echo "root=$SCOTCH_ARCH_PATH"
|
echo "root=\"$SCOTCH_ARCH_PATH\""
|
||||||
echo "include=$SCOTCH_INC_DIR"
|
echo "include=\"$SCOTCH_INC_DIR\""
|
||||||
echo "library=$SCOTCH_LIB_DIR"
|
echo "library=\"$SCOTCH_LIB_DIR\""
|
||||||
echo
|
echo
|
||||||
echo "ptscotch=${HAVE_PTSCOTCH:-false}"
|
echo "ptscotch=${HAVE_PTSCOTCH:-false}"
|
||||||
echo "root=$PTSCOTCH_ARCH_PATH"
|
echo "root=\"$PTSCOTCH_ARCH_PATH\""
|
||||||
echo "include=$PTSCOTCH_INC_DIR"
|
echo "include=\"$PTSCOTCH_INC_DIR\""
|
||||||
echo "library=$PTSCOTCH_LIB_DIR"
|
echo "library=\"$PTSCOTCH_LIB_DIR\""
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Query settings
|
|
||||||
query_scotch()
|
|
||||||
{
|
|
||||||
local config="config.sh/scotch"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
_process_query scotch "$SCOTCH_ARCH_PATH"
|
|
||||||
else
|
|
||||||
echo "(no $config settings)" 1>&2
|
|
||||||
echo "scotch=unknown"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Search
|
||||||
|
# $1 : prefix (*_ARCH_PATH, system, ...)
|
||||||
|
#
|
||||||
# On success, return 0 and export variables
|
# On success, return 0 and export variables
|
||||||
# -> HAVE_SCOTCH, SCOTCH_ARCH_PATH, SCOTCH_INC_DIR, SCOTCH_LIB_DIR
|
# -> HAVE_SCOTCH, SCOTCH_ARCH_PATH, SCOTCH_INC_DIR, SCOTCH_LIB_DIR
|
||||||
have_scotch()
|
search_scotch()
|
||||||
{
|
{
|
||||||
local warn="==> skip scotch"
|
local warn="==> skip scotch"
|
||||||
local config="config.sh/scotch"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
else
|
|
||||||
[ -n "$warn" ] && echo "$warn (no $config settings)"
|
|
||||||
return 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Expected location, include/library names
|
|
||||||
local prefix="$SCOTCH_ARCH_PATH"
|
|
||||||
local incName="scotch.h"
|
local incName="scotch.h"
|
||||||
local libName="libscotch"
|
local libName="libscotch"
|
||||||
local localDir="scotch-int$WM_LABEL_SIZE"
|
local localDir="scotch-int$WM_LABEL_SIZE"
|
||||||
|
|
||||||
|
local prefix="${1:-system}"
|
||||||
local header library
|
local header library
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
@ -106,6 +131,7 @@ have_scotch()
|
|||||||
then
|
then
|
||||||
header=$(findFirstFile \
|
header=$(findFirstFile \
|
||||||
"$prefix/include/$localDir/$incName" \
|
"$prefix/include/$localDir/$incName" \
|
||||||
|
"$prefix/include/scotch/$incName" \
|
||||||
"$prefix/include/$incName" \
|
"$prefix/include/$incName" \
|
||||||
)
|
)
|
||||||
library=$(findExtLib "$libName")
|
library=$(findExtLib "$libName")
|
||||||
@ -192,30 +218,24 @@ have_scotch()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Must be called after have_scotch!
|
# Search
|
||||||
|
# $1 : prefix (*_ARCH_PATH, system, ...)
|
||||||
#
|
#
|
||||||
# On success, return 0 and export variables
|
# On success, return 0 and export variables
|
||||||
# -> HAVE_PTSCOTCH, PTSCOTCH_ARCH_PATH, PTSCOTCH_INC_DIR, PTSCOTCH_LIB_DIR
|
# -> HAVE_PTSCOTCH, PTSCOTCH_ARCH_PATH, PTSCOTCH_INC_DIR, PTSCOTCH_LIB_DIR
|
||||||
have_ptscotch()
|
search_ptscotch()
|
||||||
{
|
{
|
||||||
local warn="==> skip ptscotch"
|
local warn="==> skip ptscotch"
|
||||||
|
|
||||||
if [ "$HAVE_SCOTCH" != true ]
|
|
||||||
then
|
|
||||||
echo "$warn (no serial scotch available?)"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Reuse old settings
|
|
||||||
[ -n "$PTSCOTCH_ARCH_PATH" ] || PTSCOTCH_ARCH_PATH="$SCOTCH_ARCH_PATH"
|
|
||||||
|
|
||||||
# Expected location, include/library names
|
|
||||||
local prefix="$PTSCOTCH_ARCH_PATH"
|
|
||||||
local incName="ptscotch.h"
|
local incName="ptscotch.h"
|
||||||
local libName="libptscotch"
|
local libName="libptscotch"
|
||||||
local localDir="scotch-int$WM_LABEL_SIZE"
|
local localDir="scotch-int$WM_LABEL_SIZE"
|
||||||
|
|
||||||
|
local prefix="${1:-system}"
|
||||||
local header library
|
local header library
|
||||||
|
|
||||||
|
local mpiPrefix="$MPI_ARCH_PATH"
|
||||||
|
local mpiName="${MPI_ARCH_PATH##*/}"
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
if isNone "$prefix"
|
if isNone "$prefix"
|
||||||
then
|
then
|
||||||
@ -226,12 +246,18 @@ have_ptscotch()
|
|||||||
header=$(findFirstFile \
|
header=$(findFirstFile \
|
||||||
"$prefix/include/$FOAM_MPI/$incName" \
|
"$prefix/include/$FOAM_MPI/$incName" \
|
||||||
"$prefix/include/$localDir/$incName" \
|
"$prefix/include/$localDir/$incName" \
|
||||||
"$prefix/include/$incName"
|
"$prefix/include/ptscotch/$incName" \
|
||||||
|
"$prefix/include/scotch/$incName" \
|
||||||
|
"$prefix/include/$incName" \
|
||||||
|
"$mpiPrefix/include/$incName" \
|
||||||
|
"$prefix/include/$mpiName/$incName" \
|
||||||
|
"$prefix/include/${mpiName}-$(uname -m)/$incName" \
|
||||||
)
|
)
|
||||||
library="$(findExtLib $FOAM_MPI/$libName $libName)"
|
library="$(findExtLib $FOAM_MPI/$libName $libName)"
|
||||||
elif isSystem "$prefix"
|
elif isSystem "$prefix"
|
||||||
then
|
then
|
||||||
header=$(findFirstFile \
|
header=$(findFirstFile \
|
||||||
|
"/usr/local/include/$localDir/$incName" \
|
||||||
"/usr/local/include/ptscotch/$incName" \
|
"/usr/local/include/ptscotch/$incName" \
|
||||||
"/usr/local/include/scotch/$incName" \
|
"/usr/local/include/scotch/$incName" \
|
||||||
"/usr/local/include/$incName" \
|
"/usr/local/include/$incName" \
|
||||||
@ -239,6 +265,9 @@ have_ptscotch()
|
|||||||
"/usr/include/ptscotch/$incName" \
|
"/usr/include/ptscotch/$incName" \
|
||||||
"/usr/include/scotch/$incName" \
|
"/usr/include/scotch/$incName" \
|
||||||
"/usr/include/$incName" \
|
"/usr/include/$incName" \
|
||||||
|
"$mpiPrefix/include/$incName" \
|
||||||
|
"/usr/include/$mpiName/$incName" \
|
||||||
|
"$prefix/include/${mpiName}-$(uname -m)/$incName" \
|
||||||
)
|
)
|
||||||
prefix=$(sysPrefix "$header")
|
prefix=$(sysPrefix "$header")
|
||||||
else
|
else
|
||||||
@ -256,6 +285,7 @@ have_ptscotch()
|
|||||||
# Library
|
# Library
|
||||||
[ -n "$library" ] \
|
[ -n "$library" ] \
|
||||||
|| library=$(findLibrary -prefix="$prefix" -name="$libName" -local="$localDir") \
|
|| library=$(findLibrary -prefix="$prefix" -name="$libName" -local="$localDir") \
|
||||||
|
|| library=$(findLibrary -prefix="$mpiPrefix" -name="$libName" -local="$localDir") \
|
||||||
|| {
|
|| {
|
||||||
[ -n "$warn" ] && echo "$warn (no library)"
|
[ -n "$warn" ] && echo "$warn (no library)"
|
||||||
return 2
|
return 2
|
||||||
@ -272,7 +302,63 @@ have_ptscotch()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Reset variables
|
# Output as per search_* function
|
||||||
|
have_scotch()
|
||||||
|
{
|
||||||
|
local warn="==> skip scotch"
|
||||||
|
local config="config.sh/scotch"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
else
|
||||||
|
[ -n "$warn" ] && echo "$warn (no $config)"
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
search_scotch "$SCOTCH_ARCH_PATH"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Output as per search_* function
|
||||||
|
have_ptscotch()
|
||||||
|
{
|
||||||
|
local warn="==> skip ptscotch"
|
||||||
|
|
||||||
|
if [ "$HAVE_SCOTCH" != true ]
|
||||||
|
then
|
||||||
|
echo "$warn (no serial scotch available?)"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Reuse old settings
|
||||||
|
[ -n "$PTSCOTCH_ARCH_PATH" ] || PTSCOTCH_ARCH_PATH="$SCOTCH_ARCH_PATH"
|
||||||
|
|
||||||
|
search_ptscotch "$PTSCOTCH_ARCH_PATH"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Query settings
|
||||||
|
query_scotch()
|
||||||
|
{
|
||||||
|
local config="config.sh/scotch"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
_process_query scotch "$SCOTCH_ARCH_PATH"
|
||||||
|
else
|
||||||
|
echo "(no $config)" 1>&2
|
||||||
|
echo "scotch=unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Reset
|
||||||
no_scotch
|
no_scotch
|
||||||
|
|
||||||
# Test/query
|
# Test/query
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
# config.sh/zoltan
|
# config.sh/zoltan
|
||||||
#
|
#
|
||||||
# Functions provided
|
# Functions provided
|
||||||
# have_zoltan, no_zoltan, echo_zoltan, query_zoltan
|
# have_zoltan, no_zoltan, echo_zoltan, query_zoltan, search_zoltan
|
||||||
#
|
#
|
||||||
# Variables set on success
|
# Variables set on success
|
||||||
# HAVE_ZOLTAN
|
# HAVE_ZOLTAN
|
||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Reset variables
|
# Reset
|
||||||
no_zoltan()
|
no_zoltan()
|
||||||
{
|
{
|
||||||
unset HAVE_ZOLTAN ZOLTAN_INC_DIR ZOLTAN_LIB_DIR
|
unset HAVE_ZOLTAN ZOLTAN_INC_DIR ZOLTAN_LIB_DIR
|
||||||
@ -44,49 +44,24 @@ no_zoltan()
|
|||||||
echo_zoltan()
|
echo_zoltan()
|
||||||
{
|
{
|
||||||
echo "zoltan=${HAVE_ZOLTAN:-false}"
|
echo "zoltan=${HAVE_ZOLTAN:-false}"
|
||||||
echo "root=$ZOLTAN_ARCH_PATH"
|
echo "root=\"$ZOLTAN_ARCH_PATH\""
|
||||||
echo "include=$ZOLTAN_INC_DIR"
|
echo "include=\"$ZOLTAN_INC_DIR\""
|
||||||
echo "library=$ZOLTAN_LIB_DIR"
|
echo "library=\"$ZOLTAN_LIB_DIR\""
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Query settings
|
|
||||||
query_zoltan()
|
|
||||||
{
|
|
||||||
local config="config.sh/zoltan"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
_process_query zoltan "$ZOLTAN_ARCH_PATH"
|
|
||||||
else
|
|
||||||
echo "(no $config settings)" 1>&2
|
|
||||||
echo "zoltan=unknown"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Search
|
||||||
|
# $1 : prefix (*_ARCH_PATH, system, ...)
|
||||||
|
#
|
||||||
# On success, return 0 and export variables
|
# On success, return 0 and export variables
|
||||||
# -> HAVE_ZOLTAN, ZOLTAN_INC_DIR, ZOLTAN_LIB_DIR
|
# -> HAVE_ZOLTAN, ZOLTAN_INC_DIR, ZOLTAN_LIB_DIR
|
||||||
have_zoltan()
|
search_zoltan()
|
||||||
{
|
{
|
||||||
local warn # warn="==> skip zoltan"
|
local warn # warn="==> skip zoltan"
|
||||||
local config="config.sh/zoltan"
|
|
||||||
local settings
|
|
||||||
|
|
||||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
|
||||||
then
|
|
||||||
. "$settings"
|
|
||||||
else
|
|
||||||
[ -n "$warn" ] && echo "$warn (no $config settings)"
|
|
||||||
return 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Expected location, include/library names
|
|
||||||
local prefix="$ZOLTAN_ARCH_PATH"
|
|
||||||
local incName="zoltan.h"
|
local incName="zoltan.h"
|
||||||
local libName="libzoltan"
|
local libName="libzoltan"
|
||||||
|
|
||||||
|
local prefix="${1:-system}"
|
||||||
local header library
|
local header library
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
@ -131,7 +106,45 @@ have_zoltan()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Reset variables
|
# Output as per search_* function
|
||||||
|
have_zoltan()
|
||||||
|
{
|
||||||
|
local warn # warn="==> skip zoltan"
|
||||||
|
local config="config.sh/zoltan"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
else
|
||||||
|
[ -n "$warn" ] && echo "$warn (no $config)"
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
search_zoltan "$ZOLTAN_ARCH_PATH"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Query settings
|
||||||
|
query_zoltan()
|
||||||
|
{
|
||||||
|
local config="config.sh/zoltan"
|
||||||
|
local file
|
||||||
|
|
||||||
|
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
|
||||||
|
then
|
||||||
|
. "$file"
|
||||||
|
_process_query zoltan "$ZOLTAN_ARCH_PATH"
|
||||||
|
else
|
||||||
|
echo "(no $config)" 1>&2
|
||||||
|
echo "zoltan=unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Reset
|
||||||
no_zoltan
|
no_zoltan
|
||||||
|
|
||||||
# Test/query
|
# Test/query
|
||||||
|
|||||||
@ -53,9 +53,9 @@ no_paraview()
|
|||||||
echo_paraview()
|
echo_paraview()
|
||||||
{
|
{
|
||||||
echo "paraview=${HAVE_PVPLUGIN_SUPPORT:-false}"
|
echo "paraview=${HAVE_PVPLUGIN_SUPPORT:-false}"
|
||||||
echo "root=$ParaView_DIR"
|
echo "root=\"$ParaView_DIR\""
|
||||||
echo "include=$PARAVIEW_INC_DIR"
|
echo "include=\"$PARAVIEW_INC_DIR\""
|
||||||
echo "plugin=$FOAM_PV_PLUGIN_LIBBIN"
|
echo "plugin=\"$FOAM_PV_PLUGIN_LIBBIN\""
|
||||||
echo "api=$PARAVIEW_API"
|
echo "api=$PARAVIEW_API"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,17 +6,19 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2015-2016 OpenFOAM Foundation
|
# Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||||
# Copyright (C) 2018 OpenCFD Ltd.
|
# Copyright (C) 2018-2021 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/>.
|
|
||||||
#
|
#
|
||||||
# Script
|
# Script
|
||||||
# wmakeFunctions
|
# wmakeFunctions
|
||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Functions to check wmake environment and find .dep and .o files
|
# Support functions for wmake infrastructure.
|
||||||
|
# For example, check environment, find .dep and .o files, various
|
||||||
|
# wrappers when making libraries.
|
||||||
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Ensure these variables are always defined
|
# Ensure these variables are always defined
|
||||||
@ -31,17 +33,18 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
# Check environment variables
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Check environment variables
|
||||||
checkEnv()
|
checkEnv()
|
||||||
{
|
{
|
||||||
local check failed
|
local check failed
|
||||||
|
|
||||||
for check in WM_PROJECT_DIR WM_OPTIONS WM_DIR
|
# Default for WM_DIR already provided above
|
||||||
|
|
||||||
|
for check in WM_PROJECT_DIR WM_OPTIONS
|
||||||
do
|
do
|
||||||
eval test "\$$check" || failed="$failed $check"
|
eval test -n "\$$check" || failed="$failed $check"
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -z "$failed" ] || {
|
[ -z "$failed" ] || {
|
||||||
@ -52,11 +55,45 @@ checkEnv()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
# Set FOAM_MODULE_PREFIX according to
|
||||||
# Search up directories tree for the Make sub-directory
|
# - absolute/relative path
|
||||||
|
# - predefined type (u,user | g,group | o,openfoam)
|
||||||
|
setModulePrefix()
|
||||||
|
{
|
||||||
|
export FOAM_MODULE_PREFIX="$1"
|
||||||
|
case "$FOAM_MODULE_PREFIX" in
|
||||||
|
# Prefix: user
|
||||||
|
(u | user) FOAM_MODULE_PREFIX="${FOAM_USER_LIBBIN%/*}" ;;
|
||||||
|
|
||||||
|
# Prefix: group
|
||||||
|
(g | group) FOAM_MODULE_PREFIX="${FOAM_SITE_LIBBIN%/*}" ;;
|
||||||
|
|
||||||
|
# Prefix: openfoam (other)
|
||||||
|
(o | openfoam) FOAM_MODULE_PREFIX="${FOAM_LIBBIN%/*}" ;;
|
||||||
|
|
||||||
|
# Prefix: false | none (ie, 'disabled')
|
||||||
|
(false | none) FOAM_MODULE_PREFIX=false ;;
|
||||||
|
|
||||||
|
# Prefix: directory (absolute or relative)
|
||||||
|
(*)
|
||||||
|
: "${FOAM_MODULE_PREFIX:=/usr/local}" # Fallback (autoconf-like)
|
||||||
|
|
||||||
|
# Require absolute path
|
||||||
|
[ "${FOAM_MODULE_PREFIX#/}" != "${FOAM_MODULE_PREFIX}" ] || \
|
||||||
|
FOAM_MODULE_PREFIX="${PWD}/${FOAM_MODULE_PREFIX}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Avoid potential conflicts
|
||||||
|
unset FOAM_MODULE_APPBIN FOAM_MODULE_LIBBIN
|
||||||
|
echo "Module prefix = ${FOAM_MODULE_PREFIX:-[]}" 1>&2
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Return the absolute path for a directory or a file's parent directory
|
# Return the absolute (physical) path for a directory or
|
||||||
|
# for a file's parent directory
|
||||||
# expandPath dirName
|
# expandPath dirName
|
||||||
# expandPath fileName
|
# expandPath fileName
|
||||||
#
|
#
|
||||||
@ -69,12 +106,13 @@ expandPath()
|
|||||||
(cd "$1" && pwd -P)
|
(cd "$1" && pwd -P)
|
||||||
elif [ -n "$1" ]
|
elif [ -n "$1" ]
|
||||||
then
|
then
|
||||||
(cd $(dirname "$1") && pwd -P)
|
(cd "$(dirname "$1")" && pwd -P)
|
||||||
else
|
else
|
||||||
pwd -P
|
pwd -P
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Find the target directory, which contains a Make/ directory
|
# Find the target directory, which contains a Make/ directory
|
||||||
# search upwards in its parent directories, but stopping
|
# search upwards in its parent directories, but stopping
|
||||||
# when it hits the project root, home, or the file-system root
|
# when it hits the project root, home, or the file-system root
|
||||||
@ -88,15 +126,15 @@ expandPath()
|
|||||||
# - WM_PROJECT_DIR, HOME
|
# - WM_PROJECT_DIR, HOME
|
||||||
findTarget()
|
findTarget()
|
||||||
{
|
{
|
||||||
local project=$(expandPath $WM_PROJECT_DIR)
|
local project=$(expandPath "$WM_PROJECT_DIR")
|
||||||
local home=$(expandPath $HOME)
|
local home=$(expandPath "$HOME")
|
||||||
local reldir="${1:-.}"
|
local reldir="${1:-.}"
|
||||||
local absdir=$(expandPath $reldir)
|
local absdir=$(expandPath "$reldir")
|
||||||
|
|
||||||
while [ -n "$absdir" ]
|
while [ -n "$absdir" ]
|
||||||
do
|
do
|
||||||
case "$absdir" in
|
case "$absdir" in
|
||||||
($project | $home | /)
|
("$project" | "$home" | /)
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -112,7 +150,7 @@ findTarget()
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Error: no Make directory for $(expandPath $1)" 1>&2
|
echo "Error: no Make directory for $(expandPath "$1")" 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
@ -132,14 +170,14 @@ cdSource()
|
|||||||
echo " Searching up directories tree for Make directory" 1>&2
|
echo " Searching up directories tree for Make directory" 1>&2
|
||||||
|
|
||||||
dir=$(findTarget .) || exit 1 # Fatal
|
dir=$(findTarget .) || exit 1 # Fatal
|
||||||
cd $dir 2>/dev/null || {
|
cd "$dir" 2>/dev/null || {
|
||||||
echo "$Script error: could not change to directory '$dir'" 1>&2
|
echo "$Script error: could not change to directory '$dir'" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
unset targetType
|
unset targetType
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -r $MakeDir/files ] || {
|
[ -r "$MakeDir"/files ] || {
|
||||||
echo "$Script error: file '$MakeDir/files' does not exist in $PWD" 1>&2
|
echo "$Script error: file '$MakeDir/files' does not exist in $PWD" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
@ -157,23 +195,34 @@ cdSource()
|
|||||||
# - WM_PROJECT_DIR, WM_OPTIONS
|
# - WM_PROJECT_DIR, WM_OPTIONS
|
||||||
findObjectDir()
|
findObjectDir()
|
||||||
{
|
{
|
||||||
local project=$(expandPath $WM_PROJECT_DIR)
|
local project="$(expandPath "$WM_PROJECT_DIR")"
|
||||||
local absdir=$(expandPath ${1:-.})
|
local absdir="$(expandPath "${1:-.}")"
|
||||||
local objectsDir
|
local appDir relativeDir objectsDir
|
||||||
|
|
||||||
case "$absdir" in
|
# Treat project/ builds as out-of-source
|
||||||
("$project"/*)
|
relativeDir="${absdir#${project}/}"
|
||||||
local buildPath=$WM_PROJECT_DIR/build/${WM_OPTIONS}
|
if [ "$relativeDir" != "$absdir" ]
|
||||||
objectsDir=$buildPath$(echo $absdir | sed s%$project%% )
|
then
|
||||||
;;
|
[ -w "$WM_PROJECT_DIR" ] && \
|
||||||
(*)
|
objectsDir="${WM_PROJECT_DIR}/build/${WM_OPTIONS}/${relativeDir}"
|
||||||
local path=$absdir
|
fi
|
||||||
local appDir=.
|
|
||||||
[ -d Make ] || appDir=$(findTarget .) || exit 1 # Fatal
|
# Default (local) build directory
|
||||||
absdir=$(expandPath $appDir/.)
|
if [ -z "$objectsDir" ]
|
||||||
objectsDir=$appDir/Make/${WM_OPTIONS}$(echo $path | sed s%$absdir%% )
|
then
|
||||||
;;
|
if [ -d "$absdir/Make" ]
|
||||||
esac
|
then
|
||||||
|
objectsDir="${absdir}/Make/${WM_OPTIONS}"
|
||||||
|
else
|
||||||
|
relativeDir="$absdir"
|
||||||
|
appDir=.
|
||||||
|
[ -d Make ] || appDir=$(findTarget .) || exit 1 # Fatal
|
||||||
|
absdir=$(expandPath "$appDir"/.)
|
||||||
|
|
||||||
|
relativeDir="${relativeDir#${absdir}}"
|
||||||
|
objectsDir="${appDir}/Make/${WM_OPTIONS}${relativeDir}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
echo "$objectsDir"
|
echo "$objectsDir"
|
||||||
}
|
}
|
||||||
@ -190,7 +239,7 @@ findObjectDir()
|
|||||||
# - WM_PROJECT_DIR, WM_OPTIONS
|
# - WM_PROJECT_DIR, WM_OPTIONS
|
||||||
removeObjectDir()
|
removeObjectDir()
|
||||||
{
|
{
|
||||||
local objectsDir=$(findObjectDir ${1:-.})
|
local objectsDir="$(findObjectDir "${1:-.}")"
|
||||||
if [ -d "$objectsDir" ]
|
if [ -d "$objectsDir" ]
|
||||||
then
|
then
|
||||||
rm -rf "$objectsDir" 2>/dev/null
|
rm -rf "$objectsDir" 2>/dev/null
|
||||||
@ -198,6 +247,139 @@ removeObjectDir()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Save build/configure parameter information (dependency) into sentinel file
|
||||||
|
#
|
||||||
|
# 1 - sentinelFile
|
||||||
|
# 2... build/configure parameters
|
||||||
|
#
|
||||||
|
storeDependency()
|
||||||
|
{
|
||||||
|
local sentinel="$1"
|
||||||
|
local depend
|
||||||
|
shift
|
||||||
|
|
||||||
|
if [ -n "$sentinel" ]
|
||||||
|
then
|
||||||
|
mkdir -p "$(dirname "$sentinel")"
|
||||||
|
|
||||||
|
echo '# Build/configure parameters' >| "$sentinel"
|
||||||
|
|
||||||
|
for depend
|
||||||
|
do
|
||||||
|
echo "-- $depend"
|
||||||
|
done >> "$sentinel"
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Check sentinel file(s) to handle changed build/configure parameters
|
||||||
|
# such as paraview / vtk version changes
|
||||||
|
#
|
||||||
|
# 1 - sourceDir
|
||||||
|
# 2... build/configure parameters
|
||||||
|
#
|
||||||
|
# The additional test for "CMakeCache.txt" helps for cmake projects and
|
||||||
|
# has no adverse affect for others
|
||||||
|
#
|
||||||
|
sameDependency()
|
||||||
|
{
|
||||||
|
local sourceDir="$1"
|
||||||
|
shift
|
||||||
|
local objectsDir
|
||||||
|
local compare=0
|
||||||
|
|
||||||
|
# Where generated files are stored
|
||||||
|
objectsDir=$(findObjectDir "$sourceDir") || exit 1 # Fatal
|
||||||
|
local sentinel="$objectsDir/ConfigParameters"
|
||||||
|
|
||||||
|
if [ -f "$sentinel" ]
|
||||||
|
then
|
||||||
|
# Create an .update version for comparison
|
||||||
|
storeDependency "${sentinel}.update" $@
|
||||||
|
cmp "${sentinel}" "${sentinel}.update" >/dev/null 2>&1
|
||||||
|
compare=$?
|
||||||
|
|
||||||
|
if [ "$compare" -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "build/configure parameters changed between builds" 1>&2
|
||||||
|
## cat "${sentinel}.update" 1>&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
# No sentinel file: First time, or failed compilation?
|
||||||
|
if [ -f "$objectsDir/CMakeCache.txt" ]
|
||||||
|
then
|
||||||
|
echo "previous build was incomplete" 1>&2
|
||||||
|
compare=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$sentinel"
|
||||||
|
return "$compare"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Build a mpi-versioned library (targetType)
|
||||||
|
# - use sentinel file(s) to handle paraview version changes
|
||||||
|
# compile into qualified directory
|
||||||
|
# use sentinel file(s) to handle version changes
|
||||||
|
# 1 - libName
|
||||||
|
# 2... build/configure information
|
||||||
|
#
|
||||||
|
# Global variables used:
|
||||||
|
# - WM_OPTIONS, WM_MPLIB, FOAM_MPI
|
||||||
|
#
|
||||||
|
# Requires that WM_MPLIB contain an "MPI" string
|
||||||
|
wmakeLibMpi()
|
||||||
|
{
|
||||||
|
local libName="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
case "$WM_MPLIB" in (*MPI* | *mpi*)
|
||||||
|
(
|
||||||
|
WM_OPTIONS="$WM_OPTIONS$WM_MPLIB"
|
||||||
|
|
||||||
|
# Where generated files are stored
|
||||||
|
objectsDir="$(findObjectDir "$libName")" || exit 1 # Fatal
|
||||||
|
|
||||||
|
# Something changed
|
||||||
|
sentinel=$(sameDependency "$libName" "MPLIB=$WM_MPLIB" "MPI=$FOAM_MPI" $@) || \
|
||||||
|
wclean "$libName"
|
||||||
|
|
||||||
|
echo "wmake $targetType $libName (mpi=$WM_MPLIB)"
|
||||||
|
wmake $targetType "$libName" && \
|
||||||
|
storeDependency "$sentinel" "MPLIB=$WM_MPLIB" "MPI=$FOAM_MPI" $@
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Clean an mpi-versioned library
|
||||||
|
#
|
||||||
|
# Global variables used:
|
||||||
|
# - WM_OPTIONS, WM_MPLIB
|
||||||
|
#
|
||||||
|
# Requires that WM_MPLIB contain an "MPI" string
|
||||||
|
wcleanLibMpi()
|
||||||
|
{
|
||||||
|
case "$WM_MPLIB" in (*MPI* | *mpi*)
|
||||||
|
(
|
||||||
|
WM_OPTIONS="$WM_OPTIONS$WM_MPLIB"
|
||||||
|
|
||||||
|
for libName
|
||||||
|
do
|
||||||
|
wclean "$libName"
|
||||||
|
done
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# depToSource depFile
|
# depToSource depFile
|
||||||
#
|
#
|
||||||
# Output:
|
# Output:
|
||||||
@ -210,7 +392,7 @@ if [ -n "$BASH_VERSION" ]
|
|||||||
then
|
then
|
||||||
depToSource()
|
depToSource()
|
||||||
{
|
{
|
||||||
local sourceFile=${1%.dep}
|
local sourceFile="${1%.dep}"
|
||||||
sourceFile="${sourceFile/build\/${WM_OPTIONS}\//}"
|
sourceFile="${sourceFile/build\/${WM_OPTIONS}\//}"
|
||||||
sourceFile="${sourceFile/build\/${WM_OPTIONS}${WM_MPLIB}\//}"
|
sourceFile="${sourceFile/build\/${WM_OPTIONS}${WM_MPLIB}\//}"
|
||||||
sourceFile="${sourceFile/Make\/${WM_OPTIONS}\//}"
|
sourceFile="${sourceFile/Make\/${WM_OPTIONS}\//}"
|
||||||
@ -221,13 +403,11 @@ then
|
|||||||
else
|
else
|
||||||
depToSource()
|
depToSource()
|
||||||
{
|
{
|
||||||
local sourceFile=$(echo ${1%.dep} | \
|
echo "${1%.dep}" | sed \
|
||||||
sed -e s%build/${WM_OPTIONS}/%% \
|
-e "s%build/${WM_OPTIONS}/%%" \
|
||||||
-e s%build/${WM_OPTIONS}${WM_MPLIB}/%% \
|
-e "s%build/${WM_OPTIONS}${WM_MPLIB}/%%" \
|
||||||
-e s%Make/${WM_OPTIONS}/%% \
|
-e "s%Make/${WM_OPTIONS}/%%" \
|
||||||
-e s%Make/${WM_OPTIONS}${WM_MPLIB}/%% )
|
-e "s%Make/${WM_OPTIONS}${WM_MPLIB}/%%"
|
||||||
|
|
||||||
echo "$sourceFile"
|
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -152,6 +152,8 @@ die()
|
|||||||
# Default make is the "make" in the path
|
# Default make is the "make" in the path
|
||||||
make="make"
|
make="make"
|
||||||
|
|
||||||
|
# Print compiler/system information (serial only)
|
||||||
|
printInfo() { make --no-print-directory -f "$WM_DIR"/makefiles/info "$@"; }
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -189,11 +191,11 @@ do
|
|||||||
-show-api | -show-ext-so | \
|
-show-api | -show-ext-so | \
|
||||||
-show-compile-c | -show-c | -show-cflags | -show-cflags-arch | \
|
-show-compile-c | -show-c | -show-cflags | -show-cflags-arch | \
|
||||||
-show-compile-cxx | -show-cxx | -show-cxxflags | -show-cxxflags-arch )
|
-show-compile-cxx | -show-cxx | -show-cxxflags | -show-cxxflags-arch )
|
||||||
$make -f $WM_DIR/makefiles/info "${1#-show-}"
|
printInfo "${1#-show-}"
|
||||||
optShow=true
|
optShow=true
|
||||||
;;
|
;;
|
||||||
-show-path-c | -show-path-cxx )
|
-show-path-c | -show-path-cxx )
|
||||||
command -v $($make -f $WM_DIR/makefiles/info "${1#-show-path-}")
|
command -v $(printInfo "${1#-show-path-}")
|
||||||
optShow=true
|
optShow=true
|
||||||
;;
|
;;
|
||||||
-a | -all | all)
|
-a | -all | all)
|
||||||
@ -240,7 +242,7 @@ do
|
|||||||
: ${all:=all} # implies 'all', unless previous set to 'queue' etc.
|
: ${all:=all} # implies 'all', unless previous set to 'queue' etc.
|
||||||
;;
|
;;
|
||||||
-version | --version)
|
-version | --version)
|
||||||
$make -f $WM_DIR/makefiles/info api
|
printInfo api
|
||||||
optShow=true
|
optShow=true
|
||||||
break;
|
break;
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user