CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Run time selectibility: factory vs marcros (https://www.cfd-online.com/Forums/openfoam-programming-development/126799-run-time-selectibility-factory-vs-marcros.html)

AlmostSurelyRob November 26, 2013 08:05

Run time selectibility: factory vs marcros
 
Dear OpenFOAM Developers,

I would like to ask a question about OpenFOAM code structure. I have read and with an exception of implementation details understood this article:
http://openfoamwiki.net/index.php/Op...tion_mechanism
Using this and by mimicing the structure of libraries supplied in the distribution I also implemented a few of my own libraries.

So I understand that currently run time selection is achieved through macros. In many other places OF extensively uses templates. Is it possible and has there been any effort to achieve run time selection through templates? I believe that a factory design pattern has exactly this purpose. Please note that I ask chiefly out out of curiosity and to have a discussion about alternatives.


All times are GMT -4. The time now is 02:34.