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 1a24664
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 9 deletions.
6 changes: 4 additions & 2 deletions psydac/feec/multipatch/examples/ppc_test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,12 @@ 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:
"""
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
11 changes: 9 additions & 2 deletions psydac/feec/multipatch/examples_nc/hcurl_eigen_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,12 @@
nb_eigs_solve = 10
nb_eigs_plot = 5
skip_eigs_threshold = 1e-7

else:
ref_sigmas = None
sigma = None
nb_eigs_solve = None
nb_eigs_plot = None
skip_eigs_threshold = None
#
# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----

Expand Down Expand Up @@ -270,7 +275,9 @@
hide_plots=True,
m_load_dir=m_load_dir,
)

else:
diags = None
eigenvalues = None

if ref_sigmas is not None:
errors = []
Expand Down
3 changes: 3 additions & 0 deletions psydac/feec/multipatch/examples_nc/timedomain_maxwell_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@ def source_enveloppe(tau):
# 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 1a24664

Please sign in to comment.