Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/helmholtz-dirichlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
np.linspace(0, 1, nelements+1),
mesh_order)

from meshmode.mesh.processing import affine_map, merge_disjoint_meshes

Check warning on line 51 in examples/helmholtz-dirichlet.py

View workflow job for this annotation

GitHub Actions / basedpyright

Type of "affine_map" is partially unknown   Type of "affine_map" is "(mesh: Mesh, A: generic[Any] | Unknown | None = None, b: generic[Any] | Unknown | None = None) -> Mesh" (reportUnknownVariableType)
nx = 2
ny = 2
dx = 2 / nx
Expand Down Expand Up @@ -82,7 +82,7 @@

from sumpy.visualization import FieldPlotter
fplot = FieldPlotter(np.zeros(2), extent=5, npoints=500)
targets = actx.from_numpy(fplot.points)

Check warning on line 85 in examples/helmholtz-dirichlet.py

View workflow job for this annotation

GitHub Actions / basedpyright

Argument type is unknown   Argument corresponds to parameter "array" in function "from_numpy" (reportUnknownArgumentType)

Check warning on line 85 in examples/helmholtz-dirichlet.py

View workflow job for this annotation

GitHub Actions / basedpyright

Type of "points" is unknown (reportUnknownMemberType)

from pytential import GeometryCollection
places = GeometryCollection({
Expand Down Expand Up @@ -125,7 +125,7 @@

nodes = actx.thaw(density_discr.nodes())
k_vec = np.array([2, 1])
k_vec = k * k_vec / la.norm(k_vec, 2)

Check warning on line 128 in examples/helmholtz-dirichlet.py

View workflow job for this annotation

GitHub Actions / basedpyright

Type of "norm" is partially unknown   Type of "norm" is "Overload[(x: numpy._typing._array_like._SupportsArray[dtype[complex128 | float64 | integer[Any] | numpy.bool[builtins.bool] | datetime64[Any] | timedelta64[Any] | character[Any]]] | _NestedSequence[numpy._typing._array_like._SupportsArray[dtype[complex128 | float64 | integer[Any] | numpy.bool[builtins.bool] | datetime64[Any] | timedelta64[Any] | character[Any]]]] | _NestedSequence[complex], ord: float | Literal[1, -1, 2, -2, 'fro', 'nuc'] | None = None, axis: None = None, keepdims: Literal[False] = False) -> float64, (x: numpy._typing._array_like._SupportsArray[dtype[complex128 | float64 | integer[Any] | numpy.bool[builtins.bool] | datetime64[Any] | timedelta64[Any] | character[Any]]] | _NestedSequence[numpy._typing._array_like._SupportsArray[dtype[complex128 | float64 | integer[Any] | numpy.bool[builtins.bool] | datetime64[Any] | timedelta64[Any] | character[Any]]]] | _NestedSequence[complex], ord: float | Literal[1, -1, 2, -2, 'fro', 'nuc'] | None, axis: SupportsIndex | tuple[SupportsIndex, SupportsIndex], keepdims: Literal[False] = False) -> ndarray[tuple[Any, ...], dtype[float64]], (x: numpy._typing._array_like._SupportsArray[dtype[complex128 | float64 | integer[Any] | numpy.bool[builtins.bool] | datetime64[Any] | timedelta64[Any] | character[Any]]] | _NestedSequence[numpy._typing._array_like._SupportsArray[dtype[complex128 | float64 | integer[Any] | numpy.bool[builtins.bool] | datetime64[Any] | timedelta64[Any] | character[Any]]]] | _NestedSequence[complex], ord: float | Literal[1, -1, 2, -2, 'fro', 'nuc'] | None = None, *, axis: SupportsIndex | tuple[SupportsIndex, SupportsIndex], keepdims: Literal[False] = False) -> ndarray[tuple[Any, ...], dtype[float64]], (x: numpy.linalg._linalg._SupportsArray[ShapeT@norm, dtype[complex128 | float64 | integer[Any] | numpy.bool[builtins.bool] | datetime64[Any] | timedelta64[Any] | character[Any]]], ord: float | Literal[1, -1, 2, -2, 'fro', 'nuc'] | None = None, axis: SupportsIndex | tuple[SupportsIndex, SupportsIndex] | None = None, *, keepdims: Literal[True]) -> ndarray[ShapeT@norm, dtype[float64]], (x: numpy._typing._array_like._SupportsArray[dtype[complex128 | float64 | integer[Any] | numpy.bool[builtins.bool] | datetime64[Any] | timedelta64[Any] | character[Any]]] | _NestedSequence[numpy._typing._array_like._SupportsArray[dtype[complex128 | float64 | integer[Any] | numpy.bool[builtins.bool] | datetime64[Any] | timedelta64[Any] | character[Any]]]] | _NestedSequence[complex], ord: float | Literal[1, -1, 2, -2, 'fro', 'nuc'] | None = None, axis: SupportsIndex | tuple[SupportsIndex, SupportsIndex] | None = None, *, keepdims: Literal[True]) -> ndarray[tuple[Any, ...], dtype[float64]], (x: numpy._typing._array_like._SupportsArray[dtype[floating[_16Bit]]] | _NestedSequence[numpy._typing._array_like._SupportsArray[dtype[floating[_16Bit]]]], ord: float | Literal[1, -1, 2, -2, 'fro', 'nuc'] | None = None, axis: None = None, keepdims: Literal[False] = False) -> floating[_16Bit], (x: numpy._typing._array_like._SupportsArray[dtype[floating[_16Bit]]] | _NestedSequence[numpy._typing._array_like._SupportsArray[dtype[floating[_16Bit]]]], ord: float | Literal[1, -1, 2, -2, 'fro', 'nuc'] | None, axis: SupportsIndex | tuple[SupportsIndex, SupportsIndex], keepdims: Literal[False] = False) -> ndarray[tuple[Any, ...], dtype[floating[_16Bit]]], (x: numpy._typing._array_like._SupportsArray[dtype[floating[_16Bit]]] | _NestedSequence[numpy._typing._array_like._SupportsArray[dtype[floating[_16Bit]]]], ord: float | Literal[1, -1, 2, -2, 'fro', 'nuc'] | None = None, *, axis: SupportsIndex | tuple[SupportsIndex, SupportsIndex], keepdims: Literal[False] = False) -> ndarray[tuple[Any, ...], dtype[floating[_16Bit]]], (x: numpy.linalg._linalg._SupportsArray[ShapeT@norm, dtype[floating[_16Bit]]], ord: float | Literal[1, -1, 2, -2, 'fro', 'nuc'] | None = None, axis: SupportsIndex | tuple[SupportsIndex, SupportsIndex] | None = None, *, keepdims: Literal[True]) -> ndarray[ShapeT@norm, dtype[floating[_16Bit]]], (x: numpy._typing._array_like._SupportsArray[

def u_incoming_func(x):
return actx.np.exp(
Expand All @@ -135,7 +135,7 @@

bvp_rhs = bind(places, sqrt_w*sym.var("bc"))(actx, bc=bc)

from pytential.linalg.gmres import gmres
from arraycontext.linalg.solve import gmres

Check warning on line 138 in examples/helmholtz-dirichlet.py

View workflow job for this annotation

GitHub Actions / basedpyright

Type of "gmres" is unknown (reportUnknownVariableType)

Check failure on line 138 in examples/helmholtz-dirichlet.py

View workflow job for this annotation

GitHub Actions / basedpyright

Import "arraycontext.linalg.solve" could not be resolved (reportMissingImports)
gmres_result = gmres(
bound_op.scipy_op(actx, sigma_sym.name, dtype=np.complex128, k=k),
bvp_rhs, tol=1e-8, progress=True,
Expand Down Expand Up @@ -168,13 +168,13 @@
bind(places, representation_sym)(
actx, sigma=gmres_result.solution, k=k))
except QBXTargetAssociationFailedError as e:
fplot.write_vtk_file("helmholtz-dirichlet-failed-targets.vts", [

Check warning on line 171 in examples/helmholtz-dirichlet.py

View workflow job for this annotation

GitHub Actions / basedpyright

Type of "write_vtk_file" is partially unknown   Type of "write_vtk_file" is "(file_name: str | Path, data: Iterable[tuple[str, Unknown]], *, real_only: bool = False, overwrite: bool = False) -> None" (reportUnknownMemberType)
("failed", actx.to_numpy(e.failed_target_flags))
])
raise

# fplot.show_scalar_in_mayavi(fld_in_vol.real, max_val=5)
fplot.write_vtk_file("helmholtz-dirichlet-potential.vts", [

Check warning on line 177 in examples/helmholtz-dirichlet.py

View workflow job for this annotation

GitHub Actions / basedpyright

Type of "write_vtk_file" is partially unknown   Type of "write_vtk_file" is "(file_name: str | Path, data: Iterable[tuple[str, Unknown]], *, real_only: bool = False, overwrite: bool = False) -> None" (reportUnknownMemberType)
("potential", fld_in_vol),
("indicator", indicator),
("u_incoming", actx.to_numpy(u_incoming)),
Expand Down
2 changes: 1 addition & 1 deletion examples/laplace-dirichlet-3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
bc = u_incoming_func(nodes)
bvp_rhs = bind(places, sqrt_w*sym.var("bc"))(actx, bc=bc)

from pytential.linalg.gmres import gmres
from arraycontext.linalg.solve import gmres

Check failure on line 123 in examples/laplace-dirichlet-3d.py

View workflow job for this annotation

GitHub Actions / basedpyright

Import "arraycontext.linalg.solve" could not be resolved (reportMissingImports)
gmres_result = gmres(
bound_op.scipy_op(actx, "sigma", dtype=np.float64),
bvp_rhs, tol=1e-14, progress=True,
Expand Down
2 changes: 1 addition & 1 deletion examples/laplace-dirichlet-simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
nodes = actx.thaw(density_discr.nodes())
bvp_rhs = actx.np.sin(nodes[0])

from pytential.linalg.gmres import gmres
from arraycontext.linalg.solve import gmres

Check failure on line 97 in examples/laplace-dirichlet-simple.py

View workflow job for this annotation

GitHub Actions / basedpyright

Import "arraycontext.linalg.solve" could not be resolved (reportMissingImports)
gmres_result = gmres(
bound_op.scipy_op(actx, sigma_sym.name, dtype=np.float64),
bvp_rhs, tol=1e-8, progress=True,
Expand Down
2 changes: 1 addition & 1 deletion experiments/cahn-hilliard.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def g(xvec):
-g(nodes),
])

from pytential.linalg.gmres import gmres
from arraycontext.linalg.solve import gmres
gmres_result = gmres(
bound_op.scipy_op(queue, "sigma", dtype=np.complex128),
bc, tol=1e-8, progress=True,
Expand Down
2 changes: 1 addition & 1 deletion experiments/find-photonic-mode-sk.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def find_mode():
bound_op = bind(qbx, op, auto_where="source")

def muller_solve_func(ne):
from pytential.linalg.gmres import gmres
from arraycontext.linalg.solve import gmres
gmres_result = gmres(
bound_op.scipy_op(queue, "u",
np.complex128, ne=ne, **base_context),
Expand Down
2 changes: 1 addition & 1 deletion experiments/layerpot-coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def reference_solu(rvec):
op.operator(sym.var('sigma')))
rhs = bind(qbx.density_discr, op.prepare_rhs(sym.var("bc")))(queue, bc=bvals)

from pytential.linalg.gmres import gmres
from arraycontext.linalg.solve import gmres
gmres_result = gmres(
bound_op.scipy_op(queue, "sigma", dtype=np.float64),
rhs,
Expand Down
2 changes: 1 addition & 1 deletion experiments/maxwell.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def dipole3eall(x,y,z,sources,strengths,k):

bound_op = bind(qbx, sym_operator)

from pytential.linalg.gmres import gmres
from arraycontext.linalg.solve import gmres
if 0:
gmres_result = gmres(
bound_op.scipy_op(queue, "sigma", dtype=np.complex128, k=k),
Expand Down
2 changes: 1 addition & 1 deletion experiments/maxwell_sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def dipole3eall(x,y,z,sources,strengths,k):

bound_op = bind(qbx, sym_operator)

from pytential.linalg.gmres import gmres
from arraycontext.linalg.solve import gmres
if 1:
gmres_result = gmres(
bound_op.scipy_op(queue, "sigma", dtype=np.complex128, k=k),
Expand Down
2 changes: 1 addition & 1 deletion experiments/poisson.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def get_kernel():

bvp_rhs = bind(bdry_discr, op.prepare_rhs(sym.var("bc")))(queue, bc=bvp_bc)

from pytential.linalg.gmres import gmres
from arraycontext.linalg.solve import gmres
gmres_result = gmres(
bound_op.scipy_op(queue, "sigma", dtype=np.float64),
bvp_rhs, tol=1e-14, progress=True,
Expand Down
2 changes: 1 addition & 1 deletion experiments/stokes-2d-interior.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def couette_soln(x, y, dp, h):
# Get rhs vector
bvp_rhs = bind(qbx, sqrt_w*sym.make_sym_vector("bc",dim))(queue, bc=bc)

from pytential.linalg.gmres import gmres
from arraycontext.linalg.solve import gmres
gmres_result = gmres(
bound_op.scipy_op(queue, "sigma", np.float64, mu=mu, normal=normal),
bvp_rhs, tol=1e-9, progress=True,
Expand Down
2 changes: 1 addition & 1 deletion experiments/two-domain-helmholtz.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def main():

bvp_rhs[i_bc] *= sqrt_w

from pytential.linalg.gmres import gmres
from arraycontext.linalg.solve import gmres
gmres_result = gmres(
bound_pde_op.scipy_op(queue, "unknown", dtype=np.complex128,
domains=[sym.DEFAULT_TARGET]*2, K0=K0, K1=K1),
Expand Down
Loading
Loading