On Wed, 11 Jan 2012, Ataollah Mesgarnejad wrote: > On Jan 11, 2012, at 12:52 PM, Roy Stogner wrote: > >> On Wed, 11 Jan 2012, Ataollah Mesgarnejad wrote: >> >> A patch to save just matrix metadata (probably just the name) to >> automatically re-add-matrices upon restart wouldn't be a bad idea, but >> it would be mildly tricky to implement, since ImplicitSystem would >> have to override some of the system_io code. > > If you can point me to where you did this for vectors I can try to add the > needed code so we don't won't have a problem with added matrices.
The trouble is that it's easy to re-add vectors upon restart, because the System class knows what a vector is and can directly play with them in its I/O. System and subclasses don't know what a matrix is until you hit ImplicitSystem, though. So you'd either have to make the system_io.C functions virtual and override them in ImplicitSystem (copying and pasting too much code), or you'd have to come up with some new virtual functions to override and call from within system_io.C I'd be happy for the latter sort of patch, despite it being yet-another format upgrade, but it's easier said than done. >> Set a variable. The default EquationSystems::read() flags include >> READ_HEADER, which is superfluous if you've already done all the >> add_variable, add_vector, etc. setup that the header would otherwise >> have been required to specify, and which is actively damaging if your >> System subclass's clear() method removes data (like matrix existence) >> which the header doesn't know how to re-add. > > The reason I asked this was I thought if the > EquationSystems::read() doesn't go and init the EquationSystem I > don't see a reason why you won't be able to add a Matrix after > EquationSystems::read()? equation_systems_io.C, line 324. If you tell read() to read the header, then it assumes that it's responsible for initializing everything too. --- Roy ------------------------------------------------------------------------------ Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
