SyFi
0.3
|
Public Member Functions | |
def | __init__ |
def | setUp |
def | tearDown |
def | testSetup |
def | testJitMass |
def | testJitWeightedMass |
def | testJitSource |
def | testJitSplitTerms |
Public Attributes | |
options |
def jit.JitTest.__init__ | ( | self, | |
args, | |||
kwargs | |||
) |
def jit.JitTest.setUp | ( | self | ) |
Definition at line 44 of file jit.py.
References jit.JitTest.options, and element_indexing.ElementIndexingTest.options.
00044 00045 def setUp(self): 00046 #print "Running sfc jit test in testdir" 00047 #print "Imported SyFi from location", SyFi.__file__ 00048 #print "Imported sfc from location", sfc.__file__ 00049 self.options = sfc.default_parameters() 00050 self.options.compilation.cache_dir = os.path.abspath("test_cache") 00051 self.options.code.integral.integration_method = "quadrature" 00052 # Generate code in a clean directory: 00053 shutil.rmtree(_test_temp_dir, ignore_errors=True) 00054 os.mkdir(_test_temp_dir) 00055 os.chdir(_test_temp_dir)
def jit.JitTest.tearDown | ( | self | ) |
def jit.JitTest.testJitMass | ( | self | ) |
Definition at line 66 of file jit.py.
00066 00067 def testJitMass(self): 00068 "Test the mass matrix." 00069 element = FiniteElement("CG", "triangle", 1) 00070 v = TestFunction(element) 00071 u = TrialFunction(element) 00072 a = u*v*dx 00073 form, module, formdata = sfc.jit(a, parameters = self.options) 00074 self.assertTrue(form.rank() == 2) 00075 self.assertTrue(form.num_coefficients() == 0) 00076 self.assertTrue(num_integrals(form) == (1,0,0)) 00077 A = assemble_on_cell(form, "triangle", coeffs=[5.43]) 00078 # TODO: Assert correct result
def jit.JitTest.testJitSource | ( | self | ) |
Definition at line 93 of file jit.py.
References cell_assembly.assemble_on_cell(), jit.num_integrals(), jit.JitTest.options, and element_indexing.ElementIndexingTest.options.
00093 00094 def testJitSource(self): 00095 "Test the source vector." 00096 element = FiniteElement("CG", "triangle", 1) 00097 v = TestFunction(element) 00098 f = Coefficient(element) 00099 a = f*v*dx 00100 form, module, formdata = sfc.jit(a, parameters = self.options) 00101 self.assertTrue(form.rank() == 1) 00102 self.assertTrue(form.num_coefficients() == 1) 00103 self.assertTrue(num_integrals(form) == (1,0,0)) 00104 A = assemble_on_cell(form, "triangle", coeffs=[3.14]) 00105 # TODO: Assert correct result
def jit.JitTest.testJitSplitTerms | ( | self | ) |
Definition at line 106 of file jit.py.
References cell_assembly.assemble_on_cell(), jit.num_integrals(), jit.JitTest.options, and element_indexing.ElementIndexingTest.options.
00106 00107 def testJitSplitTerms(self): 00108 "Test a form split over two foo*dx terms, using the mass matrix." 00109 element = FiniteElement("CG", "triangle", 1) 00110 v = TestFunction(element) 00111 u = TrialFunction(element) 00112 f = Coefficient(element) 00113 a = u*v*dx + f*u*v*dx 00114 form, module, formdata = sfc.jit(a, parameters = self.options) 00115 self.assertTrue(form.rank() == 2) 00116 self.assertTrue(form.num_coefficients() == 1) 00117 self.assertTrue(num_integrals(form) == (1,0,0)) 00118 A = assemble_on_cell(form, "triangle", coeffs=[4.43]) 00119 # TODO: Assert correct result 00120
def jit.JitTest.testJitWeightedMass | ( | self | ) |
Definition at line 79 of file jit.py.
References cell_assembly.assemble_on_cell(), jit.num_integrals(), jit.JitTest.options, and element_indexing.ElementIndexingTest.options.
00079 00080 def testJitWeightedMass(self): 00081 "Test the weighted mass matrix." 00082 element = FiniteElement("CG", "triangle", 1) 00083 v = TestFunction(element) 00084 u = TrialFunction(element) 00085 f = Coefficient(element) 00086 a = f*u*v*dx 00087 form, module, formdata = sfc.jit(a, parameters = self.options) 00088 self.assertTrue(form.rank() == 2) 00089 self.assertTrue(form.num_coefficients() == 1) 00090 self.assertTrue(num_integrals(form) == (1,0,0)) 00091 A = assemble_on_cell(form, "triangle", coeffs=[5.43]) 00092 # TODO: Assert correct result
def jit.JitTest.testSetup | ( | self | ) |
Definition at line 44 of file jit.py.
Referenced by volumes.VolumeTest::_testJitConstant(), quadjit.QuadJitTest::setUp(), volumes.VolumeTest::setUp(), jit.JitTest::setUp(), jit.JitTest::testJitMass(), jit.JitTest::testJitSource(), jit.JitTest::testJitSplitTerms(), and jit.JitTest::testJitWeightedMass().