Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: revamped adjoint filters #1625

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
25 changes: 10 additions & 15 deletions python/adjoint/basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@
class Basis(ABC):
"""
"""
def __init__(
self,
rho_vector=None,
volume=None,
size=None,
center=mp.Vector3(),
):
def __init__(self,
rho_vector=None,
volume=None,
size=None,
center=mp.Vector3()):
self.volume = volume if volume else mp.Volume(center=center, size=size)
self.rho_vector = rho_vector

Expand Down Expand Up @@ -54,6 +52,9 @@ class BilinearInterpolationBasis(Basis):
Simple bilinear interpolation basis set.
'''
def __init__(self, resolution, symmetry=None, **kwargs):
'''

'''
self.dim = 2

super(BilinearInterpolationBasis, self).__init__(**kwargs)
Expand Down Expand Up @@ -194,14 +195,8 @@ def get_bilinear_row(self, rx, ry, rho_x, rho_y):

return weights, interp_idx

def gen_interpolation_matrix(
self,
rho_x,
rho_y,
rho_x_interp,
rho_y_interp,
rho_z_interp,
):
def gen_interpolation_matrix(self, rho_x, rho_y, rho_x_interp,
rho_y_interp, rho_z_interp):
'''
Generates a bilinear interpolation matrix.

Expand Down
14 changes: 6 additions & 8 deletions python/adjoint/filter_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@


class FilteredSource(CustomSource):
def __init__(
self,
center_frequency,
frequencies,
frequency_response,
dt,
time_src=None,
):
def __init__(self,
center_frequency,
frequencies,
frequency_response,
dt,
time_src=None):
dt = dt / 2 # divide by two to compensate for staggered E,H time interval
self.dt = dt
self.frequencies = frequencies
Expand Down
Loading