Hi Roy,

Thanks. If I understand correctly

DofMap::attach_extra_sparsity_function

would do the job.

Best,
Jonas
________________________________________
Von: Roy Stogner <[email protected]>
Gesendet: Montag, 12. Dezember 2016 22:05
An: Jonas Ballani
Cc: [email protected]
Betreff: Re: [Libmesh-users] Access to sparsity pattern

On Mon, 12 Dec 2016, Jonas Ballani wrote:

> I wondered if there is a way to access the SparsityPattern::Graph
> corresponding to a DofMap object once the sparsity has been
> computed.

Your best bet may be to attach a callback function or functor to the
DofMap.  Those get called after the built-in sparsity computations are
done.  The intention was to allow user code to *augment* the default
sparsity, but you could *examine* the default sparsity just as easily.

> In principle I could just loop over all elements in the mesh to
> mimic the graph myself but this looks rather redundant.

Redundant and tricky - if you started using custom GhostingFunctor
subclasses, a custom CouplingMatrix, or any other advanced non-default
behavior, then you'd need to make sure that your own loop was aware of
it too.
---
Roy

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to