/* * multislice.c * * Multislice Dynamical Simulations * * (c) 2006-2007 Thomas White * * synth2d - Two-Dimensional Crystallographic Fourier Synthesis * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "reflist.h" #include "model.h" #include "data.h" /* Relativistic Electron Interaction Constant. Voltage in volts. */ static double multislice_interaction(double voltage) { double a, b; a = (1 + voltage*1.9569341e-6) * 0.25615739; b = sqrt(voltage) * sqrt(1 + voltage*0.97846707e-6); return a / b; } /* Unit cell volume */ static double multislice_volume(double a, double b, double c, double alpha, double beta, double gamma) { } static fftw_complex *multislice_phasegrating(AtomicModel *model_orig, size_t width, size_t height) { AtomicModel *model; fftw_complex *phase_grating_real; fftw_complex *phase_grating_reciprocal; fftw_plan plan; ReflectionList *V; ReflectionList *template; template = reflist_new(); model = model_copy(model_orig); model->thickness = 0.0; V = model_calculate_f(template, model, 69); model_free(model); reflist_free(template); plan = fftw_plan_dft_2d(width, height, phase_grating_real, phase_grating_reciprocal, FFTW_FORWARD, FFTW_MEASURE); fftw_execute(plan); fftw_destroy_plan(plan); return phase_grating_reciprocal; } static fftw_complex *multislice_propogator(AtomicModel *model_orig, size_t width, size_t height, double slice) { return NULL; } static void multislice_multiply(fftw_complex *a, fftw_complex *b, size_t size) { size_t i; for ( i=0; ithickness; t+=c ) { multislice_multiply(wavefunction, propogator, width*height); multislice_convolve(wavefunction, phasegrating, width*height); printf("MS: Current thickness: %f\n", t); fflush(stdout); } return NULL; }