On Sat, 10 Jan 2009, John Peterson wrote:

> How low-level do users of BSys::method() need to get?  I mean, is it
> imperative that they be able to provide the context, or is the library
> going to be smart enough to do it for them?

Well, it depends on how much context they need.  The library will
still initialize everything in an FEMContext object, but if you need
something more and you put it in a MySystemContext, you'll need to
override a MySystem::build_context() factory method to construct it
and provide a MySystemContext::reinit(Elem*) method to initialize it on
each element.

> When you first described the multithreading idea, I thought OK cool,
> I still just call element_residual() and then DiffSystem/FEMSystem
> worries about creating the separate data for separate threads, etc
> etc.

Yes, that's the goal.

> In derived systems classes, the user might be required to implement
> a build_context() function, callable by the base class.  The base
> class then manages all the contexts while the threads operate on
> them and cleans them up when the assembly is finished.
>
> But, I suspect I am just not understanding the bigger picture of how
> you want to multithread DiffSystem, so maybe I could use a little
> enlightenment on that point...

It sounds like you've got it right.  And I guess requiring a context
factory method and reinit method for new context classes isn't so bad;
99% of users won't need to create a new context class at all, and for
anyone who needs to reimplement their own reinit method it would
actually simplify the resulting code by avoiding the need to
reimplement the whole FEMSystem::assembly().  I suppose the only thing
really bugging me is the need to downcast a DiffContext& to
FEMContext& (or MySystemContext&) in user code in every *_residual()
type function.
---
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