Hi,

 I guess you should try custom source. 

In C++ it looks like (modified parts from program I use)

    custom_src_time src(custom_dipole, &your_custom_data,-infinity, infinity);
    f.add_volume_source(Ey, src, volSrc, sourceAmp);

volSrc - position of source and custom_dipole is a function

complex<double> custom_dipole(double time, void *data)
{
  // Some code from meep continuous_src_time defenition.
  // correction factor so that current amplitude (= d(dipole)/dt) is 1. 
  complex<double> amp = 1.0 / (complex<double>(0,-1.0) * (2*pi)*freq);
  return exp(complex<double>(0,-1.0) * (2*pi)*freq*time) * amp * 0.25;  
}

So, it should not be a problem to add phase here (with optional smooth 
switching on, etc.)

WBR,
Kostya


> Message: 1
> Date: Tue, 27 Mar 2012 17:10:15 -0400
> From: Htet Aung <[email protected]>
> To: [email protected]
> Subject: [Meep-discuss] Phase of an E&M wave source
> Message-ID:
>       <CAGQN4tU56_DimHmdzix69SHgEMbL8Hm=fxsi8sc_0nfzmft...@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Hi
> 
> I am new to MEEP and I have been trying to simulate the scattering of E&M
> waves. I want to change the starting phase of of the sources, for example,
> changing from cos(kx) to cos(kx + kdx) at t=0. However, I cannot find an
> option for source object to change the phase of it. I tried, just in case,
> writing (phase <number>) as one of the parameters for source object, but it
> doesn't do anything (no error either). I would really appreciate it if
> someone would tell me how to set the initial phase of an E&M wave source.
> 
> Thanks,
> 
> -- 
> *Htet Aung*
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to