1 / 6

Updating a Langevin Simulation

Updating a Langevin Simulation. Update. bool stop = false; while(!stop) { NormalizeSpins(spins); if(simulation_time<=0) // t<0 is for relaxation of initial condition RelaxMeasure(simulation_time,spins,model); if(simulation_time>=0)

kenyon-lane
Download Presentation

Updating a Langevin Simulation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Updating a Langevin Simulation

  2. Update bool stop = false; while(!stop) { NormalizeSpins(spins); if(simulation_time<=0) // t<0 is for relaxation of initial condition RelaxMeasure(simulation_time,spins,model); if(simulation_time>=0) Measure(simulation_time,spins,model); // static GlobalMag GlobalMag("dummy",false); // no output Vec3 global_mag = GlobalMag(simulation_time,spins,model); if( global_mag[2]<stop_mag ) stop = true; // if( !stop ) { Real next_time = simulation_time + dt_meas; integration(llg_operator,rng,simulation_time,next_time,spins); simulation_time = next_time; } } // while !stop

  3. Integration LLG: Rotation: Impulse:

  4. Epsilon Fluctuation-dissipation relation

  5. LLG evaluation // evaluates the LLG equation from one set of quantities s,h,dydt. template<class SpinModel> void LLGOperator<SpinModel>::LLGRHS(const orient_type &spin, const field_type &field, field_type &dydt) { // this implementation assumes that dependent_variable and field_container // are random access containers with value_type that is of type // Vec<Real,3> or can be implicitly converted into Vec<Real,3> const Real *s = static_cast<const Real*>(&(spin[0])); const Real *h = static_cast<const Real*>(&(field[0])); // This is S x H Real kx = h[2] * s[1] - h[1] * s[2]; Real ky = h[0] * s[2] - h[2] * s[0]; Real kz = h[1] * s[0] - h[0] * s[1]; // The triple product S x ( S x H ) is expanded to S.H S - H Real sh = s[0] * h[0] + s[1] * h[1] + s[2] * h[2]; // This includes the triple product in the vector k kx += damping * (sh * s[0] - h[0]); ky += damping * (sh * s[1] - h[1]); kz += damping * (sh * s[2] - h[2]); // finish off factor*M[ SxH - damping Sx(SxH) ] dydt[0] = factor * kx; dydt[1] = factor * ky; dydt[2] = factor * kz; }

  6. Update bool stop = false; while(!stop) { NormalizeSpins(spins); if(simulation_time<=0) // t<0 is for relaxation of initial condition RelaxMeasure(simulation_time,spins,model); if(simulation_time>=0) Measure(simulation_time,spins,model); // static GlobalMag GlobalMag("dummy",false); // no output Vec3 global_mag = GlobalMag(simulation_time,spins,model); if( global_mag[2]<stop_mag ) stop = true; // if( !stop ) { Real next_time = simulation_time + dt_meas; integration(llg_operator,rng,simulation_time,next_time,spins); simulation_time = next_time; } } // while !stop

More Related