Skip to content

Commit

Permalink
make Codacy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikSchnack committed Sep 20, 2023
1 parent f68c562 commit 7fbaecf
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 17 deletions.
14 changes: 8 additions & 6 deletions psydac/feec/multipatch/examples/ppc_test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ def get_Gaussian_beam(x_0, y_0, domain=None):
return Tuple(E, 0), B

def get_Gaussian_beam2(x_0, y_0, domain=None):
# return E = cos(k*x) exp( - x^2 + y^2 / 2 sigma^2) v
"""
Gaussian beam
Beam inciding from the left, centered and normal to wall:
x: axial normalized distance to the beam's focus
y: radial normalized distance to the center axis of the beam
"""
x,y = domain.coordinates


Expand All @@ -113,11 +118,8 @@ def get_Gaussian_beam2(x_0, y_0, domain=None):

t = [(x-x0)*cos(theta) - (y - y0) * sin(theta), (x-x0)*sin(theta) + (y-y0) * cos(theta)]

## Gaussian beam
'''Beam inciding from the left, centered and normal to wall:
x: axial normalized distance to the beam's focus
y: radial normalized distance to the center axis of the beam
'''


EW0 = 1.0 # amplitude at the waist
k0 = 2 * pi # free-space wavenumber

Expand Down
Empty file.
4 changes: 2 additions & 2 deletions psydac/feec/multipatch/examples_nc/hcurl_eigen_pbms_dg.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
from psydac.feec.multipatch.non_matching_multipatch_domain_utilities import create_square_domain
from psydac.api.postprocessing import OutputManager, PostProcessManager

def hcurl_solve_eigen_pbm_dg(ncells=[[2,2], [2,2]], degree=[3,3], domain=[[0, np.pi],[0, np.pi]], domain_name='refined_square', backend_language='pyccel-gcc', mu=1, nu=0, gamma_h=0,
generalized_pbm=False, sigma=None, ref_sigmas=[], nb_eigs_solve=8, nb_eigs_plot=5, skip_eigs_threshold=1e-7,
def hcurl_solve_eigen_pbm_dg(ncells=np.array([[8, 4], [4, 4]]), degree=(3,3), domain=([0, np.pi],[0, np.pi]), domain_name='refined_square', backend_language='pyccel-gcc', mu=1, nu=0, gamma_h=0,
generalized_pbm=False, sigma=5, ref_sigmas=None, nb_eigs_solve=8, nb_eigs_plot=5, skip_eigs_threshold=1e-7,
plot_dir=None, hide_plots=True, m_load_dir="",):

diags = {}
Expand Down
4 changes: 2 additions & 2 deletions psydac/feec/multipatch/examples_nc/hcurl_eigen_pbms_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
from psydac.api.postprocessing import OutputManager, PostProcessManager


def hcurl_solve_eigen_pbm_nc(ncells=[[2,2], [2,2]], degree=[3,3], domain=[[0, np.pi],[0, np.pi]], domain_name='refined_square', backend_language='pyccel-gcc', mu=1, nu=0, gamma_h=0,
generalized_pbm=False, sigma=None, ref_sigmas=[], nb_eigs_solve=8, nb_eigs_plot=5, skip_eigs_threshold=1e-7,
def hcurl_solve_eigen_pbm_nc(ncells=np.array([[8, 4], [4, 4]]), degree=(3,3), domain=([0, np.pi],[0, np.pi]), domain_name='refined_square', backend_language='pyccel-gcc', mu=1, nu=0, gamma_h=0,
generalized_pbm=False, sigma=5, ref_sigmas=None, nb_eigs_solve=8, nb_eigs_plot=5, skip_eigs_threshold=1e-7,
plot_dir=None, hide_plots=True, m_load_dir=None,):

diags = {}
Expand Down
10 changes: 7 additions & 3 deletions psydac/feec/multipatch/examples_nc/hcurl_eigen_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,13 @@
case_dir = 'eigenpbm_'+operator+'_'+method
ref_case_dir = case_dir

cb_min_sol = None
cb_max_sol = None

ref_sigmas = None
sigma = None
nb_eigs_solve = None
nb_eigs_plot = None
skip_eigs_threshold = None
diags = None
eigenvalues = None

if domain_name == 'refined_square':
assert domain == [[0, np.pi],[0, np.pi]]
Expand Down
6 changes: 3 additions & 3 deletions psydac/feec/multipatch/examples_nc/timedomain_maxwell_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,16 +484,16 @@ def is_plotting_time(nt, *, dt=dt, Nt=Nt, plot_time_ranges=plot_time_ranges):

# f0_c = np.zeros(V1h.nbasis)

def source_enveloppe(tau):
return 1

if source_omega is not None:
f0_harmonic = f0
f0 = None
if E0_type == 'th_sol':
# use source enveloppe for smooth transition from 0 to 1
def source_enveloppe(tau):
return (special.erf((tau/25)-2)-special.erf(-2))/2
else:
def source_enveloppe(tau):
return 1

t_stamp = time_count(t_stamp)
tilde_f0_c = f0_c = None
Expand Down
2 changes: 1 addition & 1 deletion psydac/feec/multipatch/utils_conga_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def get_Vh_diags_for(v=None, v_ref=None, M_m=None, print_diags=True, msg='error
return diags


def write_diags_to_file(diags, script_filename, diag_filename, params={}):
def write_diags_to_file(diags, script_filename, diag_filename, params=None):
print(' -- writing diags to file {} --'.format(diag_filename))
if not os.path.exists(diag_filename):
open(diag_filename, 'w')
Expand Down

0 comments on commit 7fbaecf

Please sign in to comment.