Benjamin Kirk wrote: >> 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 > > Thanks for that hint - it works!
Mathias -- http://www.mech.TUGraz.at ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Libmesh-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-devel
