On Thu, Jun 18, 2009 at 4:42 PM, Roy Stogner<royst...@ices.utexas.edu> wrote:
>
> On Thu, 18 Jun 2009, Brent Kraczek wrote:
>
>> Please let me know if you want anything changed.
>
> We can ignore my criticisms if other developers disagree, but:
>
>
> Doing matrix-based norms in LinearImplicitSystem rather than in
> SparseMatrix doesn't make sense to me.  Every LinearImplicitSystem
> user can use a new SparseMatrix easily, but the converse is not true.

Agree with Roy here.

> Calling:
> system.get_matrix("energy").energy_norm(*system.solution);
> is a little more involved than
> system.calc_sys_energy();
> but it would be a lot more flexible.  At most, the latter call should
> be a nicely named pseudonym that calls the former.

Indeed.

> The only reason for I can see for the library rather than the user to
> manage creation of an energy matrix is if we want the library itself
> be able to make use of an energy norm.  For example, we're now
> standardizing on "adjoint_solution" as a vector name just so that
> adjoint-based library infrastructure can know what it should access.
> Are there circumstances in which we'd want the library itself to call
> calc_sys_energy()?
>
>
> Your tmpVec is serial; better would be to clone() the input vector so
> as to avoid wasting memory when the input vector (e.g. the solution)
> is parallel.  Best still would be to directly calculate v'*A*v without
> the temp vector, but that would require linear algebra package
> specific implementations.

Which I think is the right way to do it... whether we call it energy
or whatever else, this should be a method of SparseMatrix which takes
a NumericMatrix and returns a scalar.  That way we do it once and for
all, and we do it efficiently with specialized code or fall back on a
generic implementation sitting in the base class.


BTW, sorry I never got back to you on why we call
libmesh_assert(this->closed()); at the beginning of operator=.  Did
you ever determine if that was actually necessary...?

-- 
John

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to