View Issue Details

IDProjectCategoryView StatusLast Update
0000900OpenFOAMBugpublic2013-07-05 10:23
Reportermonto Assigned Touser4 
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSOtherOS Version(please specify)
Summary0000900: execFlowFunctionObject does not work with '-dict' option
Descriptionthe application execFlowFunctionObjects does not work properly when it is used with the '-dict' option.

No error message is issued, but functionObjects are not executed and no output is produced.
Steps To Reproducecheck the attached motorBike tutorial with modified system/streamLines file.

run with:

motorBike $ ./Allrun
motorBike $ execFlowFunctionObjects -dict system/streamLines
TagsexecFlowFunctionObjects, functionObject

Activities

monto

2013-06-25 09:24

reporter  

motorBike.tgz (10,637 bytes)

monto

2013-06-25 09:25

reporter   ~0002292

With reference to the function defined in execFlowFunctionObjects.C:

void execFunctionObjects
(
    const argList& args,
    const Time& runTime,
    autoPtr<functionObjectList>& folPtr
)
{
    if (folPtr.empty())
    {
        if (args.optionFound("dict"))
        {
            IOdictionary dict
            (
                IOobject
                (
                    args["dict"],
                    runTime,
                    IOobject::MUST_READ_IF_MODIFIED
                )
            );

            folPtr.reset(new functionObjectList(runTime, dict));

        }
        else
        {
            folPtr.reset(new functionObjectList(runTime));

        }

        folPtr->start();
 
    }

    folPtr->execute(true);
}

it appears that the private member "parentDict_" of class "Foam::functionObjectList" is reset to a null object between the constructor

"folPtr.reset(new functionObjectList(runTime, dict));"

and the call

folPtr->start();

Moving "folPtr->start();" inside the "if" body fixes the problem:


void execFunctionObjects
(
    const argList& args,
    const Time& runTime,
    autoPtr<functionObjectList>& folPtr
)
{
    if (folPtr.empty())
    {
        if (args.optionFound("dict"))
        {
            IOdictionary dict
            (
                IOobject
                (
                    args["dict"],
                    runTime,
                    IOobject::MUST_READ_IF_MODIFIED
                )
            );

            folPtr.reset(new functionObjectList(runTime, dict));
            folPtr->start();

        }
        else
        {
            folPtr.reset(new functionObjectList(runTime));
            folPtr->start();
        }
    }

    folPtr->execute(true);
}

user4

2013-07-05 10:23

  ~0002309

Fixed in 2639f219c3068f7ab888b6751db6a133ad936c0e

Thanks for reporting.

Issue History

Date Modified Username Field Change
2013-06-25 09:24 monto New Issue
2013-06-25 09:24 monto File Added: motorBike.tgz
2013-06-25 09:25 monto Note Added: 0002292
2013-06-25 09:28 monto Tag Attached: execFlowFunctionObjects
2013-06-25 09:28 monto Tag Attached: functionObject
2013-07-05 10:23 user4 Note Added: 0002309
2013-07-05 10:23 user4 Status new => resolved
2013-07-05 10:23 user4 Fixed in Version => 2.2.x
2013-07-05 10:23 user4 Resolution open => fixed
2013-07-05 10:23 user4 Assigned To => user4