View Issue Details

IDProjectCategoryView StatusLast Update
0001880OpenFOAM[All Projects] Bugpublic2015-10-27 16:31
ReporterAndreasGAssigned Tohenry 
PrioritylowSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version14.04
Product Versiondev 
Fixed in Version 
Summary0001880: Preserve time when reconstructing sets
DescriptionWhen reconstructing cell/face/pointSets, these seem to be written to constant time rather then to the time step they are reconstructed from. To resolve this, three lines in reconstructPar could be changed (see below).
Steps To Reproducediff --git a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
index db2df9e..8eedb08 100644
--- a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
+++ b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
@@ -854,14 +854,17 @@ int main(int argc, char *argv[])
                 // Write sets
                 forAll(cellSets, i)
                 {
+ cellSets[i].instance() = runTime.timeName();
                     cellSets[i].write();
                 }
                 forAll(faceSets, i)
                 {
+ faceSets[i].instance() = runTime.timeName();
                     faceSets[i].write();
                 }
                 forAll(pointSets, i)
                 {
+ pointSets[i].instance() = runTime.timeName();
                     pointSets[i].write();
                 }
             }
TagsNo tags attached.

Activities

AndreasG

2015-10-27 14:08

reporter  

reconstructPar-write-reconstructed-topoSets-to-right.patch (1,375 bytes)
From 076f964d3c4cba4ed986ffbdf391fefa15ccaf72 Mon Sep 17 00:00:00 2001
From: Andreas <andreas.gross@uni-rostock.de>
Date: Tue, 27 Oct 2015 15:03:23 +0100
Subject: [PATCH 834/834] reconstructPar: write reconstructed topoSets to right
 time

---
 .../utilities/parallelProcessing/reconstructPar/reconstructPar.C       | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
index db2df9e..8eedb08 100644
--- a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
+++ b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
@@ -854,14 +854,17 @@ int main(int argc, char *argv[])
                 // Write sets
                 forAll(cellSets, i)
                 {
+                    cellSets[i].instance() = runTime.timeName();
                     cellSets[i].write();
                 }
                 forAll(faceSets, i)
                 {
+                    faceSets[i].instance() = runTime.timeName();
                     faceSets[i].write();
                 }
                 forAll(pointSets, i)
                 {
+                    pointSets[i].instance() = runTime.timeName();
                     pointSets[i].write();
                 }
             }
-- 
1.9.1

henry

2015-10-27 14:51

manager   ~0005502

What now happens for cases where the sets are independent of time and reside in the constant directory? Are they now written to the time directory?

AndreasG

2015-10-27 15:05

reporter   ~0005503

No, they are reconstructed only if one uses the -constant flag and runTime.timeName() returns constant in this case, so the sets will be written to constant as desired.
At least a short test seems to confirm this.

henry

2015-10-27 16:31

manager   ~0005507

Thanks for the clarification. I think a better solution would be for the set constructors to take an IOobject argument which can be created from the IOobject of the source sets. This would be more consistent with the way all other mesh data types are constructed from or for file. In the interim I have pushed a fix based on your proposal but with the setting of the instance just after construction rather than just before write. Please reopen this report if there are any problems with this fix.

Resolved by commit deb9df2051b1e6b0f1b2f73295b37ca78fa27565

Issue History

Date Modified Username Field Change
2015-10-27 14:08 AndreasG New Issue
2015-10-27 14:08 AndreasG File Added: reconstructPar-write-reconstructed-topoSets-to-right.patch
2015-10-27 14:51 henry Note Added: 0005502
2015-10-27 15:05 AndreasG Note Added: 0005503
2015-10-27 16:31 henry Note Added: 0005507
2015-10-27 16:31 henry Status new => resolved
2015-10-27 16:31 henry Resolution open => fixed
2015-10-27 16:31 henry Assigned To => henry