View Issue Details

IDProjectCategoryView StatusLast Update
0000735OpenFOAMBugpublic2013-02-12 09:05
Reporterniklas.wikstrom Assigned Touser2 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformAnyOSAnyOS VersionAny
Summary0000735: Probable error in cfdTools/.../fieldSources/.../ExplicitSetValue.C
DescriptionThe explicitSetValue basic fieldSource does from cfdTools does not work.

The (set)values List is initiated through a UIndirectList, which I guess tries to initiate list addresses defined by the indices in the cellSet? Since the values List is not a volField or internalField, this most often cause segfault.

If the values list is declared and initiated simply as

List<Type> values(cells_.size(), injectionRate_[fieldI]);

it works fine, for my applications.
Steps To ReproduceModify e.g. scalarTransportFoam to include fieldSources.

Add an explicitSetValuce source to constant/sourcesProperties and run.

The result is crashes for various reasons. (sigFpe or sigSegv).
Additional Informationgit diff ExplicitSetValue.C

--- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/ExplicitSetValue.C
+++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/ExplicitSetValue.C
@@ -81,9 +81,7 @@ void Foam::ExplicitSetValue<Type>::setValue
             << ">::setValue for source " << name_ << endl;
     }
 
- List<Type> values(cells_.size());
-
- UIndirectList<Type>(values, cells_) = injectionRate_[fieldI];
+ List<Type> values(cells_.size(), injectionRate_[fieldI]);
 
     eqn.setValues(cells_, values);
 }
TagsNo tags attached.

Activities

user2

2013-02-12 09:05

  ~0001899

Thanks for the report - corrected by commit 7fb2db

Issue History

Date Modified Username Field Change
2013-02-04 16:34 niklas.wikstrom New Issue
2013-02-12 09:05 user2 Note Added: 0001899
2013-02-12 09:05 user2 Status new => resolved
2013-02-12 09:05 user2 Fixed in Version => 2.1.x
2013-02-12 09:05 user2 Resolution open => fixed
2013-02-12 09:05 user2 Assigned To => user2