On Jan 11, 2012, at 5:16 PM, Roy Stogner wrote: > > 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. So what would happen if EquationSystems::read() does not do the init until later when I add the matrices? In other words what is the purpose of calling init inside EquationSystems::read() and is it really necessary as long as it's done later on at some point before we start solution process?
Ata ------------------------------------------------------------------------------ RSA(R) Conference 2012 Mar 27 - Feb 2 Save $400 by Jan. 27 Register now! http://p.sf.net/sfu/rsa-sfdev2dev2 _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
