def init_material_hx(self):
"""Set up the update mechanism for Hx field.
Set up the update mechanism for Hx field and stores the result
at self.pw_material[Hx].
"""
self.pw_material[Hx] = {}
shape = self.hx.shape
for idx in ndindex(shape):
spc = self.space.hx_index_to_space(*idx)
mat_obj, underneath = self.geom_tree.material_of_point(spc)
if idx[1] == 0 or idx[2] == 0:
mat_obj = Dummy(mat_obj.eps_inf, mat_obj.mu_inf)
pw_obj = mat_obj.get_pw_material_hx(idx, spc, underneath, self.cmplx)
if self.pw_material[Hx].has_key(type(pw_obj)):
self.pw_material[Hx][type(pw_obj)].merge(pw_obj)
else:
self.pw_material[Hx][type(pw_obj)] = pw_obj
评论列表
文章目录