Stop calling type_to_C(self.arg_type) all the time

This commit is contained in:
jan 2016-06-21 18:27:11 -07:00
parent f4b2df2b2c
commit 481613fe5d

View File

@ -105,10 +105,11 @@ class Simulation(object):
Exception('Initial_H list elements must have same shape as epsilon elements') Exception('Initial_H list elements must have same shape as epsilon elements')
self.H = [pyopencl.array.to_device(self.queue, H.astype(float_type)) for H in initial_H] self.H = [pyopencl.array.to_device(self.queue, H.astype(float_type)) for H in initial_H]
E_args = [type_to_C(self.arg_type) + ' *E' + c for c in 'xyz'] ctype = type_to_C(self.arg_type)
H_args = [type_to_C(self.arg_type) + ' *H' + c for c in 'xyz'] E_args = [ctype + ' *E' + c for c in 'xyz']
eps_args = [type_to_C(self.arg_type) + ' *eps' + c for c in 'xyz'] H_args = [ctype + ' *H' + c for c in 'xyz']
dt_arg = [type_to_C(self.arg_type) + ' dt'] eps_args = [ctype + ' *eps' + c for c in 'xyz']
dt_arg = [ctype + ' dt']
sxyz = base.shape_source(epsilon[0].shape) sxyz = base.shape_source(epsilon[0].shape)
E_source = sxyz + base.dixyz_source + base.maxwell_E_source E_source = sxyz + base.dixyz_source + base.maxwell_E_source
@ -163,12 +164,13 @@ class Simulation(object):
psi_E_names += pml_data['psi_E'] psi_E_names += pml_data['psi_E']
psi_H_names += pml_data['psi_H'] psi_H_names += pml_data['psi_H']
E_args = [type_to_C(self.arg_type) + ' *E' + c for c in 'xyz'] ctype = type_to_C(self.arg_type)
H_args = [type_to_C(self.arg_type) + ' *H' + c for c in 'xyz'] E_args = [ctype + ' *E' + c for c in 'xyz']
eps_args = [type_to_C(self.arg_type) + ' *eps' + c for c in 'xyz'] H_args = [ctype + ' *H' + c for c in 'xyz']
dt_arg = [type_to_C(self.arg_type) + ' dt'] eps_args = [ctype + ' *eps' + c for c in 'xyz']
arglist_E = [type_to_C(self.arg_type) + ' *' + psi for psi in psi_E_names] dt_arg = [ctype + ' dt']
arglist_H = [type_to_C(self.arg_type) + ' *' + psi for psi in psi_H_names] arglist_E = [ctype + ' *' + psi for psi in psi_E_names]
arglist_H = [ctype + ' *' + psi for psi in psi_H_names]
pml_E_args = ', '.join(E_args + H_args + dt_arg + eps_args + arglist_E) pml_E_args = ', '.join(E_args + H_args + dt_arg + eps_args + arglist_E)
pml_H_args = ', '.join(E_args + H_args + dt_arg + arglist_H) pml_H_args = ', '.join(E_args + H_args + dt_arg + arglist_H)