You may also want to check, if you cannot use BlockMatrixArray and avoid the copying. Best, Guido
On Fri, May 11, 2012 at 4:15 PM, Justin Droba <[email protected]> wrote: > Timo, > > Thank you so much for your response! Thanks to using make_sparsity_pattern > on the individual blocks as you suggest, I now have it working just as I > want (well, mod another bug whose origin is eluding me at the moment). It's > absolutely marvelous. Thank you! > > Unfortunately, I can't remember the exact code that generated the error with > copy_from (I changed it so many times), but I think I was getting a type > error of some sort. I think it was looking for a > CompressedSparsityPattern--something other than a SparsityPattern (or maybe > that was when I used = ). If you'd like more information because you want > to investigate a possible issue within the library, I can try to replicate > the failed implementation that generated the error. > > Best, > -J > > On 05/09/2012 11:50 PM, Timo Heister wrote: > > Hey Justin, > > block_sparsity.block(0,0) is a SparsityPattern, so you can use > DoFTools::make_sparsity_pattern() on it. > > What error are you getting if you call block_sparsity.block(0,0).copy_from() > ? > > On Thu, May 3, 2012 at 12:51 PM, Justin Droba <[email protected]> wrote: > > 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 list http://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 > > > > > > -- > ----------------------------------------------------------------------------- > 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 > -- Guido Kanschat, Department of Mathematics, Texas A&M University In accordance with the Texas Public Information Act all email sent to and from my Texas A&M email account can be obtained through a Public Information Request. If you do not want your correspondence public, please arrange a phone conversation with me. _______________________________________________ dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
