Hi Bin, What run-k-points does is, it runs several simulations using different Bloch-periodic boundary conditions. The (change-k-point) function changes these conditions and the restart-fields destroys the fields class object (if it is non NULL), so it calls the fields destructor followed by the init-fields function, which in it's turn calls the structure constructor (taking a k-point). This new structure is then used for the fields constructor.
When you wrote your C code, you called the fields class constructor, the Scheme counterpart is the the init-fields function where it calls the constructor for both the fields and structure classes, ie (new-meep-fields structure ...). Arthur On 12 October 2010 09:28, Bin Huang <[email protected]> wrote: > Hi Arthur, > > Your advice for implementing stop-when-fields-decayed has been extremely > helpful. Thank you so much for that. > > I am trying to implement "(run-k-points T k-points)". Thus I need to first > implement "(run-k-point T k)" and I am stuck at how to implement these two > lines. > > (change-k-point! k) > (restart-fields) > > From what I understand, the vector "k-point" defines the direction in which > the wave propagates through the waveguide. So I guess in C++ I should > re-initialize the fields using the new k-point in each iteration of the loop > in "(run-k-points T k-points)". I am not sure how to do it. In fact, I > searched through fieds.cpp, the method "initialize_field" is never called. > When I write my own C++ program, I also never had to explicitly initialize > the field. > > My question is: > 1) how to change k-point parameter? > 2) how to initialize the field with the effect of the change in k-point? > > Thanks so much! > -- > Bin Huang (Bryan) > MIT Graduate Student '10 > Computation for Design and Optimization > (+65)98947649 >
_______________________________________________ meep-discuss mailing list [email protected] http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

