eprecond.c 838 Bytes
Newer Older
Florian Wittkamp's avatar
Florian Wittkamp committed
1
/*                          Acknowledgement                         */
2
/* This function is copied from DENISE Black Edition from D. Koehn  */
Florian Wittkamp's avatar
Florian Wittkamp committed
3 4 5
/* Licence: GNU GENERAL PUBLIC LICENSE Version 2, June 1991         */
/* https://github.com/daniel-koehn/DENISE-Black-Edition             */

6 7 8 9 10 11 12

#include "fd.h"
void eprecond(float ** W, float ** vx, float ** vy){
    
    extern int NX, NY, IDX, IDY;
    int i, j;
    
13 14
    for (j=1;j<=NY;j=j+IDY){
        for (i=1;i<=NX;i=i+IDX){
15 16 17 18 19 20 21 22 23 24 25 26 27
            
            W[j][i]+=((vx[j][i]*vx[j][i])+(vy[j][i]*vy[j][i]));
            
        }
    }

}

void eprecond_SH(float ** W, float ** vz){
    
    extern int NX, NY, IDX, IDY;
    int i, j;
    
28 29
    for (j=1;j<=NY;j=j+IDY){
        for (i=1;i<=NX;i=i+IDX){
30 31 32 33 34 35 36
            
            W[j][i]+=((vz[j][i]*vz[j][i]));
            
        }
    }
    
}