On Thu, 10 May 2012, Boyce Griffith wrote: > Is it feasible to template over the return type in FEBase and then have the > derived classes pick either scalar or vector versions?
Hmm... yes, actually. We'd need some kind of traits classes to tell the code that GradientOf<Number>::type is Gradient and GradientOf<Gradient>::type is Tensor, but that would be doable. Not sure if it'd be much of a simplification or not. > Although this would seem to be a pretty big design change . . . I definitely *don't* want any application-level API changes if we can help it. The goal is that app codes would work unmodified and even utility codes would still work if they were presented with data files that didn't include any vector-valued variables. To be that careful, we couldn't actually template FEBase itself (even with a default template parameter specified), but we could have it inherit from something templated. Even that would risk breaking 3rd party FEBase subclasses if they referred to FEBase members with e.g. "phi" instead of "this->phi", but I'd be willing to go that far. I don't think we have any 3rd party FEBase subclasses, and I do think C++ programmers should know by now to future-proof their code against two-phase-name-lookup-induced bugs. Everybody should remember to prepend "this->" if referring to member variables and prepend "What the hell, man?" if talking to Stroustrop. --- 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