That's good news. I look forward to that. Just to note - the memory overhead doesn't have to be large for the correction matrix, since it normally has significantly fewer nonzero elements than the main matrix. I don't know if it's easy to compute the sparsity pattern for just the boundary, but just a ::compress() will at least limit the consumption in time.
-j. On 14 August 2013 09:09, Garth N. Wells <[email protected]> wrote: > On 13 August 2013 21:29, Joachim Berdal Haga <[email protected]> wrote: > > ...and a fix was waiting to be merged when I came in. Lovely, thanks > Magne! > > Coraline, can you check that this solves your problem (with fenics 1.2)? > > > > The fix relies on DirichletBC::zero_columns() for symmetric matrices, so > > symmetry doesn't work in parallel. I'd like to use the anointed > > assemble_system interface, but there are some problems: > > > > 1) Off-diagonal blocks have different BC specifications on rows and > columns. > > We could add separate row and column BCs in the interface (like > > symmetric_assemble), but... > > > > 2) The rhs must be corrected for off-diagonal blocks, too. > > > > Does this have a simple solution that I just don't see? Or would it be > > acceptable to modify assemble_system to (optionally) return the > correction > > matrix as well, like symmetric_assemble did? > > > > Support for block matrices via PETSc (using MatNest) will be added in > the next few days, and will also need to support the application of > bcs on blocks, so I'll be looking into this too. > > Returning a second/correction sparse matrix is not ok because the > memory overhead is too high. > > Garth > > > > > > > On 13 August 2013 08:33, Joachim Berdal Haga <[email protected]> wrote: > >> > >> I'll have a look at this tonight. Obviously we'll need to support newer > >> fenics, but that requires some changes in dolfin to be able to specify > >> different bcs for rows and columns (for off-diag blocks) in the > >> assemble-system interface. If you don't require symmetry, you can bypass > >> cbc.block and use bc.apply() / bc.zero() on the diagonal / off-diag > blocks. > >> > >> J. > >> > >> Den 9. aug. 2013 12:06 skrev "Line" <[email protected]> > følgende: > >>> > >>> Hello ! > >>> > >>> Sorry on advance for the long email, I tried to be specific. > >>> > >>> I need to use the cbc.block package for my python code (I need > >>> block-structure matrix), but I don't know how to apply my boundary > condition > >>> (Dirichlet boundary conditions, basically non-slip conditions). Let me > >>> explain: > >>> > >>> I downloaded the last version of cbc.block from: > >>> https://bitbucket.org/fenics-apps/cbc.bloI ck/overview. I first tried > to run > >>> some demo, mixedpoisson.py and biot.py for example. However, I have a > >>> problem with the block_symmetric_assemble and block_assemble > functions. Here > >>> is the error I obtain : > >>> > >>> Traceback (most recent call last): > >>> File "mixedpoisson.py", line 97, in > >>> [a21, 0 ]], bcs=bcs) > >>> File "/usr/local/lib/python2.7/dist-packages/block/block_assemble.py", > >>> line 35, in block_symmetric_assemble > >>> symm[i,j], asymm[i,j] = _symmetric_assemble(forms[i,j], row_bcs=bcs[i], > >>> col_bcs=bcs[j]) > >>> File "/usr/local/lib/python2.7/dist-packages/block/block_assemble.py", > >>> line 79, in _symmetric_assemble > >>> from dolfin import symmetric_assemble > >>> ImportError: cannot import name symmetric_assemble > >>> > >>> I suspect an incompatibility between the versions of FEniCS/cbc.block > (I > >>> have dolfin-1.2.0). I understood that "symmetric_assemble" does no > longer > >>> exist in the Python interface, sp obviously it won't work. > >>> > >>> Consequently, I downloaded a previous version of cbc.block (1.0.1), > where > >>> I can use bc = block_bc([...]) (with inside my boundary conditions > defined > >>> with DirichletBC) and bc.apply(A, b) to apply my boundary conditions > >>> (block_bc is not available in the last version of cbc.block). I > previously > >>> assemble my blocks and build my block matrix with: A = > block_mat([...]) and > >>> the RHS: b = block_vec([...]). > >>> > >>> Obviously, it's not the best way to do it (some of the demo for example > >>> still don't work), but I don't know how to apply boundary conditions > with > >>> the newest version of cbc.block. > >>> > >>> On top of that, I have an other error which I don't know how to solve: > >>> > >>> Calculated signs of diagonal blocks:[1, None, 1] > >>> Traceback (most recent call last): > >>> File "block_stokes_1.py", line 93, in > >>> bc.apply(A, b, save_A=True) > >>> File "/usr/local/lib/python2.7/dist-packages/block/block_bc.py", line > 41, > >>> in apply > >>> self.apply_matvec(A, b, symmetric) > >>> File "/usr/local/lib/python2.7/dist-packages/block/block_bc.py", line > 87, > >>> in apply_matvec > >>> bc.zero_columns(A[j,i], b[j]) > >>> TypeError: in method 'DirichletBC_zero_columns', argument 2 of type > >>> 'dolfin::GenericMatrix &' > >>> > >>> I had an idea from https://lists.launchpad.net/cbc.block/msg00018.html > , > >>> but even with that, it still doesn't work.So now, I'm lost ! Anyone > can help > >>> me with that ? > >>> > >>> Thanks in advance for your time (sorry again for the huge question...), > >>> > >>> Coraline > >>> > >>> PS: I install FEniCS via dorsal, so I have dolfin-1.2.0 > >>> > >>> Python 2.7.3 > >>> > >>> > >>> > >>> > >>> _______________________________________________ > >>> fenics mailing list > >>> [email protected] > >>> http://fenicsproject.org/mailman/listinfo/fenics > >>> > > > > > > _______________________________________________ > > fenics mailing list > > [email protected] > > http://fenicsproject.org/mailman/listinfo/fenics > > >
_______________________________________________ fenics mailing list [email protected] http://fenicsproject.org/mailman/listinfo/fenics
