Dosya:Reciprocal monoclinic lattice.png

Reciprocal_monoclinic_lattice.png((516 × 318 piksel, dosya boyutu: 126 KB, MIME tipi: image/png))


Özet

Açıklama
English: The Fourier transform of a monoclinic lattice with real-space vectors a = (1, 0, 0), b = (0, 1, 0), c = (0.5, 0, 0.8). (These vectors are arbitrary.) A 12×12×12 lattice of delta functions was used. The reciprocal lattice vectors are marked on in black.
Tarih
Kaynak Yükleyenin kendi çalışması
Yazar GKFX

Generating code

Data points for this file were created with the following code:

#include <complex.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

typedef struct {
    double x, y, z;
} vector;

static inline vector mult_sv(double scalar, vector vec) {
    vector r = { scalar * vec.x, scalar * vec.y, scalar * vec.z };
    return r;
}

static inline vector add_vvv(vector v1, vector v2, vector v3) {
     vector r = {
         v1.x + v2.x + v3.x,
         v1.y + v2.y + v3.y,
         v1.z + v2.z + v3.z };
     return r;
}

static inline double dot_vv(vector v1, vector v2) {
    return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z;
}

static inline int cube(int n) { return n*n*n; }

vector a = {1.0, 0.0, 0.0};
vector b = {0.0, 1.0, 0.0};
vector c = {0.5, 0.0, 0.8};
double meshStepLen = 10.0/64.0;
int nPerSide = 12;
int meshSideN = 100;

/*
 * The Fourier transform of δ(x - a, y - b, z - c) is
 *     exp(i(aX + bY + cZ))
 *     --------------------
 *          (2√2)(√π)³
 * using Mathematica's default definition of FT.
 */
double complex FTDD(vector realDDPos, vector reciprPos) {
    return cexp(I * dot_vv(realDDPos, reciprPos)) /
        (M_SQRT2 * M_2_SQRTPI * M_PI * M_PI);
}

int main() {
    // Make progress bar work.
    setvbuf (stdout, NULL, _IONBF, BUFSIZ);

    vector *directLattice = (vector*) malloc(cube(nPerSide)*sizeof(vector));
    {
        vector *directLatticeTmp = directLattice;
        for (int i = 0; i < nPerSide; i++) {
            for (int j = 0; j < nPerSide; j++) {
                for (int k = 0; k < nPerSide; k++) {
                    directLatticeTmp[0] = add_vvv(mult_sv(i, a), mult_sv(j, b), mult_sv(k, c));
                    directLatticeTmp++;
                }
            }
        }
    }

    double complex *reciprocalLattice = (double complex*) malloc(cube(meshSideN)*sizeof(double complex));
    for (int i = 0; i < cube(meshSideN); i++) {
        reciprocalLattice[i] = 0.0;
    }

    {
        double complex *reciprocalLatticeTmp = reciprocalLattice;

        for (int i = 0; i < meshSideN; i++) {
            putchar('.');
            for (int j = 0; j < meshSideN; j++) {
                for (int k = 0; k < meshSideN; k++) {
                    vector imagPoint = { i*meshStepLen, j*meshStepLen, k*meshStepLen };
                    for (int l = 0; l < cube(nPerSide); l++) {
                        reciprocalLatticeTmp[0] += FTDD(directLattice[l], imagPoint);
                    }
                    reciprocalLatticeTmp++;
                }
            }
        }
    }
    printf(" Created complex lattice\n");

    double *magData = (double*) malloc(cube(meshSideN)*sizeof(double));
    for (int i = 0; i < cube(meshSideN); i++) {
        magData[i] = cabs(reciprocalLattice[i]);
    }
    FILE *datafile = fopen("rlattice.bin", "wb");
    if (!datafile) {
        perror(0);
        goto free_rlattice;
    }
    fwrite(magData, sizeof(double)*cube(meshSideN), 1, datafile);
    fclose(datafile);

    printf("\nDone.\n");

free_rlattice:
    free(reciprocalLattice);
    free(directLattice);
    return 0;
}

It was then plotted in Mathematica.

Lisanslama

Ben, bu işin telif sahibi, burada işi aşağıdaki lisans altında yayımlıyorum:
Creative Commons CC-Zero Bu dosya Creative Commons Evrensel Kamu Malı İthafı altındadır.
Bu çalışmayı oluşturan kişi bu senet ile eser hakkında tüm dünya çapında telif hakkı yasaları kapsamında, yasalar tarafından izin verilen ölçülerde ve diğer benzer tüm haklarından feragat etmiş ve kamu malı olarak nitelendirmiştir. Siz bu çalışmayı ve eseri hiç bir izin almadan ticari amaçlar da dahil olmak üzere kopyalayabilir, değiştirebilir ve serbestçe dağıtabilirsiniz.

Altyazılar

Bu dosyanın temsil ettiği şeyin tek satırlık açıklamasını ekleyin.

Bu dosyada gösterilen öğeler

betimlenen

31 Ekim 2019

image/png

Dosya geçmişi

Dosyanın herhangi bir zamandaki hâli için ilgili tarih/saat kısmına tıklayın.

Tarih/SaatKüçük resimBoyutlarKullanıcıYorum
güncel23.11, 31 Ekim 201923.11, 31 Ekim 2019 tarihindeki sürümün küçültülmüş hâli516 × 318 (126 KB)GKFX{{Information |description ={{en|1=The Fourier transform of a monoclinic lattice with real-space vectors '''a''' = (1, 0, 0), '''b''' = (0, 1, 0), '''c''' = (0.5, 0, 0.8). (These vectors are arbitrary.) A 12×12×12 lattice of delta functions was used.}} |date =2019-10-31 |source ={{own}} |author =User:GKFX }} Category:Reciprocal lattice Category:X-ray diffraction

Bu görüntü dosyasına bağlantısı olan sayfalar:

Küresel dosya kullanımı

Aşağıdaki diğer vikiler bu dosyayı kullanır:

Meta veri