Would it be a good idea to put the global variables defined in globals.hxx (mesh and dump) into a namespace like bout::globals?
I've come across bugs a few times caused by parts of the library using the global mesh when they should have been using a local one.
If we put using namespace bout::globals into physicsmodel.hxx then user code could use the global namespaces transparently and (once #1464 is merged) the using statement would not propagate into any library code except physicsmodel.hxx/cxx. This would help root out any remaining unintentional uses of the global variables in the library code, and places that we do want them (like default arguments) can use e.g. bout::globals::mesh to avoid any possibility of name conflicts.
Would it be a good idea to put the global variables defined in
globals.hxx(meshanddump) into a namespace likebout::globals?I've come across bugs a few times caused by parts of the library using the global
meshwhen they should have been using a local one.If we put
using namespace bout::globalsintophysicsmodel.hxxthen user code could use the global namespaces transparently and (once #1464 is merged) theusingstatement would not propagate into any library code exceptphysicsmodel.hxx/cxx. This would help root out any remaining unintentional uses of the global variables in the library code, and places that we do want them (like default arguments) can use e.g.bout::globals::meshto avoid any possibility of name conflicts.