Skip to content
Snippets Groups Projects
Commit 4c96647a authored by Kutalmış Berçin's avatar Kutalmış Berçin
Browse files

BUG: DMD: write snapshot0 at start times (fixes #2122)

parent 11e0db96
No related branches found
No related tags found
No related merge requests found
...@@ -879,17 +879,15 @@ bool Foam::DMDModels::STDMD::initialise(const RMatrix& z) ...@@ -879,17 +879,15 @@ bool Foam::DMDModels::STDMD::initialise(const RMatrix& z)
// algorithms at the final output computations (K:p. 43) // algorithms at the final output computations (K:p. 43)
{ {
const label nSnap = z.m()/2; const label nSnap = z.m()/2;
timeName0_ =
mesh_.time().timeName(mesh_.time().startTime().value());
if (nSnap == 0) if (nSnap == 0)
{ {
empty_ = true; empty_ = true;
} }
scalarField snapshot0(nSnap); IOField<scalar> snapshot0
std::copy(z.cbegin(), z.cbegin() + nSnap, snapshot0.begin());
timeName0_ = mesh_.time().timeName();
IOField<scalar>
( (
IOobject IOobject
( (
...@@ -897,10 +895,21 @@ bool Foam::DMDModels::STDMD::initialise(const RMatrix& z) ...@@ -897,10 +895,21 @@ bool Foam::DMDModels::STDMD::initialise(const RMatrix& z)
timeName0_, timeName0_,
mesh_, mesh_,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE,
false
), ),
snapshot0 nSnap
).write(); );
std::copy(z.cbegin(), z.cbegin() + nSnap, snapshot0.begin());
const IOstreamOption streamOpt
(
mesh_.time().writeFormat(),
mesh_.time().writeCompression()
);
fileHandler().writeObject(snapshot0, streamOpt, true);
} }
Q_ = z/norm; Q_ = z/norm;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment