mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop
This commit is contained in:
@ -22,7 +22,7 @@ VTK
|
|||||||
---
|
---
|
||||||
|
|
||||||
If using the runTimePostProcessing to create on-the-fly images, you
|
If using the runTimePostProcessing to create on-the-fly images, you
|
||||||
can either simply just compile ParaView-5.0.1 and these libraries will
|
can simply just compile ParaView-5.0.1 and these libraries will
|
||||||
be used.
|
be used.
|
||||||
|
|
||||||
If you elect to use a separate VTK compilation (for example for
|
If you elect to use a separate VTK compilation (for example for
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
cd ${0%/*} || exit 1
|
|
||||||
|
|
||||||
wclean libso DPMTurbulenceModels
|
wclean libso DPMTurbulenceModels
|
||||||
wclean
|
wclean
|
||||||
wclean MPPICFoam
|
wclean MPPICFoam
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -8,3 +8,5 @@ wmake $targetType DPMTurbulenceModels
|
|||||||
|
|
||||||
wmake $targetType
|
wmake $targetType
|
||||||
wmake $targetType MPPICFoam
|
wmake $targetType MPPICFoam
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd ${0%/*} || exit 1 # run from this directory
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
wclean libso CompressibleTwoPhaseMixtureTurbulenceModels
|
wclean libso CompressibleTwoPhaseMixtureTurbulenceModels
|
||||||
wclean
|
wclean
|
||||||
|
|||||||
@ -40,7 +40,6 @@ See also
|
|||||||
#include "IStringStream.H"
|
#include "IStringStream.H"
|
||||||
#include "scalar.H"
|
#include "scalar.H"
|
||||||
#include "vector.H"
|
#include "vector.H"
|
||||||
#include "ListOps.H"
|
|
||||||
|
|
||||||
#include "labelRange.H"
|
#include "labelRange.H"
|
||||||
#include "ListOps.H"
|
#include "ListOps.H"
|
||||||
@ -140,11 +139,36 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Elements " << map << " out of " << list3
|
Info<< "Elements " << map << " out of " << list3
|
||||||
<< " => " << subList3 << endl;
|
<< " => " << subList3 << endl;
|
||||||
|
|
||||||
|
// test flattened output
|
||||||
|
{
|
||||||
|
Info<< nl;
|
||||||
|
|
||||||
|
labelList longLabelList = identity(15);
|
||||||
|
|
||||||
|
Info<< "labels (contiguous=" << contiguous<label>() << ")" << nl;
|
||||||
|
|
||||||
|
Info<< "normal: " << longLabelList << nl;
|
||||||
|
Info<< "flatOutput: " << flatOutput(longLabelList) << nl;
|
||||||
|
// Info<< "flatOutput(14): " << flatOutput(longLabelList, 14) << nl;
|
||||||
|
// Info<< "flatOutput(15): " << flatOutput(longLabelList, 15) << nl;
|
||||||
|
|
||||||
|
stringList longStringList(12);
|
||||||
|
forAll(longStringList, i)
|
||||||
|
{
|
||||||
|
longStringList[i].resize(3, 'a' + i);
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "string (contiguous=" << contiguous<string>() << ")" << nl;
|
||||||
|
|
||||||
|
Info<< "normal: " << longStringList << nl;
|
||||||
|
Info<< "flatOutput: " << flatOutput(longStringList) << nl;
|
||||||
|
// contiguous longStringList[i].resize(3, 'a' + i);
|
||||||
|
}
|
||||||
|
|
||||||
wordReList reLst;
|
wordReList reLst;
|
||||||
wordList wLst;
|
wordList wLst;
|
||||||
stringList sLst;
|
stringList sLst;
|
||||||
|
|
||||||
|
|
||||||
scalar xxx(-1);
|
scalar xxx(-1);
|
||||||
|
|
||||||
if (args.optionFound("flag"))
|
if (args.optionFound("flag"))
|
||||||
@ -173,9 +197,9 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
Info<< nl
|
Info<< nl
|
||||||
<< "-reList: " << reLst << nl
|
<< "-reList: " << flatOutput(reLst) << nl
|
||||||
<< "-wordList: " << wLst << nl
|
<< "-wordList: " << flatOutput(wLst) << nl
|
||||||
<< "-stringList: " << sLst << endl;
|
<< "-stringList: " << flatOutput(sLst) << endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -143,7 +143,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "\ntest Istream constructor\n";
|
Info<< "\ntest Istream constructor\n";
|
||||||
|
|
||||||
list4.printInfo(Info, true);
|
list4.printInfo(Info, true);
|
||||||
Info<< list4 << " indices: " << list4.used()() <<endl;
|
Info<< list4 << " indices: " << list4.used()() << nl;
|
||||||
|
|
||||||
Info<< "\nassign from labelList\n";
|
Info<< "\nassign from labelList\n";
|
||||||
list4 = labelList
|
list4 = labelList
|
||||||
@ -155,7 +155,7 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
list4.printInfo(Info, true);
|
list4.printInfo(Info, true);
|
||||||
Info<< list4 << " indices: " << list4.used()() <<endl;
|
Info<< list4 << " indices: " << list4.used()() << nl;
|
||||||
|
|
||||||
Info<< "\nassign from indices\n";
|
Info<< "\nassign from indices\n";
|
||||||
list4.read
|
list4.read
|
||||||
@ -168,7 +168,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
|
|
||||||
list4.printInfo(Info, true);
|
list4.printInfo(Info, true);
|
||||||
Info<< list4 << " indices: " << list4.used()() <<endl;
|
Info<< list4 << " indices: " << list4.used()() << nl;
|
||||||
|
|
||||||
List<bool> boolLst(list4.size());
|
List<bool> boolLst(list4.size());
|
||||||
forAll(list4, i)
|
forAll(list4, i)
|
||||||
@ -176,8 +176,7 @@ int main(int argc, char *argv[])
|
|||||||
boolLst[i] = list4[i];
|
boolLst[i] = list4[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "List<bool>: " << boolLst <<endl;
|
Info<< "List<bool>: " << boolLst << nl;
|
||||||
|
|
||||||
|
|
||||||
// check roundabout assignments
|
// check roundabout assignments
|
||||||
PackedList<2> pl2
|
PackedList<2> pl2
|
||||||
@ -188,7 +187,7 @@ int main(int argc, char *argv[])
|
|||||||
)()
|
)()
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "roundabout assignment: " << pl2 << endl;
|
Info<< "roundabout assignment: " << pl2 << nl;
|
||||||
|
|
||||||
list4.clear();
|
list4.clear();
|
||||||
forAll(pl2, i)
|
forAll(pl2, i)
|
||||||
@ -196,7 +195,7 @@ int main(int argc, char *argv[])
|
|||||||
list4[i] = pl2[i];
|
list4[i] = pl2[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
list4.write(Info, true) << endl;
|
list4.writeList(Info, -1) << nl; // indexed output
|
||||||
|
|
||||||
list4.writeEntry("PackedBoolList", Info);
|
list4.writeEntry("PackedBoolList", Info);
|
||||||
|
|
||||||
|
|||||||
@ -1,24 +1,33 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
|
||||||
# Build optional components (eg, may depend on third-party libraries)
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
|
# Optional component: continue-on-error
|
||||||
|
# - may not have third-party installed
|
||||||
|
export WM_CONTINUE_ON_ERROR=true
|
||||||
|
|
||||||
# Parse arguments for compilation (at least for error catching)
|
# Parse arguments for compilation (at least for error catching)
|
||||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||||
|
|
||||||
# Get version info and arch-path
|
warning="==> skip ccmio"
|
||||||
. $WM_PROJECT_DIR/etc/config.sh/functions
|
|
||||||
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio)
|
|
||||||
|
|
||||||
|
if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio)
|
||||||
|
then
|
||||||
|
. $settings
|
||||||
|
else
|
||||||
|
echo "$warning (no config.sh/ccmio settings)"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# Build libccmio (.a|.so)
|
# Build libccmio (.a|.so) - use static linkage for fewer issues
|
||||||
$WM_THIRD_PARTY_DIR/makeCCMIO lib # libso
|
$WM_THIRD_PARTY_DIR/makeCCMIO lib
|
||||||
|
|
||||||
if [ -e $CCMIO_ARCH_PATH/include/libccmio/ccmio.h \
|
if [ -e $CCMIO_ARCH_PATH/include/libccmio/ccmio.h \
|
||||||
-a \( -e $CCMIO_ARCH_PATH/lib/libccmio.a -o $FOAM_EXT_LIBBIN/libccmio.so \) ]
|
-a \( -e $CCMIO_ARCH_PATH/lib/libccmio.a -o $FOAM_EXT_LIBBIN/libccmio.so \) ]
|
||||||
then
|
then
|
||||||
wmake $targetType ccm26ToFoam
|
wmake $targetType ccm26ToFoam
|
||||||
|
else
|
||||||
|
echo $warning
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -4,19 +4,18 @@ cd ${0%/*} || exit 1 # Run from this directory
|
|||||||
# Parse arguments for compilation (at least for error catching)
|
# Parse arguments for compilation (at least for error catching)
|
||||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||||
|
|
||||||
export COMPILE_FLAGS=''
|
unset COMP_FLAGS LINK_FLAGS
|
||||||
export LINK_FLAGS=''
|
|
||||||
|
|
||||||
if [ -f "${FOAM_LIBBIN}/libSloanRenumber.so" ]
|
if [ -f "${FOAM_LIBBIN}/libSloanRenumber.so" ]
|
||||||
then
|
then
|
||||||
echo "Found libSloanRenumber.so -- enabling Sloan renumbering support."
|
echo " found libSloanRenumber -- enabling sloan renumbering support."
|
||||||
export LINK_FLAGS="${LINK_FLAGS} -lSloanRenumber"
|
export LINK_FLAGS="${LINK_FLAGS} -lSloanRenumber"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "${ZOLTAN_ARCH_PATH}/lib/libzoltan.a" -a -f "${FOAM_LIBBIN}/libzoltanRenumber.so" ]
|
if [ -f "${ZOLTAN_ARCH_PATH}/lib/libzoltan.a" -a -f "${FOAM_LIBBIN}/libzoltanRenumber.so" ]
|
||||||
then
|
then
|
||||||
echo "Found libzoltanRenumber.so -- enabling zoltan renumbering support."
|
echo " found libzoltanRenumber -- enabling sloan renumbering support."
|
||||||
export COMPILE_FLAGS="-DFOAM_USE_ZOLTAN"
|
export COMP_FLAGS="-DFOAM_USE_ZOLTAN"
|
||||||
export LINK_FLAGS="${LINK_FLAGS} -lzoltanRenumber -L${ZOLTAN_ARCH_PATH}/lib -lzoltan"
|
export LINK_FLAGS="${LINK_FLAGS} -lzoltanRenumber -L${ZOLTAN_ARCH_PATH}/lib -lzoltan"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
/* -DFULLDEBUG -g -O0 */ \
|
/* -DFULLDEBUG -g -O0 */ \
|
||||||
${COMPILE_FLAGS} \
|
${COMP_FLAGS} \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
|||||||
@ -4,5 +4,4 @@ cd ${0%/*} || exit 1 # Run from this directory
|
|||||||
wclean libso helpTypes
|
wclean libso helpTypes
|
||||||
wclean
|
wclean
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -5,7 +5,4 @@ wclean libso foamPv
|
|||||||
PVblockMeshReader/Allwclean
|
PVblockMeshReader/Allwclean
|
||||||
PVFoamReader/Allwclean
|
PVFoamReader/Allwclean
|
||||||
|
|
||||||
# remove dummy directory (see Allwmake)
|
|
||||||
rmdir Make 2>/dev/null
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -24,10 +24,6 @@ case "$major" in
|
|||||||
wmakeLibPv foamPv
|
wmakeLibPv foamPv
|
||||||
PVblockMeshReader/Allwmake $targetType $*
|
PVblockMeshReader/Allwmake $targetType $*
|
||||||
PVFoamReader/Allwmake $targetType $*
|
PVFoamReader/Allwmake $targetType $*
|
||||||
|
|
||||||
# Dummy directory to trigger proper 'wclean all' behaviour
|
|
||||||
# - the Allwclean will otherwise not be used
|
|
||||||
mkdir -p Make
|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|||||||
@ -10,8 +10,7 @@ rm -f $FOAM_LIBBIN/libPVFoamReader* 2>/dev/null
|
|||||||
rm -rf PVFoamReader/Make # safety: old build location
|
rm -rf PVFoamReader/Make # safety: old build location
|
||||||
wclean libso vtkPVFoam
|
wclean libso vtkPVFoam
|
||||||
|
|
||||||
# Cleanup generated files
|
# Cleanup generated files - remove entire top-level
|
||||||
findObjectDir $PWD # remove entire top-level
|
removeObjectDir $PWD
|
||||||
rm -rf "$objectsDir" > /dev/null 2>&1
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -10,8 +10,7 @@ rm -f $FOAM_LIBBIN/libPVblockMeshReader* 2>/dev/null
|
|||||||
rm -rf PVblockMeshReader/Make # safety: old build location
|
rm -rf PVblockMeshReader/Make # safety: old build location
|
||||||
wclean libso vtkPVblockMesh
|
wclean libso vtkPVblockMesh
|
||||||
|
|
||||||
# Cleanup generated files
|
# Cleanup generated files - remove entire top-level
|
||||||
findObjectDir $PWD # remove entire top-level
|
removeObjectDir $PWD
|
||||||
rm -rf "$objectsDir" > /dev/null 2>&1
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
wclean libso tabulatedWallFunction
|
wclean libso tabulatedWallFunction
|
||||||
wclean
|
wclean
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
unset COMPILE_FLAGS LINK_FLAGS
|
unset COMP_FLAGS LINK_FLAGS
|
||||||
|
|
||||||
if [ -f "$CGAL_ARCH_PATH/include/CGAL/version.h" ] || \
|
if [ -f "$CGAL_ARCH_PATH/include/CGAL/version.h" ] || \
|
||||||
[ "${CGAL_ARCH_PATH##*-}" = system -a -f /usr/include/CGAL/version.h ]
|
[ "${CGAL_ARCH_PATH##*-}" = system -a -f /usr/include/CGAL/version.h ]
|
||||||
then
|
then
|
||||||
wmake PolyhedronReader
|
wmake PolyhedronReader
|
||||||
export COMPILE_FLAGS='-IPolyhedronReader'
|
export COMP_FLAGS='-IPolyhedronReader'
|
||||||
export LINK_FLAGS='${CGAL_LIBS} -lPolyhedronReader'
|
export LINK_FLAGS='${CGAL_LIBS} -lPolyhedronReader'
|
||||||
else
|
else
|
||||||
export COMPILE_FLAGS="-DNO_CGAL"
|
export COMP_FLAGS="-DNO_CGAL"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
wmake
|
wmake
|
||||||
|
|||||||
@ -14,7 +14,7 @@ EXE_INC = \
|
|||||||
${EXE_NDEBUG} \
|
${EXE_NDEBUG} \
|
||||||
${CGAL_INC} \
|
${CGAL_INC} \
|
||||||
${c++CGALWARN} \
|
${c++CGALWARN} \
|
||||||
$(COMPILE_FLAGS) \
|
$(COMP_FLAGS) \
|
||||||
-I$(FOAM_SRC)/surfMesh/lnInclude \
|
-I$(FOAM_SRC)/surfMesh/lnInclude \
|
||||||
-I$(FOAM_SRC)/triSurface/lnInclude \
|
-I$(FOAM_SRC)/triSurface/lnInclude \
|
||||||
-I$(LIB_SRC)/edgeMesh/lnInclude \
|
-I$(LIB_SRC)/edgeMesh/lnInclude \
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
if [ "$#" -gt 0 ]
|
if [ "$#" -gt 0 ]
|
||||||
then
|
then
|
||||||
find . -name "*.[CHL]" -exec $1 {} \; -print
|
find . -name "*.[CHL]" -type f -exec $1 {} \; -print
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
163
bin/foamEtcFile
163
bin/foamEtcFile
@ -4,7 +4,7 @@
|
|||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -34,8 +34,7 @@
|
|||||||
#
|
#
|
||||||
# For example, within the user ~/.OpenFOAM/<VER>/prefs.sh:
|
# For example, within the user ~/.OpenFOAM/<VER>/prefs.sh:
|
||||||
# \code
|
# \code
|
||||||
# foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile -m go prefs.sh` \
|
# foamFile=$(foamEtcFile -mode go prefs.sh) && . $foamFile
|
||||||
# && _foamSource $foamPrefs
|
|
||||||
# \endcode
|
# \endcode
|
||||||
#
|
#
|
||||||
# Note
|
# Note
|
||||||
@ -43,6 +42,7 @@
|
|||||||
# or $FOAM_INST_DIR/openfoam<VERSION>/bin/ (for the debian version)
|
# or $FOAM_INST_DIR/openfoam<VERSION>/bin/ (for the debian version)
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
unset optQuiet optSilent
|
||||||
usage() {
|
usage() {
|
||||||
[ "${optQuiet:-$optSilent}" = true ] && exit 1
|
[ "${optQuiet:-$optSilent}" = true ] && exit 1
|
||||||
|
|
||||||
@ -53,21 +53,23 @@ usage() {
|
|||||||
Usage: ${0##*/} [OPTION] fileName
|
Usage: ${0##*/} [OPTION] fileName
|
||||||
${0##*/} [OPTION] -list
|
${0##*/} [OPTION] -list
|
||||||
options:
|
options:
|
||||||
-all return all files (otherwise stop after the first match)
|
-a, -all return all files (otherwise stop after the first match)
|
||||||
-list list the directories to be searched
|
-l, -list list the directories to be searched
|
||||||
-mode <mode> any combination of u(user), g(group), o(other)
|
-m, -mode MODE any combination of u(user), g(group), o(other)
|
||||||
-prefix <dir> specify an alternative installation prefix
|
-p, -prefix DIR specify an alternative installation prefix
|
||||||
-quiet suppress all normal output
|
-q, -quiet suppress all normal output
|
||||||
-silent suppress all stderr output
|
-s, -silent suppress stderr output, except for things that are emitted
|
||||||
-version <ver> specify an alternative OpenFOAM version
|
by -csh-verbose, -sh-verbose.
|
||||||
in the form Maj.Min.Rev (eg, 1.7.0)
|
-v, -version VER specify alternative OpenFOAM version (eg, 3.0, 1612, ...)
|
||||||
|
-csh | -sh produce output suitable for a csh or sh 'eval'
|
||||||
|
-csh-verbose,
|
||||||
|
-sh-verbose with additional verbosity
|
||||||
-help print the usage
|
-help print the usage
|
||||||
|
|
||||||
Locate user/group/shipped file with semantics similar to the
|
Locate user/group/shipped file with semantics similar to the
|
||||||
~OpenFOAM/fileName expansion.
|
~OpenFOAM/fileName expansion.
|
||||||
|
|
||||||
The options can also be specified as a single character
|
Many options can be specified as a single character, but must not be grouped.
|
||||||
(eg, '-q' instead of '-quiet'), but must not be grouped.
|
|
||||||
|
|
||||||
Exit status
|
Exit status
|
||||||
0 when the file is found. Print resolved path to stdout.
|
0 when the file is found. Print resolved path to stdout.
|
||||||
@ -77,60 +79,56 @@ options:
|
|||||||
USAGE
|
USAGE
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
# the bin dir:
|
# The bin dir:
|
||||||
binDir="${0%/*}"
|
binDir="${0%/*}"
|
||||||
|
|
||||||
# the project dir:
|
# The project dir:
|
||||||
projectDir="${binDir%/bin}"
|
projectDir="${binDir%/bin}"
|
||||||
|
|
||||||
# the prefix dir (same as $FOAM_INST_DIR):
|
# The prefix dir (same as $FOAM_INST_DIR):
|
||||||
prefixDir="${projectDir%/*}"
|
prefixDir="${projectDir%/*}"
|
||||||
|
|
||||||
# the name used for the project directory
|
# The name used for the project directory
|
||||||
projectDirName="${projectDir##*/}"
|
projectDirName="${projectDir##*/}"
|
||||||
|
|
||||||
# version number used for debian packaging
|
# versionNum used for debian packaging
|
||||||
unset versionNum
|
unset version versionNum
|
||||||
|
|
||||||
#
|
#
|
||||||
# handle standard and debian naming convention
|
# Handle standard and debian naming conventions
|
||||||
|
# - set version (always) and versionNum (debian only)
|
||||||
#
|
#
|
||||||
case "$projectDirName" in
|
case "$projectDirName" in
|
||||||
OpenFOAM-*) # standard naming convention OpenFOAM-<VERSION>
|
OpenFOAM-*) # standard naming: OpenFOAM-<VERSION>
|
||||||
version="${projectDirName##OpenFOAM-}"
|
version="${projectDirName##OpenFOAM-}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
openfoam[0-9]* | openfoam-dev) # debian naming convention 'openfoam<VERSION>'
|
openfoam[0-9]* | openfoam-dev) # debian naming: openfoam<VERSION>
|
||||||
versionNum="${projectDirName##openfoam}"
|
versionNum="${projectDirName##openfoam}"
|
||||||
case "$versionNum" in
|
case "${#versionNum}" in
|
||||||
??) # convert 2 digit version number to decimal delineated
|
(2|3|4) # Convert digits version number to decimal delineated
|
||||||
version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)@\1.\2@')
|
version=$(echo "$versionNum" | sed -e 's@\([0-9]\)@\1.@g')
|
||||||
|
version="${version%.}"
|
||||||
;;
|
;;
|
||||||
???) # convert 3 digit version number to decimal delineated
|
|
||||||
version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)\(.\)@\1.\2.\3@')
|
(*) # Fallback - use current environment setting
|
||||||
;;
|
|
||||||
????) # convert 4 digit version number to decimal delineated
|
|
||||||
version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)\(.\)\(.\)@\1.\2.\3.\4@')
|
|
||||||
;;
|
|
||||||
*) # failback - use current environment setting
|
|
||||||
version="$WM_PROJECT_VERSION"
|
version="$WM_PROJECT_VERSION"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "Error : unknown/unsupported naming convention"
|
echo "${0##*/} Error : unknown/unsupported naming convention" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
# default mode is 'ugo'
|
# Default mode is always 'ugo'
|
||||||
mode=ugo
|
mode=ugo
|
||||||
unset optAll optList optQuiet optSilent
|
unset optAll optList optShell
|
||||||
|
|
||||||
# parse options
|
# parse options
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
@ -141,27 +139,46 @@ do
|
|||||||
;;
|
;;
|
||||||
-a | -all)
|
-a | -all)
|
||||||
optAll=true
|
optAll=true
|
||||||
|
unset optShell
|
||||||
;;
|
;;
|
||||||
-l | -list)
|
-l | -list)
|
||||||
optList=true
|
optList=true
|
||||||
|
unset optShell
|
||||||
|
;;
|
||||||
|
-csh | -sh | -csh-verbose | -sh-verbose)
|
||||||
|
optShell="${1#-}"
|
||||||
|
unset optAll
|
||||||
|
;;
|
||||||
|
-mode=[ugo]*)
|
||||||
|
mode="${1#-mode=}"
|
||||||
|
;;
|
||||||
|
-prefix=/*)
|
||||||
|
prefixDir="${1#-prefix=}"
|
||||||
|
prefixDir="${prefixDir%/}"
|
||||||
|
;;
|
||||||
|
-version=*)
|
||||||
|
version="${1#-version=}"
|
||||||
|
# convert x.y.z -> xyz version (if installation looked like debian)
|
||||||
|
if [ -n "$versionNum" ]
|
||||||
|
then
|
||||||
|
versionNum=$(echo "$version" | sed -e 's@\.@@g')
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
-m | -mode)
|
-m | -mode)
|
||||||
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
|
|
||||||
mode="$2"
|
mode="$2"
|
||||||
|
# Sanity check. Handles missing argument too.
|
||||||
# sanity check:
|
|
||||||
case "$mode" in
|
case "$mode" in
|
||||||
*u* | *g* | *o* )
|
[ugo]*)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
usage "'$1' option with invalid mode '$mode'"
|
usage "invalid mode '$mode'"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-p | -prefix)
|
-p | -prefix)
|
||||||
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
|
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
|
||||||
prefixDir="$2"
|
prefixDir="${2%/}"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-q | -quiet)
|
-q | -quiet)
|
||||||
@ -185,7 +202,7 @@ do
|
|||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
-*)
|
-*)
|
||||||
usage "unknown option: '$*'"
|
usage "unknown option: '$1'"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
break
|
break
|
||||||
@ -194,6 +211,13 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Update projectDir accordingly
|
||||||
|
if [ -n "$versionNum" ]
|
||||||
|
then
|
||||||
|
projectDir="$prefixDir/openfoam$versionNum" # debian
|
||||||
|
else
|
||||||
|
projectDir="$prefixDir/${WM_PROJECT:-OpenFOAM}-$version" # standard
|
||||||
|
fi
|
||||||
|
|
||||||
# debugging:
|
# debugging:
|
||||||
# echo "Installed locations:"
|
# echo "Installed locations:"
|
||||||
@ -210,30 +234,20 @@ fileName="${1#~OpenFOAM/}"
|
|||||||
|
|
||||||
# Define the various places to be searched:
|
# Define the various places to be searched:
|
||||||
unset dirList
|
unset dirList
|
||||||
case "$mode" in
|
case "$mode" in (*u*) # user
|
||||||
*u*) # user
|
dir="$HOME/.${WM_PROJECT:-OpenFOAM}"
|
||||||
userDir="$HOME/.${WM_PROJECT:-OpenFOAM}"
|
dirList="$dirList $dir/$version $dir"
|
||||||
dirList="$dirList $userDir/$version $userDir"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$mode" in
|
case "$mode" in (*g*) # group (site)
|
||||||
*g*) # group (site)
|
dir="${WM_PROJECT_SITE:-$prefixDir/site}"
|
||||||
siteDir="${WM_PROJECT_SITE:-$prefixDir/site}"
|
dirList="$dirList $dir/$version $dir"
|
||||||
dirList="$dirList $siteDir/$version $siteDir"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$mode" in
|
case "$mode" in (*o*) # other (shipped)
|
||||||
*o*) # other (shipped)
|
dirList="$dirList $projectDir/etc"
|
||||||
if [ -n "$versionNum" ]
|
|
||||||
then
|
|
||||||
# debian packaging
|
|
||||||
dirList="$dirList $prefixDir/openfoam$versionNum/etc"
|
|
||||||
else
|
|
||||||
# standard packaging
|
|
||||||
dirList="$dirList $prefixDir/${WM_PROJECT:-OpenFOAM}-$version/etc"
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
set -- $dirList
|
set -- $dirList
|
||||||
@ -251,7 +265,7 @@ then
|
|||||||
[ "$nArgs" -le 1 ] || usage
|
[ "$nArgs" -le 1 ] || usage
|
||||||
|
|
||||||
# a silly combination, but -quiet does have precedence
|
# a silly combination, but -quiet does have precedence
|
||||||
[ "$optQuiet" = true ] && exit 0
|
[ -n "$optQuiet" ] && exit 0
|
||||||
|
|
||||||
for dir
|
for dir
|
||||||
do
|
do
|
||||||
@ -275,13 +289,28 @@ else
|
|||||||
if [ -f "$dir/$fileName" ]
|
if [ -f "$dir/$fileName" ]
|
||||||
then
|
then
|
||||||
exitCode=0
|
exitCode=0
|
||||||
if [ "$optQuiet" = true ]
|
[ -n "$optQuiet" ] && break
|
||||||
then
|
|
||||||
|
case "$optShell" in
|
||||||
|
(*verbose)
|
||||||
|
echo "Using: $dir/$fileName" 1>&2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "$optShell" in
|
||||||
|
csh*)
|
||||||
|
echo "source $dir/$fileName"
|
||||||
break
|
break
|
||||||
else
|
;;
|
||||||
|
sh*)
|
||||||
|
echo ". $dir/$fileName"
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
*)
|
||||||
echo "$dir/$fileName"
|
echo "$dir/$fileName"
|
||||||
[ "$optAll" = true ] || break
|
[ -n "$optAll" ] || break
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@ -119,7 +119,7 @@ else
|
|||||||
( cd $packDir && git archive --format=tar --prefix=$packDir/ HEAD) > $packBase.tar &&
|
( cd $packDir && git archive --format=tar --prefix=$packDir/ HEAD) > $packBase.tar &&
|
||||||
|
|
||||||
echo "add in time-stamp and lnInclude directories" 1>&2 &&
|
echo "add in time-stamp and lnInclude directories" 1>&2 &&
|
||||||
tar cf $packBase.tar2 $packDir/.timeStamp $packDir/.build `find -H $packDir -type d -name lnInclude` &&
|
tar cf $packBase.tar2 $packDir/.timeStamp $packDir/.build $(find -H $packDir -name lnInclude -type d) &&
|
||||||
tar Af $packBase.tar $packBase.tar2 &&
|
tar Af $packBase.tar $packBase.tar2 &&
|
||||||
|
|
||||||
echo "gzip tar file" 1>&2 &&
|
echo "gzip tar file" 1>&2 &&
|
||||||
|
|||||||
@ -71,8 +71,8 @@ then
|
|||||||
elif [ -d system ]
|
elif [ -d system ]
|
||||||
then
|
then
|
||||||
# Run normal case.
|
# Run normal case.
|
||||||
parentDir=`dirname $PWD`
|
parentDir=$(dirname $PWD)
|
||||||
application=`getApplication`
|
application=$(getApplication)
|
||||||
runApplication blockMesh
|
runApplication blockMesh
|
||||||
runApplication $application
|
runApplication $application
|
||||||
else
|
else
|
||||||
|
|||||||
@ -93,7 +93,7 @@ if [ ! -d $DIR ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FILES=$(find $DIR -type f -name *vtk)
|
FILES=$(find $DIR -name '*.vtk' -type f)
|
||||||
NAMES=$(for f in $FILES; do basename $f .vtk; done | sort -u)
|
NAMES=$(for f in $FILES; do basename $f .vtk; done | sort -u)
|
||||||
|
|
||||||
if [ -d $OUT ]; then
|
if [ -d $OUT ]; then
|
||||||
|
|||||||
@ -28,8 +28,8 @@
|
|||||||
# Description
|
# Description
|
||||||
# Updates the header of application files.
|
# Updates the header of application files.
|
||||||
# By default, writes current version in the header.
|
# By default, writes current version in the header.
|
||||||
# Alternatively version can be specified with -v option.
|
# The version can alternatively be specified with the -v option.
|
||||||
# Also removes consecutive blank lines from file.
|
# Also removes consecutive blank lines from the file.
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
usage() {
|
||||||
@ -66,7 +66,7 @@ do
|
|||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
-*)
|
-*)
|
||||||
usage "unknown option: '$*'"
|
usage "unknown option: '$1'"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
break
|
break
|
||||||
@ -118,7 +118,7 @@ FoamFileAttribute()
|
|||||||
tmpFile=FoamFile.tmp$$
|
tmpFile=FoamFile.tmp$$
|
||||||
for caseFile
|
for caseFile
|
||||||
do
|
do
|
||||||
if grep FoamFile $caseFile >/dev/null 2>&1
|
if grep -q FoamFile $caseFile 2>/dev/null
|
||||||
then
|
then
|
||||||
echo "Updating case file: $caseFile"
|
echo "Updating case file: $caseFile"
|
||||||
sed -n '/FoamFile/,/}/p' $caseFile > $tmpFile
|
sed -n '/FoamFile/,/}/p' $caseFile > $tmpFile
|
||||||
@ -137,7 +137,7 @@ do
|
|||||||
[ -s $tmpFile ] && cat $tmpFile >| $caseFile
|
[ -s $tmpFile ] && cat $tmpFile >| $caseFile
|
||||||
rm -f $tmpFile 2>/dev/null
|
rm -f $tmpFile 2>/dev/null
|
||||||
else
|
else
|
||||||
echo " Invalid case file: $caseFile" 1>&2
|
echo "Invalid case file: $caseFile" 1>&2
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,7 @@ then
|
|||||||
set -- .
|
set -- .
|
||||||
elif [ "$1" = "-h" -o "$1" = "-help" ]
|
elif [ "$1" = "-h" -o "$1" = "-help" ]
|
||||||
then
|
then
|
||||||
|
exec 1>&2
|
||||||
echo "Usage: ${0##*/} [dir1] .. [dirN]"
|
echo "Usage: ${0##*/} [dir1] .. [dirN]"
|
||||||
echo " remove all core files"
|
echo " remove all core files"
|
||||||
exit 1
|
exit 1
|
||||||
@ -45,8 +46,8 @@ for i
|
|||||||
do
|
do
|
||||||
if [ -d "$i" ]
|
if [ -d "$i" ]
|
||||||
then
|
then
|
||||||
echo "removing all core files: $i"
|
echo "removing all core files: $i" 1>&2
|
||||||
find $i \( -type f -name 'core' -o -name 'core.[1-9]*' -o -name 'vgcore.*' \) -print | xargs -t rm 2>/dev/null
|
find $i \( -name core -o -name 'core.[1-9]*' -o -name 'vgcore.*' \) -type f -delete
|
||||||
else
|
else
|
||||||
echo "no directory: $i" 1>&2
|
echo "no directory: $i" 1>&2
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -35,6 +35,7 @@ then
|
|||||||
set -- .
|
set -- .
|
||||||
elif [ "$1" = "-h" -o "$1" = "-help" ]
|
elif [ "$1" = "-h" -o "$1" = "-help" ]
|
||||||
then
|
then
|
||||||
|
exec 1>&2
|
||||||
echo "Usage: ${0##*/} [dir1] .. [dirN]"
|
echo "Usage: ${0##*/} [dir1] .. [dirN]"
|
||||||
echo " remove all *~ files"
|
echo " remove all *~ files"
|
||||||
exit 1
|
exit 1
|
||||||
@ -45,8 +46,8 @@ for i
|
|||||||
do
|
do
|
||||||
if [ -d "$i" ]
|
if [ -d "$i" ]
|
||||||
then
|
then
|
||||||
echo "removing all *~ files: $i"
|
echo "removing all *~ files: $i" 1>&2
|
||||||
find $i \( -name '*~' -o -name '.*~' \) -print | xargs -t rm 2>/dev/null
|
find $i \( -name '*~' -o -name '.*~' \) -type f -delete -print
|
||||||
else
|
else
|
||||||
echo "no directory: $i" 1>&2
|
echo "no directory: $i" 1>&2
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -78,6 +78,7 @@ find -H $packDir \
|
|||||||
| sed \
|
| sed \
|
||||||
-e '\@/\.git/@d' \
|
-e '\@/\.git/@d' \
|
||||||
-e '\@/\.tags/@d' \
|
-e '\@/\.tags/@d' \
|
||||||
|
-e '\@/build/@d' \
|
||||||
-e '\@/platforms/@d' \
|
-e '\@/platforms/@d' \
|
||||||
-e '\@/t/@d' \
|
-e '\@/t/@d' \
|
||||||
-e '\@/Make[.A-Za-z]*/[^/]*/@d' \
|
-e '\@/Make[.A-Za-z]*/[^/]*/@d' \
|
||||||
|
|||||||
46
etc/bashrc
46
etc/bashrc
@ -3,7 +3,7 @@
|
|||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -61,7 +61,7 @@ export FOAM_INST_DIR
|
|||||||
export WM_COMPILER_TYPE=system
|
export WM_COMPILER_TYPE=system
|
||||||
|
|
||||||
#- Compiler:
|
#- Compiler:
|
||||||
# WM_COMPILER = Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-2] | Clang | Icc
|
# WM_COMPILER= Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-3] | Clang | Icc | IccKNL
|
||||||
export WM_COMPILER=Gcc
|
export WM_COMPILER=Gcc
|
||||||
unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH
|
unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH
|
||||||
|
|
||||||
@ -136,10 +136,10 @@ export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
|
|||||||
. $WM_PROJECT_DIR/etc/config.sh/functions
|
. $WM_PROJECT_DIR/etc/config.sh/functions
|
||||||
|
|
||||||
# Add in preset user or site preferences:
|
# Add in preset user or site preferences:
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`
|
_foamSourceEtc prefs.sh
|
||||||
|
|
||||||
# Evaluate command-line parameters and record settings for later
|
# Evaluate command-line parameters and record settings for later.
|
||||||
# these can be used to set/unset values, or specify alternative pref files
|
# These can be used to set/unset values, or specify alternative pref files.
|
||||||
export FOAM_SETTINGS="$@"
|
export FOAM_SETTINGS="$@"
|
||||||
_foamEval $@
|
_foamEval $@
|
||||||
|
|
||||||
@ -148,55 +148,55 @@ _foamEval $@
|
|||||||
foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
|
foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
|
||||||
|
|
||||||
#- Clean PATH
|
#- Clean PATH
|
||||||
cleaned=`$foamClean "$PATH" "$foamOldDirs"` && PATH="$cleaned"
|
cleaned=$($foamClean "$PATH" "$foamOldDirs") && PATH="$cleaned"
|
||||||
|
|
||||||
#- Clean LD_LIBRARY_PATH
|
#- Clean LD_LIBRARY_PATH
|
||||||
cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"` \
|
cleaned=$($foamClean "$LD_LIBRARY_PATH" "$foamOldDirs") \
|
||||||
&& LD_LIBRARY_PATH="$cleaned"
|
&& LD_LIBRARY_PATH="$cleaned"
|
||||||
|
|
||||||
#- Clean MANPATH
|
#- Clean MANPATH
|
||||||
cleaned=`$foamClean "$MANPATH" "$foamOldDirs"` && MANPATH="$cleaned"
|
cleaned=$($foamClean "$MANPATH" "$foamOldDirs") && MANPATH="$cleaned"
|
||||||
|
|
||||||
export PATH LD_LIBRARY_PATH MANPATH
|
export PATH LD_LIBRARY_PATH MANPATH
|
||||||
|
|
||||||
|
|
||||||
# Source project setup files
|
# Source project setup files
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
_foamSource $WM_PROJECT_DIR/etc/config.sh/settings
|
_foamSourceEtc config.sh/settings
|
||||||
_foamSource $WM_PROJECT_DIR/etc/config.sh/aliases
|
_foamSourceEtc config.sh/aliases
|
||||||
|
|
||||||
|
|
||||||
# Source user setup files for optional packages
|
# Source user setup files for optional packages
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/mpi`
|
_foamSourceEtc config.sh/mpi
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/paraview`
|
_foamSourceEtc config.sh/paraview
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/vtk`
|
_foamSourceEtc config.sh/vtk
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/ensight`
|
_foamSourceEtc config.sh/ensight
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/gperftools`
|
_foamSourceEtc config.sh/gperftools
|
||||||
|
|
||||||
##_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/ADIOS`
|
#_foamSourceEtc config.sh/ADIOS
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL`
|
_foamSourceEtc config.sh/CGAL
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch`
|
_foamSourceEtc config.sh/scotch
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/FFTW`
|
_foamSourceEtc config.sh/FFTW
|
||||||
|
|
||||||
|
|
||||||
# Clean environment paths again. Only remove duplicates
|
# Clean environment paths again. Only remove duplicates
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
#- Clean PATH
|
#- Clean PATH
|
||||||
cleaned=`$foamClean "$PATH"` && PATH="$cleaned"
|
cleaned=$($foamClean "$PATH") && PATH="$cleaned"
|
||||||
|
|
||||||
#- Clean LD_LIBRARY_PATH
|
#- Clean LD_LIBRARY_PATH
|
||||||
cleaned=`$foamClean "$LD_LIBRARY_PATH"` && LD_LIBRARY_PATH="$cleaned"
|
cleaned=$($foamClean "$LD_LIBRARY_PATH") && LD_LIBRARY_PATH="$cleaned"
|
||||||
|
|
||||||
#- Clean MANPATH (trailing ':' to find system pages)
|
#- Clean MANPATH (trailing ':' to find system pages)
|
||||||
cleaned=`$foamClean "$MANPATH"`: && MANPATH="$cleaned"
|
cleaned=$($foamClean "$MANPATH") && MANPATH="${cleaned}:"
|
||||||
|
|
||||||
export PATH LD_LIBRARY_PATH MANPATH
|
export PATH LD_LIBRARY_PATH MANPATH
|
||||||
|
|
||||||
#- Clean LD_PRELOAD
|
#- Clean LD_PRELOAD
|
||||||
if [ -n "$LD_PRELOAD" ]
|
if [ -n "$LD_PRELOAD" ]
|
||||||
then
|
then
|
||||||
cleaned=`$foamClean "$LD_PRELOAD"` && LD_PRELOAD="$cleaned"
|
cleaned=$($foamClean "$LD_PRELOAD") && LD_PRELOAD="$cleaned"
|
||||||
export LD_PRELOAD
|
export LD_PRELOAD
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
# \\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
@ -47,10 +47,12 @@
|
|||||||
# be used during the build process. See further notes there.
|
# be used during the build process. See further notes there.
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||||
|
|
||||||
set adios_version=ADIOS-1.11.0
|
set adios_version=ADIOS-1.11.1
|
||||||
setenv ADIOS_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$adios_version
|
setenv ADIOS_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$adios_version
|
||||||
|
|
||||||
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
if ($?FOAM_VERBOSE && $?prompt) then
|
if ($?FOAM_VERBOSE && $?prompt) then
|
||||||
echo "Using adios ($adios_version) -> $ADIOS_ARCH_PATH"
|
echo "Using adios ($adios_version) -> $ADIOS_ARCH_PATH"
|
||||||
|
|||||||
@ -49,6 +49,7 @@
|
|||||||
# be used during the build process.
|
# be used during the build process.
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||||
|
|
||||||
set boost_version=boost_1_62_0
|
set boost_version=boost_1_62_0
|
||||||
set cgal_version=CGAL-4.9
|
set cgal_version=CGAL-4.9
|
||||||
@ -56,6 +57,7 @@ set cgal_version=CGAL-4.9
|
|||||||
setenv BOOST_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
|
setenv BOOST_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
|
||||||
setenv CGAL_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version
|
setenv CGAL_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version
|
||||||
|
|
||||||
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
if ($?FOAM_VERBOSE && $?prompt) then
|
if ($?FOAM_VERBOSE && $?prompt) then
|
||||||
echo "Using boost ($boost_version) -> $BOOST_ARCH_PATH"
|
echo "Using boost ($boost_version) -> $BOOST_ARCH_PATH"
|
||||||
|
|||||||
@ -47,11 +47,12 @@
|
|||||||
# be used during the build process.
|
# be used during the build process.
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||||
|
|
||||||
set fftw_version=fftw-3.3.5
|
set fftw_version=fftw-3.3.5
|
||||||
|
|
||||||
setenv FFTW_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$fftw_version
|
setenv FFTW_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$fftw_version
|
||||||
|
|
||||||
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
if ($?FOAM_VERBOSE && $?prompt) then
|
if ($?FOAM_VERBOSE && $?prompt) then
|
||||||
echo "Using fftw ($fftw_version) -> $FFTW_ARCH_PATH"
|
echo "Using fftw ($fftw_version) -> $FFTW_ARCH_PATH"
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -63,6 +63,9 @@ case ThirdParty:
|
|||||||
case Gcc62:
|
case Gcc62:
|
||||||
set gcc_version=gcc-6.2.0
|
set gcc_version=gcc-6.2.0
|
||||||
breaksw
|
breaksw
|
||||||
|
case Gcc63:
|
||||||
|
set gcc_version=gcc-6.3.0
|
||||||
|
breaksw
|
||||||
case Clang:
|
case Clang:
|
||||||
set clang_version=llvm-3.7.0
|
set clang_version=llvm-3.7.0
|
||||||
# set clang_version=llvm-3.8.0
|
# set clang_version=llvm-3.8.0
|
||||||
@ -84,7 +87,7 @@ case Clang:
|
|||||||
setenv WM_CC 'clang'
|
setenv WM_CC 'clang'
|
||||||
setenv WM_CXX 'clang++'
|
setenv WM_CXX 'clang++'
|
||||||
breaksw
|
breaksw
|
||||||
case Icc:
|
case Icc*:
|
||||||
setenv WM_CC 'icc'
|
setenv WM_CC 'icc'
|
||||||
setenv WM_CXX 'icpc'
|
setenv WM_CXX 'icpc'
|
||||||
breaksw
|
breaksw
|
||||||
|
|||||||
@ -38,9 +38,7 @@ endif
|
|||||||
if ( -r $CEI_HOME ) then
|
if ( -r $CEI_HOME ) then
|
||||||
|
|
||||||
# Special treatment for 32bit OpenFOAM and 64bit Ensight
|
# Special treatment for 32bit OpenFOAM and 64bit Ensight
|
||||||
if ($WM_ARCH == linux && `uname -m` == x86_64) then
|
if ($WM_ARCH-`uname -m` == linux-x86_64) setenv CEI_ARCH linux_2.6_32
|
||||||
setenv CEI_ARCH linux_2.6_32
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Add to path
|
# Add to path
|
||||||
setenv PATH ${CEI_HOME}/bin:${PATH}
|
setenv PATH ${CEI_HOME}/bin:${PATH}
|
||||||
|
|||||||
@ -53,7 +53,7 @@ case SYSTEMOPENMPI:
|
|||||||
case OPENMPI:
|
case OPENMPI:
|
||||||
setenv FOAM_MPI openmpi-1.10.4
|
setenv FOAM_MPI openmpi-1.10.4
|
||||||
# Optional configuration tweaks:
|
# Optional configuration tweaks:
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/openmpi`
|
_foamSourceEtc config.csh/openmpi
|
||||||
|
|
||||||
setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
|
setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
|
||||||
|
|
||||||
|
|||||||
@ -50,12 +50,13 @@
|
|||||||
# unsetenv ParaView_VERSION # avoid using ThirdParty settings
|
# unsetenv ParaView_VERSION # avoid using ThirdParty settings
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||||
|
|
||||||
setenv ParaView_VERSION 5.0.1
|
setenv ParaView_VERSION 5.0.1
|
||||||
setenv ParaView_MAJOR detect # Automatically determine major version
|
setenv ParaView_MAJOR detect # Automatically determine major version
|
||||||
|
|
||||||
set cmake_version=cmake-system
|
set cmake_version=cmake-system
|
||||||
|
|
||||||
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
if ( ! $?ParaView_DIR ) setenv ParaView_DIR
|
if ( ! $?ParaView_DIR ) setenv ParaView_DIR
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -75,7 +75,7 @@ case Linux:
|
|||||||
breaksw
|
breaksw
|
||||||
|
|
||||||
default:
|
default:
|
||||||
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32 or 64"
|
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32|64"
|
||||||
breaksw
|
breaksw
|
||||||
|
|
||||||
endsw
|
endsw
|
||||||
@ -124,11 +124,13 @@ case SunOS:
|
|||||||
setenv WM_LDFLAGS '-mabi=64 -G0'
|
setenv WM_LDFLAGS '-mabi=64 -G0'
|
||||||
breaksw
|
breaksw
|
||||||
|
|
||||||
default:
|
default: # An unsupported operating system
|
||||||
echo
|
/bin/cat <<USAGE
|
||||||
echo "Your '$WM_ARCH' operating system is not supported by this release"
|
|
||||||
echo "of OpenFOAM. For further assistance, please contact www.OpenFOAM.com"
|
Your "$WM_ARCH" operating system is unsupported by this OpenFOAM release.
|
||||||
echo
|
For further assistance, please contact www.OpenFOAM.com
|
||||||
|
|
||||||
|
USAGE
|
||||||
breaksw
|
breaksw
|
||||||
|
|
||||||
endsw
|
endsw
|
||||||
@ -210,7 +212,7 @@ if ( ! $?WM_COMPILER_TYPE ) setenv WM_COMPILER_TYPE system
|
|||||||
|
|
||||||
# Load configured compiler versions, regardless of the compiler type
|
# Load configured compiler versions, regardless of the compiler type
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/compiler`
|
_foamSourceEtc config.csh/compiler
|
||||||
|
|
||||||
switch ("$WM_COMPILER_TYPE")
|
switch ("$WM_COMPILER_TYPE")
|
||||||
case system:
|
case system:
|
||||||
@ -230,7 +232,7 @@ case ThirdParty:
|
|||||||
|
|
||||||
# Check that the compiler directory can be found
|
# Check that the compiler directory can be found
|
||||||
if ( ! -d "$gccDir" ) then
|
if ( ! -d "$gccDir" ) then
|
||||||
cat << GCC_NOT_FOUND
|
/bin/cat << GCC_NOT_FOUND
|
||||||
===============================================================================
|
===============================================================================
|
||||||
Warning in $WM_PROJECT_DIR/etc/config.csh/settings:
|
Warning in $WM_PROJECT_DIR/etc/config.csh/settings:
|
||||||
Cannot find '$WM_COMPILER' compiler installation
|
Cannot find '$WM_COMPILER' compiler installation
|
||||||
@ -272,7 +274,7 @@ GCC_NOT_FOUND
|
|||||||
|
|
||||||
# Check that the compiler directory can be found
|
# Check that the compiler directory can be found
|
||||||
if ( ! -d "$clangDir" ) then
|
if ( ! -d "$clangDir" ) then
|
||||||
cat << CLANG_NOT_FOUND
|
/bin/cat << CLANG_NOT_FOUND
|
||||||
===============================================================================
|
===============================================================================
|
||||||
Warning in $WM_PROJECT_DIR/etc/config.csh/settings:
|
Warning in $WM_PROJECT_DIR/etc/config.csh/settings:
|
||||||
Cannot find '$WM_COMPILER' compiler installation
|
Cannot find '$WM_COMPILER' compiler installation
|
||||||
|
|||||||
@ -41,6 +41,7 @@
|
|||||||
# See the BuildIssues.txt about problems that can be encountered when using
|
# See the BuildIssues.txt about problems that can be encountered when using
|
||||||
# the 'plain' VTK sources.
|
# the 'plain' VTK sources.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||||
|
|
||||||
set vtk_version=VTK-7.1.0
|
set vtk_version=VTK-7.1.0
|
||||||
set mesa_version=mesa-13.0.1
|
set mesa_version=mesa-13.0.1
|
||||||
@ -48,6 +49,7 @@ set mesa_version=mesa-13.0.1
|
|||||||
setenv VTK_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$vtk_version
|
setenv VTK_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$vtk_version
|
||||||
setenv MESA_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mesa_version
|
setenv MESA_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mesa_version
|
||||||
|
|
||||||
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
if ($?FOAM_VERBOSE && $?prompt) then
|
if ($?FOAM_VERBOSE && $?prompt) then
|
||||||
echo "Using vtk ($vtk_version) -> $VTK_DIR"
|
echo "Using vtk ($vtk_version) -> $VTK_DIR"
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
# \\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
@ -46,10 +46,12 @@
|
|||||||
# for the appropriate MPI. Eg, libadios_openmpi-system
|
# for the appropriate MPI. Eg, libadios_openmpi-system
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||||
|
|
||||||
adios_version=ADIOS-1.11.0
|
adios_version=ADIOS-1.11.1
|
||||||
export ADIOS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$adios_version
|
export ADIOS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$adios_version
|
||||||
|
|
||||||
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||||
then
|
then
|
||||||
|
|||||||
@ -48,6 +48,7 @@
|
|||||||
# - boost_version / cgal_version variables are retained.
|
# - boost_version / cgal_version variables are retained.
|
||||||
# - the LD_LIBRARY_PATH is not adjusted.
|
# - the LD_LIBRARY_PATH is not adjusted.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||||
|
|
||||||
boost_version=boost_1_62_0
|
boost_version=boost_1_62_0
|
||||||
cgal_version=CGAL-4.9
|
cgal_version=CGAL-4.9
|
||||||
@ -55,6 +56,7 @@ cgal_version=CGAL-4.9
|
|||||||
export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
|
export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
|
||||||
export CGAL_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version
|
export CGAL_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version
|
||||||
|
|
||||||
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||||
then
|
then
|
||||||
|
|||||||
@ -46,11 +46,12 @@
|
|||||||
# - fftw_version variable is retained.
|
# - fftw_version variable is retained.
|
||||||
# - the LD_LIBRARY_PATH is not adjusted.
|
# - the LD_LIBRARY_PATH is not adjusted.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||||
|
|
||||||
fftw_version=fftw-3.3.5
|
fftw_version=fftw-3.3.5
|
||||||
|
|
||||||
export FFTW_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$fftw_version
|
export FFTW_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$fftw_version
|
||||||
|
|
||||||
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||||
then
|
then
|
||||||
|
|||||||
@ -35,8 +35,10 @@
|
|||||||
# A csh version is not needed, since the values here are only sourced
|
# A csh version is not needed, since the values here are only sourced
|
||||||
# during the wmake process
|
# during the wmake process
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||||
|
|
||||||
ccmio_version=libccmio-2.6.1
|
ccmio_version=libccmio-2.6.1
|
||||||
export CCMIO_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$ccmio_version
|
export CCMIO_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$ccmio_version
|
||||||
|
|
||||||
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -62,6 +62,9 @@ ThirdParty)
|
|||||||
Gcc62)
|
Gcc62)
|
||||||
gcc_version=gcc-6.2.0
|
gcc_version=gcc-6.2.0
|
||||||
;;
|
;;
|
||||||
|
Gcc63)
|
||||||
|
gcc_version=gcc-6.3.0
|
||||||
|
;;
|
||||||
Clang)
|
Clang)
|
||||||
clang_version=llvm-3.7.0
|
clang_version=llvm-3.7.0
|
||||||
# clang_version=llvm-3.8.0
|
# clang_version=llvm-3.8.0
|
||||||
@ -84,7 +87,7 @@ Clang)
|
|||||||
export WM_CC='clang'
|
export WM_CC='clang'
|
||||||
export WM_CXX='clang++'
|
export WM_CXX='clang++'
|
||||||
;;
|
;;
|
||||||
Icc)
|
Icc*)
|
||||||
export WM_CC='icc'
|
export WM_CC='icc'
|
||||||
export WM_CXX='icpc'
|
export WM_CXX='icpc'
|
||||||
;;
|
;;
|
||||||
|
|||||||
@ -31,22 +31,16 @@
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Fallback value
|
# Fallback value
|
||||||
if [ ! -d "$CEI_HOME" ]
|
[ -d "$CEI_HOME" ] || export CEI_HOME=/usr/local/ensight/CEI
|
||||||
then
|
|
||||||
export CEI_HOME=/usr/local/ensight/CEI
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -r $CEI_HOME ]
|
if [ -r $CEI_HOME ]
|
||||||
then
|
then
|
||||||
|
|
||||||
# Special treatment for 32bit OpenFOAM and 64bit Ensight
|
# Special treatment for 32bit OpenFOAM and 64bit Ensight
|
||||||
if [ "$WM_ARCH" = linux -a `uname -m` = x86_64 ]
|
[ "$WM_ARCH-$(uname -m)" = linux-x86_64 ] && export CEI_ARCH=linux_2.6_32
|
||||||
then
|
|
||||||
export CEI_ARCH=linux_2.6_32
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add to path if required
|
# Add to path if required
|
||||||
if [ "$CEI_HOME/bin/ensight" != "`which ensight 2>/dev/null`" ]
|
if [ "$CEI_HOME/bin/ensight" != "$(command -v ensight)" ]
|
||||||
then
|
then
|
||||||
export PATH=$CEI_HOME/bin:$PATH
|
export PATH=$CEI_HOME/bin:$PATH
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -31,9 +31,10 @@
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# First load the standard versions, if necessary
|
# First load the standard versions, if necessary
|
||||||
foamFile=$($WM_PROJECT_DIR/bin/foamEtcFile -mode o config.sh/compiler \
|
if foamFile=$($WM_PROJECT_DIR/bin/foamEtcFile -mode o config.sh/compiler)
|
||||||
2>/dev/null)
|
then
|
||||||
[ $? -eq 0 ] && _foamSource $foamFile
|
. $foamFile
|
||||||
|
fi
|
||||||
unset foamFile
|
unset foamFile
|
||||||
|
|
||||||
|
|
||||||
@ -57,7 +58,7 @@ Gcc48u)
|
|||||||
export WM_CC='gcc-4.8'
|
export WM_CC='gcc-4.8'
|
||||||
export WM_CXX='g++-4.8'
|
export WM_CXX='g++-4.8'
|
||||||
;;
|
;;
|
||||||
Icc)
|
Icc*)
|
||||||
# Example for ensuring that 3rd software uses the Icc compilers
|
# Example for ensuring that 3rd software uses the Icc compilers
|
||||||
export WM_CC='icc'
|
export WM_CC='icc'
|
||||||
export WM_CXX='icpc'
|
export WM_CXX='icpc'
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -36,20 +36,31 @@ then
|
|||||||
# Temporary environment variable for automatically (un)loading functions
|
# Temporary environment variable for automatically (un)loading functions
|
||||||
WM_BASH_FUNCTIONS=loaded
|
WM_BASH_FUNCTIONS=loaded
|
||||||
|
|
||||||
# Source files, possibly with some verbosity
|
# Source a file, possibly with some verbosity
|
||||||
_foamSource()
|
_foamSource()
|
||||||
{
|
{
|
||||||
while [ $# -ge 1 ]
|
if [ $# -gt 0 -a -f "$1" ]
|
||||||
do
|
then
|
||||||
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo "Sourcing: $1" 1>&2
|
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo "Using: $1" 1>&2
|
||||||
. $1
|
. $1
|
||||||
shift
|
fi
|
||||||
done
|
}
|
||||||
|
|
||||||
|
# Source an etc file, possibly with some verbosity
|
||||||
|
_foamSourceEtc()
|
||||||
|
{
|
||||||
|
local file
|
||||||
|
if [ $# -gt 0 ] && file=$($WM_PROJECT_DIR/bin/foamEtcFile "$@")
|
||||||
|
then
|
||||||
|
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo "Using: $file" 1>&2
|
||||||
|
. $file
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Evaluate command-line parameters
|
# Evaluate command-line parameters
|
||||||
_foamEval()
|
_foamEval()
|
||||||
{
|
{
|
||||||
|
local file
|
||||||
while [ $# -gt 0 ]
|
while [ $# -gt 0 ]
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -71,9 +82,10 @@ then
|
|||||||
# Filename: source it
|
# Filename: source it
|
||||||
if [ -f "$1" ]
|
if [ -f "$1" ]
|
||||||
then
|
then
|
||||||
_foamSource "$1"
|
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo "Using: $1" 1>&2
|
||||||
|
. "$1"
|
||||||
else
|
else
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -silent "$1"`
|
_foamSourceEtc -silent "$1"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -84,31 +96,19 @@ then
|
|||||||
# Prefix to PATH
|
# Prefix to PATH
|
||||||
_foamAddPath()
|
_foamAddPath()
|
||||||
{
|
{
|
||||||
while [ $# -ge 1 ]
|
[ $# -gt 0 ] && export PATH=$1:$PATH;
|
||||||
do
|
|
||||||
export PATH=$1:$PATH
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Prefix to LD_LIBRARY_PATH
|
# Prefix to LD_LIBRARY_PATH
|
||||||
_foamAddLib()
|
_foamAddLib()
|
||||||
{
|
{
|
||||||
while [ $# -ge 1 ]
|
[ $# -gt 0 ] && export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH
|
||||||
do
|
|
||||||
export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Prefix to MANPATH
|
# Prefix to MANPATH
|
||||||
_foamAddMan()
|
_foamAddMan()
|
||||||
{
|
{
|
||||||
while [ $# -ge 1 ]
|
[ $# -gt 0 ] && export MANPATH=$1:$MANPATH
|
||||||
do
|
|
||||||
export MANPATH=$1:$MANPATH
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -117,6 +117,9 @@ else
|
|||||||
# ~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~
|
||||||
unset WM_BASH_FUNCTIONS
|
unset WM_BASH_FUNCTIONS
|
||||||
unset -f _foamAddPath _foamAddLib _foamAddMan
|
unset -f _foamAddPath _foamAddLib _foamAddMan
|
||||||
unset -f _foamSource _foamEval
|
unset -f _foamSourceEtc _foamEval
|
||||||
|
unset -f _foamSource
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -46,11 +46,12 @@
|
|||||||
# - gperftools_version variable are retained.
|
# - gperftools_version variable are retained.
|
||||||
# - the LD_LIBRARY_PATH and PATH are not adjusted.
|
# - the LD_LIBRARY_PATH and PATH are not adjusted.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||||
|
|
||||||
gperftools_version=gperftools-2.5
|
gperftools_version=gperftools-2.5
|
||||||
|
|
||||||
GPERFTOOLS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$gperftools_version
|
GPERFTOOLS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$gperftools_version
|
||||||
|
|
||||||
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||||
then
|
then
|
||||||
|
|||||||
@ -52,9 +52,10 @@
|
|||||||
# by creating an empty one with the same name at a user or site location.
|
# by creating an empty one with the same name at a user or site location.
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||||
|
|
||||||
METIS_VERSION=metis-5.1.0
|
METIS_VERSION=metis-5.1.0
|
||||||
|
|
||||||
export METIS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$METIS_VERSION
|
export METIS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$METIS_VERSION
|
||||||
|
|
||||||
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -43,7 +43,7 @@ SYSTEMOPENMPI)
|
|||||||
unset OPAL_PREFIX
|
unset OPAL_PREFIX
|
||||||
fi
|
fi
|
||||||
|
|
||||||
libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'`
|
libDir=$(mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/')
|
||||||
|
|
||||||
# Bit of a hack: strip off 'lib' and hope this is the path to openmpi
|
# Bit of a hack: strip off 'lib' and hope this is the path to openmpi
|
||||||
# include files and libraries.
|
# include files and libraries.
|
||||||
@ -56,7 +56,7 @@ SYSTEMOPENMPI)
|
|||||||
OPENMPI)
|
OPENMPI)
|
||||||
export FOAM_MPI=openmpi-1.10.4
|
export FOAM_MPI=openmpi-1.10.4
|
||||||
# Optional configuration tweaks:
|
# Optional configuration tweaks:
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/openmpi`
|
_foamSourceEtc config.sh/openmpi
|
||||||
|
|
||||||
export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
|
export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ HPMPI)
|
|||||||
|
|
||||||
_foamAddPath $MPI_ARCH_PATH/bin
|
_foamAddPath $MPI_ARCH_PATH/bin
|
||||||
|
|
||||||
case `uname -m` in
|
case $(uname -m) in
|
||||||
i686)
|
i686)
|
||||||
_foamAddLib $MPI_ARCH_PATH/lib/linux_ia32
|
_foamAddLib $MPI_ARCH_PATH/lib/linux_ia32
|
||||||
;;
|
;;
|
||||||
@ -171,7 +171,7 @@ HPMPI)
|
|||||||
_foamAddLib $MPI_ARCH_PATH/lib/linux_ia64
|
_foamAddLib $MPI_ARCH_PATH/lib/linux_ia64
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo Unknown processor type `uname -m` 1>&2
|
echo Unknown processor type $(uname -m) 1>&2
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|||||||
@ -53,12 +53,13 @@
|
|||||||
# When _foamAddLib is unset (eg, called from makeParaView or from foamPV):
|
# When _foamAddLib is unset (eg, called from makeParaView or from foamPV):
|
||||||
# - the ParaView_VERSION variable is retained.
|
# - the ParaView_VERSION variable is retained.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||||
|
|
||||||
ParaView_VERSION=5.0.1
|
ParaView_VERSION=5.0.1
|
||||||
ParaView_MAJOR=detect # Automatically determine major version
|
ParaView_MAJOR=detect # Automatically determine major version
|
||||||
|
|
||||||
cmake_version=cmake-system
|
cmake_version=cmake-system
|
||||||
|
|
||||||
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Clean PATH and LD_LIBRARY_PATH
|
# Clean PATH and LD_LIBRARY_PATH
|
||||||
|
|||||||
@ -52,9 +52,10 @@
|
|||||||
# by creating an empty one with the same name at a user or site location.
|
# by creating an empty one with the same name at a user or site location.
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||||
|
|
||||||
SCOTCH_VERSION=scotch_6.0.3
|
SCOTCH_VERSION=scotch_6.0.3
|
||||||
|
|
||||||
export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$SCOTCH_VERSION
|
export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$SCOTCH_VERSION
|
||||||
|
|
||||||
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -31,14 +31,14 @@
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Set environment variables according to system type
|
# Set environment variables according to system type
|
||||||
export WM_ARCH=`uname -s`
|
export WM_ARCH=$(uname -s)
|
||||||
|
|
||||||
case "$WM_ARCH" in
|
case "$WM_ARCH" in
|
||||||
Linux)
|
Linux)
|
||||||
WM_ARCH=linux
|
WM_ARCH=linux
|
||||||
|
|
||||||
# Compiler specifics
|
# Compiler specifics
|
||||||
case `uname -m` in
|
case $(uname -m) in
|
||||||
i686)
|
i686)
|
||||||
export WM_ARCH_OPTION=32
|
export WM_ARCH_OPTION=32
|
||||||
export WM_CC='gcc'
|
export WM_CC='gcc'
|
||||||
@ -68,8 +68,7 @@ Linux)
|
|||||||
export WM_LDFLAGS='-m64'
|
export WM_LDFLAGS='-m64'
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32 or 64"\
|
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32|64" 1>&2
|
||||||
1>&2
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@ -111,7 +110,7 @@ Linux)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo Unknown processor type `uname -m` for Linux 1>&2
|
echo Unknown processor type $(uname -m) for Linux 1>&2
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@ -130,8 +129,8 @@ SunOS)
|
|||||||
*) # An unsupported operating system
|
*) # An unsupported operating system
|
||||||
/bin/cat <<USAGE 1>&2
|
/bin/cat <<USAGE 1>&2
|
||||||
|
|
||||||
Your "$WM_ARCH" operating system is not supported by this release
|
Your "$WM_ARCH" operating system is unsupported by this OpenFOAM release.
|
||||||
of OpenFOAM. For further assistance, please contact www.OpenFOAM.com
|
For further assistance, please contact www.OpenFOAM.com
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
;;
|
;;
|
||||||
@ -212,7 +211,7 @@ unset GMP_ARCH_PATH MPFR_ARCH_PATH
|
|||||||
|
|
||||||
# Load configured compiler versions, regardless of the compiler type
|
# Load configured compiler versions, regardless of the compiler type
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler`
|
_foamSourceEtc config.sh/compiler
|
||||||
|
|
||||||
case "$WM_COMPILER_TYPE" in
|
case "$WM_COMPILER_TYPE" in
|
||||||
system)
|
system)
|
||||||
@ -227,7 +226,7 @@ OpenFOAM | ThirdParty)
|
|||||||
mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/${mpc_version:-mpc-system}
|
mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/${mpc_version:-mpc-system}
|
||||||
|
|
||||||
# Check that the compiler directory can be found
|
# Check that the compiler directory can be found
|
||||||
[ -d "$gccDir" ] || cat << GCC_NOT_FOUND 1>&2
|
[ -d "$gccDir" ] || /bin/cat << GCC_NOT_FOUND 1>&2
|
||||||
===============================================================================
|
===============================================================================
|
||||||
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
|
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
|
||||||
Cannot find '$WM_COMPILER' compiler installation
|
Cannot find '$WM_COMPILER' compiler installation
|
||||||
@ -272,7 +271,7 @@ GCC_NOT_FOUND
|
|||||||
clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
|
clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
|
||||||
|
|
||||||
# Check that the compiler directory can be found
|
# Check that the compiler directory can be found
|
||||||
[ -d "$clangDir" ] || cat << CLANG_NOT_FOUND 1>&2
|
[ -d "$clangDir" ] || /bin/cat << CLANG_NOT_FOUND 1>&2
|
||||||
===============================================================================
|
===============================================================================
|
||||||
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
|
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
|
||||||
Cannot find '$WM_COMPILER' compiler installation
|
Cannot find '$WM_COMPILER' compiler installation
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -143,9 +143,9 @@ unset SCOTCH_ARCH_PATH
|
|||||||
|
|
||||||
if [ -n "$foamClean" ]
|
if [ -n "$foamClean" ]
|
||||||
then
|
then
|
||||||
cleaned=`$foamClean "$PATH" "$foamOldDirs"` && PATH="$cleaned"
|
cleaned=$($foamClean "$PATH" "$foamOldDirs") && PATH="$cleaned"
|
||||||
cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"` && LD_LIBRARY_PATH="$cleaned"
|
cleaned=$($foamClean "$LD_LIBRARY_PATH" "$foamOldDirs") && LD_LIBRARY_PATH="$cleaned"
|
||||||
cleaned=`$foamClean "$MANPATH" "$foamOldDirs"` && MANPATH="$cleaned"
|
cleaned=$($foamClean "$MANPATH" "$foamOldDirs") && MANPATH="$cleaned"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -153,7 +153,6 @@ fi
|
|||||||
[ -n "$MANPATH" ] || unset MANPATH
|
[ -n "$MANPATH" ] || unset MANPATH
|
||||||
[ -n "$LD_PRELOAD" ] || unset LD_PRELOAD
|
[ -n "$LD_PRELOAD" ] || unset LD_PRELOAD
|
||||||
|
|
||||||
|
|
||||||
unset cleaned foamClean foamOldDirs
|
unset cleaned foamClean foamOldDirs
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -41,6 +41,7 @@
|
|||||||
# See the BuildIssues.txt about problems that can be encountered when using
|
# See the BuildIssues.txt about problems that can be encountered when using
|
||||||
# the 'plain' VTK sources.
|
# the 'plain' VTK sources.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||||
|
|
||||||
vtk_version=VTK-7.1.0
|
vtk_version=VTK-7.1.0
|
||||||
mesa_version=mesa-13.0.1
|
mesa_version=mesa-13.0.1
|
||||||
@ -48,6 +49,7 @@ mesa_version=mesa-13.0.1
|
|||||||
export VTK_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$vtk_version
|
export VTK_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$vtk_version
|
||||||
export MESA_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mesa_version
|
export MESA_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mesa_version
|
||||||
|
|
||||||
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||||
then
|
then
|
||||||
|
|||||||
52
etc/cshrc
52
etc/cshrc
@ -3,7 +3,7 @@
|
|||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -60,7 +60,7 @@ setenv FOAM_INST_DIR `lsof +p $$ |& grep -oE '/.*'$WM_PROJECT'[^/]*/etc/cshrc' |
|
|||||||
setenv WM_COMPILER_TYPE system
|
setenv WM_COMPILER_TYPE system
|
||||||
|
|
||||||
#- Compiler:
|
#- Compiler:
|
||||||
# WM_COMPILER = Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-2] | Clang | Icc
|
# WM_COMPILER= Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-3] | Clang | Icc | IccKNL
|
||||||
setenv WM_COMPILER Gcc
|
setenv WM_COMPILER Gcc
|
||||||
setenv WM_COMPILER_ARCH # defined but empty
|
setenv WM_COMPILER_ARCH # defined but empty
|
||||||
unsetenv WM_COMPILER_LIB_ARCH
|
unsetenv WM_COMPILER_LIB_ARCH
|
||||||
@ -144,20 +144,23 @@ endif
|
|||||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||||
setenv WM_PROJECT_USER_DIR $HOME/$WM_PROJECT/$LOGNAME-$WM_PROJECT_VERSION
|
setenv WM_PROJECT_USER_DIR $HOME/$WM_PROJECT/$LOGNAME-$WM_PROJECT_VERSION
|
||||||
|
|
||||||
|
# Source etc files, possibly with some verbosity
|
||||||
# Source files, possibly with some verbosity
|
if ($?FOAM_VERBOSE && $?prompt) then
|
||||||
alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!* != "") source \!*'
|
alias _foamSourceEtc 'eval `$WM_PROJECT_DIR/bin/foamEtcFile -csh-verbose \!*`'
|
||||||
|
else
|
||||||
|
alias _foamSourceEtc 'eval `$WM_PROJECT_DIR/bin/foamEtcFile -csh \!*`'
|
||||||
|
endif
|
||||||
|
|
||||||
# Add in preset user or site preferences:
|
# Add in preset user or site preferences:
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh`
|
_foamSourceEtc prefs.csh
|
||||||
|
|
||||||
# Evaluate command-line parameters and record settings for later
|
# Evaluate command-line parameters and record settings for later.
|
||||||
# these can be used to set/unset values, or specify alternative pref files
|
# These can be used to set/unset values, or specify alternative pref files.
|
||||||
setenv FOAM_SETTINGS "${*}"
|
setenv FOAM_SETTINGS "${*}"
|
||||||
while ( $#argv > 0 )
|
while ( $#argv > 0 )
|
||||||
switch ($argv[1])
|
switch ($argv[1])
|
||||||
case -*:
|
case -*:
|
||||||
# stray option (not meant for us here) -> get out
|
# Stray option (not meant for us here) -> get out
|
||||||
break
|
break
|
||||||
breaksw
|
breaksw
|
||||||
case *=:
|
case *=:
|
||||||
@ -171,11 +174,12 @@ while ( $#argv > 0 )
|
|||||||
eval "setenv $argv[1]:s/=/ /"
|
eval "setenv $argv[1]:s/=/ /"
|
||||||
breaksw
|
breaksw
|
||||||
default:
|
default:
|
||||||
# filename: source it
|
# Filename: source it
|
||||||
if ( -f "$1" ) then
|
if ( -f "$1" ) then
|
||||||
_foamSource "$1"
|
if ($?FOAM_VERBOSE && $?prompt) echo "Using: $1"
|
||||||
|
source "$1"
|
||||||
else
|
else
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -silent "$1"`
|
_foamSourceEtc -silent "$1"
|
||||||
endif
|
endif
|
||||||
breaksw
|
breaksw
|
||||||
endsw
|
endsw
|
||||||
@ -208,19 +212,19 @@ if ( $status == 0 ) setenv MANPATH $cleaned
|
|||||||
|
|
||||||
# Source project setup files
|
# Source project setup files
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
_foamSource $WM_PROJECT_DIR/etc/config.csh/settings
|
_foamSourceEtc config.csh/settings
|
||||||
_foamSource $WM_PROJECT_DIR/etc/config.csh/aliases
|
_foamSourceEtc config.csh/aliases
|
||||||
|
|
||||||
# Source user setup files for optional packages
|
# Source user setup files for optional packages
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/mpi`
|
_foamSourceEtc config.csh/mpi
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/paraview`
|
_foamSourceEtc config.csh/paraview
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/vtk`
|
_foamSourceEtc config.csh/vtk
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/ensight`
|
_foamSourceEtc config.csh/ensight
|
||||||
|
|
||||||
##_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/ADIOS`
|
#_foamSourceEtc config.csh/ADIOS
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/CGAL`
|
_foamSourceEtc config.csh/CGAL
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/FFTW`
|
_foamSourceEtc config.csh/FFTW
|
||||||
|
|
||||||
|
|
||||||
# Clean environment paths again. Only remove duplicates
|
# Clean environment paths again. Only remove duplicates
|
||||||
@ -234,8 +238,8 @@ set cleaned=`$foamClean "$LD_LIBRARY_PATH"`
|
|||||||
if ( $status == 0 ) setenv LD_LIBRARY_PATH $cleaned
|
if ( $status == 0 ) setenv LD_LIBRARY_PATH $cleaned
|
||||||
|
|
||||||
#- Clean MANPATH (trailing ':' to find system pages)
|
#- Clean MANPATH (trailing ':' to find system pages)
|
||||||
set cleaned=`$foamClean "$MANPATH"`:
|
set cleaned=`$foamClean "$MANPATH"`
|
||||||
if ( $status == 0 ) setenv MANPATH "$cleaned"
|
if ( $status == 0 ) setenv MANPATH "${cleaned}:"
|
||||||
|
|
||||||
#- Clean LD_PRELOAD
|
#- Clean LD_PRELOAD
|
||||||
if ( $?LD_PRELOAD ) then
|
if ( $?LD_PRELOAD ) then
|
||||||
@ -247,6 +251,6 @@ endif
|
|||||||
# Cleanup environment:
|
# Cleanup environment:
|
||||||
# ~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~
|
||||||
unset cleaned foamClean foamOldDirs
|
unset cleaned foamClean foamOldDirs
|
||||||
unalias _foamSource
|
unalias _foamSourceEtc
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -4,11 +4,9 @@ cd ${0%/*} || exit 1 # run from this directory
|
|||||||
# Source tutorial run functions
|
# Source tutorial run functions
|
||||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
application=`getApplication`
|
|
||||||
|
|
||||||
runApplication blockMesh
|
runApplication blockMesh
|
||||||
runApplication extrudeMesh
|
runApplication extrudeMesh
|
||||||
|
|
||||||
runApplication $application
|
runApplication $(getApplication)
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -14,8 +14,6 @@ if [ -f /usr/include/sys/inotify.h ]
|
|||||||
then
|
then
|
||||||
echo " found <sys/inotify.h> -- enabling inotify for file monitoring."
|
echo " found <sys/inotify.h> -- enabling inotify for file monitoring."
|
||||||
export COMP_FLAGS="-DFOAM_USE_INOTIFY"
|
export COMP_FLAGS="-DFOAM_USE_INOTIFY"
|
||||||
else
|
|
||||||
unset COMP_FLAGS
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# make (non-shared by default) object
|
# make (non-shared by default) object
|
||||||
|
|||||||
@ -47,10 +47,10 @@ void Foam::HashPtrTable<T, Key, Hash>::read(Istream& is, const INew& inewt)
|
|||||||
|
|
||||||
if (firstToken.isLabel())
|
if (firstToken.isLabel())
|
||||||
{
|
{
|
||||||
label s = firstToken.labelToken();
|
const label s = firstToken.labelToken();
|
||||||
|
|
||||||
// Read beginning of contents
|
// Read beginning of contents
|
||||||
char delimiter = is.readBeginList("HashPtrTable<T, Key, Hash>");
|
const char delimiter = is.readBeginList("HashPtrTable<T, Key, Hash>");
|
||||||
|
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -41,7 +41,7 @@ Foam::HashTable<T, Key, Hash>::HashTable(Istream& is, const label size)
|
|||||||
{
|
{
|
||||||
table_ = new hashedEntry*[tableSize_];
|
table_ = new hashedEntry*[tableSize_];
|
||||||
|
|
||||||
for (label hashIdx = 0; hashIdx < tableSize_; hashIdx++)
|
for (label hashIdx = 0; hashIdx < tableSize_; ++hashIdx)
|
||||||
{
|
{
|
||||||
table_[hashIdx] = 0;
|
table_[hashIdx] = 0;
|
||||||
}
|
}
|
||||||
@ -116,10 +116,10 @@ Foam::Istream& Foam::operator>>
|
|||||||
|
|
||||||
if (firstToken.isLabel())
|
if (firstToken.isLabel())
|
||||||
{
|
{
|
||||||
label s = firstToken.labelToken();
|
const label s = firstToken.labelToken();
|
||||||
|
|
||||||
// Read beginning of contents
|
// Read beginning of contents
|
||||||
char delimiter = is.readBeginList("HashTable<T, Key, Hash>");
|
const char delimiter = is.readBeginList("HashTable<T, Key, Hash>");
|
||||||
|
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
@ -130,7 +130,7 @@ Foam::Istream& Foam::operator>>
|
|||||||
|
|
||||||
if (delimiter == token::BEGIN_LIST)
|
if (delimiter == token::BEGIN_LIST)
|
||||||
{
|
{
|
||||||
for (label i=0; i<s; i++)
|
for (label i=0; i<s; ++i)
|
||||||
{
|
{
|
||||||
Key key;
|
Key key;
|
||||||
is >> key;
|
is >> key;
|
||||||
|
|||||||
@ -44,10 +44,10 @@ void Foam::ILList<LListBase, T>::read(Istream& is, const INew& iNew)
|
|||||||
|
|
||||||
if (firstToken.isLabel())
|
if (firstToken.isLabel())
|
||||||
{
|
{
|
||||||
label s = firstToken.labelToken();
|
const label s = firstToken.labelToken();
|
||||||
|
|
||||||
// Read beginning of contents
|
// Read beginning of contents
|
||||||
char delimiter = is.readBeginList("ILList<LListBase, T>");
|
const char delimiter = is.readBeginList("ILList<LListBase, T>");
|
||||||
|
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -55,10 +55,10 @@ Foam::Istream& Foam::operator>>(Istream& is, LList<LListBase, T>& L)
|
|||||||
|
|
||||||
if (firstToken.isLabel())
|
if (firstToken.isLabel())
|
||||||
{
|
{
|
||||||
label s = firstToken.labelToken();
|
const label s = firstToken.labelToken();
|
||||||
|
|
||||||
// Read beginning of contents
|
// Read beginning of contents
|
||||||
char delimiter = is.readBeginList("LList<LListBase, T>");
|
const char delimiter = is.readBeginList("LList<LListBase, T>");
|
||||||
|
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -49,10 +49,10 @@ void Foam::LPtrList<LListBase, T>::read(Istream& is, const INew& iNew)
|
|||||||
|
|
||||||
if (firstToken.isLabel())
|
if (firstToken.isLabel())
|
||||||
{
|
{
|
||||||
label s = firstToken.labelToken();
|
const label s = firstToken.labelToken();
|
||||||
|
|
||||||
// Read beginning of contents
|
// Read beginning of contents
|
||||||
char delimiter = is.readBeginList("LPtrList<LListBase, T>");
|
const char delimiter = is.readBeginList("LPtrList<LListBase, T>");
|
||||||
|
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -86,6 +86,14 @@ class FixedList
|
|||||||
T v_[Size];
|
T v_[Size];
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected Member Functions
|
||||||
|
|
||||||
|
//- Write the FixedList with its compound type
|
||||||
|
void writeEntry(Ostream& os) const;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Hashing function class.
|
//- Hashing function class.
|
||||||
@ -117,7 +125,7 @@ public:
|
|||||||
inline FixedList();
|
inline FixedList();
|
||||||
|
|
||||||
//- Construct from value
|
//- Construct from value
|
||||||
explicit inline FixedList(const T&);
|
explicit inline FixedList(const T& t);
|
||||||
|
|
||||||
//- Construct from C-array
|
//- Construct from C-array
|
||||||
explicit inline FixedList(const T v[Size]);
|
explicit inline FixedList(const T v[Size]);
|
||||||
@ -127,19 +135,19 @@ public:
|
|||||||
inline FixedList(InputIterator first, InputIterator last);
|
inline FixedList(InputIterator first, InputIterator last);
|
||||||
|
|
||||||
//- Construct from an initializer list
|
//- Construct from an initializer list
|
||||||
inline FixedList(std::initializer_list<T>);
|
inline FixedList(std::initializer_list<T> lst);
|
||||||
|
|
||||||
//- Construct from UList
|
//- Construct from UList
|
||||||
explicit inline FixedList(const UList<T>&);
|
explicit inline FixedList(const UList<T>& lst);
|
||||||
|
|
||||||
//- Construct from SLList
|
//- Construct from SLList
|
||||||
explicit inline FixedList(const SLList<T>&);
|
explicit inline FixedList(const SLList<T>& lst);
|
||||||
|
|
||||||
//- Copy constructor
|
//- Copy constructor
|
||||||
inline FixedList(const FixedList<T, Size>&);
|
inline FixedList(const FixedList<T, Size>& lst);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
FixedList(Istream&);
|
FixedList(Istream& is);
|
||||||
|
|
||||||
//- Clone
|
//- Clone
|
||||||
inline autoPtr<FixedList<T, Size>> clone() const;
|
inline autoPtr<FixedList<T, Size>> clone() const;
|
||||||
@ -197,45 +205,39 @@ public:
|
|||||||
|
|
||||||
//- Dummy resize function
|
//- Dummy resize function
|
||||||
// needed to make FixedList consistent with List
|
// needed to make FixedList consistent with List
|
||||||
inline void resize(const label);
|
inline void resize(const label s);
|
||||||
|
|
||||||
//- Dummy setSize function
|
//- Dummy setSize function
|
||||||
// needed to make FixedList consistent with List
|
// needed to make FixedList consistent with List
|
||||||
inline void setSize(const label);
|
inline void setSize(const label s);
|
||||||
|
|
||||||
//- Copy (not transfer) the argument contents
|
//- Copy (not transfer) the argument contents
|
||||||
// needed to make FixedList consistent with List
|
// needed to make FixedList consistent with List
|
||||||
void transfer(const FixedList<T, Size>&);
|
void transfer(const FixedList<T, Size>& lst);
|
||||||
|
|
||||||
//- Write the FixedList as a dictionary entry
|
|
||||||
void writeEntry(Ostream&) const;
|
|
||||||
|
|
||||||
//- Write the FixedList as a dictionary entry with keyword
|
|
||||||
void writeEntry(const word& keyword, Ostream&) const;
|
|
||||||
|
|
||||||
|
|
||||||
// Member operators
|
// Member operators
|
||||||
|
|
||||||
//- Return element of FixedList
|
//- Return element of FixedList
|
||||||
inline T& operator[](const label);
|
inline T& operator[](const label i);
|
||||||
|
|
||||||
//- Return element of constant FixedList
|
//- Return element of constant FixedList
|
||||||
inline const T& operator[](const label) const;
|
inline const T& operator[](const label i) const;
|
||||||
|
|
||||||
//- Assignment to array operator. Takes linear time
|
//- Assignment to array operator. Takes linear time
|
||||||
inline void operator=(const T v[Size]);
|
inline void operator=(const T lst[Size]);
|
||||||
|
|
||||||
//- Assignment to UList operator. Takes linear time
|
//- Assignment to UList operator. Takes linear time
|
||||||
inline void operator=(const UList<T>&);
|
inline void operator=(const UList<T>& lst);
|
||||||
|
|
||||||
//- Assignment to SLList operator. Takes linear time
|
//- Assignment to SLList operator. Takes linear time
|
||||||
inline void operator=(const SLList<T>&);
|
inline void operator=(const SLList<T>& lst);
|
||||||
|
|
||||||
//- Assignment to an initializer list. Takes linear time
|
//- Assignment to an initializer list. Takes linear time
|
||||||
inline void operator=(std::initializer_list<T>);
|
inline void operator=(std::initializer_list<T> lst);
|
||||||
|
|
||||||
//- Assignment of all entries to the given value
|
//- Assignment of all entries to the given value
|
||||||
inline void operator=(const T&);
|
inline void operator=(const T& t);
|
||||||
|
|
||||||
|
|
||||||
// STL type definitions
|
// STL type definitions
|
||||||
@ -331,7 +333,7 @@ public:
|
|||||||
inline bool empty() const;
|
inline bool empty() const;
|
||||||
|
|
||||||
//- Swap two FixedLists of the same type in constant time
|
//- Swap two FixedLists of the same type in constant time
|
||||||
void swap(FixedList<T, Size>&);
|
void swap(FixedList<T, Size>& a);
|
||||||
|
|
||||||
|
|
||||||
// STL member operators
|
// STL member operators
|
||||||
@ -339,35 +341,48 @@ public:
|
|||||||
//- Equality operation on FixedLists of the same type.
|
//- Equality operation on FixedLists of the same type.
|
||||||
// Returns true when the FixedLists are elementwise equal
|
// Returns true when the FixedLists are elementwise equal
|
||||||
// (using FixedList::value_type::operator==). Takes linear time
|
// (using FixedList::value_type::operator==). Takes linear time
|
||||||
bool operator==(const FixedList<T, Size>&) const;
|
bool operator==(const FixedList<T, Size>& a) const;
|
||||||
|
|
||||||
//- The opposite of the equality operation. Takes linear time
|
//- The opposite of the equality operation. Takes linear time
|
||||||
bool operator!=(const FixedList<T, Size>&) const;
|
bool operator!=(const FixedList<T, Size>& a) const;
|
||||||
|
|
||||||
//- Compare two FixedLists lexicographically. Takes linear time
|
//- Compare two FixedLists lexicographically. Takes linear time
|
||||||
bool operator<(const FixedList<T, Size>&) const;
|
bool operator<(const FixedList<T, Size>& a) const;
|
||||||
|
|
||||||
//- Compare two FixedLists lexicographically. Takes linear time
|
//- Compare two FixedLists lexicographically. Takes linear time
|
||||||
bool operator>(const FixedList<T, Size>&) const;
|
bool operator>(const FixedList<T, Size>& a) const;
|
||||||
|
|
||||||
//- Return true if !(a > b). Takes linear time
|
//- Return true if !(a > b). Takes linear time
|
||||||
bool operator<=(const FixedList<T, Size>&) const;
|
bool operator<=(const FixedList<T, Size>& a) const;
|
||||||
|
|
||||||
//- Return true if !(a < b). Takes linear time
|
//- Return true if !(a < b). Takes linear time
|
||||||
bool operator>=(const FixedList<T, Size>&) const;
|
bool operator>=(const FixedList<T, Size>& a) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Writing
|
||||||
|
|
||||||
|
//- Write the List as a dictionary entry with keyword
|
||||||
|
void writeEntry(const word& keyword, Ostream& os) const;
|
||||||
|
|
||||||
|
//- Write the List, with line-breaks in ASCII if the list length
|
||||||
|
// exceeds shortListLen. Using '0' suppresses line-breaks entirely.
|
||||||
|
Ostream& writeList(Ostream& os, const label shortListLen=0) const;
|
||||||
|
|
||||||
|
|
||||||
// IOstream operators
|
// IOstream operators
|
||||||
|
|
||||||
//- Read List from Istream, discarding contents of existing List
|
//- Read List from Istream, discarding contents of existing List
|
||||||
friend Istream& operator>> <T, Size>
|
friend Istream& operator>> <T, Size>
|
||||||
(Istream&, FixedList<T, Size>&);
|
(
|
||||||
|
Istream& is,
|
||||||
|
FixedList<T, Size>& L
|
||||||
|
);
|
||||||
|
|
||||||
//- Write FixedList to Ostream
|
//- Write List to Ostream, as per writeList() with shortListLen=10
|
||||||
friend Ostream& operator<< <T, Size>
|
friend Ostream& operator<< <T, Size>
|
||||||
(
|
(
|
||||||
Ostream&,
|
Ostream& os,
|
||||||
const FixedList<T, Size>&
|
const FixedList<T, Size>& L
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -29,6 +29,123 @@ License
|
|||||||
#include "token.H"
|
#include "token.H"
|
||||||
#include "contiguous.H"
|
#include "contiguous.H"
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class T, unsigned Size>
|
||||||
|
void Foam::FixedList<T, Size>::writeEntry(Ostream& os) const
|
||||||
|
{
|
||||||
|
const word tag = "List<" + word(pTraits<T>::typeName) + '>';
|
||||||
|
if (token::compound::isCompound(tag))
|
||||||
|
{
|
||||||
|
os << tag << ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
os << *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class T, unsigned Size>
|
||||||
|
void Foam::FixedList<T, Size>::writeEntry
|
||||||
|
(
|
||||||
|
const word& keyword,
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
os.writeKeyword(keyword);
|
||||||
|
writeEntry(os);
|
||||||
|
os << token::END_STATEMENT << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, unsigned Size>
|
||||||
|
Foam::Ostream& Foam::FixedList<T, Size>::writeList
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const label shortListLen
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const FixedList<T, Size>& L = *this;
|
||||||
|
|
||||||
|
// Write list contents depending on data format
|
||||||
|
if (os.format() == IOstream::ASCII || !contiguous<T>())
|
||||||
|
{
|
||||||
|
// Can the contents be considered 'uniform' (ie, identical)?
|
||||||
|
bool uniform = (Size > 1 && contiguous<T>());
|
||||||
|
if (uniform)
|
||||||
|
{
|
||||||
|
forAll(L, i)
|
||||||
|
{
|
||||||
|
if (L[i] != L[0])
|
||||||
|
{
|
||||||
|
uniform = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (uniform)
|
||||||
|
{
|
||||||
|
// Write size (so it is valid dictionary entry) and start delimiter
|
||||||
|
os << Size << token::BEGIN_BLOCK;
|
||||||
|
|
||||||
|
// Write contents
|
||||||
|
os << L[0];
|
||||||
|
|
||||||
|
// Write end delimiter
|
||||||
|
os << token::END_BLOCK;
|
||||||
|
}
|
||||||
|
else if
|
||||||
|
(
|
||||||
|
Size <= 1 || !shortListLen
|
||||||
|
|| (Size <= unsigned(shortListLen) && contiguous<T>())
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// Write start delimiter
|
||||||
|
os << token::BEGIN_LIST;
|
||||||
|
|
||||||
|
// Write contents
|
||||||
|
forAll(L, i)
|
||||||
|
{
|
||||||
|
if (i) os << token::SPACE;
|
||||||
|
os << L[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write end delimiter
|
||||||
|
os << token::END_LIST;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Write start delimiter
|
||||||
|
os << nl << token::BEGIN_LIST << nl;
|
||||||
|
|
||||||
|
// Write contents
|
||||||
|
forAll(L, i)
|
||||||
|
{
|
||||||
|
os << L[i] << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write end delimiter
|
||||||
|
os << token::END_LIST << nl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Contents are binary and contiguous
|
||||||
|
|
||||||
|
// write(...) includes surrounding start/end delimiters
|
||||||
|
os.write(reinterpret_cast<const char*>(L.cdata()), Size*sizeof(T));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check state of IOstream
|
||||||
|
os.check("const FixedList::writeList(Ostream&)");
|
||||||
|
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class T, unsigned Size>
|
template<class T, unsigned Size>
|
||||||
@ -81,11 +198,11 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, FixedList<T, Size>& L)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Read beginning of contents
|
// Read beginning of contents
|
||||||
char delimiter = is.readBeginList("FixedList");
|
const char delimiter = is.readBeginList("FixedList");
|
||||||
|
|
||||||
if (delimiter == token::BEGIN_LIST)
|
if (delimiter == token::BEGIN_LIST)
|
||||||
{
|
{
|
||||||
for (unsigned i=0; i<Size; i++)
|
for (unsigned i=0; i<Size; ++i)
|
||||||
{
|
{
|
||||||
is >> L[i];
|
is >> L[i];
|
||||||
|
|
||||||
@ -107,7 +224,7 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, FixedList<T, Size>& L)
|
|||||||
"reading the single entry"
|
"reading the single entry"
|
||||||
);
|
);
|
||||||
|
|
||||||
for (unsigned i=0; i<Size; i++)
|
for (unsigned i=0; i<Size; ++i)
|
||||||
{
|
{
|
||||||
L[i] = element;
|
L[i] = element;
|
||||||
}
|
}
|
||||||
@ -133,107 +250,10 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, FixedList<T, Size>& L)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class T, unsigned Size>
|
|
||||||
void Foam::FixedList<T, Size>::writeEntry(Ostream& os) const
|
|
||||||
{
|
|
||||||
const word tag = "List<" + word(pTraits<T>::typeName) + '>';
|
|
||||||
if (token::compound::isCompound(tag))
|
|
||||||
{
|
|
||||||
os << tag << " ";
|
|
||||||
}
|
|
||||||
|
|
||||||
os << *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class T, unsigned Size>
|
|
||||||
void Foam::FixedList<T, Size>::writeEntry
|
|
||||||
(
|
|
||||||
const word& keyword,
|
|
||||||
Ostream& os
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
os.writeKeyword(keyword);
|
|
||||||
writeEntry(os);
|
|
||||||
os << token::END_STATEMENT << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class T, unsigned Size>
|
template<class T, unsigned Size>
|
||||||
Foam::Ostream& Foam::operator<<(Ostream& os, const FixedList<T, Size>& L)
|
Foam::Ostream& Foam::operator<<(Ostream& os, const FixedList<T, Size>& L)
|
||||||
{
|
{
|
||||||
// Write list contents depending on data format
|
return L.writeList(os, 10);
|
||||||
if (os.format() == IOstream::ASCII || !contiguous<T>())
|
|
||||||
{
|
|
||||||
// Can the contents be considered 'uniform' (ie, identical)?
|
|
||||||
bool uniform = (Size > 1 && contiguous<T>());
|
|
||||||
if (uniform)
|
|
||||||
{
|
|
||||||
forAll(L, i)
|
|
||||||
{
|
|
||||||
if (L[i] != L[0])
|
|
||||||
{
|
|
||||||
uniform = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (uniform)
|
|
||||||
{
|
|
||||||
// Write size (so it is valid dictionary entry) and start delimiter
|
|
||||||
os << L.size() << token::BEGIN_BLOCK;
|
|
||||||
|
|
||||||
// Write contents
|
|
||||||
os << L[0];
|
|
||||||
|
|
||||||
// Write end delimiter
|
|
||||||
os << token::END_BLOCK;
|
|
||||||
}
|
|
||||||
else if (Size <= 1 || (Size < 11 && contiguous<T>()))
|
|
||||||
{
|
|
||||||
// Write start delimiter
|
|
||||||
os << token::BEGIN_LIST;
|
|
||||||
|
|
||||||
// Write contents
|
|
||||||
forAll(L, i)
|
|
||||||
{
|
|
||||||
if (i) os << token::SPACE;
|
|
||||||
os << L[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write end delimiter
|
|
||||||
os << token::END_LIST;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Write start delimiter
|
|
||||||
os << nl << token::BEGIN_LIST;
|
|
||||||
|
|
||||||
// Write contents
|
|
||||||
forAll(L, i)
|
|
||||||
{
|
|
||||||
os << nl << L[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write end delimiter
|
|
||||||
os << nl << token::END_LIST << nl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Contents are binary and contiguous
|
|
||||||
|
|
||||||
// write(...) includes surrounding start/end delimiters
|
|
||||||
os.write(reinterpret_cast<const char*>(L.cdata()), Size*sizeof(T));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check state of IOstream
|
|
||||||
os.check("Ostream& operator<<(Ostream&, const FixedList&)");
|
|
||||||
|
|
||||||
return os;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -74,13 +74,13 @@ Foam::Istream& Foam::operator>>(Istream& is, List<T>& L)
|
|||||||
if (is.format() == IOstream::ASCII || !contiguous<T>())
|
if (is.format() == IOstream::ASCII || !contiguous<T>())
|
||||||
{
|
{
|
||||||
// Read beginning of contents
|
// Read beginning of contents
|
||||||
char delimiter = is.readBeginList("List");
|
const char delimiter = is.readBeginList("List");
|
||||||
|
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
if (delimiter == token::BEGIN_LIST)
|
if (delimiter == token::BEGIN_LIST)
|
||||||
{
|
{
|
||||||
for (label i=0; i<s; i++)
|
for (label i=0; i<s; ++i)
|
||||||
{
|
{
|
||||||
is >> L[i];
|
is >> L[i];
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ Foam::Istream& Foam::operator>>(Istream& is, List<T>& L)
|
|||||||
"reading the single entry"
|
"reading the single entry"
|
||||||
);
|
);
|
||||||
|
|
||||||
for (label i=0; i<s; i++)
|
for (label i=0; i<s; ++i)
|
||||||
{
|
{
|
||||||
L[i] = element;
|
L[i] = element;
|
||||||
}
|
}
|
||||||
|
|||||||
96
src/OpenFOAM/containers/Lists/ListOps/FlatOutput.H
Normal file
96
src/OpenFOAM/containers/Lists/ListOps/FlatOutput.H
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::FlatOutput
|
||||||
|
|
||||||
|
Description
|
||||||
|
Simple output adapter for list output on a single line.
|
||||||
|
The backend type must support a two-argument \c writeList() method.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef FlatOutput_H
|
||||||
|
#define FlatOutput_H
|
||||||
|
|
||||||
|
#include "Ostream.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// Forward declaration of friend functions and operators
|
||||||
|
template<class Container> class FlatOutput;
|
||||||
|
template<class Container>
|
||||||
|
Ostream& operator<<(Ostream& os, const FlatOutput<Container>& obj);
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class FlatOutput Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class Container>
|
||||||
|
class FlatOutput
|
||||||
|
{
|
||||||
|
const Container& ref_;
|
||||||
|
const label len_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
inline FlatOutput(const Container& obj, label len)
|
||||||
|
:
|
||||||
|
ref_(obj),
|
||||||
|
len_(len)
|
||||||
|
{}
|
||||||
|
|
||||||
|
//- Ostream operator
|
||||||
|
inline friend Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const FlatOutput<Container>& wrapped
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return wrapped.ref_.writeList(os, wrapped.len_);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
//- Global flatOutput function
|
||||||
|
template<class Container>
|
||||||
|
FlatOutput<Container> flatOutput(const Container& obj, label len=0)
|
||||||
|
{
|
||||||
|
return FlatOutput<Container>(obj, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -36,6 +36,7 @@ SourceFiles
|
|||||||
#ifndef ListOps_H
|
#ifndef ListOps_H
|
||||||
#define ListOps_H
|
#define ListOps_H
|
||||||
|
|
||||||
|
#include "FlatOutput.H"
|
||||||
#include "labelList.H"
|
#include "labelList.H"
|
||||||
#include "ops.H"
|
#include "ops.H"
|
||||||
|
|
||||||
@ -51,7 +52,7 @@ extern const labelList emptyLabelList;
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
static const List<Type>& emptyList()
|
static const List<Type>& emptyList()
|
||||||
{
|
{
|
||||||
return *reinterpret_cast<const List<Type>* >(&emptyLabelList);
|
return *reinterpret_cast<const List<Type>*>(&emptyLabelList);
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Renumber the values (not the indices) of a list.
|
//- Renumber the values (not the indices) of a list.
|
||||||
@ -263,7 +264,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//- Helper class for list to append unique elelements of y onto the end of x
|
//- Helper class for list to append unique elements of y onto the end of x
|
||||||
template<class T>
|
template<class T>
|
||||||
class ListUniqueEqOp
|
class ListUniqueEqOp
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -26,11 +26,19 @@ License
|
|||||||
#include "PackedList.H"
|
#include "PackedList.H"
|
||||||
#include "IOstreams.H"
|
#include "IOstreams.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<unsigned nBits>
|
||||||
|
void Foam::PackedList<nBits>::writeEntry(Ostream& os) const
|
||||||
|
{
|
||||||
|
os << *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#if (UINT_MAX == 0xFFFFFFFF)
|
#if (UINT_MAX == 0xFFFFFFFF)
|
||||||
// 32-bit counting, Hamming weight method
|
// 32-bit counting, Hamming weight method
|
||||||
#define COUNT_PACKEDBITS(sum, x) \
|
#define COUNT_PACKEDBITS(sum, x) \
|
||||||
{ \
|
{ \
|
||||||
x -= (x >> 1) & 0x55555555; \
|
x -= (x >> 1) & 0x55555555; \
|
||||||
@ -38,15 +46,15 @@ License
|
|||||||
sum += (((x + (x >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24; \
|
sum += (((x + (x >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24; \
|
||||||
}
|
}
|
||||||
#elif (UINT_MAX == 0xFFFFFFFFFFFFFFFF)
|
#elif (UINT_MAX == 0xFFFFFFFFFFFFFFFF)
|
||||||
// 64-bit counting, Hamming weight method
|
// 64-bit counting, Hamming weight method
|
||||||
#define COUNT_PACKEDBITS(sum, x) \
|
#define COUNT_PACKEDBITS(sum, x) \
|
||||||
{ \
|
{ \
|
||||||
x -= (x >> 1) & 0x5555555555555555; \
|
x -= (x >> 1) & 0x5555555555555555; \
|
||||||
x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333); \
|
x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333); \
|
||||||
sum += (((x + (x >> 4)) & 0x0F0F0F0F0F0F0F0F) * 0x0101010101010101) >> 56;\
|
sum += (((x + (x >> 4)) & 0x0F0F0F0F0F0F0F0F) * 0x0101010101010101) >> 56; \
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// Arbitrary number of bits, Brian Kernighan's method
|
// Arbitrary number of bits, Brian Kernighan's method
|
||||||
#define COUNT_PACKEDBITS(sum, x) for (; x; ++sum) { x &= x - 1; }
|
#define COUNT_PACKEDBITS(sum, x) for (; x; ++sum) { x &= x - 1; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -69,6 +77,8 @@ unsigned int Foam::PackedList<nBits>::count() const
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef COUNT_PACKEDBITS
|
||||||
|
|
||||||
|
|
||||||
template<unsigned nBits>
|
template<unsigned nBits>
|
||||||
bool Foam::PackedList<nBits>::trim()
|
bool Foam::PackedList<nBits>::trim()
|
||||||
@ -395,12 +405,13 @@ Foam::Istream& Foam::PackedList<nBits>::read(Istream& is)
|
|||||||
|
|
||||||
|
|
||||||
template<unsigned nBits>
|
template<unsigned nBits>
|
||||||
Foam::Ostream& Foam::PackedList<nBits>::write
|
Foam::Ostream& Foam::PackedList<nBits>::writeList
|
||||||
(
|
(
|
||||||
Ostream& os,
|
Ostream& os,
|
||||||
const bool indexedOutput
|
const label shortListLen
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
const bool indexedOutput = (shortListLen < 0);
|
||||||
const PackedList<nBits>& lst = *this;
|
const PackedList<nBits>& lst = *this;
|
||||||
const label sz = lst.size();
|
const label sz = lst.size();
|
||||||
|
|
||||||
@ -446,36 +457,33 @@ Foam::Ostream& Foam::PackedList<nBits>::write
|
|||||||
|
|
||||||
os << token::END_BLOCK << nl;
|
os << token::END_BLOCK << nl;
|
||||||
}
|
}
|
||||||
else if (sz < 11)
|
else if (!shortListLen || sz <= shortListLen)
|
||||||
{
|
{
|
||||||
// short list:
|
// Shorter list, or line-breaks suppressed
|
||||||
os << sz << token::BEGIN_LIST;
|
os << sz << token::BEGIN_LIST;
|
||||||
forAll(lst, i)
|
forAll(lst, i)
|
||||||
{
|
{
|
||||||
if (i)
|
if (i) os << token::SPACE;
|
||||||
{
|
|
||||||
os << token::SPACE;
|
|
||||||
}
|
|
||||||
os << lst[i];
|
os << lst[i];
|
||||||
}
|
}
|
||||||
os << token::END_LIST;
|
os << token::END_LIST;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// longer list:
|
// Longer list
|
||||||
os << nl << sz << nl << token::BEGIN_LIST;
|
os << nl << sz << nl << token::BEGIN_LIST << nl;
|
||||||
forAll(lst, i)
|
forAll(lst, i)
|
||||||
{
|
{
|
||||||
os << nl << lst[i];
|
os << lst[i] << nl;
|
||||||
}
|
}
|
||||||
os << nl << token::END_LIST << nl;
|
os << token::END_LIST << nl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Contents are binary and contiguous
|
// Contents are binary and contiguous
|
||||||
|
|
||||||
os << nl << sz << nl;
|
os << nl << sz << nl;
|
||||||
|
|
||||||
if (sz)
|
if (sz)
|
||||||
{
|
{
|
||||||
// write(...) includes surrounding start/end delimiters
|
// write(...) includes surrounding start/end delimiters
|
||||||
@ -491,13 +499,6 @@ Foam::Ostream& Foam::PackedList<nBits>::write
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<unsigned nBits>
|
|
||||||
void Foam::PackedList<nBits>::writeEntry(Ostream& os) const
|
|
||||||
{
|
|
||||||
os << *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<unsigned nBits>
|
template<unsigned nBits>
|
||||||
void Foam::PackedList<nBits>::writeEntry
|
void Foam::PackedList<nBits>::writeEntry
|
||||||
(
|
(
|
||||||
@ -559,7 +560,7 @@ Foam::Istream& Foam::operator>>(Istream& is, PackedList<nBits>& lst)
|
|||||||
template<unsigned nBits>
|
template<unsigned nBits>
|
||||||
Foam::Ostream& Foam::operator<<(Ostream& os, const PackedList<nBits>& lst)
|
Foam::Ostream& Foam::operator<<(Ostream& os, const PackedList<nBits>& lst)
|
||||||
{
|
{
|
||||||
return lst.write(os, false);
|
return lst.writeList(os, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -186,6 +186,14 @@ private:
|
|||||||
label size_;
|
label size_;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected Member Functions
|
||||||
|
|
||||||
|
//- Write as a dictionary entry
|
||||||
|
void writeEntry(Ostream& os) const;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Public data
|
// Public data
|
||||||
@ -224,19 +232,19 @@ public:
|
|||||||
inline PackedList(const label size, const unsigned val);
|
inline PackedList(const label size, const unsigned val);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
inline PackedList(Istream&);
|
inline PackedList(Istream& is);
|
||||||
|
|
||||||
//- Copy constructor
|
//- Copy constructor
|
||||||
inline PackedList(const PackedList<nBits>&);
|
inline PackedList(const PackedList<nBits>& lst);
|
||||||
|
|
||||||
//- Construct by transferring the parameter contents
|
//- Construct by transferring the parameter contents
|
||||||
inline PackedList(const Xfer<PackedList<nBits>>&);
|
inline PackedList(const Xfer<PackedList<nBits>>& lst);
|
||||||
|
|
||||||
//- Construct from a list of labels
|
//- Construct from a list of labels
|
||||||
explicit inline PackedList(const labelUList&);
|
explicit inline PackedList(const labelUList& lst);
|
||||||
|
|
||||||
//- Construct from an indirect list of labels
|
//- Construct from an indirect list of labels
|
||||||
explicit inline PackedList(const UIndirectList<label>&);
|
explicit inline PackedList(const UIndirectList<label>& lst);
|
||||||
|
|
||||||
//- Clone
|
//- Clone
|
||||||
inline autoPtr<PackedList<nBits>> clone() const;
|
inline autoPtr<PackedList<nBits>> clone() const;
|
||||||
@ -257,16 +265,16 @@ public:
|
|||||||
|
|
||||||
//- Get value at index I.
|
//- Get value at index I.
|
||||||
// Never auto-vivify entries.
|
// Never auto-vivify entries.
|
||||||
inline unsigned int get(const label) const;
|
inline unsigned int get(const label i) const;
|
||||||
|
|
||||||
//- Set value at index I. Return true if value changed.
|
//- Set value at index I. Return true if value changed.
|
||||||
// Does auto-vivify for non-existent entries.
|
// Does auto-vivify for non-existent entries.
|
||||||
// Default value set is the max_value.
|
// Default value set is the max_value.
|
||||||
inline bool set(const label, const unsigned int val = ~0u);
|
inline bool set(const label i, const unsigned int val = ~0u);
|
||||||
|
|
||||||
//- Unset the entry at index I. Return true if value changed.
|
//- Unset the entry at index I. Return true if value changed.
|
||||||
// Never auto-vivify entries.
|
// Never auto-vivify entries.
|
||||||
inline bool unset(const label);
|
inline bool unset(const label i);
|
||||||
|
|
||||||
//- Return the underlying packed storage
|
//- Return the underlying packed storage
|
||||||
// Manipulate with utmost caution
|
// Manipulate with utmost caution
|
||||||
@ -322,10 +330,10 @@ public:
|
|||||||
|
|
||||||
//- Reset addressable list size, does not shrink the allocated size.
|
//- Reset addressable list size, does not shrink the allocated size.
|
||||||
// Optionally specify a value for new elements.
|
// Optionally specify a value for new elements.
|
||||||
inline void resize(const label, const unsigned int& val = 0u);
|
inline void resize(const label, const unsigned int val = 0u);
|
||||||
|
|
||||||
//- Alias for resize()
|
//- Alias for resize()
|
||||||
inline void setSize(const label, const unsigned int& val = 0u);
|
inline void setSize(const label, const unsigned int val = 0u);
|
||||||
|
|
||||||
//- Reserve allocation space for at least this size.
|
//- Reserve allocation space for at least this size.
|
||||||
// Never shrinks the allocated size.
|
// Never shrinks the allocated size.
|
||||||
@ -354,9 +362,12 @@ public:
|
|||||||
// IO
|
// IO
|
||||||
|
|
||||||
//- Clear list and read from stream
|
//- Clear list and read from stream
|
||||||
Istream& read(Istream&);
|
Istream& read(Istream& is);
|
||||||
|
|
||||||
//- Write, optionally with indexedOutput
|
//- Write the List, with line-breaks in ASCII if the list length
|
||||||
|
// exceeds shortListLen. Using '0' suppresses line-breaks entirely.
|
||||||
|
// A special indexed output (ASCII only) is triggered by specifying
|
||||||
|
// a negative value for shortListLen.
|
||||||
//
|
//
|
||||||
// The indexed output may be convenient in some situations.
|
// The indexed output may be convenient in some situations.
|
||||||
// The general format is a group of index/value pairs:
|
// The general format is a group of index/value pairs:
|
||||||
@ -368,20 +379,10 @@ public:
|
|||||||
// \verbatim
|
// \verbatim
|
||||||
// { index1 index2 index3 }
|
// { index1 index2 index3 }
|
||||||
// \endverbatim
|
// \endverbatim
|
||||||
//
|
Ostream& writeList(Ostream& os, const label shortListLen=0) const;
|
||||||
// Note the indexed output is only supported for ASCII streams.
|
|
||||||
Ostream& write
|
|
||||||
(
|
|
||||||
Ostream&,
|
|
||||||
const bool indexedOutput=false
|
|
||||||
) const;
|
|
||||||
|
|
||||||
|
|
||||||
//- Write as a dictionary entry
|
|
||||||
void writeEntry(Ostream&) const;
|
|
||||||
|
|
||||||
//- Write as a dictionary entry with keyword
|
//- Write as a dictionary entry with keyword
|
||||||
void writeEntry(const word& keyword, Ostream&) const;
|
void writeEntry(const word& keyword, Ostream& os) const;
|
||||||
|
|
||||||
|
|
||||||
// Member operators
|
// Member operators
|
||||||
@ -394,24 +395,24 @@ public:
|
|||||||
|
|
||||||
//- Get value at index I
|
//- Get value at index I
|
||||||
// Never auto-vivify entries.
|
// Never auto-vivify entries.
|
||||||
inline unsigned int operator[](const label) const;
|
inline unsigned int operator[](const label i) const;
|
||||||
|
|
||||||
//- Set value at index I.
|
//- Set value at index I.
|
||||||
// Returns iterator to perform the actual operation.
|
// Returns iterator to perform the actual operation.
|
||||||
// Does not auto-vivify entries, but will when assigned to.
|
// Does not auto-vivify entries, but will when assigned to.
|
||||||
inline iteratorBase operator[](const label);
|
inline iteratorBase operator[](const label i);
|
||||||
|
|
||||||
//- Assignment of all entries to the given value. Takes linear time.
|
//- Assignment of all entries to the given value. Takes linear time.
|
||||||
inline void operator=(const unsigned int val);
|
inline void operator=(const unsigned int val);
|
||||||
|
|
||||||
//- Assignment operator.
|
//- Assignment operator.
|
||||||
void operator=(const PackedList<nBits>&);
|
void operator=(const PackedList<nBits>& lst);
|
||||||
|
|
||||||
//- Assignment operator.
|
//- Assignment operator.
|
||||||
void operator=(const labelUList&);
|
void operator=(const labelUList& lst);
|
||||||
|
|
||||||
//- Assignment operator.
|
//- Assignment operator.
|
||||||
void operator=(const UIndirectList<label>&);
|
void operator=(const UIndirectList<label>& lst);
|
||||||
|
|
||||||
|
|
||||||
// Iterators and helpers
|
// Iterators and helpers
|
||||||
|
|||||||
@ -727,7 +727,7 @@ template<unsigned nBits>
|
|||||||
inline void Foam::PackedList<nBits>::resize
|
inline void Foam::PackedList<nBits>::resize
|
||||||
(
|
(
|
||||||
const label newSize,
|
const label newSize,
|
||||||
const unsigned int& val
|
const unsigned int val
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
reserve(newSize);
|
reserve(newSize);
|
||||||
@ -821,7 +821,7 @@ template<unsigned nBits>
|
|||||||
inline void Foam::PackedList<nBits>::setSize
|
inline void Foam::PackedList<nBits>::setSize
|
||||||
(
|
(
|
||||||
const label newSize,
|
const label newSize,
|
||||||
const unsigned int& val
|
const unsigned int val
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
resize(newSize, val);
|
resize(newSize, val);
|
||||||
|
|||||||
@ -48,12 +48,13 @@ void Foam::PtrList<T>::read(Istream& is, const INew& inewt)
|
|||||||
if (firstToken.isLabel())
|
if (firstToken.isLabel())
|
||||||
{
|
{
|
||||||
// Read size of list
|
// Read size of list
|
||||||
label s = firstToken.labelToken();
|
const label s = firstToken.labelToken();
|
||||||
|
|
||||||
|
// Set list length to that read
|
||||||
setSize(s);
|
setSize(s);
|
||||||
|
|
||||||
// Read beginning of contents
|
// Read beginning of contents
|
||||||
char delimiter = is.readBeginList("PtrList");
|
const char delimiter = is.readBeginList("PtrList");
|
||||||
|
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
@ -81,7 +82,7 @@ void Foam::PtrList<T>::read(Istream& is, const INew& inewt)
|
|||||||
"reading the single entry"
|
"reading the single entry"
|
||||||
);
|
);
|
||||||
|
|
||||||
for (label i=1; i<s; i++)
|
for (label i=1; i<s; ++i)
|
||||||
{
|
{
|
||||||
set(i, tPtr->clone());
|
set(i, tPtr->clone());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,7 +83,7 @@ inline const Foam::SubList<T>& Foam::SubList<T>::null()
|
|||||||
template<class T>
|
template<class T>
|
||||||
inline Foam::SubList<T>::operator const Foam::List<T>&() const
|
inline Foam::SubList<T>::operator const Foam::List<T>&() const
|
||||||
{
|
{
|
||||||
return *reinterpret_cast<const List<T>* >(this);
|
return *reinterpret_cast<const List<T>*>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -70,7 +70,11 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct given the complete list and the addressing array
|
//- Construct given the complete list and the addressing array
|
||||||
inline UIndirectList(const UList<T>&, const labelUList&);
|
inline UIndirectList
|
||||||
|
(
|
||||||
|
const UList<T>& completeList,
|
||||||
|
const labelUList& addr
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
@ -108,19 +112,19 @@ public:
|
|||||||
inline List<T> operator()() const;
|
inline List<T> operator()() const;
|
||||||
|
|
||||||
//- Return non-const access to an element
|
//- Return non-const access to an element
|
||||||
inline T& operator[](const label);
|
inline T& operator[](const label i);
|
||||||
|
|
||||||
//- Return const access to an element
|
//- Return const access to an element
|
||||||
inline const T& operator[](const label) const;
|
inline const T& operator[](const label i) const;
|
||||||
|
|
||||||
//- Assignment to UList of addressed elements
|
//- Assignment to UList of addressed elements
|
||||||
inline void operator=(const UList<T>&);
|
inline void operator=(const UList<T>& ae);
|
||||||
|
|
||||||
//- Assignment to UIndirectList of addressed elements
|
//- Assignment to UIndirectList of addressed elements
|
||||||
inline void operator=(const UIndirectList<T>&);
|
inline void operator=(const UIndirectList<T>& ae);
|
||||||
|
|
||||||
//- Assignment of all entries to the given value
|
//- Assignment of all entries to the given value
|
||||||
inline void operator=(const T&);
|
inline void operator=(const T& t);
|
||||||
|
|
||||||
|
|
||||||
// STL type definitions
|
// STL type definitions
|
||||||
@ -144,14 +148,21 @@ public:
|
|||||||
typedef label size_type;
|
typedef label size_type;
|
||||||
|
|
||||||
|
|
||||||
|
// Writing
|
||||||
|
|
||||||
|
//- Write the List, with line-breaks in ASCII if the list length
|
||||||
|
// exceeds shortListLen. Using '0' suppresses line-breaks entirely.
|
||||||
|
// Binary output is currently still a bit of an annoyance.
|
||||||
|
Ostream& writeList(Ostream& os, const label shortListLen=0) const;
|
||||||
|
|
||||||
|
|
||||||
// Ostream operator
|
// Ostream operator
|
||||||
|
|
||||||
//- Write UIndirectList to Ostream
|
//- Write List to Ostream, as per writeList() with shortListLen=10
|
||||||
// Binary output is currently still a bit of a problem
|
|
||||||
friend Ostream& operator<< <T>
|
friend Ostream& operator<< <T>
|
||||||
(
|
(
|
||||||
Ostream&,
|
Ostream& os,
|
||||||
const UIndirectList<T>&
|
const UIndirectList<T>& L
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -28,15 +28,17 @@ License
|
|||||||
#include "token.H"
|
#include "token.H"
|
||||||
#include "contiguous.H"
|
#include "contiguous.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
Foam::Ostream& Foam::operator<<
|
Foam::Ostream& Foam::UIndirectList<T>::writeList
|
||||||
(
|
(
|
||||||
Foam::Ostream& os,
|
Ostream& os,
|
||||||
const Foam::UIndirectList<T>& L
|
const label shortListLen
|
||||||
)
|
) const
|
||||||
{
|
{
|
||||||
|
const UIndirectList<T>& L = *this;
|
||||||
|
|
||||||
// Write list contents depending on data format
|
// Write list contents depending on data format
|
||||||
if (os.format() == IOstream::ASCII || !contiguous<T>())
|
if (os.format() == IOstream::ASCII || !contiguous<T>())
|
||||||
{
|
{
|
||||||
@ -65,7 +67,11 @@ Foam::Ostream& Foam::operator<<
|
|||||||
// Write end delimiter
|
// Write end delimiter
|
||||||
os << token::END_BLOCK;
|
os << token::END_BLOCK;
|
||||||
}
|
}
|
||||||
else if (L.size() <= 1 || (L.size() < 11 && contiguous<T>()))
|
else if
|
||||||
|
(
|
||||||
|
L.size() <= 1 || !shortListLen
|
||||||
|
|| (L.size() <= shortListLen && contiguous<T>())
|
||||||
|
)
|
||||||
{
|
{
|
||||||
// Write size and start delimiter
|
// Write size and start delimiter
|
||||||
os << L.size() << token::BEGIN_LIST;
|
os << L.size() << token::BEGIN_LIST;
|
||||||
@ -83,16 +89,16 @@ Foam::Ostream& Foam::operator<<
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Write size and start delimiter
|
// Write size and start delimiter
|
||||||
os << nl << L.size() << nl << token::BEGIN_LIST;
|
os << nl << L.size() << nl << token::BEGIN_LIST << nl;
|
||||||
|
|
||||||
// Write contents
|
// Write contents
|
||||||
forAll(L, i)
|
forAll(L, i)
|
||||||
{
|
{
|
||||||
os << nl << L[i];
|
os << L[i] << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write end delimiter
|
// Write end delimiter
|
||||||
os << nl << token::END_LIST << nl;
|
os << token::END_LIST << nl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -115,10 +121,23 @@ Foam::Ostream& Foam::operator<<
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check state of IOstream
|
// Check state of IOstream
|
||||||
os.check("Ostream& operator<<(Ostream&, const UIndirectList&)");
|
os.check("UIndirectList::writeList(Ostream&)");
|
||||||
|
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
Foam::Ostream& Foam::operator<<
|
||||||
|
(
|
||||||
|
Foam::Ostream& os,
|
||||||
|
const Foam::UIndirectList<T>& L
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return L.writeList(os, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -93,6 +93,14 @@ class UList
|
|||||||
void operator=(const UList<T>&) = delete;
|
void operator=(const UList<T>&) = delete;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected Member Functions
|
||||||
|
|
||||||
|
//- Write the UList with its compound type
|
||||||
|
void writeEntry(Ostream& os) const;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Related types
|
// Related types
|
||||||
@ -214,33 +222,27 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Copy the pointer held by the given UList
|
//- Copy the pointer held by the given UList
|
||||||
inline void shallowCopy(const UList<T>&);
|
inline void shallowCopy(const UList<T>& a);
|
||||||
|
|
||||||
//- Copy elements of the given UList
|
//- Copy elements of the given UList
|
||||||
void deepCopy(const UList<T>&);
|
void deepCopy(const UList<T>& a);
|
||||||
|
|
||||||
//- Write the UList with its compound type
|
|
||||||
void writeEntry(Ostream&) const;
|
|
||||||
|
|
||||||
//- Write the UList as a dictionary entry with keyword
|
|
||||||
void writeEntry(const word& keyword, Ostream&) const;
|
|
||||||
|
|
||||||
|
|
||||||
// Member operators
|
// Member operators
|
||||||
|
|
||||||
//- Return element of UList
|
//- Return element of UList
|
||||||
inline T& operator[](const label);
|
inline T& operator[](const label i);
|
||||||
|
|
||||||
//- Return element of constant UList
|
//- Return element of constant UList
|
||||||
// Note that the bool specialization adds lazy evaluation so reading
|
// Note that the bool specialization adds lazy evaluation so reading
|
||||||
// an out-of-range element returns false without any ill-effects
|
// an out-of-range element returns false without any ill-effects
|
||||||
inline const T& operator[](const label) const;
|
inline const T& operator[](const label i) const;
|
||||||
|
|
||||||
//- Allow cast to a const List<T>&
|
//- Allow cast to a const List<T>&
|
||||||
inline operator const Foam::List<T>&() const;
|
inline operator const Foam::List<T>&() const;
|
||||||
|
|
||||||
//- Assignment of all entries to the given value
|
//- Assignment of all entries to the given value
|
||||||
void operator=(const T&);
|
void operator=(const T& t);
|
||||||
|
|
||||||
//- Assignment of all entries to zero
|
//- Assignment of all entries to zero
|
||||||
void operator=(const zero);
|
void operator=(const zero);
|
||||||
@ -339,7 +341,7 @@ public:
|
|||||||
inline bool empty() const;
|
inline bool empty() const;
|
||||||
|
|
||||||
//- Swap two ULists of the same type in constant time
|
//- Swap two ULists of the same type in constant time
|
||||||
void swap(UList<T>&);
|
void swap(UList<T>& a);
|
||||||
|
|
||||||
|
|
||||||
// STL member operators
|
// STL member operators
|
||||||
@ -347,64 +349,74 @@ public:
|
|||||||
//- Equality operation on ULists of the same type.
|
//- Equality operation on ULists of the same type.
|
||||||
// Returns true when the ULists are element-wise equal
|
// Returns true when the ULists are element-wise equal
|
||||||
// (using UList::value_type::operator==). Takes linear time
|
// (using UList::value_type::operator==). Takes linear time
|
||||||
bool operator==(const UList<T>&) const;
|
bool operator==(const UList<T>& a) const;
|
||||||
|
|
||||||
//- The opposite of the equality operation. Takes linear time
|
//- The opposite of the equality operation. Takes linear time
|
||||||
bool operator!=(const UList<T>&) const;
|
bool operator!=(const UList<T>& a) const;
|
||||||
|
|
||||||
//- Compare two ULists lexicographically. Takes linear time
|
//- Compare two ULists lexicographically. Takes linear time
|
||||||
bool operator<(const UList<T>&) const;
|
bool operator<(const UList<T>& a) const;
|
||||||
|
|
||||||
//- Compare two ULists lexicographically. Takes linear time
|
//- Compare two ULists lexicographically. Takes linear time
|
||||||
bool operator>(const UList<T>&) const;
|
bool operator>(const UList<T>& a) const;
|
||||||
|
|
||||||
//- Return true if !(a > b). Takes linear time
|
//- Return true if !(a > b). Takes linear time
|
||||||
bool operator<=(const UList<T>&) const;
|
bool operator<=(const UList<T>& a) const;
|
||||||
|
|
||||||
//- Return true if !(a < b). Takes linear time
|
//- Return true if !(a < b). Takes linear time
|
||||||
bool operator>=(const UList<T>&) const;
|
bool operator>=(const UList<T>& a) const;
|
||||||
|
|
||||||
|
|
||||||
// Ostream operator
|
// Writing
|
||||||
|
|
||||||
// Write UList to Ostream
|
//- Write the List as a dictionary entry with keyword
|
||||||
|
void writeEntry(const word& keyword, Ostream& os) const;
|
||||||
|
|
||||||
|
//- Write the List, with line-breaks in ASCII if the list length
|
||||||
|
// exceeds shortListLen. Using '0' suppresses line-breaks entirely.
|
||||||
|
Ostream& writeList(Ostream& os, const label shortListLen=0) const;
|
||||||
|
|
||||||
|
|
||||||
|
// IOstream operators
|
||||||
|
|
||||||
|
//- Write List to Ostream, as per writeList() with shortListLen=10
|
||||||
friend Ostream& operator<< <T>
|
friend Ostream& operator<< <T>
|
||||||
(
|
(
|
||||||
Ostream&,
|
Ostream& os,
|
||||||
const UList<T>&
|
const UList<T>& L
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Read UList contents from Istream. Requires size to have been set
|
//- Read List contents from Istream.
|
||||||
// before
|
// Requires size to have been set before
|
||||||
friend Istream& operator>> <T>
|
friend Istream& operator>> <T>
|
||||||
(
|
(
|
||||||
Istream&,
|
Istream& os,
|
||||||
UList<T>&
|
UList<T>& L
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void sort(UList<T>&);
|
void sort(UList<T>& a);
|
||||||
|
|
||||||
template<class T, class Cmp>
|
template<class T, class Cmp>
|
||||||
void sort(UList<T>&, const Cmp&);
|
void sort(UList<T>& a, const Cmp& cmp);
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void stableSort(UList<T>&);
|
void stableSort(UList<T>& a);
|
||||||
|
|
||||||
template<class T, class Cmp>
|
template<class T, class Cmp>
|
||||||
void stableSort(UList<T>&, const Cmp&);
|
void stableSort(UList<T>& a, const Cmp& cmp);
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void shuffle(UList<T>&);
|
void shuffle(UList<T>& a);
|
||||||
|
|
||||||
// Reverse the first n elements of the list
|
// Reverse the first n elements of the list
|
||||||
template<class T>
|
template<class T>
|
||||||
inline void reverse(UList<T>&, const label n);
|
inline void reverse(UList<T>& ul, const label n);
|
||||||
|
|
||||||
// Reverse all the elements of the list
|
// Reverse all the elements of the list
|
||||||
template<class T>
|
template<class T>
|
||||||
inline void reverse(UList<T>&);
|
inline void reverse(UList<T>& ul);
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -29,7 +29,7 @@ License
|
|||||||
#include "SLList.H"
|
#include "SLList.H"
|
||||||
#include "contiguous.H"
|
#include "contiguous.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void Foam::UList<T>::writeEntry(Ostream& os) const
|
void Foam::UList<T>::writeEntry(Ostream& os) const
|
||||||
@ -56,6 +56,8 @@ void Foam::UList<T>::writeEntry(Ostream& os) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void Foam::UList<T>::writeEntry(const word& keyword, Ostream& os) const
|
void Foam::UList<T>::writeEntry(const word& keyword, Ostream& os) const
|
||||||
{
|
{
|
||||||
@ -66,8 +68,14 @@ void Foam::UList<T>::writeEntry(const word& keyword, Ostream& os) const
|
|||||||
|
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
Foam::Ostream& Foam::operator<<(Foam::Ostream& os, const Foam::UList<T>& L)
|
Foam::Ostream& Foam::UList<T>::writeList
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const label shortListLen
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
|
const UList<T>& L = *this;
|
||||||
|
|
||||||
// Write list contents depending on data format
|
// Write list contents depending on data format
|
||||||
if (os.format() == IOstream::ASCII || !contiguous<T>())
|
if (os.format() == IOstream::ASCII || !contiguous<T>())
|
||||||
{
|
{
|
||||||
@ -96,7 +104,11 @@ Foam::Ostream& Foam::operator<<(Foam::Ostream& os, const Foam::UList<T>& L)
|
|||||||
// Write end delimiter
|
// Write end delimiter
|
||||||
os << token::END_BLOCK;
|
os << token::END_BLOCK;
|
||||||
}
|
}
|
||||||
else if (L.size() <= 1 || (L.size() < 11 && contiguous<T>()))
|
else if
|
||||||
|
(
|
||||||
|
L.size() <= 1 || !shortListLen
|
||||||
|
|| (L.size() <= shortListLen && contiguous<T>())
|
||||||
|
)
|
||||||
{
|
{
|
||||||
// Write size and start delimiter
|
// Write size and start delimiter
|
||||||
os << L.size() << token::BEGIN_LIST;
|
os << L.size() << token::BEGIN_LIST;
|
||||||
@ -114,16 +126,16 @@ Foam::Ostream& Foam::operator<<(Foam::Ostream& os, const Foam::UList<T>& L)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Write size and start delimiter
|
// Write size and start delimiter
|
||||||
os << nl << L.size() << nl << token::BEGIN_LIST;
|
os << nl << L.size() << nl << token::BEGIN_LIST << nl;
|
||||||
|
|
||||||
// Write contents
|
// Write contents
|
||||||
forAll(L, i)
|
forAll(L, i)
|
||||||
{
|
{
|
||||||
os << nl << L[i];
|
os << L[i] << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write end delimiter
|
// Write end delimiter
|
||||||
os << nl << token::END_LIST << nl;
|
os << token::END_LIST << nl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -139,12 +151,21 @@ Foam::Ostream& Foam::operator<<(Foam::Ostream& os, const Foam::UList<T>& L)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check state of IOstream
|
// Check state of IOstream
|
||||||
os.check("Ostream& operator<<(Ostream&, const UList&)");
|
os.check("UList<T>::writeList(Ostream&)");
|
||||||
|
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
Foam::Ostream& Foam::operator<<(Foam::Ostream& os, const Foam::UList<T>& L)
|
||||||
|
{
|
||||||
|
return L.writeList(os, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
Foam::Istream& Foam::operator>>(Istream& is, UList<T>& L)
|
Foam::Istream& Foam::operator>>(Istream& is, UList<T>& L)
|
||||||
{
|
{
|
||||||
@ -197,7 +218,7 @@ Foam::Istream& Foam::operator>>(Istream& is, UList<T>& L)
|
|||||||
if (is.format() == IOstream::ASCII || !contiguous<T>())
|
if (is.format() == IOstream::ASCII || !contiguous<T>())
|
||||||
{
|
{
|
||||||
// Read beginning of contents
|
// Read beginning of contents
|
||||||
char delimiter = is.readBeginList("List");
|
const char delimiter = is.readBeginList("List");
|
||||||
|
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -26,7 +26,6 @@ License
|
|||||||
#include "dictionary.H"
|
#include "dictionary.H"
|
||||||
#include "IFstream.H"
|
#include "IFstream.H"
|
||||||
#include "inputModeEntry.H"
|
#include "inputModeEntry.H"
|
||||||
#include "regExp.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -139,7 +139,7 @@ inline void Foam::SubField<Type>::operator=
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
inline Foam::SubField<Type>::operator const Foam::Field<Type>&() const
|
inline Foam::SubField<Type>::operator const Foam::Field<Type>&() const
|
||||||
{
|
{
|
||||||
return *reinterpret_cast<const Field<Type>* >(this);
|
return *reinterpret_cast<const Field<Type>*>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2009-2016 Bernhard Gschaider
|
\\ / A nd | Copyright (C) 2009-2016 Bernhard Gschaider
|
||||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2016-2107 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -225,6 +225,10 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Forward declaration of friend functions and operators
|
||||||
|
Ostream& operator<<(Ostream& os, const profiling::Information& info);
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class profiling::Information Declaration
|
Class profiling::Information Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -385,7 +389,7 @@ public:
|
|||||||
|
|
||||||
// IOstream Operators
|
// IOstream Operators
|
||||||
|
|
||||||
friend Ostream& operator<<(Ostream&, const Information&);
|
friend Ostream& operator<<(Ostream& os, const Information& info);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,26 +1,23 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
# Define how an mpi-versioned library is created
|
# Clean an mpi-versioned library
|
||||||
# clean the qualified directory
|
|
||||||
wcleanMpiLib()
|
wcleanMpiLib()
|
||||||
{
|
{
|
||||||
for libName
|
case "$WM_MPLIB" in (*MPI*)
|
||||||
do
|
|
||||||
(
|
(
|
||||||
WM_OPTIONS="$WM_OPTIONS$WM_MPLIB"
|
WM_OPTIONS="$WM_OPTIONS$WM_MPLIB"
|
||||||
|
for libName
|
||||||
|
do
|
||||||
wclean $libName
|
wclean $libName
|
||||||
)
|
|
||||||
done
|
done
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wclean dummy
|
wclean dummy
|
||||||
|
wcleanMpiLib mpi
|
||||||
case "$WM_MPLIB" in
|
|
||||||
*MPI*)
|
|
||||||
wcleanMpiLib mpi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -10,16 +10,17 @@ cd ${0%/*} || exit 1 # Run from this directory
|
|||||||
# use sentinel file to handle version changes
|
# use sentinel file to handle version changes
|
||||||
wmakeMpiLib()
|
wmakeMpiLib()
|
||||||
{
|
{
|
||||||
|
local objectsDir
|
||||||
for libName
|
for libName
|
||||||
do
|
do
|
||||||
(
|
(
|
||||||
WM_OPTIONS="$WM_OPTIONS$WM_MPLIB"
|
WM_OPTIONS="$WM_OPTIONS$WM_MPLIB"
|
||||||
libDir="$WM_PROJECT_DIR/platforms/$WM_OPTIONS/src/Pstream/$libName"
|
objectsDir="$WM_PROJECT_DIR/build/$WM_OPTIONS/src/Pstream/$libName"
|
||||||
whichmpi="$libDir/using:$FOAM_MPI"
|
whichmpi="$objectsDir/using:$FOAM_MPI"
|
||||||
[ -e "$whichmpi" ] || wclean $libName
|
[ -e "$whichmpi" ] || wclean $libName
|
||||||
echo "wmake $targetType $libName"
|
echo "wmake $targetType $libName"
|
||||||
wmake $targetType $libName
|
wmake $targetType $libName
|
||||||
mkdir -p "$libDir"
|
mkdir -p "$objectsDir"
|
||||||
touch "$whichmpi"
|
touch "$whichmpi"
|
||||||
)
|
)
|
||||||
done
|
done
|
||||||
|
|||||||
@ -1,18 +1,23 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Build optional components (eg, may depend on third-party libraries)
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
|
# Optional component: (eg, may depend on third-party libraries)
|
||||||
|
|
||||||
# Parse arguments for compilation (at least for error catching)
|
# Parse arguments for compilation (at least for error catching)
|
||||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||||
|
|
||||||
. $WM_PROJECT_DIR/etc/config.sh/functions
|
|
||||||
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio)
|
|
||||||
|
|
||||||
# Link with static libccmio only (possibly fewer issues)
|
|
||||||
|
|
||||||
warning="==> skip optional libccm adapter"
|
warning="==> skip optional libccm adapter"
|
||||||
|
|
||||||
|
if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio)
|
||||||
|
then
|
||||||
|
. $settings
|
||||||
|
else
|
||||||
|
echo "$warning (no config.sh/ccmio settings)"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Link with static libccmio only (possibly fewer issues)
|
||||||
if [ -e $CCMIO_ARCH_PATH/include/libccmio/ccmio.h \
|
if [ -e $CCMIO_ARCH_PATH/include/libccmio/ccmio.h \
|
||||||
-a -e $CCMIO_ARCH_PATH/lib/libccmio.a ]
|
-a -e $CCMIO_ARCH_PATH/lib/libccmio.a ]
|
||||||
then
|
then
|
||||||
|
|||||||
@ -49,6 +49,18 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Forward declaration of classes
|
||||||
|
class Istream;
|
||||||
|
class Ostream;
|
||||||
|
|
||||||
|
// Forward declaration of friend functions and operators
|
||||||
|
class eddy;
|
||||||
|
bool operator==(const eddy& a, const eddy& b);
|
||||||
|
bool operator!=(const eddy& a, const eddy& b);
|
||||||
|
Istream& operator>>(Istream& is, eddy& e);
|
||||||
|
Ostream& operator<<(Ostream& os, const eddy& e);
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class eddy Declaration
|
Class eddy Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|||||||
@ -7,8 +7,7 @@ cd ${0%/*} || exit 1 # Run from this directory
|
|||||||
# Cleanup library
|
# Cleanup library
|
||||||
rm -f $FOAM_LIBBIN/librunTimePostProcessing* 2>/dev/null
|
rm -f $FOAM_LIBBIN/librunTimePostProcessing* 2>/dev/null
|
||||||
|
|
||||||
# Cleanup generated files
|
# Cleanup generated files - remove entire top-level
|
||||||
findObjectDir $PWD # remove entire top-level
|
removeObjectDir $PWD
|
||||||
rm -rf "$objectsDir" > /dev/null 2>&1
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -37,21 +37,19 @@ void Foam::blockMeshTools::read
|
|||||||
|
|
||||||
if (firstToken.isLabel())
|
if (firstToken.isLabel())
|
||||||
{
|
{
|
||||||
label s = firstToken.labelToken();
|
const label s = firstToken.labelToken();
|
||||||
|
|
||||||
// Set list length to that read
|
// Set list length to that read
|
||||||
L.setSize(s);
|
L.setSize(s);
|
||||||
|
|
||||||
// Read list contents depending on data format
|
|
||||||
|
|
||||||
// Read beginning of contents
|
// Read beginning of contents
|
||||||
char delimiter = is.readBeginList("List");
|
const char delimiter = is.readBeginList("List");
|
||||||
|
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
if (delimiter == token::BEGIN_LIST)
|
if (delimiter == token::BEGIN_LIST)
|
||||||
{
|
{
|
||||||
for (label i=0; i<s; i++)
|
for (label i=0; i<s; ++i)
|
||||||
{
|
{
|
||||||
read(is, L[i], dict);
|
read(is, L[i], dict);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,46 +1,26 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
# get SCOTCH_VERSION, SCOTCH_ARCH_PATH
|
# Clean an mpi-versioned library
|
||||||
if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch`
|
|
||||||
then
|
|
||||||
. $settings
|
|
||||||
echo " using SCOTCH_ARCH_PATH=$SCOTCH_ARCH_PATH"
|
|
||||||
else
|
|
||||||
echo
|
|
||||||
echo " Error: no config.sh/scotch settings"
|
|
||||||
echo
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Define how to clean an mpi-versioned library
|
|
||||||
wcleanMpiLib()
|
wcleanMpiLib()
|
||||||
{
|
{
|
||||||
for libName
|
case "$WM_MPLIB" in (*MPI*)
|
||||||
do
|
|
||||||
(
|
(
|
||||||
WM_OPTIONS="$WM_OPTIONS$WM_MPLIB"
|
WM_OPTIONS="$WM_OPTIONS$WM_MPLIB"
|
||||||
whichmpi="$WM_PROJECT_DIR/platforms/$WM_OPTIONS/src/parallel/decompose/$libName/using:$FOAM_MPI"
|
for libName
|
||||||
whichscotch="$WM_PROJECT_DIR/platforms/$WM_OPTIONS/src/parallel/decompose/$libName/using:$SCOTCH_VERSION"
|
do
|
||||||
wclean $libName
|
wclean $libName
|
||||||
)
|
|
||||||
done
|
done
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -n "$SCOTCH_ARCH_PATH" ]
|
|
||||||
then
|
|
||||||
wclean scotchDecomp
|
|
||||||
|
|
||||||
if [ -d "$FOAM_LIBBIN/$FOAM_MPI" ]
|
|
||||||
then
|
|
||||||
wcleanMpiLib ptscotchDecomp
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo " skipping scotchDecomp (ptscotchDecomp)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
wclean scotchDecomp
|
||||||
wclean metisDecomp
|
wclean metisDecomp
|
||||||
wclean decompositionMethods
|
wclean decompositionMethods
|
||||||
wclean decompose
|
wclean decompose
|
||||||
|
wcleanMpiLib ptscotchDecomp
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -126,18 +126,19 @@ hasScotch()
|
|||||||
wmakeMpiLib()
|
wmakeMpiLib()
|
||||||
{
|
{
|
||||||
local decompName="$1"
|
local decompName="$1"
|
||||||
|
local objectsDir
|
||||||
shift
|
shift
|
||||||
for libName
|
for libName
|
||||||
do
|
do
|
||||||
(
|
(
|
||||||
WM_OPTIONS="$WM_OPTIONS$WM_MPLIB"
|
WM_OPTIONS="$WM_OPTIONS$WM_MPLIB"
|
||||||
libDir="$WM_PROJECT_DIR/platforms/$WM_OPTIONS/src/parallel/decompose/$libName"
|
objectsDir="$WM_PROJECT_DIR/build/$WM_OPTIONS/src/parallel/decompose/$libName"
|
||||||
whichmpi="$libDir/using:$FOAM_MPI"
|
whichmpi="$objectsDir/using:$FOAM_MPI"
|
||||||
whichdecomp="$libDir/using:$decompName"
|
whichdecomp="$objectsDir/using:$decompName"
|
||||||
[ -e "$whichmpi" -a -e "$whichdecomp" ] || wclean $libName
|
[ -e "$whichmpi" -a -e "$whichdecomp" ] || wclean $libName
|
||||||
echo "wmake $targetType $libName"
|
echo "wmake $targetType $libName"
|
||||||
wmake $targetType $libName
|
wmake $targetType $libName
|
||||||
mkdir -p "$libDir"
|
mkdir -p "$objectsDir"
|
||||||
touch "$whichdecomp" "$whichmpi"
|
touch "$whichdecomp" "$whichmpi"
|
||||||
)
|
)
|
||||||
done
|
done
|
||||||
|
|||||||
@ -1,11 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
makeType=${1:-libso}
|
|
||||||
|
|
||||||
wclean $makeType regionModel
|
wclean libso regionModel
|
||||||
wclean $makeType pyrolysisModels
|
wclean libso pyrolysisModels
|
||||||
wclean $makeType surfaceFilmModels
|
wclean libso surfaceFilmModels
|
||||||
wclean $makeType thermalBaffleModels
|
wclean libso thermalBaffleModels
|
||||||
wclean $makeType regionCoupling
|
wclean libso regionCoupling
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -31,7 +31,6 @@ License
|
|||||||
#include "ensightSerialOutput.H"
|
#include "ensightSerialOutput.H"
|
||||||
#include "ensightPTraits.H"
|
#include "ensightPTraits.H"
|
||||||
#include "OStringStream.H"
|
#include "OStringStream.H"
|
||||||
#include "regExp.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -129,10 +129,10 @@ void Foam::MeshedSurface<Face>::write
|
|||||||
|
|
||||||
if (mfIter == writefileExtensionMemberFunctionTablePtr_->end())
|
if (mfIter == writefileExtensionMemberFunctionTablePtr_->end())
|
||||||
{
|
{
|
||||||
// no direct writer, delegate to proxy if possible
|
// No direct writer, delegate to proxy if possible
|
||||||
wordHashSet supported = ProxyType::writeTypes();
|
const wordHashSet& delegate = ProxyType::writeTypes();
|
||||||
|
|
||||||
if (supported.found(ext))
|
if (delegate.found(ext))
|
||||||
{
|
{
|
||||||
MeshedSurfaceProxy<Face>(surf).write(name);
|
MeshedSurfaceProxy<Face>(surf).write(name);
|
||||||
}
|
}
|
||||||
@ -140,8 +140,8 @@ void Foam::MeshedSurface<Face>::write
|
|||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Unknown file extension " << ext << nl << nl
|
<< "Unknown file extension " << ext << nl << nl
|
||||||
<< "Valid types are :" << endl
|
<< "Valid types:" << nl
|
||||||
<< (supported | writeTypes())
|
<< flatOutput((delegate | writeTypes()).sortedToc()) << nl
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -25,6 +25,7 @@ License
|
|||||||
|
|
||||||
#include "MeshedSurface.H"
|
#include "MeshedSurface.H"
|
||||||
#include "UnsortedMeshedSurface.H"
|
#include "UnsortedMeshedSurface.H"
|
||||||
|
#include "ListOps.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -42,26 +43,26 @@ Foam::MeshedSurface<Face>::New(const fileName& name, const word& ext)
|
|||||||
|
|
||||||
if (cstrIter == fileExtensionConstructorTablePtr_->end())
|
if (cstrIter == fileExtensionConstructorTablePtr_->end())
|
||||||
{
|
{
|
||||||
// no direct reader, delegate if possible
|
// No direct reader, delegate to friend if possible
|
||||||
wordHashSet supported = FriendType::readTypes();
|
const wordHashSet& delegate = FriendType::readTypes();
|
||||||
if (supported.found(ext))
|
|
||||||
|
if (delegate.found(ext))
|
||||||
{
|
{
|
||||||
// create indirectly
|
// Create indirectly
|
||||||
autoPtr<MeshedSurface<Face>> surf(new MeshedSurface<Face>);
|
autoPtr<MeshedSurface<Face>> surf(new MeshedSurface<Face>);
|
||||||
surf().transfer(FriendType::New(name, ext)());
|
surf().transfer(FriendType::New(name, ext)());
|
||||||
|
|
||||||
return surf;
|
return surf;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
// nothing left to try, issue error
|
{
|
||||||
supported += readTypes();
|
|
||||||
|
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Unknown file extension " << ext << nl << nl
|
<< "Unknown file extension " << ext << nl << nl
|
||||||
<< "Valid types are :" << nl
|
<< "Valid types:" << nl
|
||||||
<< supported
|
<< flatOutput((delegate | readTypes()).sortedToc()) << nl
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return autoPtr<MeshedSurface<Face>>(cstrIter()(name));
|
return autoPtr<MeshedSurface<Face>>(cstrIter()(name));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -26,9 +26,9 @@ License
|
|||||||
#include "MeshedSurfaceProxy.H"
|
#include "MeshedSurfaceProxy.H"
|
||||||
|
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
|
#include "ListOps.H"
|
||||||
#include "surfMesh.H"
|
#include "surfMesh.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include "ListOps.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ void Foam::MeshedSurfaceProxy<Face>::write
|
|||||||
InfoInFunction << "Writing to " << name << endl;
|
InfoInFunction << "Writing to " << name << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
word ext = name.ext();
|
const word ext = name.ext();
|
||||||
|
|
||||||
typename writefileExtensionMemberFunctionTable::iterator mfIter =
|
typename writefileExtensionMemberFunctionTable::iterator mfIter =
|
||||||
writefileExtensionMemberFunctionTablePtr_->find(ext);
|
writefileExtensionMemberFunctionTablePtr_->find(ext);
|
||||||
@ -74,8 +74,8 @@ void Foam::MeshedSurfaceProxy<Face>::write
|
|||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Unknown file extension " << ext << nl << nl
|
<< "Unknown file extension " << ext << nl << nl
|
||||||
<< "Valid types are :" << endl
|
<< "Valid types:" << nl
|
||||||
<< writeTypes()
|
<< flatOutput(writeTypes().sortedToc()) << nl
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ void Foam::MeshedSurfaceProxy<Face>::write
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
// the surface name to be used
|
// the surface name to be used
|
||||||
word name(surfName.size() ? surfName : surfaceRegistry::defaultName);
|
const word name(surfName.size() ? surfName : surfaceRegistry::defaultName);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -29,6 +29,7 @@ License
|
|||||||
#include "IFstream.H"
|
#include "IFstream.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
|
#include "ListOps.H"
|
||||||
#include "polyBoundaryMesh.H"
|
#include "polyBoundaryMesh.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
|
|
||||||
@ -117,10 +118,10 @@ void Foam::UnsortedMeshedSurface<Face>::write
|
|||||||
|
|
||||||
if (mfIter == writefileExtensionMemberFunctionTablePtr_->end())
|
if (mfIter == writefileExtensionMemberFunctionTablePtr_->end())
|
||||||
{
|
{
|
||||||
// no direct writer, delegate to proxy if possible
|
// No direct writer, delegate to proxy if possible
|
||||||
wordHashSet supported = ProxyType::writeTypes();
|
const wordHashSet& delegate = ProxyType::writeTypes();
|
||||||
|
|
||||||
if (supported.found(ext))
|
if (delegate.found(ext))
|
||||||
{
|
{
|
||||||
MeshedSurfaceProxy<Face>(surf).write(name);
|
MeshedSurfaceProxy<Face>(surf).write(name);
|
||||||
}
|
}
|
||||||
@ -128,8 +129,8 @@ void Foam::UnsortedMeshedSurface<Face>::write
|
|||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Unknown file extension " << ext << nl << nl
|
<< "Unknown file extension " << ext << nl << nl
|
||||||
<< "Valid types are :" << endl
|
<< "Valid types:" << nl
|
||||||
<< (supported | writeTypes())
|
<< flatOutput((delegate | writeTypes()).sortedToc()) << nl
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -24,6 +24,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "UnsortedMeshedSurface.H"
|
#include "UnsortedMeshedSurface.H"
|
||||||
|
#include "ListOps.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -41,11 +42,12 @@ Foam::UnsortedMeshedSurface<Face>::New(const fileName& name, const word& ext)
|
|||||||
|
|
||||||
if (cstrIter == fileExtensionConstructorTablePtr_->end())
|
if (cstrIter == fileExtensionConstructorTablePtr_->end())
|
||||||
{
|
{
|
||||||
// no direct reader, use the parent if possible
|
// No direct reader, delegate to parent if possible
|
||||||
wordHashSet supported = ParentType::readTypes();
|
const wordHashSet& delegate = ParentType::readTypes();
|
||||||
if (supported.found(ext))
|
|
||||||
|
if (delegate.found(ext))
|
||||||
{
|
{
|
||||||
// create indirectly
|
// Create indirectly
|
||||||
autoPtr<UnsortedMeshedSurface<Face>> surf
|
autoPtr<UnsortedMeshedSurface<Face>> surf
|
||||||
(
|
(
|
||||||
new UnsortedMeshedSurface<Face>
|
new UnsortedMeshedSurface<Face>
|
||||||
@ -54,16 +56,15 @@ Foam::UnsortedMeshedSurface<Face>::New(const fileName& name, const word& ext)
|
|||||||
|
|
||||||
return surf;
|
return surf;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
// nothing left but to issue an error
|
{
|
||||||
supported += readTypes();
|
|
||||||
|
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Unknown file extension " << ext << nl << nl
|
<< "Unknown file extension " << ext << nl << nl
|
||||||
<< "Valid types are:" << nl
|
<< "Valid types:" << nl
|
||||||
<< supported
|
<< flatOutput((delegate | readTypes()).sortedToc()) << nl
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return autoPtr<UnsortedMeshedSurface<Face>>(cstrIter()(name));
|
return autoPtr<UnsortedMeshedSurface<Face>>(cstrIter()(name));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -26,9 +26,9 @@ License
|
|||||||
#include "surfaceFormatsCore.H"
|
#include "surfaceFormatsCore.H"
|
||||||
|
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
|
#include "ListOps.H"
|
||||||
#include "IFstream.H"
|
#include "IFstream.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include "SortableList.H"
|
|
||||||
#include "surfMesh.H"
|
#include "surfMesh.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -167,18 +167,9 @@ bool Foam::fileFormats::surfaceFormatsCore::checkSupport
|
|||||||
}
|
}
|
||||||
else if (verbose)
|
else if (verbose)
|
||||||
{
|
{
|
||||||
wordList toc = available.toc();
|
|
||||||
SortableList<word> known(toc.xfer());
|
|
||||||
|
|
||||||
Info<<"Unknown file extension for " << functionName
|
Info<<"Unknown file extension for " << functionName
|
||||||
<< " : " << ext << nl
|
<< " : " << ext << nl
|
||||||
<<"Valid types: (";
|
<< "Valid types: " << flatOutput(available.sortedToc()) << endl;
|
||||||
// compact output:
|
|
||||||
forAll(known, i)
|
|
||||||
{
|
|
||||||
Info<<" " << known[i];
|
|
||||||
}
|
|
||||||
Info<<" )" << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -62,8 +62,8 @@ class surfaceFormatsCore
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
//- Return a list with a single entry,
|
//- Return a surfZone list with a single entry, the size of which
|
||||||
// the size corresponds to that of the container
|
// corresponds to that of the container
|
||||||
template<class Container>
|
template<class Container>
|
||||||
static List<surfZone> oneZone
|
static List<surfZone> oneZone
|
||||||
(
|
(
|
||||||
@ -89,6 +89,7 @@ public:
|
|||||||
|
|
||||||
// Static Member Functions
|
// Static Member Functions
|
||||||
|
|
||||||
|
//- Helper function when checking if a file extension is supported.
|
||||||
static bool checkSupport
|
static bool checkSupport
|
||||||
(
|
(
|
||||||
const wordHashSet& available,
|
const wordHashSet& available,
|
||||||
|
|||||||
@ -55,7 +55,7 @@ class surfZone;
|
|||||||
// Forward declaration of friend functions and operators
|
// Forward declaration of friend functions and operators
|
||||||
|
|
||||||
class triSurface;
|
class triSurface;
|
||||||
|
Istream& operator>>(Istream&, triSurface&);
|
||||||
Ostream& operator<<(Ostream&, const triSurface&);
|
Ostream& operator<<(Ostream&, const triSurface&);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,10 +4,14 @@ cd ${0%/*} || exit 1 # Run from this directory
|
|||||||
echo "--------"
|
echo "--------"
|
||||||
echo "Cleaning tutorials ..."
|
echo "Cleaning tutorials ..."
|
||||||
echo "Removing backup files"
|
echo "Removing backup files"
|
||||||
find . -type f \( -name "*~" -o -name "*.bak" \) -exec rm {} \;
|
|
||||||
find . \( -name core -o -name 'core.[1-9]*' \) -exec rm {} \;
|
find . \( \
|
||||||
find . \( -name '*.pvs' -o -name '*.OpenFOAM' \) -exec rm {} \;
|
-name '*~' -o -name '*.bak' \
|
||||||
rm logs testLoopReport > /dev/null 2>&1
|
-name core -o -name 'core.[1-9]*' \
|
||||||
|
-name '*.pvs' -o -name '*.OpenFOAM' \
|
||||||
|
\) -type f -delete
|
||||||
|
|
||||||
|
rm -f logs testLoopReport > /dev/null 2>&1
|
||||||
|
|
||||||
foamCleanTutorials cases
|
foamCleanTutorials cases
|
||||||
|
|
||||||
|
|||||||
@ -138,7 +138,7 @@ do
|
|||||||
[ -d $appDir ] || continue
|
[ -d $appDir ] || continue
|
||||||
echo -n " $appDir..." 1>&2
|
echo -n " $appDir..." 1>&2
|
||||||
|
|
||||||
logs=$(find -L $appDir -type f -name 'log.*')
|
logs=$(find -L $appDir -name 'log.*' -type f)
|
||||||
if [ -n "$logs" ]
|
if [ -n "$logs" ]
|
||||||
then
|
then
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|||||||
@ -211,7 +211,7 @@ fi
|
|||||||
echo "Modifying the controlDicts to run only one time step" 1>&2
|
echo "Modifying the controlDicts to run only one time step" 1>&2
|
||||||
cd ${TEST_RUN_DIR} || exit 1
|
cd ${TEST_RUN_DIR} || exit 1
|
||||||
|
|
||||||
for CD in $(find . -type f -name "controlDict*")
|
for CD in $(find . -name "controlDict*" -type f)
|
||||||
do
|
do
|
||||||
mv ${CD} ${CD}.orig
|
mv ${CD} ${CD}.orig
|
||||||
sed \
|
sed \
|
||||||
@ -225,7 +225,7 @@ done
|
|||||||
if [ "$DEFAULT_SCHEMES" = true ]
|
if [ "$DEFAULT_SCHEMES" = true ]
|
||||||
then
|
then
|
||||||
echo "Modifying the fvSchemes to contain only default schemes" 1>&2
|
echo "Modifying the fvSchemes to contain only default schemes" 1>&2
|
||||||
for FV_SC in $(find . -type f -name fvSchemes)
|
for FV_SC in $(find . -name fvSchemes -type f)
|
||||||
do
|
do
|
||||||
for S in $FV_SCHEMES
|
for S in $FV_SCHEMES
|
||||||
do
|
do
|
||||||
@ -253,7 +253,7 @@ do
|
|||||||
do
|
do
|
||||||
rm $SCHEMES_TEMP $SOLVERS_TEMP > /dev/null 2>&1
|
rm $SCHEMES_TEMP $SOLVERS_TEMP > /dev/null 2>&1
|
||||||
echo " ${ST}" >> $SCHEMES_FILE
|
echo " ${ST}" >> $SCHEMES_FILE
|
||||||
for LOG in $(find ${APP} -type f -name "log.${APP}")
|
for LOG in $(find ${APP} -name "log.${APP}" -type f)
|
||||||
do
|
do
|
||||||
for S in $(grep ${ST} ${LOG} | cut -d" " -f4)
|
for S in $(grep ${ST} ${LOG} | cut -d" " -f4)
|
||||||
do
|
do
|
||||||
|
|||||||
@ -44,9 +44,9 @@ done
|
|||||||
|
|
||||||
sample $timeOpt
|
sample $timeOpt
|
||||||
SDIR=sets
|
SDIR=sets
|
||||||
LSDIR=`ls $SDIR | head -1`
|
LSDIR=$(ls $SDIR | head -1)
|
||||||
EXAMPLE_FILE=`ls -1 $SDIR/${LSDIR}/* | head -1`
|
EXAMPLE_FILE=$(ls -1 $SDIR/${LSDIR}/* | head -1)
|
||||||
FS=`basename $EXAMPLE_FILE | cut -d_ -f2-`
|
FS=$(basename $EXAMPLE_FILE | cut -d_ -f2-)
|
||||||
|
|
||||||
for d in $SDIR/*
|
for d in $SDIR/*
|
||||||
do
|
do
|
||||||
|
|||||||
@ -95,7 +95,7 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# paths to data
|
# paths to data
|
||||||
LATESTTIME=`ls $SETSDIR`
|
LATESTTIME=$(ls $SETSDIR)
|
||||||
OFDATAROOT=$SETSDIR/$LATESTTIME
|
OFDATAROOT=$SETSDIR/$LATESTTIME
|
||||||
|
|
||||||
EXPTDATAROOT=./exptData
|
EXPTDATAROOT=./exptData
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user