Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Mark Olesen
2019-07-08 19:24:10 +02:00
10 changed files with 45 additions and 77 deletions

View File

@ -1,2 +1,2 @@
api=1906
patch=0
patch=190708

View File

@ -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
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -153,12 +153,6 @@ then
MANPATH="${MANPATH}:"
fi
if [ -n "$LD_PRELOAD" ]
then
export LD_PRELOAD
_foamClean LD_PRELOAD
fi
# Cleanup temporary information
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -147,7 +147,6 @@ then
fi
[ -n "$LD_LIBRARY_PATH" ] || unset LD_LIBRARY_PATH
[ -n "$LD_PRELOAD" ] || unset LD_PRELOAD
[ -n "$MANPATH" ] || unset MANPATH
#------------------------------------------------------------------------------

View File

@ -757,8 +757,8 @@ Foam::IOobject Foam::fileOperation::findInstance
return io;
}
// Search back through the time directories to find the time
// closest to and lower than current time
// Search back through the time directories to find the first time
// that is less than or equal to the current time
instantList ts = time.times();
label instanceI = ts.size()-1;
@ -771,20 +771,21 @@ Foam::IOobject Foam::fileOperation::findInstance
}
}
// Continue searching from here
// Found the time, continue from here
for (; instanceI >= 0; --instanceI)
{
io.instance() = ts[instanceI].name();
// Shortcut: if actual directory is the timeName we've already tested it
if
(
ts[instanceI].name() == startIO.instance()
&& ts[instanceI].name() != stopInstance
io.instance() == startIO.instance()
&& io.instance() != stopInstance
)
{
continue;
}
io.instance() = ts[instanceI].name();
if (exists(io))
{
DebugInFunction
@ -796,7 +797,7 @@ Foam::IOobject Foam::fileOperation::findInstance
}
// Check if hit minimum instance
if (ts[instanceI].name() == stopInstance)
if (io.instance() == stopInstance)
{
DebugInFunction
<< "Hit stopInstance " << stopInstance << endl;

View File

@ -119,10 +119,10 @@ inline bool read(const std::string& str, int64_t& val)
Istream& operator>>(Istream& is, int64_t& val);
Ostream& operator<<(Ostream& os, const int64_t val);
// On Darwin and Windows (mingw):
// On Darwin:
// long is not unambiguously (int32_t | int64_t)
// - explicitly resolve for input and output
#if defined(__APPLE__) || defined(_WIN32)
#if defined(__APPLE__)
Istream& operator>>(Istream& is, long& val);
Ostream& operator<<(Ostream& os, const long val);
#endif

View File

@ -125,7 +125,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const int64_t val)
}
#if defined(__APPLE__) || defined(_WIN32)
#if defined(__APPLE__)
Foam::Istream& Foam::operator>>(Istream& is, long& val)
{
return operator>>(is, reinterpret_cast<int64_t&>(val));

View File

@ -48,58 +48,29 @@ Foam::IOobject Foam::points0MotionSolver::points0IO(const polyMesh& mesh)
IOobject::READ_IF_PRESENT
);
if (instance != mesh.time().constant())
IOobject io
(
"points0",
instance,
polyMesh::meshSubDir,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
);
// If points0 are located in constant directory, verify their existence
// or fallback to a copy of the original mesh points
if
(
instance == mesh.time().constant()
&& !io.typeHeaderOk<pointIOField>()
)
{
// points0 written to a time folder
return
IOobject
(
"points0",
instance,
polyMesh::meshSubDir,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
);
io.rename("points");
}
else
{
// Check that points0 are actually in constant directory
IOobject io
(
"points0",
instance,
polyMesh::meshSubDir,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
);
if (io.typeHeaderOk<pointIOField>())
{
return io;
}
else
{
// Copy of original mesh points
return
IOobject
(
"points",
instance,
polyMesh::meshSubDir,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
);
}
}
return io;
}

View File

@ -165,8 +165,15 @@ Foam::Ostream& Foam::ensightFile::write
Foam::Ostream& Foam::ensightFile::write(const char* value)
{
// Parentheses around strncpy to silence the GCC -Wstringop-truncation
// warning, which is spurious here.
// The max-size and buffer-size *are* identical, which means the buffer
// may not have a nul terminator. However, this is properly handled in
// the subsequent binary write and the ASCII write explicitly adds
// a nul terminator.
char buf[80];
strncpy(buf, value, 80); // max 80 chars or padded with nul if smaller
(strncpy(buf, value, 80)); // max 80 chars or padded with nul if smaller
if (format() == IOstream::BINARY)
{

View File

@ -206,8 +206,8 @@ Foam::label Foam::metisDecomp::decomposeSerial
(
&numCells, // num vertices in graph
&ncon, // num balancing constraints
xadj_metis.ref().data(), // indexing into adjncy
adjncy_metis.ref().data(), // neighbour info
xadj_metis.constCast().data(), // indexing into adjncy
adjncy_metis.constCast().data(), // neighbour info
cellWeights.data(), // vertex wts
nullptr, // vsize: total communication vol
faceWeights.data(), // edge wts
@ -225,8 +225,8 @@ Foam::label Foam::metisDecomp::decomposeSerial
(
&numCells, // num vertices in graph
&ncon, // num balancing constraints
xadj_metis.ref().data(), // indexing into adjncy
adjncy_metis.ref().data(), // neighbour info
xadj_metis.constCast().data(), // indexing into adjncy
adjncy_metis.constCast().data(), // neighbour info
cellWeights.data(), // vertex wts
nullptr, // vsize: total communication vol
faceWeights.data(), // edge wts