SyFi
0.3
|
Inherits TempDirTestBase.
Public Member Functions | |
def | __init__ |
def | setUp |
def | tearDown |
def | testSetup |
def | testScalarArgument |
def | testScalarCoefficient |
def | testVectorArgument |
def | testVectorCoefficient |
Definition at line 34 of file test_element_indexing.py.
def test_sfc.test_element_indexing.ElementIndexingTest.__init__ | ( | self, | |
args, | |||
kwargs | |||
) |
Definition at line 35 of file test_element_indexing.py.
Definition at line 38 of file test_element_indexing.py.
Definition at line 41 of file test_element_indexing.py.
Definition at line 48 of file test_element_indexing.py.
References test_sfc::cell_assembly.assemble_on_cell(), test_sfc::cell_assembly.num_integrals(), and test_sfc.test_tempdir_base.TempDirTestBase.options.
00048 00049 def testScalarArgument(self): 00050 polygon = "triangle" 00051 degree = 1 00052 element = FiniteElement("CG", polygon, degree) 00053 v = Argument(element) 00054 a = v*dx 00055 form, module, formdata, prefix = sfc.jit(a, parameters = self.options) 00056 # Test form properties 00057 self.assertTrue(form.rank() == 1) 00058 self.assertTrue(form.num_coefficients() == 0) 00059 self.assertTrue(num_integrals(form) == (1,0,0)) 00060 # Test assembled values 00061 A = assemble_on_cell(form, polygon, coeffs=[], elements=[element]) 00062 #self.assertAlmostEqual(A, cell2volume[polygon]) # TODO
Definition at line 63 of file test_element_indexing.py.
References test_sfc::cell_assembly.assemble_on_cell(), test_sfc::cell_assembly.num_integrals(), and test_sfc.test_tempdir_base.TempDirTestBase.options.
00063 00064 def testScalarCoefficient(self): 00065 polygon = "triangle" 00066 degree = 1 00067 element = FiniteElement("CG", polygon, degree) 00068 f = Coefficient(element) 00069 a = f*dx 00070 form, module, formdata, prefix = sfc.jit(a, parameters = self.options) 00071 # Test form properties 00072 self.assertTrue(form.rank() == 0) 00073 self.assertTrue(form.num_coefficients() == 1) 00074 self.assertTrue(num_integrals(form) == (1,0,0)) 00075 # Test assembled values 00076 const = 1.23 00077 A = assemble_on_cell(form, polygon, coeffs=[const]) 00078 self.assertAlmostEqual(A, const*cell2volume[polygon])
Definition at line 44 of file test_element_indexing.py.
Definition at line 79 of file test_element_indexing.py.
References test_sfc::cell_assembly.assemble_on_cell(), test_sfc::cell_assembly.num_integrals(), and test_sfc.test_tempdir_base.TempDirTestBase.options.
00079 00080 def testVectorArgument(self): 00081 polygon = "triangle" 00082 degree = 1 00083 element = VectorElement("CG", polygon, degree) 00084 v = Argument(element) 00085 a = v[0]*dx 00086 form, module, formdata, prefix = sfc.jit(a, parameters = self.options) 00087 # Test form properties 00088 self.assertTrue(form.rank() == 1) 00089 self.assertTrue(form.num_coefficients() == 0) 00090 self.assertTrue(num_integrals(form) == (1,0,0)) 00091 # Test assembled values 00092 A = assemble_on_cell(form, polygon, coeffs=[], elements=[element]) 00093 #self.assertAlmostEqual(A, cell2volume[polygon]) # TODO
Definition at line 94 of file test_element_indexing.py.
References test_sfc::cell_assembly.assemble_on_cell(), test_sfc::cell_assembly.num_integrals(), and test_sfc.test_tempdir_base.TempDirTestBase.options.
00094 00095 def testVectorCoefficient(self): 00096 polygon = "triangle" 00097 degree = 1 00098 element = VectorElement("CG", polygon, degree) 00099 f = Coefficient(element) 00100 a = (f[0] + f[1])*dx 00101 form, module, formdata, prefix = sfc.jit(a, parameters = self.options) 00102 # Test form properties 00103 self.assertTrue(form.rank() == 0) 00104 self.assertTrue(form.num_coefficients() == 1) 00105 self.assertTrue(num_integrals(form) == (1,0,0)) 00106 # Test assembled values 00107 const = (1.23, 4.56) 00108 A = assemble_on_cell(form, polygon, coeffs=[const]) 00109 self.assertAlmostEqual(A, (float(const[0]) + 00110 float(const[1]))*cell2volume[polygon])