Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rotate and poisson #69

Merged
merged 5 commits into from
Dec 15, 2024
Merged
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
6 changes: 5 additions & 1 deletion lapy/diffgeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,11 @@ def tria_compute_rotated_f(tria, vfunc):
# we can pass identity instead of B here:
# div is the integrated divergence (so it is already B*div)
fem.mass = sparse.eye(fem.stiffness.shape[0], dtype=vfunc.dtype)
vf = fem.poisson(divf)
# since the solution is ill defined (addition of constant)
# we specify an arbitrary boundary condition at a single vertex to
# remove that degree of freedom
dtup = ( np.array([0]), np.array([0.0]))
vf = fem.poisson(divf,dtup)
return vf


Expand Down
2 changes: 1 addition & 1 deletion lapy/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _get_colorval(t, colormap):
# compute new color via linear interpolation
cval = np.rint(rv1 + tt * (rv2 - rv1)).astype(int)
# format as string again
cstr = "rgb(%d, %d, %d)" % (cval[0], cval[1], cval[2])
cstr = f"rgb({cval[0]:d}, {cval[1]:d}, {cval[2]:d})"
return cstr


Expand Down
2 changes: 2 additions & 0 deletions lapy/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@ def poisson(self, h=0.0, dtup=(), ntup=()): # poissonSolver
raise ValueError(
"h should be either scalar or column vector with row num of A"
)
if h.ndim == 1:
h = h[:,np.newaxis]
# create vector d
didx = []
dvec = []
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-backend = 'setuptools.build_meta'

[project]
name = 'lapy'
version = '1.2.0-dev'
version = '1.1.2'
description = 'A package for differential geometry on meshes (Laplace, FEM)'
readme = 'README.md'
license = {file = 'LICENSE'}
Expand Down
Loading