mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
@ -1,2 +1,2 @@
|
|||||||
api=1906
|
api=1906
|
||||||
patch=0
|
patch=190708
|
||||||
|
|||||||
@ -122,7 +122,7 @@ end
|
|||||||
# Clean standard environment variables (PATH, MANPATH, LD_LIBRARY_PATH)
|
# Clean standard environment variables (PATH, MANPATH, LD_LIBRARY_PATH)
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
# Prevent local variables from shadowing setenv variables
|
# 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 (! $?LD_LIBRARY_PATH ) setenv LD_LIBRARY_PATH
|
||||||
if (! $?MANPATH ) setenv MANPATH
|
if (! $?MANPATH ) setenv MANPATH
|
||||||
|
|
||||||
@ -167,10 +167,6 @@ if ( $?MANPATH ) then
|
|||||||
setenv MANPATH "${MANPATH}:"
|
setenv MANPATH "${MANPATH}:"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if ( $?LD_PRELOAD ) then
|
|
||||||
_foamClean LD_PRELOAD
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# Cleanup temporary information
|
# Cleanup temporary information
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
@ -153,12 +153,6 @@ then
|
|||||||
MANPATH="${MANPATH}:"
|
MANPATH="${MANPATH}:"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$LD_PRELOAD" ]
|
|
||||||
then
|
|
||||||
export LD_PRELOAD
|
|
||||||
_foamClean LD_PRELOAD
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Cleanup temporary information
|
# Cleanup temporary information
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
@ -147,7 +147,6 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
[ -n "$LD_LIBRARY_PATH" ] || unset LD_LIBRARY_PATH
|
[ -n "$LD_LIBRARY_PATH" ] || unset LD_LIBRARY_PATH
|
||||||
[ -n "$LD_PRELOAD" ] || unset LD_PRELOAD
|
|
||||||
[ -n "$MANPATH" ] || unset MANPATH
|
[ -n "$MANPATH" ] || unset MANPATH
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -757,8 +757,8 @@ Foam::IOobject Foam::fileOperation::findInstance
|
|||||||
return io;
|
return io;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search back through the time directories to find the time
|
// Search back through the time directories to find the first time
|
||||||
// closest to and lower than current time
|
// that is less than or equal to the current time
|
||||||
|
|
||||||
instantList ts = time.times();
|
instantList ts = time.times();
|
||||||
label instanceI = ts.size()-1;
|
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)
|
for (; instanceI >= 0; --instanceI)
|
||||||
{
|
{
|
||||||
|
io.instance() = ts[instanceI].name();
|
||||||
|
|
||||||
// Shortcut: if actual directory is the timeName we've already tested it
|
// Shortcut: if actual directory is the timeName we've already tested it
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
ts[instanceI].name() == startIO.instance()
|
io.instance() == startIO.instance()
|
||||||
&& ts[instanceI].name() != stopInstance
|
&& io.instance() != stopInstance
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
io.instance() = ts[instanceI].name();
|
|
||||||
if (exists(io))
|
if (exists(io))
|
||||||
{
|
{
|
||||||
DebugInFunction
|
DebugInFunction
|
||||||
@ -796,7 +797,7 @@ Foam::IOobject Foam::fileOperation::findInstance
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if hit minimum instance
|
// Check if hit minimum instance
|
||||||
if (ts[instanceI].name() == stopInstance)
|
if (io.instance() == stopInstance)
|
||||||
{
|
{
|
||||||
DebugInFunction
|
DebugInFunction
|
||||||
<< "Hit stopInstance " << stopInstance << endl;
|
<< "Hit stopInstance " << stopInstance << endl;
|
||||||
|
|||||||
@ -119,10 +119,10 @@ inline bool read(const std::string& str, int64_t& val)
|
|||||||
Istream& operator>>(Istream& is, int64_t& val);
|
Istream& operator>>(Istream& is, int64_t& val);
|
||||||
Ostream& operator<<(Ostream& os, const 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)
|
// long is not unambiguously (int32_t | int64_t)
|
||||||
// - explicitly resolve for input and output
|
// - explicitly resolve for input and output
|
||||||
#if defined(__APPLE__) || defined(_WIN32)
|
#if defined(__APPLE__)
|
||||||
Istream& operator>>(Istream& is, long& val);
|
Istream& operator>>(Istream& is, long& val);
|
||||||
Ostream& operator<<(Ostream& os, const long val);
|
Ostream& operator<<(Ostream& os, const long val);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -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)
|
Foam::Istream& Foam::operator>>(Istream& is, long& val)
|
||||||
{
|
{
|
||||||
return operator>>(is, reinterpret_cast<int64_t&>(val));
|
return operator>>(is, reinterpret_cast<int64_t&>(val));
|
||||||
|
|||||||
@ -48,58 +48,29 @@ Foam::IOobject Foam::points0MotionSolver::points0IO(const polyMesh& mesh)
|
|||||||
IOobject::READ_IF_PRESENT
|
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
|
io.rename("points");
|
||||||
|
|
||||||
return
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"points0",
|
|
||||||
instance,
|
|
||||||
polyMesh::meshSubDir,
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// Check that points0 are actually in constant directory
|
|
||||||
|
|
||||||
IOobject io
|
return 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
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -165,8 +165,15 @@ Foam::Ostream& Foam::ensightFile::write
|
|||||||
|
|
||||||
Foam::Ostream& Foam::ensightFile::write(const char* value)
|
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];
|
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)
|
if (format() == IOstream::BINARY)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -206,8 +206,8 @@ Foam::label Foam::metisDecomp::decomposeSerial
|
|||||||
(
|
(
|
||||||
&numCells, // num vertices in graph
|
&numCells, // num vertices in graph
|
||||||
&ncon, // num balancing constraints
|
&ncon, // num balancing constraints
|
||||||
xadj_metis.ref().data(), // indexing into adjncy
|
xadj_metis.constCast().data(), // indexing into adjncy
|
||||||
adjncy_metis.ref().data(), // neighbour info
|
adjncy_metis.constCast().data(), // neighbour info
|
||||||
cellWeights.data(), // vertex wts
|
cellWeights.data(), // vertex wts
|
||||||
nullptr, // vsize: total communication vol
|
nullptr, // vsize: total communication vol
|
||||||
faceWeights.data(), // edge wts
|
faceWeights.data(), // edge wts
|
||||||
@ -225,8 +225,8 @@ Foam::label Foam::metisDecomp::decomposeSerial
|
|||||||
(
|
(
|
||||||
&numCells, // num vertices in graph
|
&numCells, // num vertices in graph
|
||||||
&ncon, // num balancing constraints
|
&ncon, // num balancing constraints
|
||||||
xadj_metis.ref().data(), // indexing into adjncy
|
xadj_metis.constCast().data(), // indexing into adjncy
|
||||||
adjncy_metis.ref().data(), // neighbour info
|
adjncy_metis.constCast().data(), // neighbour info
|
||||||
cellWeights.data(), // vertex wts
|
cellWeights.data(), // vertex wts
|
||||||
nullptr, // vsize: total communication vol
|
nullptr, // vsize: total communication vol
|
||||||
faceWeights.data(), // edge wts
|
faceWeights.data(), // edge wts
|
||||||
|
|||||||
Reference in New Issue
Block a user