Hi,
May be you will be intrested in some component of Poynting vector (Sx, Sy) ?
first parameter for output_hdf5 is integer defined in vec.hpp, so it could be
component or derived component
enum component { Ex=0, Ey, Er, Ep, Ez, Hx, Hy, Hr, Hp, Hz,
Dx, Dy, Dr, Dp, Dz, Bx, By, Br, Bp, Bz, Dielectric,
Permeability };
enum derived_component { Sx=100, Sy, Sr, Sp, Sz, EnergyDensity,
D_EnergyDensity, H_EnergyDensity };
you can also try to get value just in one (or several) point with
f.get_field(component, vector);
Kostya
> Message: 2
> Date: Mon, 2 Apr 2012 17:25:52 -0300
> From: Roger Garay Avenda?o <[email protected]>
> To: [email protected]
> Subject: [Meep-discuss] Electric field intensity propagation
> Message-ID:
> <caedvzazreyyeqnrpk8pmsbstg2bki2uomwxlkxjyknwzgkt...@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Konstantin Ladutenko .
> > Dear teacher Steven and Meep Users,
> >
> > I have worked with simulation in MeepC-plus-plus (2D).
> >
> > I did a simulation a electric field propagation (Ez) in a waveguide (2D)
> > in Meep, but I need to do a simulation a electric field intensity
> > propagation (Ez*Ez) or modulo of electric field, so I would like to know
> > what Meep's comand I can use to simulation a electric field intensity
> > propagation in MeepC-plus-plus?.
> >
> > Thanks
>
> Anexo :
>
> #include <meep.hpp>
> #include <iostream>
> using namespace meep;
> //********************************************************************************************
> double PuntaObject(const vec &p)
> {
> if ((p.x() >= -15 && p.x() <= 15) && (p.y() >= 4 && p.y() <=5 ))
> {
> return 12.0;
> }
> return 1.0;
> }
> //**************************************************************************
> int main(int argc, char **argv)
> {
> meep::initialize mpi(argc, argv); // Do this even for non-MPI Meep
> double resolution = 10; // pixels per distance
> const double pml_thickness = 1.0;
> const double x = 30 + pml_thickness;
> const double y = 30 + pml_thickness;
>
> grid_volume grid_vol = vol2d(x, y, resolution); // 30x30 2d cell
> grid_vol.center_origin(); // set the origin as
> the center of cell
>
> structure strct(grid_vol, PuntaObject, pml(pml_thickness)); //
> structure punta
> fields field(&strct);
> field.use_real_fields(); // this is for optimization purposes
> field.output_hdf5(Dielectric, grid_vol.surroundings());
> //************************************************************************
> double freq = 0.15, fwidth = 4.0;
> double start_time = 0, end_time = 200;
> continuous_src_time src(freq, fwidth, start_time, end_time);
> //************************************************************************
> field.add_point_source(Ez, src, vec(-13.0,4.5));
> //***********************************************************************
> h5file *h5_file = field.open_h5file("ez", h5file::WRITE, "", true);
>
> while (field.time() < field.last_source_time())
> {
> field.output_hdf5( fabs(Ez), grid_vol.surroundings(), h5_file,
> true, false, ""); // Electric field intensity ~ Ez*Ez
> // field.output_hdf5( Ez*Ez, grid_vol.surroundings(), h5_file, true,
> false, "");
> // field.output_hdf5(dpwr, grid_vol.surroundings(), h5_file, true,
> false, "");
> field.step();
> }
> }
> //***********************************************************************
> return 0;
> }
>
> thanks
> --
> Roger Leonardo Garay Avenda?o
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://ab-initio.mit.edu/pipermail/meep-discuss/attachments/20120402/68a80f98/attachment-0001.html>
>
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss