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

« back to all changes in this revision

Viewing changes to test/unit/misc/test.py

  • Committer: Bazaar Package Importer
  • Author(s): Johannes Ring
  • Date: 2011-05-18 11:22:37 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20110518112237-22o6lwrno3uf0jyz
Tags: 0.9.10-1
* New upstream release. This release introduces some new features and
  some behind-the-scenes improvements. Special quadrature schemes for
  simplices have been added, which will lead to improved performance
  when using the quadrature representation for low-order forms.
* Move from python-central to dh_python2 (closes: #616807).
  - Remove python-central from Build-Depends.
  - Bump minimum required python-all package version to 2.6.6-3~.
  - Remove XB-Python-Version line.
  - Bump minimum required cdbs version to 0.4.90~.
  - Remove DEB_PYTHON_SYSTEM=pycentral from debian/rules.
  - Replace XS-Python-Version with X-Python-Version.
* debian/rules:
  - Avoid compressing files with .ufl extension.
  - Use DEB_COMPRESS_EXCLUDE_ALL instead of deprecated
    DEB_COMPRESS_EXCLUDE.
  - Include cdbs utils.mk rule for automated copyright checks.
* Remove old custom cdbs rules and licensecheck script for copyright
  check.
* Bump Standards-Version to 3.9.2 (no changes needed).
* debian/copyright:
  - Update for upstream license change to LGPLv3.
  - Switch to DEP-5 format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
"Unit tests for FFC"
2
2
 
3
 
__author__ = "Anders Logg (logg@simula.no)"
4
 
__date__ = "2007-02-06 -- 2009-02-24"
5
 
__copyright__ = "Copyright (C) 2007-2009 Anders Logg"
6
 
__license__  = "GNU GPL version 3 or any later version"
 
3
# Copyright (C) 2007-2009 Anders Logg
 
4
#
 
5
# This file is part of FFC.
 
6
#
 
7
# FFC is free software: you can redistribute it and/or modify
 
8
# it under the terms of the GNU Lesser General Public License as published by
 
9
# the Free Software Foundation, either version 3 of the License, or
 
10
# (at your option) any later version.
 
11
#
 
12
# FFC is distributed in the hope that it will be useful,
 
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
# GNU Lesser General Public License for more details.
 
16
#
 
17
# You should have received a copy of the GNU Lesser General Public License
 
18
# along with FFC.  If not, see <http://www.gnu.org/licenses/>.
 
19
#
 
20
# Modified by Marie E. Rognes, 2010
 
21
#
 
22
# First added:  2007-02-06
 
23
# Last changed: 2009-02-24
7
24
 
8
 
# Modified by Marie E. Rognes <meg@simula.no> 2010
9
25
import unittest
10
26
import sys
11
27
import numpy
12
28
import math
13
29
import os
 
30
import instant
14
31
from time import time
15
32
 
16
33
sys.path.append(os.path.join(os.pardir, os.pardir))
24
41
tetrahedron = [(0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1)]
25
42
num_points = 5
26
43
 
 
44
# FIXME: A hack that will make the test run on Ubuntu 4.11, which ships two
 
45
# FIXME: versions of SWIG. UFC automatically uses the swig2.0 binary, which
 
46
# FIXME: FFC also need to use
 
47
use_swig2_binary = instant.check_and_set_swig_binary("swig2.0")
 
48
 
27
49
def random_point(shape):
28
50
    w = numpy.random.random(len(shape))
29
51
    return sum([numpy.array(shape[i])*w[i] for i in range(len(shape))]) / sum(w)
260
282
        #options = {"log_level": 5}
261
283
        options = {"log_level": WARNING}
262
284
 
 
285
        # FIXME: A hack to get the unit test pass on Ubuntu 11.04, see above.
 
286
        if use_swig2_binary:
 
287
            options["swig_binary"] = "swig2.0"
 
288
 
263
289
        # Define two forms with the same signatures
264
290
        element = FiniteElement("Lagrange", "triangle", 1)
265
291
        v = TestFunction(element)