> In general, using pointers to class methods doesn't really work like > you would expect.... the reason? Because you have to have a class > instance to call it on... meaning you have to store two pieces of > data... the pointer to the method and a pointer to a class instance. > Here is some reading on the subject: > > http://www.parashift.com/c++-faq-lite/pointers-to-members.html > > I do believe that you can do exactly what you were suggesting if you > make the function "static".... but at that point you might as well > just make it external to the class because a static member function > can't access any data internal to the class anyway... > > Basically, the answer is no...
The right way to do this should be pretty easy, and I think works already. See http://libmesh.sourceforge.net/doxygen/classSystem.php, particularly the "user_assembly" bit. This is a virtual void function whose sole purpose is to call the user provided function. Instead, simply derive your class from System and then re-implement this method to do your assembly. -Ben ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Libmesh-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-devel
