forked from jan/opencl_fdfd
fix bugs after refactor
This commit is contained in:
parent
ff3951ba35
commit
8e3706948e
5 changed files with 20 additions and 31 deletions
|
|
@ -1,21 +1,13 @@
|
|||
/* Common code for E, H updates
|
||||
*
|
||||
* Template parameters:
|
||||
* ctype string denoting type for storing complex field values
|
||||
* shape list of 3 ints specifying shape of fields
|
||||
*/
|
||||
|
||||
//Defines to clean up operation names
|
||||
#define ctype {{ctype}}_t
|
||||
#define zero {{ctype}}_new(0.0, 0.0)
|
||||
#define add {{ctype}}_add
|
||||
#define sub {{ctype}}_sub
|
||||
#define mul {{ctype}}_mul
|
||||
|
||||
// Field sizes
|
||||
const int sx = {shape[0]};
|
||||
const int sy = {shape[1]};
|
||||
const int sz = {shape[2]};
|
||||
const int sx = {{shape[0]}};
|
||||
const int sy = {{shape[1]}};
|
||||
const int sz = {{shape[2]}};
|
||||
|
||||
//Since we use i to index into Ex[], E[], ... rather than E[], do nothing if
|
||||
// i is outside the bounds of Ex[].
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ __global ctype *inv_mu_x = inv_mu + XX;
|
|||
__global ctype *inv_mu_y = inv_mu + YY;
|
||||
__global ctype *inv_mu_z = inv_mu + ZZ;
|
||||
|
||||
__global ctype *pmc_x = pmc + XX;
|
||||
__global ctype *pmc_y = pmc + YY;
|
||||
__global ctype *pmc_z = pmc + ZZ;
|
||||
__global char *pmc_x = pmc + XX;
|
||||
__global char *pmc_y = pmc + YY;
|
||||
__global char *pmc_z = pmc + ZZ;
|
||||
|
||||
/*
|
||||
* Implement periodic boundary conditions
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ __global ctype *oeps_x = oeps + XX;
|
|||
__global ctype *oeps_y = oeps + YY;
|
||||
__global ctype *oeps_z = oeps + ZZ;
|
||||
|
||||
__global ctype *pec_x = pec + XX;
|
||||
__global ctype *pec_y = pec + YY;
|
||||
__global ctype *pec_z = pec + ZZ;
|
||||
__global char *pec_x = pec + XX;
|
||||
__global char *pec_y = pec + YY;
|
||||
__global char *pec_z = pec + ZZ;
|
||||
|
||||
__global ctype *Pl_x = Pl + XX;
|
||||
__global ctype *Pl_y = Pl + YY;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* Apply PEC and preconditioner.
|
||||
*
|
||||
* Template parameters:
|
||||
* ctype name of complex type (eg. cdouble)
|
||||
* pec false iff no PEC anyhwere
|
||||
*
|
||||
* Arguments:
|
||||
|
|
@ -13,12 +12,6 @@
|
|||
*/
|
||||
|
||||
|
||||
//Defines to clean up operation names
|
||||
#define ctype {{ctype}}_t
|
||||
#define zero {{ctype}}_new(0.0, 0.0)
|
||||
#define mul {{ctype}}_mul
|
||||
|
||||
|
||||
{%- if pec -%}
|
||||
if (pec[i] != 0) {
|
||||
E[i] = zero;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue