1 |
ksteube |
1312 |
# |
2 |
|
|
# $Id$ |
3 |
|
|
# |
4 |
|
|
####################################################### |
5 |
|
|
# |
6 |
|
|
# Copyright 2003-2007 by ACceSS MNRF |
7 |
|
|
# Copyright 2007 by University of Queensland |
8 |
|
|
# |
9 |
|
|
# http://esscc.uq.edu.au |
10 |
|
|
# Primary Business: Queensland, Australia |
11 |
|
|
# Licensed under the Open Software License version 3.0 |
12 |
|
|
# http://www.opensource.org/licenses/osl-3.0.php |
13 |
|
|
# |
14 |
|
|
####################################################### |
15 |
|
|
# |
16 |
|
|
|
17 |
gross |
399 |
""" |
18 |
|
|
frame to ran a single test out of the Test_util suite |
19 |
|
|
""" |
20 |
|
|
|
21 |
elspeth |
617 |
__copyright__=""" Copyright (c) 2006 by ACcESS MNRF |
22 |
|
|
http://www.access.edu.au |
23 |
|
|
Primary Business: Queensland, Australia""" |
24 |
|
|
__license__="""Licensed under the Open Software License version 3.0 |
25 |
|
|
http://www.opensource.org/licenses/osl-3.0.php""" |
26 |
gross |
399 |
import unittest |
27 |
|
|
from esys.escript import * |
28 |
ksteube |
1312 |
from esys.escript.linearPDEs import LinearPDE |
29 |
|
|
from esys.finley import Rectangle, JoinFaces, Brick |
30 |
gross |
888 |
|
31 |
gross |
399 |
import numarray |
32 |
ksteube |
1312 |
FINLEY_TEST_MESH_PATH="data_meshes/" |
33 |
|
|
|
34 |
gross |
1375 |
NE=1 # number of element in each spatial direction (must be even) |
35 |
ksteube |
1312 |
|
36 |
|
|
class Test_X(unittest.TestCase): |
37 |
gross |
888 |
RES_TOL=1.e-7 |
38 |
|
|
ABS_TOL=1.e-8 |
39 |
gross |
1375 |
DEBUG=True |
40 |
gross |
888 |
def setUp(self): |
41 |
gross |
1375 |
self.domain = Rectangle(n0=NE,n1=NE,l0=0.5,order=1) |
42 |
gross |
857 |
|
43 |
gross |
1375 |
def test_setCoefficient_y_reduced_Scalar_using_y(self): |
44 |
|
|
d=self.domain.getDim() |
45 |
|
|
mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG) |
46 |
|
|
mypde.setValue(y=Scalar(1.,ReducedFunctionOnBoundary(self.domain))) |
47 |
|
|
coeff=mypde.getCoefficientOfGeneralPDE("y_reduced") |
48 |
|
|
self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1)) |
49 |
ksteube |
1312 |
|
50 |
gross |
399 |
if __name__ == '__main__': |
51 |
|
|
suite = unittest.TestSuite() |
52 |
ksteube |
1312 |
suite.addTest(unittest.makeSuite(Test_X)) |
53 |
gross |
399 |
s=unittest.TextTestRunner(verbosity=2).run(suite) |
54 |
gross |
699 |
|
55 |
|
|
|