Skip to content
Snippets Groups Projects
Commit 07ccd80a authored by Mark OLESEN's avatar Mark OLESEN
Browse files

BUG: sample/store surface field triggers dimension check (fixes #2361)

- when used for example with wallShearStress, the stress field is
  initially created as incompressible but later updated with the
  correct compressible/incompressible dimensions.

  If this field is sampled as a surface and stored on the registry
  the dimensions should be reset() and not '=' assigned, since that
  causes a dimension check which will obviously fail.
parent 6168f960
Branches
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -107,7 +107,7 @@ void Foam::polySurface::storeField ...@@ -107,7 +107,7 @@ void Foam::polySurface::storeField
if (dimfield) if (dimfield)
{ {
dimfield->dimensions() = dims; dimfield->dimensions().reset(dims); // Dimensions may have changed
dimfield->field() = values; dimfield->field() = values;
} }
else else
...@@ -148,7 +148,7 @@ void Foam::polySurface::storeField ...@@ -148,7 +148,7 @@ void Foam::polySurface::storeField
if (dimfield) if (dimfield)
{ {
dimfield->dimensions() = dims; dimfield->dimensions().reset(dims); // Dimensions may have changed
dimfield->field() = std::move(values); dimfield->field() = std::move(values);
} }
else else
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -45,7 +45,7 @@ void Foam::surfMesh::storeField ...@@ -45,7 +45,7 @@ void Foam::surfMesh::storeField
if (dimfield) if (dimfield)
{ {
dimfield->dimensions() = dims; dimfield->dimensions().reset(dims); // Dimensions may have changed
dimfield->field() = values; dimfield->field() = values;
} }
else else
...@@ -85,7 +85,7 @@ void Foam::surfMesh::storeField ...@@ -85,7 +85,7 @@ void Foam::surfMesh::storeField
if (dimfield) if (dimfield)
{ {
dimfield->dimensions() = dims; dimfield->dimensions().reset(dims); // Dimensions may have changed
dimfield->field() = std::move(values); dimfield->field() = std::move(values);
} }
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment