Skip to content

Next: Restart doesn't read solid for scalars except temperature #671

@joneuhauser

Description

@joneuhauser

Describe the bug
See title.

To Reproduce
Steps to reproduce the behavior:

  1. Run conj_ht example.
  2. Restart conj_ht example, for only one timestep.

Expected behavior
The solution looks roughly like from the previous run.

Actual behavior
The solid domain is very close to zero.

Fix:

diff --git a/src/app/nrs/nrs.cpp b/src/app/nrs/nrs.cpp
index cb6a14b8..3231024a 100644
--- a/src/app/nrs/nrs.cpp
+++ b/src/app/nrs/nrs.cpp
@@ -641,7 +641,7 @@ void nrs_t::restartFromFiles(const std::vector<std::string> &fileList)
       for (int i = scalarStart; i < Nscalar; i++) {
         const auto sid = scalarDigitStr(i - scalarStart);
         if (checkOption("s" + sid) && isAvailable("scalar" + sid)) {
-          auto o_Si = scalar->o_S.slice(scalar->fieldOffsetScan[i], meshV->Nlocal);
+          auto o_Si = scalar->o_S.slice(scalar->fieldOffsetScan[i], scalar->mesh(i)->Nlocal);
           std::vector<occa::memory> o_iofldSi = {o_Si};
           iofld->addVariable("scalar" + sid, o_iofldSi);
         }

Commit: b5b876d

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions