diff --git a/volumential/nearfield_potential_table.py b/volumential/nearfield_potential_table.py index 1a61d9fa16a6427d5257987823f591c8eb50d599..b50f8c24b39ae0eb50b00283603dde93309c759c 100644 --- a/volumential/nearfield_potential_table.py +++ b/volumential/nearfield_potential_table.py @@ -124,7 +124,7 @@ def get_cahn_hilliard(dim, b=0, c=0, approx_at_origin=False): r = rr * lam return -(np.log(lam) + euler_constant) - ( np.log(r/2) + euler_constant) * ( - r**2 / 4 + r**4 / 64 ) + ( + r**2 / 4 + r**4 / 64) + ( r**2 / 4 + r**4 * 3 / 128) if approx_at_origin: @@ -134,9 +134,9 @@ def get_cahn_hilliard(dim, b=0, c=0, approx_at_origin=False): return - 1 / (2 * np.pi * (lam1**2 - lam2**2)) * ( sp.kn(0, lam1 * r) - sp.kn(0, lam2 * r)) - return cahn_hilliard + def sumpy_kernel_to_lambda(sknl): from sympy import Symbol, symbols, lambdify var_name_prefix = "x" @@ -164,7 +164,6 @@ def sumpy_kernel_to_lambda(sknl): # {{{ table data structure - class NearFieldInteractionTable(object): """Class for a near-field interaction table. @@ -527,7 +526,7 @@ class NearFieldInteractionTable(object): ) * 0.5 * self.source_box_extent + vec if int(max(abs(np.array( - self.interaction_case_vecs[case_index])))) == 0: + self.interaction_case_vecs[case_index])))) == 0: new_size = 1 else: new_size = max([ @@ -1096,7 +1095,7 @@ class NearFieldInteractionTable(object): # must have try: brick_map_knl = self.integral_knl.prepare_loopy_kernel(brick_map_knl) - except: + except Exception: pass # }}} End loopy kernel for heavy-lifting @@ -1286,11 +1285,11 @@ class NearFieldInteractionTable(object): assert (kernel_power is not None) displacement = 0 - scaling =ource_box_size**( + scaling = source_box_size**( 2 + kernel_power) elif kernel_type == "rigid": - # TODO: add assersion for source box size + # TODO: add assertion for source box size displacement = 0 scaling = 1