Skip to content

Commit

Permalink
Don't use SymPDE's obsolete classes Scalar/VectorField (#9)
Browse files Browse the repository at this point in the history
* Do not import obsolete classes ScalarField and VectorField from SymPDE - they were not used anyway;
* Update version.
  • Loading branch information
yguclu authored Feb 5, 2021
1 parent ded25c7 commit f77d9e2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
16 changes: 5 additions & 11 deletions gelato/expr.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
# coding: utf-8

from sympy import Function
from sympy.core import Add, Mul
from sympy import I as sympy_I
from sympy import Symbol
from sympy.core.containers import Tuple
from sympy import S
from sympy.core import Expr, Basic, AtomicExpr
from sympy.core import Expr, Basic
from sympy import simplify, expand
from sympy import Matrix, ImmutableDenseMatrix
from sympy.physics.quantum import TensorProduct

from sympde.expr import LinearForm, BilinearForm
from sympde.expr import BilinearForm
from sympde.expr import TensorExpr

from sympde.expr import Mass as MassForm
Expand All @@ -22,12 +18,12 @@
from sympde.expr import Basic1dForm
from sympde.topology import SymbolicExpr
from sympde.calculus.matrices import SymbolicDeterminant
from sympde.topology.space import ScalarField, VectorField

from .glt import (BasicGlt, Mass, Stiffness,
Advection, Bilaplacian)
from .glt import (BasicGlt, Mass, Stiffness, Advection, Bilaplacian)

__all__ = ('gelatize', 'GltExpr')

#==============================================================================
def gelatize(a, degrees=None, n_elements=None, evaluate=False, mapping=None,
human=False, expand=False):

Expand Down Expand Up @@ -130,8 +126,6 @@ def gelatize(a, degrees=None, n_elements=None, evaluate=False, mapping=None,

return expr



#==============================================================================
# TODO add __call__
class GltExpr(Expr):
Expand Down
10 changes: 5 additions & 5 deletions gelato/tests/test_glt_symbol.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

from sympy.core import Symbol
from sympy import cos, sin
from sympy import cos, sin, Rational as frac

from gelato import Mass, Stiffness, Advection, Bilaplacian

Expand All @@ -15,22 +15,22 @@ def test_glt_symbol_1():
three = 3

# ... linear splines
assert( Mass(one, t) == cos(t)/3 + 2/3 )
assert( Mass(one, t) == cos(t)/3 + frac(2, 3) )
assert( Stiffness(one, t) == -2*cos(t) + 2 )
assert( Advection(one, t) == -sin(t) )
# assert( Bilaplacian(one, t) == 0 )
# ...

# ... quadratic splines
assert( Mass(two, t) == 13*cos(t)/30 + cos(2*t)/60 + 11/20 )
assert( Mass(two, t) == 13*cos(t)/30 + cos(2*t)/60 + frac(11, 20) )
assert( Stiffness(two, t) == -2*cos(t)/3 - cos(2*t)/3 + 1 )
assert( Advection(two, t) == -5*sin(t)/6 - sin(2*t)/12 )
# assert( Bilaplacian(two, t) == -8*cos(t) + 2*cos(2*t) + 6 )
# ...

# ... cubic splines
assert( Mass(three, t) == 397*cos(t)/840 + cos(2*t)/21 + cos(3*t)/2520 + 151/315 )
assert( Stiffness(three, t) == -cos(t)/4 - 2*cos(2*t)/5 - cos(3*t)/60 + 2/3)
assert( Mass(three, t) == 397*cos(t)/840 + cos(2*t)/21 + cos(3*t)/2520 + frac(151, 315) )
assert( Stiffness(three, t) == -cos(t)/4 - 2*cos(2*t)/5 - cos(3*t)/60 + frac(2, 3))
assert( Advection(three, t) == -49*sin(t)/72 - 7*sin(2*t)/45 - sin(3*t)/360 )
# assert( Bilaplacian(three, t) == -3*cos(t) + cos(3*t)/3 + 8/3 )
# ...
Expand Down
2 changes: 1 addition & 1 deletion gelato/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.10.0'
__version__ = '0.11.0'

0 comments on commit f77d9e2

Please sign in to comment.