On Sep 1, 2010, at 1:21 PM, Roy Stogner wrote: > rhs (and adjoint_solution, and everything other than solution) > currently gets created via add_vector, so if anyone wants to enforce > non-default vector behavior they can just create the vector themselves > before ExplicitSystem::init (or ImplicitSystem::adjoint_solve, > whatever) gets to it.
I would say that this is at best inconvenient... and at worst breaks object-oriented ideas. Users shouldn't have to know the names and exactly what vectors each type of solver creates. > Solution is now kind of an ugly special-case. Originally we had > several vectors that weren't created via add_vector, and I changed > that, but now I don't remember why I didn't change solution along with > them. Maybe now's the right time to do that? And then we don't need > any member variables - the user can just do an add_vector() with > whatever options they prefer. We'd also get to (have to!) simplify a > lot of code which currently looks like "do X to solution, then loop > over all other vectors and do X to each"; it would instead just "loop > over all vectors and do X to each" I'll look into adding Solution with add_vector... that sounds like the right way to go. So my compromise is this: add a member variable to system called "default_parallel_vector_type" that defaults to PARALLEL. add_vector will get an optional argument for the ParallelType (defaulting to PARALLEL). add_vector will also store off the ParallelType for each vector in a map (I _do_ think this is necessary because there is no other way to capture the ParallelType within add_vector). All internal vectors will be added using add_vector and passing in "default_parallel_vector_type" (or GHOSTED or PARALLEL if only those make sense... like for current_local_solution). Finally, I'm also going to create a helper function in System called init_vector that just takes the name of the vector to be inited... this is because there are a few places where vectors get explicitly inited. I think that should cover it. If you _want_ to you will be able to override the defaults by either setting default_parallel_vector_type OR by doing as you mentioned and calling add_vector yourself with a different type. Derek ------------------------------------------------------------------------------ This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd _______________________________________________ Libmesh-devel mailing list Libmesh-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libmesh-devel