AttributeError: module 'bempp.api.operators.boundary.maxwell' has no attribute 'multitrace_operator'

96 views
Skip to first unread message

georgm...@gmail.com

unread,
Sep 9, 2020, 9:34:01 AM9/9/20
to bempp
Hey all,

when running the Maxwell example code with the different dielectrica, I get the follwoing error: 

AttributeError: module 'bempp.api.operators.boundary.maxwell' has no attribute 'multitrace_operator'

when trying to run:

scaled_interior_operators = [
    rescale(bempp.api.operators.boundary.maxwell.multitrace_operator(
        grid, wavenumber, space_type='electric_dual', assembler='dense_evaluator', precision='single'), 
            np.sqrt(epsr), np.sqrt(mur)) for grid, wavenumber, epsr, mur in
            zip(grids, wavenumbers, rel_permittivities, rel_permeabilities)
]

Thank in advance!!

Best,
Georg 

Timo Betcke

unread,
Sep 10, 2020, 2:15:59 PM9/10/20
to bempp
Dear Georg,

I fixed this yesterday. However, looking at your example I can see that we haven't updated the multitrace operator example notebook for Bempp 0.2. We do not have the 'dense_evaluator' mode anymore since we now have a working FMM interface, which is more efficient. I also have an updated code for this example which is simpler and faster. Seeing your message, I hope to upload this by Monday. Please send me a reminder if I haven't done it by then :-) By the way, the updated multitrace operator has attributes to specify eps_r and mu_r, which makes the code look a lot nicer.

Timo

georg maier

unread,
Sep 11, 2020, 7:57:06 AM9/11/20
to bempp
Dear Timo,

thanks for your quick response, it works now :) 

Never the less I have some more questions regarding bempp. Is it possible to simulate electromagnetic scattering at an-isotropic material? And also I'm not able to solve the perfect magnetic conductor screen boundary problem, because the solvers are  not converging.

Thanks a lot,
Georg

P.s.: I'll try to remind you on Monday if you have not uploaded the example.

Timo Betcke

unread,
Sep 14, 2020, 7:21:32 AM9/14/20
to bempp
Hi. We have just pushed Bempp-cl 0.2.1 with a couple of small patches. One of them is a better error message if Exafmm is not available. Another one is the rewritten Maxwell dielectric scattering notebook. 

For an an-isotropic material you need a corresponding Green's function, which is something that we do not support at the moment. I would recommend you have a look at NGSolve, which is a FEM package with good capabilities for Maxwell. The only problem is that the boundary conditions towards infinity are a bit messy with FEM.

Screen problems require good preconditioners. Without preconditioning I would not expect convergence. In our corresponding example notebook we solve the screen problem with LU decomposition.

Best wishes

Timo

georg maier

unread,
Sep 14, 2020, 12:26:48 PM9/14/20
to bempp
Hi Timo,

thanks for your suggestion.

I tried the LU solver and got after a "long" time of calculation the following error:

TypeError: cannot unpack non-iterable GridFunction object

Timo Betcke

unread,
Sep 14, 2020, 12:36:14 PM9/14/20
to bempp
Have you compared with the Maxwell screen notebook? This is working fine. I just tried it again.

georg maier

unread,
Sep 15, 2020, 3:30:31 AM9/15/20
to bempp
I did. It is working for me as well... 
Maybe I'm using the wrong equation to enforce the perfect magnetic boundary screen condition? 
Solving for \lambda:
H \lambda = \gamma_N e^{inc} 

Timo Betcke

unread,
Sep 15, 2020, 6:15:39 AM9/15/20
to bempp
Are you using dense or FMM assembly? If you want to use LU decomposition you need to use the default dense assembler.

georg maier

unread,
Sep 15, 2020, 7:32:11 AM9/15/20
to bempp
When I'm using the default assembler an different error message appears:

ValueError: Spaces that require dof transformations not supported for dense assembly.

Timo Betcke

unread,
Sep 15, 2020, 9:08:00 AM9/15/20
to bempp
It seems, you are using a BC space. BC spaces are defined over barycentric grids, which increase the number of elements by a factor 6. Dense Assembly would therefore increase the effort by a factor of 36 (quadratic complexity). This is why we haven't implemented those spaces for dense assembly. They are not suitable for it. However, if you have a problem that you solve dense with LU decomposition, it is usually possible to find formulations that don't require BC spaces. Their main use is to provide well-conditioned formulations for iterative solvers.

georg maier

unread,
Sep 15, 2020, 7:53:49 PM9/15/20
to bempp
Thank you a lot! 
You are doing a great job with bempp!

Cheers,
Georg
Reply all
Reply to author
Forward
0 new messages