View Issue Details

IDProjectCategoryView StatusLast Update
0000875OpenFOAMBugpublic2014-03-24 15:34
Reporterdavidh Assigned Touser4 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSOpenSuseOS Version11.1
Summary0000875: fvOptions/codedSource - missing source code for "codedFvOptionTemplate"
DescriptionThe source code templates necessary to use a codedSource through fvOptions seem to be missing from the directory "./etc/codeTemplates/dynamicCode". This causes a run-time error (below) when the code tries to build the dynamic library for the source.

Could not find the code template(s):
2
(
"codedFvOptionTemplate.C"
"codedFvOptionTemplate.H"
)

Steps To ReproduceBuild the rhoPimpleFoam angledDuct tutorial and in system/fvOptions add the following entry and delete the porosity1 entry. Then execute rhoPimpleFoam

codedSourceTest
{
    type vectorCodedSource;

    vectorCodedSourceCoeffs
    {
        fieldNames ( U );
        redirectType none;

        codeCorrect
        #{
            Pout << "**codeCorrect**" << endl;
        #};

        codeAddSup
        #{
             Pout << "**codeCorrect**" << endl;
        #};


        codeSetValue
        #{
            Pout << "**codeCorrect**" << endl;
        #};

        code
        #{
            $codeCorrect
            $codeAddSup
            $codeSetValue
        #};
        
    }

    active true;
    selectionMode all;
}
TagsNo tags attached.

Activities

davidh

2013-06-18 21:45

reporter   ~0002286

Last edited: 2013-06-18 21:46

I was able to get the coded source to work with the following modifications.

1) copy codedBasicSourceTemplate.H,.C to codedFvOptionTemplate.H,.C
2) search replace of "BasicSource" with "FvOption" in the new file
3) change inheritance and constructor from "basicSource" to "fv::option"
4) put class and member function definitions inside "fv" namespace
5) change the link libraries and include files in "CodedSource.C" from fieldSources to fvOptions

The three modified files are attached.

davidh

2013-06-18 21:46

reporter  

fvOptionsFix.tgz (2,837 bytes)

user4

2014-03-24 15:34

  ~0002972

Works in 2.3.x if you add a 'noneCoeffs' to the top level directory.

codedSourceTest
{
..
       noneCoeffs
        {}
}

Thanks for reporting.

Issue History

Date Modified Username Field Change
2013-05-29 16:46 davidh New Issue
2013-06-18 21:45 davidh Note Added: 0002286
2013-06-18 21:46 davidh Note Edited: 0002286
2013-06-18 21:46 davidh File Added: fvOptionsFix.tgz
2014-03-24 15:34 user4 Note Added: 0002972
2014-03-24 15:34 user4 Status new => resolved
2014-03-24 15:34 user4 Fixed in Version => 2.3.x
2014-03-24 15:34 user4 Resolution open => fixed
2014-03-24 15:34 user4 Assigned To => user4