Markus,

Thank you for your response.

What you say is precisely what I would like to do. I don't know how to copy the sparsity patterns from sparsity_M et al. The copy_from method and = operators both throw errors, so those aren't right. sparsity_M is of type SparsityPattern. How do I assign that to block_sparsity.block(0,0)?

I cannot use the DoFTools::make_sparsity_pattern for the following reason: in essence, I am doing an FE system without using FESystem. The components of the system (real and imaginary parts) use the same FE space and satisfy dual PDEs--so it's really a waste to use FESystem. It would duplicate a whole lot of identical data and waste a lot of valuable memory. (And I'd also prefer to avoid going through the code and modifying all the references to FEValues to accommodate a system. :) ) By stacking up the stiffness matrices in the right way, we can replicate the end result without needing to generate and keep track of two sets of identical basis functions.

In other words, my dof_handler and FE objects don't know they are actually part of a system.

I could go back and use FESystem and then make clever use of Block stuff to avoid rewriting most of the existing code (which was just for a real system), but I'd like to try this way first, if possible.

Thank you!

Best,
-J

On 05/03/2012 02:17 AM, Markus Bürg wrote:
Hello Justin,

did you try the following: Create a BlockSparsityPattern (2,2). Then copy the sparsity patterns sparsity_M, sparsity_S, sparsity_T into the corresponding blocks. Do the same with the BlockSparseMatrix.

Best Regards,
Markus



On 03.05.2012 03:42, Justin Droba wrote:
Hi,

I have three SparseMatrix objects already created, M, S, and T. I'd like to combine them into one BlockSparseMatrix of the form A = [M, S; T, M]. All of these matrices are the same size (square) and have the same sparsity patterns. I've read through the documentation on BlockSparseMatrix and I can't quite figure out how to do this. I'm sure I'm missing something obvious (unless what I want to do is impossible!), but can someone point me to the methods I need to use?

I'd like to do this so I can use SparseDirectUMFPACK to solve Ax = b with the above A. The documentation says that SparseDirectUMFPACK should work with BlockSparseMatrix objects too.

Thank you!

Best,
-J

--
-----------------------------------------------------------------------------
Justin Droba
Office: A111 Wells Hall
Ph.D. Candidate in Applied Mathematics
Michigan State University
Department of Mathematics
East Lansing, MI 48824
-----------------------------------------------------------------------------


_______________________________________________
dealii mailing listhttp://poisson.dealii.org/mailman/listinfo/dealii


_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii


--
-----------------------------------------------------------------------------
Justin Droba
Office: A111 Wells Hall
Ph.D. Candidate in Applied Mathematics
Michigan State University
Department of Mathematics
East Lansing, MI 48824
-----------------------------------------------------------------------------
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to