Skip to content

Commit 360f315

Browse files
committed
fix libraries
1 parent 2f2ba9a commit 360f315

3 files changed

Lines changed: 11 additions & 22 deletions

File tree

pyop2/compilation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ class LinuxGnuCompiler(Compiler):
344344

345345
_cflags = ("-fPIC", "-Wall", "-std=gnu11")
346346
_cxxflags = ("-fPIC", "-Wall")
347-
_ldflags = ("-shared", "-lgsl", "-lgslcblas")
347+
_ldflags = ("-shared",)
348348

349349
_optflags = ("-march=native", "-O3", "-ffast-math")
350350
_debugflags = ("-O0", "-g")

pyop2/global_kernel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def _cppargs(self):
396396
def _ldargs(self):
397397
ldargs = [f"-L{d}/lib" for d in get_petsc_dir()]
398398
ldargs.extend(f"-Wl,-rpath,{d}/lib" for d in get_petsc_dir())
399-
ldargs.extend(["-lpetsc", "-lm"])
399+
ldargs.extend(["-lpetsc", "-lm", "-lgsl", "-lgslcblas"])
400400
ldargs.extend(self.local_kernel.ldargs)
401401
return tuple(ldargs)
402402

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
11
from firedrake import *
2+
from scipy.special import hyp2f1 as sp_hyp2f1
23
import numpy as np
3-
import scipy
44
import pytest
55

66

7-
@pytest.mark.skipif(utils.complex_mode, reason="Complex bessel functions are not implemented.")
87
def test_hypergeometric_function():
9-
sp_hyp2f1 = scipy.special.hyp2f1
10-
a = 1
11-
b = 1
12-
c = 1
138
mesh = UnitDiskMesh(3)
149
V = FunctionSpace(mesh, "CG", 1)
15-
1610
x, y = SpatialCoordinate(mesh)
1711

18-
expr = x / 10
19-
uexact = hyp2f1(a, b, c, expr)
20-
assert np.allclose(assemble(Function(V).interpolate(uexact)).dat.data,
21-
sp_hyp2f1(a, b, c, assemble(Function(V).interpolate(expr)).dat.data))
22-
23-
expr = sqrt(x**2+y**2) / 10
24-
uexact = hyp2f1(a, b, c, expr)
25-
assert np.allclose(assemble(Function(V).interpolate(uexact)).dat.data,
26-
sp_hyp2f1(a, b, c, assemble(Function(V).interpolate(expr)).dat.data))
12+
expressions = [((1/3, 1/2, 1), Constant(0.9999) * x),
13+
((1/2, 1/2, 1), Constant(0.9999) * sqrt(x**2+y**2)),
14+
((-1/2, 1/2, 1), Constant(0.4999) * sqrt(x*x + y*y))]
2715

28-
expr = sqrt(x*x + y*y) / 10
29-
uexact = hyp2f1(a, b, c, expr)
30-
assert np.allclose(assemble(Function(V).interpolate(uexact)).dat.data,
31-
sp_hyp2f1(a, b, c, assemble(Function(V).interpolate(expr)).dat.data))
16+
for (a, b, c), expr in expressions:
17+
uexact = hyp2f1(a, b, c, expr)
18+
result = assemble(Function(V).interpolate(uexact)).dat.data
19+
expect = sp_hyp2f1(a, b, c, assemble(Function(V).interpolate(expr)).dat.data)
20+
assert np.allclose(result, expect)

0 commit comments

Comments
 (0)