Problem with a blocked operator 4x4

26 views
Skip to first unread message

Rene Velasquez

unread,
Feb 7, 2020, 11:01:04 PM2/7/20
to bempp
Hi everyone,
I'm trying to create a blocked operator size 4x4 and i'm having trouble with the 2 ways that i've tried. Any help could be useful.
So, first attempt:

blocks = [[None,None,None,None],[None,None,None,None],[None,None,None,None],[None,None,None,None]]
blocks[0][0] = (0.5 * id + dlp).weak_form()
blocks[0][1] = - slp.weak_form()
blocks[0][2] = slp.weak_form()
blocks[0][3] = slp.weak_form()
blocks[1][0] = (0.5 * id2 - dlp2).weak_form()
blocks[1][1] = (er * slp2).weak_form()
blocks[1][2] = dlp12.weak_form()
blocks[1][3] = - slp12.weak_form()
blocks[2][0] = - dlp21.weak_form()
blocks[2][1] = (er * slp21).weak_form()
blocks[2][2] = (0.5 * id2 + dlp2).weak_form()
blocks[2][3] = - slp2.weak_form()
blocks[3][0] = slp.weak_form()
blocks[3][1] = slp.weak_form()
blocks[3][2] = (0.5 * id - dlp).weak_form() blocks[3][3] = (er * slp).weak_form()
blocked = bempp.api.BlockedDiscreteOperator(np.array(blocks)) 

And I get the following error: ' ValueError: Block column 0 has incompatibleoperator sizes.'

The second option i've tried is this:

blocked = bempp.api.BlockedOperator(4, 4)
blocked[0,0] = (0.5 * id + dlp) 
blocked[0,1] = - slp 
blocked[1,0] = (0.5 * id2 - dlp2) 
blocked[1,1] = (er * slp2) 
blocked[1,2] = dlp12 
blocked[1,3] = - slp12 
blocked[2,0] = - dlp21 
blocked[2,1] = (er * slp21) 
blocked[2,2] = (0.5 * id2 + dlp2) 
blocked[2,3] = - slp2 
blocked[3,2] = (0.5 * id - dlp)  
blocked[3,3] = (er * slp) 

And in this option I get the next message: ' ValueError: Domain space not compatible with self.domain_spaces'

If anyone has comments or experience on doing a blocked operator bigger than 2x2, I could really use some help

best regards and thanks in advance.

Matthew Scroggs

unread,
Feb 19, 2020, 5:49:26 AM2/19/20
to bempp
Hello,

This error is caused by your rows and/or columns using incompatible spaces.

In general, each item in a column should have the same domain space, and each item in a row should have the same dual_to_range space (and probably also the same range space) so that the blocked operator has a consistent triplet of domain and dual spaces for its columns/rows.

Which spaces are you using in the definition of your operators?
Reply all
Reply to author
Forward
0 new messages