jit::JitTest Class Reference

List of all members.

Public Member Functions

def __init__
def setUp
def tearDown
def testSetup
def testJitMass
def testJitWeightedMass
def testJitSource
def testJitSplitTerms

Public Attributes

 options


Detailed Description

Definition at line 38 of file jit.py.


Member Function Documentation

def jit::JitTest::__init__ (   self,
  args,
  kwargs 
)

Definition at line 39 of file jit.py.

00039                                        :
00040         unittest.TestCase.__init__(self, *args, **kwargs)
00041         shutil.rmtree(_done_test_temp_dir, ignore_errors=True)
00042         os.mkdir(_done_test_temp_dir)
00043     
    def setUp(self):

def jit::JitTest::setUp (   self  ) 

Definition at line 44 of file jit.py.

00044                    :
00045         #print "Running sfc jit test in testdir"
00046         #print "Imported SyFi from location", SyFi.__file__
00047         #print "Imported sfc  from location", sfc.__file__
00048         self.options = sfc.default_options()
00049         self.options.compilation.cache_dir = os.path.abspath("test_cache")
00050         self.options.code.integral.integration_method = "quadrature"
00051         # Generate code in a clean directory:
00052         shutil.rmtree(_test_temp_dir, ignore_errors=True)
00053         os.mkdir(_test_temp_dir)
00054         os.chdir(_test_temp_dir)
00055     
    def tearDown(self):

def jit::JitTest::tearDown (   self  ) 

Definition at line 56 of file jit.py.

00056                       :
00057         dirs = glob.glob("*")
00058         os.chdir("..")
00059         for d in dirs:
00060             os.rename(os.path.join(_test_temp_dir, d), os.path.join(_done_test_temp_dir, d))
00061     
    def testSetup(self):

def jit::JitTest::testJitMass (   self  ) 

Definition at line 65 of file jit.py.

00065                          :
00066         "Test the mass matrix."
00067         element = FiniteElement("CG", "triangle", 1)
00068         v = TestFunction(element)
00069         u = TrialFunction(element)
00070         a = u*v*dx
00071         form = sfc.jit(a, options = self.options)
00072         self.assertTrue(form.rank() == 2)
00073         self.assertTrue(form.num_coefficients() == 0)
00074         self.assertTrue(num_integrals(form) == (1,0,0))
00075         A = assemble_on_cell(form, "triangle", coeffs=[5.43])
00076         # TODO: Assert correct result
00077     
    def testJitWeightedMass(self):

def jit::JitTest::testJitSource (   self  ) 

Definition at line 92 of file jit.py.

00092                            :
00093         "Test the source vector."
00094         element = FiniteElement("CG", "triangle", 1)
00095         v = TestFunction(element)
00096         f = Function(element)
00097         a = f*v*dx
00098         form = sfc.jit(a, options = self.options)
00099         self.assertTrue(form.rank() == 1)
00100         self.assertTrue(form.num_coefficients() == 1)
00101         self.assertTrue(num_integrals(form) == (1,0,0))
00102         A = assemble_on_cell(form, "triangle", coeffs=[3.14])
00103         # TODO: Assert correct result
00104     
    def testJitSplitTerms(self):

def jit::JitTest::testJitSplitTerms (   self  ) 

Definition at line 105 of file jit.py.

00105                                :
00106         "Test a form split over two foo*dx terms, using the mass matrix."
00107         element = FiniteElement("CG", "triangle", 1)
00108         v = TestFunction(element)
00109         u = TrialFunction(element)
00110         f = Function(element)
00111         a = u*v*dx + f*u*v*dx
00112         form = sfc.jit(a, options = self.options)
00113         self.assertTrue(form.rank() == 2)
00114         self.assertTrue(form.num_coefficients() == 1)
00115         self.assertTrue(num_integrals(form) == (1,0,0))
00116         A = assemble_on_cell(form, "triangle", coeffs=[4.43])
00117         # TODO: Assert correct result
00118 
00119 
tests = [JitTest]

def jit::JitTest::testJitWeightedMass (   self  ) 

Definition at line 78 of file jit.py.

00078                                  :
00079         "Test the weighted mass matrix."
00080         element = FiniteElement("CG", "triangle", 1)
00081         v = TestFunction(element)
00082         u = TrialFunction(element)
00083         f = Function(element)
00084         a = f*u*v*dx
00085         form = sfc.jit(a, options = self.options)
00086         self.assertTrue(form.rank() == 2)
00087         self.assertTrue(form.num_coefficients() == 1)
00088         self.assertTrue(num_integrals(form) == (1,0,0))
00089         A = assemble_on_cell(form, "triangle", coeffs=[5.43])
00090         # TODO: Assert correct result
00091 
    def testJitSource(self):

def jit::JitTest::testSetup (   self  ) 

Definition at line 62 of file jit.py.

00062                        :
00063         pass
00064     
    def testJitMass(self):


Member Data Documentation

Definition at line 48 of file jit.py.


The documentation for this class was generated from the following file:

Generated on Mon Aug 31 16:17:05 2009 for SyFi by  doxygen 1.5.9