On Tue, 12 Jun 2012, John Peterson wrote: > OK, hopefully there won't be too much code duplication
To avoid code duplication in some of the more intricate vector-or-scalar methods, I'm having to define a few methods suitable for generic programming: e.g. TypeVector::slice(i) returns the ith entry, TypeTensor::slice(i) returns the ith column, higher rank tensors will return the slice given with the final index fixed. Simple enough, perfectly backwards compatible, makes our derivative calculations datatype independent. But for generic programming that also involves rank-0 tensors (scalars) there's no class to add methods to, and using global functions instead gives us a namespace pollution issue. Would anybody scream too loudly if I added a libMesh::dot(T,T) function (to do multiplication for scalars, dot products for vectors, dyadic products for tensors...), for instance? Note that for the 99.9% of everyone who haven't turned off "using namespace libMesh", this may conflict with any definitions of dot(T,T) in user code. --- Roy ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Libmesh-devel mailing list Libmesh-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libmesh-devel