On Sun, 11 Jan 2009, John Peterson wrote:

> Maybe you can hide that behind another function call.  For example,
>
> const std::vector<Real>& JxW = this->context()->fe->get_JxW();
>
> (the this-> part is of course not necessary).  The first call to
> context() performs the dynamic_cast to a FEMContext* and saves the
> downcasted pointer.  Subsequent calls to context() just keep re-using
> it.  Implementers of other system types would re-implement context()
> in the way appropriate to their System.  It's a virtual function call
> per access but this is outside the quadrature loop.

That's an interesting idea.  We'd need an argument to distinguish
multiple contexts in different threads, but that's easy enough.  Don't
pass in an FEMContext object, pass in a ContextIndex object (probably
just a typedef'ed short int), and then this->context(index) gives you
any type you want.  I think I like it.
---
Roy

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to