View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000292OpenFOAM[All Projects] Bugpublic2011-09-13 21:132011-10-26 10:51
Reporterbgschaid 
Assigned Tomattijs 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformLinuxOSCentOSOS Version5.5
Product Version2.0.x 
Target VersionFixed in Version2.0.x 
Summary0000292: Refactor codedFixedValueFvPatchField and codedFunctionObject to have common base class
DescriptionThe two classes that compile their own code and load a library have a lot of code in common. To avoid further code duplication (for instance when adding a class codedMixedFvPatchField) a class codedBaseClass is introduced that is inherited by these two classes and which holds all the methods they had in common. Parts where the two old classes differ are encapsulated in virtual methods and are implemented by these two classes.

Note:
- the pointer to the redirect still has to be added by the inheriting class. Alternative would have been to make codedBaseClass a template
Steps To ReproduceThe patch is on github https://github.com/bgschaid/OpenFOAM-2.0.x/commits/bgschaid/refactorCoded. [^] I will issue a pull-request once I have a bug number here
Additional InformationSecond commit in the branch fixes a problem that occurs if one inherits from codedFunctionObject: then the constructor of codedFunctionObject insists to compile the code and fails if the inheriting class has to do some additional stuff to make it work.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000749)
mattijs (manager)
2011-10-24 21:21

added in commit 53c470a06efadc95265da4c0c4cb2d3522e6c246

I've moved the dictionary out of the codedBaseClass and now supply the redirectType though arguments.

Thanks
(0000754)
bgschaid (reporter)
2011-10-25 19:47

The potentialFoam tutorial fails (you don't see i when you run Allrun, but the code is not compiled).

The reason seems to be that the constructor of codedFunctionObject doesn't initialize dict_ (probably a forgotten "dict_(dict),")
(0000755)
mattijs (manager)
2011-10-26 10:51

fixed in ce645a3740c28ea7b2f40697b50cb93ee6e7ab86

Thanks Bernhard. My fault for messing with working code ;-)

- Issue History
Date Modified Username Field Change
2011-09-13 21:13 bgschaid New Issue
2011-10-24 21:21 mattijs Note Added: 0000749
2011-10-24 21:21 mattijs Status new => resolved
2011-10-24 21:21 mattijs Fixed in Version => 2.0.x
2011-10-24 21:21 mattijs Resolution open => fixed
2011-10-24 21:21 mattijs Assigned To => mattijs
2011-10-25 19:47 bgschaid Note Added: 0000754
2011-10-25 19:47 bgschaid Status resolved => feedback
2011-10-25 19:47 bgschaid Resolution fixed => reopened
2011-10-26 10:51 mattijs Note Added: 0000755
2011-10-26 10:51 mattijs Status feedback => resolved
2011-10-26 10:51 mattijs Resolution reopened => fixed