...
 
Commits (14)
api=1812
patch=190531
patch=190813
......@@ -63,7 +63,7 @@ Components
-scotch-path DIR specify 'SCOTCH_ARCH_PATH' (eg, /opt/scotch_6.0.4)
Graphics
-paraview VER specify 'ParaView_VERSION' (eg, 5.4.1)
-paraview VER specify 'ParaView_VERSION' (eg, 5.4.1 or system)
-paraview-qt VER specify 'ParaView_QT' (eg, qt-system)
-paraview-path DIR specify 'ParaView_DIR' (eg, /opt/ParaView-5.4.1)
-vtk VER specify 'vtk_version' (eg, VTK-7.1.0)
......@@ -581,11 +581,11 @@ do
-paraview | -paraviewVersion | --paraviewVersion)
# Replace ParaView_VERSION=...
expected="[5-9][.0-9]*"
expected="[5-9][.0-9]*" # but also accept system
optionValue=$(getOptionValue "$@")
_matches "$optionValue" "$expected" || \
[ "$optionValue" != "${optionValue%system}" ] || \
die "'$1' has bad value: '$optionValue'"
replace etc/config.sh/paraview ParaView_VERSION "$optionValue"
replace etc/config.csh/paraview ParaView_VERSION "$optionValue"
adjusted=true
......
......@@ -212,9 +212,13 @@ default:
endsw
endif
unset cleaned archDir
#------------------------------------------------------------------------------
unsetenv ParaView_VERSION ParaView_QT
unset archDir
unset cmake cmake_version
unset pv_api pvLibDir pvPython qtDir qtLibDir
unsetenv ParaView_VERSION ParaView_QT
#------------------------------------------------------------------------------
......@@ -122,7 +122,7 @@ end
# Clean standard environment variables (PATH, MANPATH, LD_LIBRARY_PATH)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Prevent local variables from shadowing setenv variables
unset PATH MANPATH LD_LIBRARY_PATH LD_PRELOAD
unset PATH MANPATH LD_LIBRARY_PATH
if (! $?LD_LIBRARY_PATH ) setenv LD_LIBRARY_PATH
if (! $?MANPATH ) setenv MANPATH
......@@ -167,10 +167,6 @@ if ( $?MANPATH ) then
setenv MANPATH "${MANPATH}:"
endif
if ( $?LD_PRELOAD ) then
_foamClean LD_PRELOAD
endif
# Cleanup temporary information
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -105,27 +105,7 @@ case "$ParaView_VERSION" in
;;
(system)
# Obtain major.minor from `paraview --version`
pv_api="$(paraview --version 2>/dev/null | \
sed -ne 's/^[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/p')"
if [ -n "$pv_api" ]
then
export PV_PLUGIN_PATH="$FOAM_LIBBIN/paraview-$pv_api"
else
unset ParaView_DIR PV_PLUGIN_PATH
fi
if [ -n "$FOAM_VERBOSE" ] && [ -n "$PS1" ]
then
if [ -n "$PV_PLUGIN_PATH" ]
then
echo "Using paraview (system)" 1>&2
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH" 1>&2
else
echo "system paraview (not found)" 1>&2
fi
fi
eval "$($WM_PROJECT_DIR/bin/foamEtcFile -sh ${FOAM_CONFIG_NOUSER:+-mode=o} -config paraview-system)"
;;
(*)
......@@ -215,14 +195,16 @@ case "$ParaView_VERSION" in
;;
esac
unset -f _foamParaviewEval 2> /dev/null
unset cleaned archDir
unset cmake cmake_version
unset pv_api pvLibDir pvPython qtDir qtLibDir
#------------------------------------------------------------------------------
if command -v _foamAddLib > /dev/null 2>&1 # normal sourcing
then
unset ParaView_VERSION ParaView_QT
fi
unset archDir
unset cmake cmake_version
unset pv_api pvLibDir pvPython qtDir qtLibDir
#------------------------------------------------------------------------------
#----------------------------------*-sh-*--------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, licensed under GNU General Public License
# <http://www.gnu.org/licenses/>.
#
# File
# etc/config.sh/paraview-system
# - sourced by OpenFOAM-*/etc/bashrc or via foamPV alias
#
# Description
# Setup using PARAVIEW system installation
#
# Note
# When _foamAddLib is unset (eg, called from makeParaView or from foamPV):
# - the ParaView_VERSION variable is retained.
#------------------------------------------------------------------------------
# Compiler-specific location for ThirdParty installations
archDir="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER"
# Clean PATH and LD_LIBRARY_PATH
eval \
"$($WM_PROJECT_DIR/bin/foamCleanPath -sh-env=PATH \
$ParaView_DIR $archDir/ParaView-)"
eval \
"$($WM_PROJECT_DIR/bin/foamCleanPath -sh-env=LD_LIBRARY_PATH \
$ParaView_DIR $archDir/ParaView-)"
#------------------------------------------------------------------------------
ParaView_DIR="$(command -v paraview 2>/dev/null)"
# Do have paraview?
# Obtain major.minor from `paraview --version`
if [ -n "$ParaView_DIR" ]
then
ParaView_DIR="${ParaView_DIR%/*}" # Eg, /usr/bin/paraview -> /usr/bin
ParaView_DIR="${ParaView_DIR%/*}" # Eg, /usr/bin -> /usr
# Obtain major.minor from `paraview --version`
pv_api="$(paraview --version 2>/dev/null | \
sed -ne 's/^[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/p')"
else
unset pv_api
fi
# The `paraview --version` can fail if the build host doesn't have graphics.
# Revert to guessing from the directory name if needed.
if [ -z "$pv_api" ] && [ -d "$ParaView_DIR" ]
then
pv_api="$(find $ParaView_DIR/include -maxdepth 1 -name 'paraview-*' | \
sed -ne 's@^*/@@;s/^[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/p')"
fi
case "$pv_api" in
([0-9]*.[0-9]*)
export ParaView_DIR
export PV_PLUGIN_PATH="$FOAM_LIBBIN/paraview-$pv_api"
;;
(*)
unset ParaView_DIR PV_PLUGIN_PATH
;;
esac
if [ -n "$FOAM_VERBOSE" ] && [ -n "$PS1" ]
then
if [ -n "$PV_PLUGIN_PATH" ]
then
echo "Using paraview (system)" 1>&2
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH" 1>&2
else
echo "system paraview (not found)" 1>&2
fi
fi
#------------------------------------------------------------------------------
if command -v _foamAddLib > /dev/null 2>&1 # normal sourcing
then
unset ParaView_VERSION
else
ParaView_VERSION=system
fi
unset archDir
unset pv_api
#------------------------------------------------------------------------------
......@@ -153,12 +153,6 @@ then
MANPATH="${MANPATH}:"
fi
if [ -n "$LD_PRELOAD" ]
then
export LD_PRELOAD
_foamClean LD_PRELOAD
fi
# Cleanup temporary information
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -145,7 +145,6 @@ then
fi
[ -n "$LD_LIBRARY_PATH" ] || unset LD_LIBRARY_PATH
[ -n "$LD_PRELOAD" ] || unset LD_PRELOAD
[ -n "$MANPATH" ] || unset MANPATH
#------------------------------------------------------------------------------
......
......@@ -2,8 +2,10 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2011, 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -122,11 +124,16 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict)
void Foam::dynamicCodeContext::addLineDirective
(
string& code,
const label lineNum,
label lineNum,
const fileName& name
)
{
code = "#line " + Foam::name(lineNum + 1) + " \"" + name + "\"\n" + code;
++lineNum; // Change from 0-based to 1-based
if (lineNum > 0 && !name.empty())
{
code = "#line " + Foam::name(lineNum) + " \"" + name + "\"\n" + code;
}
}
......
......@@ -2,8 +2,10 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2011, 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -78,7 +80,7 @@ public:
// Constructors
//- Construct from a dictionary
dynamicCodeContext(const dictionary&);
dynamicCodeContext(const dictionary& dict);
// Member functions
......@@ -126,10 +128,11 @@ public:
}
//- Helper: add \#line directive
// The lineNum is 0-based. No-op if the lineNum is negative.
static void addLineDirective
(
string&,
const label lineNum,
string& code,
label lineNum,
const fileName& name
);
};
......
......@@ -301,7 +301,7 @@ Foam::DimensionedField<Type, GeoMesh>::DimensionedField
const DimensionedField<Type, GeoMesh>& df
)
:
regIOobject(newName, df, newName == df.name()),
regIOobject(newName, df, newName != df.name()),
Field<Type>(df),
mesh_(df.mesh_),
dimensions_(df.dimensions_),
......
......@@ -1188,6 +1188,12 @@ void Foam::globalMeshData::calcGlobalEdgeOrientation() const
forAll(coupledPatch().edges(), edgeI)
{
if (masterEdgeVerts[edgeI] == labelPair(labelMax, labelMax))
{
// Skip single edge on cyclic baffle
continue;
}
const edge& e = coupledPatch().edges()[edgeI];
const labelPair masterE
(
......@@ -1195,7 +1201,7 @@ void Foam::globalMeshData::calcGlobalEdgeOrientation() const
masterPoint[e[1]]
);
label stat = labelPair::compare
const int stat = labelPair::compare
(
masterE,
masterEdgeVerts[edgeI]
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2016-2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -27,6 +27,7 @@ License
#include "fvMesh.H"
#include "globalMeshData.H"
#include "PstreamCombineReduceOps.H"
#include "emptyPolyPatch.H"
#include "processorPolyPatch.H"
#include "mapDistribute.H"
#include "stringListOps.H"
......@@ -209,16 +210,23 @@ void Foam::ensightMesh::correct()
if (option().useFaceZones())
{
// Mark boundary faces to be excluded from export
bitSet excludeFace(mesh_.nFaces()); // all false
bitSet excludeFace(mesh_.nFaces());
for (const polyPatch& pp : mesh_.boundaryMesh())
{
if
(
isA<processorPolyPatch>(pp)
&& !refCast<const processorPolyPatch>(pp).owner()
)
#if OPENFOAM >= 1906
const auto* procPatch = isA<processorPolyPatch>(pp);
#else
const auto* procPatch=dynamic_cast<const processorPolyPatch*>(&pp);
#endif
if (isA<emptyPolyPatch>(pp))
{
excludeFace.set(pp.range());
}
else if (procPatch && !procPatch->owner())
{
// Exclude neighbour-side, retain owner-side only
excludeFace.set(pp.range());
}
}
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2016-2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -38,6 +38,7 @@ License
#include "uindirectPrimitivePatch.H"
#include "interpolation.H"
#include "linear.H"
#include "processorFvPatch.H"
// * * * * * * * * * * Static Private Member Functions * * * * * * * * * * * //
......@@ -119,10 +120,8 @@ bool Foam::ensightOutput::writeFaceField
return true;
}
else
{
return false;
}
return false;
}
......@@ -257,37 +256,36 @@ bool Foam::ensightOutput::writeField
);
// flat boundary field
// as per volPointInterpolation::flatBoundaryField()
// similar to volPointInterpolation::flatBoundaryField()
Field<Type> flat(mesh.nBoundaryFaces());
Field<Type> flat(mesh.nBoundaryFaces(), Zero);
const fvBoundaryMesh& bm = mesh.boundary();
forAll(vf.boundaryField(), patchI)
forAll(vf.boundaryField(), patchi)
{
const polyPatch& pp = bm[patchI].patch();
const label bFaceI = pp.start() - mesh.nInternalFaces();
const polyPatch& pp = bm[patchi].patch();
const auto& bf = vf.boundaryField()[patchi];
if
(
isA<emptyFvPatch>(bm[patchI])
|| vf.boundaryField()[patchI].coupled()
)
if (isA<processorFvPatch>(bm[patchi]))
{
// Use average value for processor faces
// own cell value = patchInternalField
// nei cell value = evaluated boundary values
SubList<Type>
(
flat,
pp.size(),
bFaceI
) = Zero;
bf.size(),
pp.offset()
) = (0.5 * (bf.patchInternalField() + bf));
}
else
else if (!isA<emptyFvPatch>(bm[patchi]))
{
SubList<Type>
(
flat,
vf.boundaryField()[patchI].size(),
bFaceI
) = vf.boundaryField()[patchI];
bf.size(),
pp.offset()
) = bf;
}
}
......
......@@ -76,7 +76,7 @@ Foam::injectedParticle::injectedParticle
}
else
{
is.read(reinterpret_cast<char*>(&soi_), sizeofFields);
is.read(reinterpret_cast<char*>(&tag_), sizeofFields);
}
}
......
......@@ -532,6 +532,8 @@ Foam::autoPtr<Foam::globalIndex> Foam::regionSplit::reduceRegions
// Buffer for swapping boundary information
labelList nbrRegion(mesh().nBoundaryFaces());
bool emitWarning = true;
do
{
if (debug)
......@@ -597,9 +599,22 @@ Foam::autoPtr<Foam::globalIndex> Foam::regionSplit::reduceRegions
const label sent = localToGlobal[orig];
const label recv = patchNbrRegion[patchFacei];
// Record the minimum value seen
if (recv < sent)
if (recv == UNASSIGNED)
{
if (emitWarning)
{
Pout<<"Warning in regionSplit:"
" received unassigned on "
<< pp.name() << " at patchFace "
<< patchFacei
<< ". Check synchronisation in caller"
<< nl;
}
}
else if (recv < sent)
{
// Record the minimum value seen
auto fnd = updateLookup.find(sent);
if (!fnd.found())
{
......@@ -644,6 +659,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::regionSplit::reduceRegions
<< " local regions" << endl;
}
emitWarning = false;
// Continue until there are no further changes
}
while (returnReduce(!updateLookup.empty(), orOp<bool>()));
......
......@@ -207,6 +207,9 @@ void Foam::distanceSurface::createGeometry()
cellBb.clear();
cellBb.add(fvm.points(), fvm.cellPoints(i));
// Expand slightly to catch corners
cellBb.inflate(0.1);
if (!cellBb.contains(nearest[i].hitPoint()))
{
ignoreCells.set(i);
......
......@@ -121,17 +121,17 @@ have_pvplugin_support()
# Extract the paraview major+minor version from the directory name
# From /path/paraview-5.6 -> 5.6
pv_api=$(echo "${targetDir##*/}" | \
sed -n -e 's/^[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/p')
pv_api=$(echo "$targetDir" | \
sed -ne 's@^.*/@@;s/^[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/p')
[ -n "$targetDir" ] || {
echo "$warn (could determine target)"
echo "$warn (could not determine target)"
echo " PV_PLUGIN_PATH=${PV_PLUGIN_PATH:-???}"
return 1
}
[ -n "$pv_api" ] || {
echo "$warn (could determine major.minor version)"
echo "$warn (could not determine major.minor version)"
return 1
}
......