Commit 5db2f67a authored by Andrew Heather's avatar Andrew Heather
Browse files

Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop

parents 42603a06 5f782919
OpenFOAM-v1612+
OpenFOAM-1706
==================
Known Build Issues
==================
......@@ -22,16 +22,15 @@ VTK
---
If using the runTimePostProcessing to create on-the-fly images, you
can simply just compile ParaView-5.0.1 and these libraries will
be used.
can simply just compile ParaView and these libraries will be used.
If you elect to use a separate VTK compilation (for example for
off-screen rendering), it is advisable to reuse the VTK libraries that
are provided with ParaView-5.0.1, by making an appropriate symlink
are provided with ParaView by making an appropriate symlink
prior to using makeVTK. This doesn't just reduce disk-space, but works
much better than using the VTK-7.1.0.tar file.
much better than using the VTK tar file.
Using runTimePostProcessing with the 'plain' VTK-7.1.0 libraries does
Using runTimePostProcessing with the 'plain' VTK libraries does
generally work, but does not exit cleanly:
symbol lookup error: .../linux64Gcc/VTK-7.1.0/lib/libvtkCommonExecutionModel-7.1.so.1:
......@@ -60,4 +59,21 @@ there are also minimum gcc/g++ requirements there:
If your system compiler is too old to build the minimum required gcc or
clang/llvm, it is just simply too old.
-------------------------
Building with spack
-------------------------
If you are building with spack, note that the depends_on for paraview
resolves poorly. The +qt dependency (for building the reader module)
may need to be specified as a preference by including the following in
your `~/.spack/packages.yaml` file:
packages:
paraview:
variants: +qt
It appears that spack will otherwise ignore any paraview+qt version
and attempt to install a paraview~qt version instead.
--
......@@ -651,7 +651,7 @@ int main(int argc, char *argv[])
);
// corrector for mesh motion
twoDPointCorrector* correct2DPtr = NULL;
twoDPointCorrector* correct2DPtr = nullptr;
if (motionObj.typeHeaderOk<IOdictionary>(true))
{
......
......@@ -28,7 +28,7 @@ int USERD_set_filenames
// remove the last '/' from rootDir
if (the_path[lRoot-1] == '/')
{
the_path[lRoot-1] = char(NULL);
the_path[lRoot-1] = '\0';
}
else
{
......
......@@ -97,6 +97,7 @@ done
cat << HEADER > $outFile
#----------------------------------*-sh-*--------------------------------------
# Bash completions for OpenFOAM applications
# Formatted as "complete ... -F _of_APPNAME APPNAME
unset -f _of_filter_opts 2>/dev/null
_of_filter_opts()
......
......@@ -62,6 +62,14 @@ die()
exit 1
}
# Automatically upgrade copyrights in files.
# Disabled by default since some changes (eg, spelling) do not automatically
# imply an update copyright.
optCopyright=false
# Run all tests (do not exit on first failure)
optAll=false
#-----------------------------------------------------------------------------
# Check content that will be added by this commit.
......@@ -76,11 +84,27 @@ fi
# called manually with arguments for the files/directories to be tested?
if [ "$#" -gt 0 ]
then
case "$1" in
-h | -help)
die "interactive usage: supply list of files/directories to check"
;;
esac
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
die "interactive usage: supply list of files/directories to check"
;;
-copy)
echo "$hookName: adjust copyright enabled" 1>&2
optCopyright=true
shift
;;
-all)
echo "$hookName: do all tests (no premature exit)" 1>&2
optAll=true
shift
;;
*)
break
;;
esac
done
# obtain list of all specified files/directories
fileList=$(git ls-files -- $@ 2>/dev/null)
......@@ -100,6 +124,8 @@ unset badFiles
# join list of files with this amount of space
Indent=" "
exitCode=0
#
# report bad files and die if there are any
#
......@@ -114,7 +140,14 @@ dieOnBadFiles()
echo "File(s):" 1>&2
echo "$badFiles" 1>&2
echo '' 1>&2
exit 1
exitCode=1
if [ "$optAll" = true ]
then
return 0 # Continue to the next test
else
exit $exitCode
fi
fi
}
......@@ -314,7 +347,7 @@ MESSAGE
#
# check that OpenFOAM Foundation copyright is current
# check that copyright date is current
#
checkCopyright()
{
......@@ -327,9 +360,9 @@ checkCopyright()
startYear=`grep "Copyright.*OpenCFD" $f | sed 's/[^0-9]*\([0-9]*\).*/\1/g'`
endYear=`grep "Copyright.*-.*OpenCFD" $f | sed 's/[^-]*-\([0-9]*\).*/\1/g'`
#echo "startYear=$startYear endYear=$endYear"
if [ "$startYear" != "" ]
if [ -n "$startYear" ]
then
if [ "$endYear" != "" ]
if [ -n "$endYear" ]
then
# Date is of type 2011-2012 OpenCFD Ltd.
if [ "$year" != "$endYear" ]
......@@ -371,7 +404,11 @@ checkLineLengthNonDirective
# check for non-standard code patterns
checkNonStandardCodePatterns
checkCopyright
# Stop now if there were any errors
[ "$exitCode" = 0 ] || exit $exitCode
# check copyright date (normally disabled)
[ "$optCopyright" = true ] && checkCopyright
exit 0
#------------------------------------------------------------------------------
#----------------------------------*-sh-*--------------------------------------
# Bash completions for OpenFOAM applications
# Formatted as "complete ... -F _of_APPNAME APPNAME
unset -f _of_filter_opts 2>/dev/null
_of_filter_opts()
......
......@@ -181,6 +181,17 @@ unset -f wmRefresh 2>/dev/null
unset -f foamVersion 2>/dev/null
unset -f foamPV 2>/dev/null
# Cleanup bash completions, which look like this:
# "complete ... -F _of_APPNAME APPNAME
# For economy, obtain list first but also add in 'filter_opts' helper
foamClean="$(complete 2>/dev/null | sed -n -e 's/complete.*-F _of_.* \(..*\)$/\1/p')"
for cleaned in $foamClean filter_opts
do
unset -f _of_$cleaned 2>/dev/null
complete -r $cleaned 2>/dev/null
done
#------------------------------------------------------------------------------
# Intermediate variables (do as last for a clean exit code)
......
......@@ -1284,7 +1284,7 @@ int Foam::system(const Foam::UList<Foam::string>& command)
{
// in child:
// Need command and arguments separately.
// args is a NULL-terminated list of c-strings
// args is a nullptr-terminated list of c-strings
CStringList args(SubList<string>(command, 0));
if (argc > 1)
......
......@@ -97,10 +97,11 @@ inline uint64_t Foam::endian::swap64(uint64_t u)
);
// alternative formulation
//
// u = ((u<< 8) & 0xFF00FF00FF00FF00ull) | ((u>> 8) & 0x00FF00FF00FF00FFull);
// u = ((u<<16) & 0xFFFF0000FFFF0000ull) | ((u>>16) & 0x0000FFFF0000FFFFull);
// return (u >> 32) | (u << 32);
/*
u = ((u<< 8) & 0xFF00FF00FF00FF00ull) | ((u>> 8) & 0x00FF00FF00FF00FFull);
u = ((u<<16) & 0xFFFF0000FFFF0000ull) | ((u>>16) & 0x0000FFFF0000FFFFull);
return (u >> 32) | (u << 32);
*/
#endif
}
......
......@@ -73,7 +73,7 @@ class CStringList
// Does not include the final nul-character
size_t len_;
//- List of strings, including trailing NULL pointer
//- List of strings, including trailing nullptr
char** argv_;
//- Flattened content with interspersed nul-characters
......@@ -109,8 +109,8 @@ public:
// Public Members
//- Count the number of parameters until the first NULL pointer.
// Return 0 if argv is NULL.
//- Count the number of parameters until the first nullptr
// Return 0 if argv is nullptr.
static inline int count(const char * const argv[]);
......@@ -120,7 +120,7 @@ public:
inline int size() const;
//- Return the list of C-strings (ie, argv)
// The position at argc is a NULL pointer
// The position at argc is a nullptr
inline char** strings() const;
......@@ -148,8 +148,8 @@ public:
template<class StringType>
static List<StringType> asList(int argc, const char * const argv[]);
//- Create a list from a NULL-terminated list of argv parameters.
// A null pointer for argv is permissible.
//- Create a list from a nullptr-terminated list of argv parameters.
// Using a nullptr for argv is permissible.
template<class StringType>
static inline List<StringType> asList(const char * const argv[]);
......
......@@ -85,10 +85,10 @@ bool Foam::ccm::base::close()
{
if (CCMIOIsValidEntity(globalState_->root))
{
CCMIOCloseFile(NULL, globalState_->root);
CCMIOCloseFile(nullptr, globalState_->root);
}
delete globalState_;
globalState_ = 0;
globalState_ = nullptr;
return true;
}
......
......@@ -52,7 +52,7 @@ void Foam::ccm::reader::determineFieldInfo
(
CCMIONextEntity
(
NULL,
nullptr,
fieldSetNode,
kCCMIOFieldPhase,
&phaseI,
......@@ -74,7 +74,7 @@ void Foam::ccm::reader::determineFieldInfo
(
CCMIONextEntity
(
NULL,
nullptr,
phaseNode,
kCCMIOField,
&fieldI,
......@@ -84,12 +84,12 @@ void Foam::ccm::reader::determineFieldInfo
&& CCMIOReadField
(
NULL,
nullptr,
fieldNode,
fullName,
shortName,
&dims,
NULL
nullptr
)
== kCCMIONoErr
)
......@@ -139,7 +139,7 @@ void Foam::ccm::reader::determineFieldInfo
(
CCMIONextEntity
(
NULL,
nullptr,
fieldNode,
kCCMIOFieldData,
&dataI,
......@@ -149,20 +149,20 @@ void Foam::ccm::reader::determineFieldInfo
&& CCMIOEntitySize
(
NULL,
nullptr,
dataNode,
NULL,
nullptr,
&maxId
)
== kCCMIONoErr
&& CCMIOReadFieldDatad
(
NULL,
nullptr,
dataNode,
NULL,
nullptr,
&dataLocation,
NULL,
nullptr,
kCCMIOStart,
kCCMIOEnd
)
......@@ -212,7 +212,7 @@ bool Foam::ccm::reader::detectSolution()
(
CCMIONextEntity
(
NULL,
nullptr,
(globalState_->root),
kCCMIOState,
&stateI,
......@@ -230,7 +230,7 @@ bool Foam::ccm::reader::detectSolution()
(
CCMIONextEntity
(
NULL,
nullptr,
stateNode,
kCCMIOProcessor,
&procI,
......@@ -240,11 +240,11 @@ bool Foam::ccm::reader::detectSolution()
&& CCMIOReadProcessor
(
NULL,
nullptr,
processorNode,
NULL, // Ignore verticesNode
NULL, // Ignore topologyNode
NULL, // Ignore initialField
nullptr, // Ignore verticesNode
nullptr, // Ignore topologyNode
nullptr, // Ignore initialField
&solutionNode
)
== kCCMIONoErr
......@@ -263,7 +263,7 @@ bool Foam::ccm::reader::detectSolution()
(
CCMIONextEntity
(
NULL,
nullptr,
solutionNode,
kCCMIORestart,
&restartI,
......@@ -273,7 +273,7 @@ bool Foam::ccm::reader::detectSolution()
&& CCMIOEntityName
(
NULL,
nullptr,
stateNode,
solutionName
)
......@@ -281,13 +281,13 @@ bool Foam::ccm::reader::detectSolution()
&& CCMIOReadRestartInfo
(
NULL,
nullptr,
restartNode,
NULL, // Ignore solverName
nullptr, // Ignore solverName
&iteration,
&timeValue,
NULL, // Ignore timeUnits
NULL // Ignore startAngle
nullptr, // Ignore timeUnits
nullptr // Ignore startAngle
)
== kCCMIONoErr
)
......@@ -310,7 +310,7 @@ bool Foam::ccm::reader::detectSolution()
(
CCMIONextEntity
(
NULL,
nullptr,
processorNode,
kCCMIOLagrangianData,
&lagrangianI,
......@@ -320,9 +320,9 @@ bool Foam::ccm::reader::detectSolution()
&& CCMIOReadLagrangianData
(
NULL,
nullptr,
lagrangianNode,
NULL,
nullptr,
&lagrangianSolutions
)
== kCCMIONoErr
......@@ -366,10 +366,10 @@ Foam::ccm::reader::readField
(
CCMIOGetState
(
NULL,
nullptr,
(globalState_->root),
solutionName.c_str(),
NULL,
nullptr,
&stateNode
)
!= kCCMIONoErr
......@@ -420,7 +420,7 @@ Foam::ccm::reader::readField
(
CCMIONextEntity
(
NULL,
nullptr,
stateNode,
kCCMIOProcessor,
&procI,
......@@ -430,11 +430,11 @@ Foam::ccm::reader::readField
&& CCMIOReadProcessor
(
NULL,
nullptr,
processorNode,
NULL, // Ignore verticesNode
NULL, // Ignore topologyNode
NULL, // Ignore initialField
nullptr, // Ignore verticesNode
nullptr, // Ignore topologyNode
nullptr, // Ignore initialField
&solutionNode
)
== kCCMIONoErr
......@@ -448,7 +448,7 @@ Foam::ccm::reader::readField
(
CCMIONextEntity
(
NULL,
nullptr,
solutionNode,
kCCMIOFieldPhase,
&phaseI,
......@@ -465,7 +465,7 @@ Foam::ccm::reader::readField
(
CCMIONextEntity
(
NULL,
nullptr,
phaseNode,
kCCMIOField,
&fieldI,
......@@ -480,10 +480,10 @@ Foam::ccm::reader::readField
(
&(globalState_->error),
fieldNode,
NULL,
nullptr,
shortName,
&dims,
NULL
nullptr
);
assertNoError
(
......@@ -501,7 +501,7 @@ Foam::ccm::reader::readField
(
CCMIONextEntity
(
NULL,
nullptr,
fieldNode,
kCCMIOFieldData,
&dataI,
......@@ -518,20 +518,20 @@ Foam::ccm::reader::readField
(
CCMIOEntitySize
(
NULL,
nullptr,
dataNode,
&n,
NULL
nullptr
)
== kCCMIONoErr
&& CCMIOReadFieldDatad
(
NULL,
nullptr,
dataNode,
&mapId,
&dataLocation,
NULL,
nullptr,
kCCMIOStart,
kCCMIOEnd
)
......@@ -549,10 +549,10 @@ Foam::ccm::reader::readField
(
CCMIOEntityDescription
(
NULL,
nullptr,
dataNode,
&len,
NULL
nullptr
)
== kCCMIONoErr
)
......@@ -563,7 +563,7 @@ Foam::ccm::reader::readField
(
CCMIOEntityDescription
(
NULL,
nullptr,
dataNode,
&len,
dataLabel
......@@ -577,7 +577,7 @@ Foam::ccm::reader::readField
strstr(fieldName.c_str(), "SIG")
|| strstr(fieldName.c_str(), "EPS")
)
&& strstr(dataLabel, "So") == NULL
&& strstr(dataLabel, "So") == nullptr
)
{
okayCombination = false;
......@@ -607,8 +607,8 @@ Foam::ccm::reader::readField
(
&(globalState_->error),
dataNode,
NULL,
NULL,
nullptr,
nullptr,
rawData.begin(),
kCCMIOStart,
kCCMIOEnd
......
......@@ -592,7 +592,7 @@ Foam::vector Foam::turbulentDFSEMInletFvPatchVectorField::uDashEddy
void Foam::turbulentDFSEMInletFvPatchVectorField::calcOverlappingProcEddies
(
List<List<eddy> >& overlappingEddies
List<List<eddy>>& overlappingEddies
) const
{
int oldTag = UPstream::msgType();
......@@ -604,7 +604,7 @@ void Foam::turbulentDFSEMInletFvPatchVectorField::calcOverlappingProcEddies
Pstream::scatterList(patchBBs);
// Per processor indices into all segments to send
List<DynamicList<label> > dynSendMap(Pstream::nProcs());
List<DynamicList<label>> dynSendMap(Pstream::nProcs());
forAll(eddies_, i)
{
......@@ -1050,7 +1050,7 @@ void Foam::turbulentDFSEMInletFvPatchVectorField::updateCoeffs()
}
// Add contributions from overlapping eddies
List<List<eddy> > overlappingEddies(Pstream::nProcs());
List<List<eddy>> overlappingEddies(Pstream::nProcs());
calcOverlappingProcEddies(overlappingEddies);
forAll(overlappingEddies, procI)
......
......@@ -231,7 +231,7 @@ class turbulentDFSEMInletFvPatchVectorField
//- Helper function to interpolate values from the boundary data or
// read from dictionary
template<class Type>
tmp<Field<Type> > interpolateOrRead
tmp<Field<Type>> interpolateOrRead
(
const word& fieldName,
const dictionary& dict,
......@@ -240,7 +240,7 @@ class turbulentDFSEMInletFvPatchVectorField
//- Helper function to interpolate values from the boundary data
template<class Type>
tmp<Field<Type> > interpolateBoundaryData
tmp<Field<Type>> interpolateBoundaryData
(
const word& fieldName
) const;
......@@ -258,7 +258,7 @@ class turbulentDFSEMInletFvPatchVectorField
// processor
void calcOverlappingProcEddies