Skip to content

Commit

Permalink
trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Sworzzy committed Sep 18, 2024
1 parent e682539 commit 7238ba5
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v2
1 change: 0 additions & 1 deletion examples/poisson_2d_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable


from sympde.topology.analytical_mapping import IdentityMapping, PolarMapping
from sympde.topology.analytical_mapping import TargetMapping, CzarnyMapping

Expand Down
2 changes: 0 additions & 2 deletions mesh/generate_pipe.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import numpy as np

raise NotImplementedError("igakit is no longer imported to support python 3.12")

from igakit.cad import circle, ruled, bilinear, join
from psydac.cad.geometry import Geometry, export_nurbs_to_hdf5, refine_nurbs

Expand Down
2 changes: 0 additions & 2 deletions mesh/multipatch/create_magnet.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import numpy as np

raise NotImplementedError("igakit is no longer imported to support python 3.12")

from psydac.cad.multipatch import export_multipatch_nurbs_to_hdf5
from igakit.cad import bilinear
from igakit.cad import circle
Expand Down
8 changes: 1 addition & 7 deletions psydac/api/tests/build_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
from sympde.topology import Square, Domain
from sympde.topology import IdentityMapping, PolarMapping, AffineMapping, BaseAnalyticMapping

# remove after sympde PR #155 is merged and call Domain.join instead
from psydac.feec.multipatch.multipatch_domain_utilities import sympde_Domain_join

# remove after sympde PR #155 is merged and call Domain.join instead
from psydac.feec.multipatch.multipatch_domain_utilities import sympde_Domain_join

#==============================================================================
# small extension to SymPDE:
class TransposedPolarMapping(BaseAnalyticMapping):
Expand Down Expand Up @@ -223,7 +217,7 @@ def build_pretzel(domain_name='pretzel', r_min=None, r_max=None):
]

# domain = Domain.join(patches, connectivity, name=domain_name)
domain = sympde_Domain_join(patches, connectivity, name=domain_name)
domain = Domain.join(patches, connectivity, name=domain_name)

return domain

70 changes: 35 additions & 35 deletions psydac/api/tests/test_2d_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,38 +550,38 @@ def teardown_function():

l2_error, Eh = run_maxwell_2d(Eex, f, alpha, domain, ncells=[2**2, 2**2], degree=[2,2])

mappings = OrderedDict([(P.logical_domain, P.mapping) for P in domain.interior])
mappings_list = list(mappings.values())

Eex_x = lambdify(domain.coordinates, Eex[0])
Eex_y = lambdify(domain.coordinates, Eex[1])
Eex_log = [pull_2d_hcurl([Eex_x,Eex_y], f) for f in mappings_list]

etas, xx, yy = get_plotting_grid(mappings, N=20)
grid_vals_hcurl = lambda v: get_grid_vals(v, etas, mappings_list, space_kind='hcurl')

Eh_x_vals, Eh_y_vals = grid_vals_hcurl(Eh)
E_x_vals, E_y_vals = grid_vals_hcurl(Eex_log)

E_x_err = [(u1 - u2) for u1, u2 in zip(E_x_vals, Eh_x_vals)]
E_y_err = [(u1 - u2) for u1, u2 in zip(E_y_vals, Eh_y_vals)]

my_small_plot(
title=r'approximation of solution $u$, $x$ component',
vals=[E_x_vals, Eh_x_vals, E_x_err],
titles=[r'$u^{ex}_x(x,y)$', r'$u^h_x(x,y)$', r'$|(u^{ex}-u^h)_x(x,y)|$'],
xx=xx,
yy=yy,
gridlines_x1=None,
gridlines_x2=None,
)

my_small_plot(
title=r'approximation of solution $u$, $y$ component',
vals=[E_y_vals, Eh_y_vals, E_y_err],
titles=[r'$u^{ex}_y(x,y)$', r'$u^h_y(x,y)$', r'$|(u^{ex}-u^h)_y(x,y)|$'],
xx=xx,
yy=yy,
gridlines_x1=None,
gridlines_x2=None,
)
mappings = OrderedDict([(P.logical_domain, P.mapping) for P in domain.interior])
mappings_list = list(mappings.values())

Eex_x = lambdify(domain.coordinates, Eex[0])
Eex_y = lambdify(domain.coordinates, Eex[1])
Eex_log = [pull_2d_hcurl([Eex_x,Eex_y], f) for f in mappings_list]

etas, xx, yy = get_plotting_grid(mappings, N=20)
grid_vals_hcurl = lambda v: get_grid_vals(v, etas, mappings_list, space_kind='hcurl')

Eh_x_vals, Eh_y_vals = grid_vals_hcurl(Eh)
E_x_vals, E_y_vals = grid_vals_hcurl(Eex_log)

E_x_err = [(u1 - u2) for u1, u2 in zip(E_x_vals, Eh_x_vals)]
E_y_err = [(u1 - u2) for u1, u2 in zip(E_y_vals, Eh_y_vals)]

my_small_plot(
title=r'approximation of solution $u$, $x$ component',
vals=[E_x_vals, Eh_x_vals, E_x_err],
titles=[r'$u^{ex}_x(x,y)$', r'$u^h_x(x,y)$', r'$|(u^{ex}-u^h)_x(x,y)|$'],
xx=xx,
yy=yy,
gridlines_x1=None,
gridlines_x2=None,
)

my_small_plot(
title=r'approximation of solution $u$, $y$ component',
vals=[E_y_vals, Eh_y_vals, E_y_err],
titles=[r'$u^{ex}_y(x,y)$', r'$u^h_y(x,y)$', r'$|(u^{ex}-u^h)_y(x,y)|$'],
xx=xx,
yy=yy,
gridlines_x1=None,
gridlines_x2=None,
)
2 changes: 1 addition & 1 deletion psydac/api/tests/test_2d_multipatch_mapping_poisson.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def teardown_function():
from sympy import lambdify
u_ex = lambdify(domain.coordinates, solution)
f_ex = lambdify(domain.coordinates, f)
F = [f for f in mappings_list]
F = mappings_list

u_ex_log = [lambda xi1, xi2,ff=f : u_ex(*ff(xi1,xi2)) for f in F]

Expand Down
6 changes: 3 additions & 3 deletions psydac/mapping/discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from sympde.topology.base_mapping import BaseMapping, MappedDomain
from sympde.topology.basic import BasicDomain
from sympde.topology.domain import Domain
from sympde.topology.domain import Domain
from sympy import Symbol

from sympde.topology.datatype import (H1SpaceType, L2SpaceType,
Expand Down Expand Up @@ -44,9 +44,9 @@ def __new__(cls, *components, name=None):
if name==None:
name='M'
obj = super().__new__(cls, name=name, dim=len(components))

return obj

def __init__(self, *components, name=None):
# Sanity checks
assert len(components) >= 1
Expand Down

0 comments on commit 7238ba5

Please sign in to comment.