|
[Sponsors] |
July 31, 2020, 10:12 |
Seg Fault using DynamicList
|
#1 |
Senior Member
Gerry Kan
Join Date: May 2016
Posts: 352
Rep Power: 11 |
Howdy Foamers:
I have a very simple OF application using OF 7. Code:
#include "fvCFD.H" #include "uniformDimensionedFields.H" #include "turbulentFluidThermoModel.H" #include "rhoReactionThermo.H" #include "ReactionModel.H" #include "multivariateScheme.H" #include "pimpleControl.H" #include "pressureControl.H" #include "fvOptions.H" #include "localEulerDdtScheme.H" #include "fvcSmooth.H" DynamicList<Foam::word> wordDynList(0); int main ( int argc, char *argv[] ) { wordDynList.append ( "one" ); wordDynList.append ( "two" ); Info << wordDynList << endl; } Code:
2 ( one two ) Segmentation fault Thanks in advance, Gerry. |
|
July 31, 2020, 10:29 |
|
#2 |
Senior Member
Gerry Kan
Join Date: May 2016
Posts: 352
Rep Power: 11 |
It looks like the culprit is in the .append() function. I don't know why, though.
|
|
July 31, 2020, 10:47 |
|
#3 |
Senior Member
Gerry Kan
Join Date: May 2016
Posts: 352
Rep Power: 11 |
Okay, it turns out I needed to deallocate the DynamicList afterall ...
Code:
#include "fvCFD.H" #include "uniformDimensionedFields.H" #include "turbulentFluidThermoModel.H" #include "rhoReactionThermo.H" #include "ReactionModel.H" #include "multivariateScheme.H" #include "pimpleControl.H" #include "pressureControl.H" #include "fvOptions.H" #include "localEulerDdtScheme.H" #include "fvcSmooth.H" DynamicList<Foam::word> wordDynList(0); int main ( int argc, char *argv[] ) { wordDynList.append ( "one" ); wordDynList.append ( "two" ); Info << wordDynList << endl; wordDynList.clearStorage(); } Gerry. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Seg fault when accessing cell face velocities F_U, F_V, F_W | oayeni1 | Fluent UDF and Scheme Programming | 0 | December 19, 2013 15:55 |
v2.0.8 seg fault occurs after convergence is achieved | newToSU2 | SU2 | 4 | November 27, 2013 06:21 |
all rans and navierstokes test cases getting seg fault | jentink | SU2 | 14 | October 9, 2013 14:07 |
interDyMFoam in OF 2.0.1 : seg fault during mesh refinement | michaelb | OpenFOAM Running, Solving & CFD | 3 | July 2, 2012 08:16 |
Workbench 11-Linux Intel EM64T platforms Seg fault | Maciej Karczewski | CFX | 5 | April 19, 2010 03:37 |