~ubuntu-branches/ubuntu/raring/ffc/raring

« back to all changes in this revision

Viewing changes to ffc/quadrature/quadraturetransformerbase.py

  • Committer: Package Import Robot
  • Author(s): Johannes Ring
  • Date: 2011-10-26 17:52:20 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20111026175220-ope1dzqv4jn2b8pq
Tags: 1.0-beta2-1
* New upstream release. This release includes some performance
  improvements for evaluating basis functions. It also adds support
  for Bessel functions and error functions.
* debian/control: Bump version numbers for python-ufc, python-fiat,
  python-instant, and python-ufl.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
# along with FFC. If not, see <http://www.gnu.org/licenses/>.
19
19
#
20
20
# First added:  2009-10-13
21
 
# Last changed: 2011-06-28
 
21
# Last changed: 2011-10-20
22
22
 
23
23
# Python modules.
24
24
from itertools import izip
80
80
        self.restriction = None
81
81
        self.coordinate = None
82
82
        self.conditionals = {}
 
83
        self.additional_includes_set = set()
83
84
 
84
85
        # Stacks.
85
86
        self._derivatives = []
237
238
        print "\n\nVisiting MathFunction:", repr(o)
238
239
        error("This MathFunction is not supported (yet).")
239
240
 
 
241
    def bessel_function(self, o):
 
242
        print "\n\nVisiting BesselFunction:", repr(o)
 
243
        error("BesselFunction is not implemented (yet).")
 
244
 
240
245
    def restricted(self, o):
241
246
        print "\n\nVisiting Restricted:", repr(o)
242
247
        error("This type of Restricted is not supported (only positive and negative are currently supported).")
591
596
        #print("\n\nVisiting Atan: " + repr(o) + "with operands: " + "\n".join(map(repr,operands)))
592
597
        return self._math_function(operands, format["atan"])
593
598
 
 
599
    def erf(self, o, *operands):
 
600
        #print("\n\nVisiting Erf: " + repr(o) + "with operands: " + "\n".join(map(repr,operands)))
 
601
        return self._math_function(operands, format["erf"])
 
602
 
 
603
    def bessel_i(self, o, *operands):
 
604
        #print("\n\nVisiting Bessel_I: " + repr(o) + "with operands: " + "\n".join(map(repr,operands)))
 
605
#        self.additional_includes_set.add("#include <tr1/cmath>")
 
606
        self.additional_includes_set.add("#include <boost/math/tr1.hpp>")
 
607
        return self._bessel_function(operands, format["bessel_i"])
 
608
 
 
609
    def bessel_j(self, o, *operands):
 
610
        #print("\n\nVisiting Bessel_J: " + repr(o) + "with operands: " + "\n".join(map(repr,operands)))
 
611
#        self.additional_includes_set.add("#include <tr1/cmath>")
 
612
        self.additional_includes_set.add("#include <boost/math/tr1.hpp>")
 
613
        return self._bessel_function(operands, format["bessel_j"])
 
614
 
 
615
    def bessel_k(self, o, *operands):
 
616
        #print("\n\nVisiting Bessel_K: " + repr(o) + "with operands: " + "\n".join(map(repr,operands)))
 
617
#        self.additional_includes_set.add("#include <tr1/cmath>")
 
618
        self.additional_includes_set.add("#include <boost/math/tr1.hpp>")
 
619
        return self._bessel_function(operands, format["bessel_k"])
 
620
 
 
621
    def bessel_y(self, o, *operands):
 
622
        #print("\n\nVisiting Bessel_Y: " + repr(o) + "with operands: " + "\n".join(map(repr,operands)))
 
623
#        self.additional_includes_set.add("#include <tr1/cmath>")
 
624
        self.additional_includes_set.add("#include <boost/math/tr1.hpp>")
 
625
        return self._bessel_function(operands, format["bessel_y"])
 
626
 
594
627
    # -------------------------------------------------------------------------
595
628
    # PositiveRestricted and NegativeRestricted (restriction.py).
596
629
    # -------------------------------------------------------------------------