From 9d93750fa4e1fab4467664adc6affacffdb8f428 Mon Sep 17 00:00:00 2001 From: Martin Reuter Date: Sun, 15 Dec 2024 01:48:24 +0100 Subject: [PATCH 1/5] specify bcondition at single vertex in compute_rotated --- lapy/diffgeo.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lapy/diffgeo.py b/lapy/diffgeo.py index f41ba1c..4abd0c9 100644 --- a/lapy/diffgeo.py +++ b/lapy/diffgeo.py @@ -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 arbitary 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 From 1cce152820b176651e5db9b8e1199ae1a5eb06a3 Mon Sep 17 00:00:00 2001 From: Martin Reuter Date: Sun, 15 Dec 2024 01:49:07 +0100 Subject: [PATCH 2/5] convert h vector to matrix with single column --- lapy/solver.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lapy/solver.py b/lapy/solver.py index 5cbf9d8..5c17899 100644 --- a/lapy/solver.py +++ b/lapy/solver.py @@ -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 = [] From f793019cbdf04907ed4bb3f1411ec02589f250a0 Mon Sep 17 00:00:00 2001 From: Martin Reuter Date: Sun, 15 Dec 2024 02:02:24 +0100 Subject: [PATCH 3/5] convert to f-string --- lapy/plot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lapy/plot.py b/lapy/plot.py index 1db8ecc..04711a1 100644 --- a/lapy/plot.py +++ b/lapy/plot.py @@ -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 From 0d3ee23db458dd02e0667d5ed750e26ba20f8b04 Mon Sep 17 00:00:00 2001 From: Martin Reuter Date: Sun, 15 Dec 2024 02:04:24 +0100 Subject: [PATCH 4/5] fix typo --- lapy/diffgeo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lapy/diffgeo.py b/lapy/diffgeo.py index 4abd0c9..d9518e9 100644 --- a/lapy/diffgeo.py +++ b/lapy/diffgeo.py @@ -367,7 +367,7 @@ def tria_compute_rotated_f(tria, vfunc): # div is the integrated divergence (so it is already B*div) fem.mass = sparse.eye(fem.stiffness.shape[0], dtype=vfunc.dtype) # since the solution is ill defined (addition of constant) - # we specify an arbitary boundary condition at a single vertex to + # 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) From ed4e433a5a38a745baf8e8737952620917bad28c Mon Sep 17 00:00:00 2001 From: Martin Reuter Date: Sun, 15 Dec 2024 22:57:50 +0100 Subject: [PATCH 5/5] update version to release --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5b3f128..5637f0e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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'}