Roy and I discussed offline how an attachable QoI should interact with the System-stored QoI. After some discussion, we converged on the idea of having a "CompositeQoI" (or whatever name you wish) that could stash multiple DifferentiableQoI objects. Then, using new virtual methods, the composite guy could decide how to populate the System-stored QoI (given references to the data structure). This required three additional virtual methods to DifferentiableQoI: init_qoi which handles the resizing of the system level qoi, thread_join which handles accumulating the qoi spread over threads (defaults to summing as before), and parallel_op which handles accumulating the qoi over multiple processes (defaults to Parallel::sum as before). The attached patch handles implementing these methods and updated adjoints_ex2 so that it now inits the System-stored QoI as opposed to letting FEMSystem do it. I have not implemented the CompositeQoI yet as I don't have a need for it, but it should be easy to add after this patch whenever it's needed. The patch should also be fully backward compatible.
Patch tested in dbg mode with LIBMESH_OPTIONS="--n_threads=2". OK for trunk? Thanks, Paul
qoi.patch
Description: Binary data
------------------------------------------------------------------------------ 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