# Re: [MPB-discuss] Computing energy in multiple objects

```It does seem to work this way. Thanks Hector.

On 01/09/16 21:45, Hector Perez wrote:
```
```I believe it works like:
```
(output-dpwr-in-objects band-func min-energy object1 object2 object3 ... objectn)
```
So for example:
(output-dpwr-in-objects
(combine-band-functions fix-efield-phase output-tot-pwr) .25
```
(make block (center 0 0 0) (material air) (size (* s4 (sqrt 3)) s4 infinity) (e2 1 1) (e1 1 -1)) (make block (center 0 0 0) (material air) (size (* s4 (sqrt 3)) s4 infinity) (e2 (/ 2 (sqrt 3)) (/ -1 (sqrt 3))) (e1 0 1)) (make block (center 0 0 0) (material air) (size (* s4 (sqrt 3)) s4 infinity) (e2 (/ -1 (sqrt 3)) (/ 2 (sqrt 3))) (e1 1 0))) gives me the total power for bands which have >25% of their electric field energy within a hexagonal region I specified using three overlapping blocks.
```
I hope this helps,
Hector

```
On Wed, Aug 31, 2016 at 11:08 AM Adam Klimont <ak...@cam.ac.uk <mailto:ak...@cam.ac.uk>> wrote:
```
Hello,

How to compute the energy of a field in a supercell? Take e.g. MPB's
tutorial script for triangular rods:
https://github.com/stevengj/mpb/blob/master/examples/tri-rods.ctl.
I can
calculate the energy in one rod by invoking:

((output-dpwr-in-objects output-dpwr 0.001 (make cylinder (center
0 0 0)
(material (make dielectric (epsilon 12)))
)) 4)

But how to do it for all rods in the supercell? Making a list doesn't
work, as (output-dpwr-in-objects) doesn't work with this type of
argument:

ERROR: wrong type for argument type (list . geometric-object) in
compute-energy-in-object-list

Regards

_______________________________________________
mpb-discuss mailing list
mpb-discuss@ab-initio.mit.edu <mailto:mpb-discuss@ab-initio.mit.edu>
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/mpb-discuss

```
```
```
```_______________________________________________
mpb-discuss mailing list
mpb-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/mpb-discuss```