SyFi
0.3
|
Inherits TempDirTestBase.
Public Member Functions | |
def | __init__ |
def | setUp |
def | tearDown |
def | testSetup |
def | testJitVolumeInterval |
def | testJitVolumeTriangle |
def | xtestJitVolumeTetrahedron |
def | testJitConstantInterval |
def | testJitConstantTriangle |
def | xtestJitConstantTetrahedron |
Private Member Functions | |
def | _testJitVolume |
def | _testJitVolumeQuadrilateral |
def | _testJitVolumeHexahedron |
def | _testJitConstant |
def | _testJitConstantQuadrilateral |
def | _testJitConstantHexahedron |
Definition at line 31 of file test_jit_volumes.py.
def test_sfc.test_jit_volumes.VolumeTest.__init__ | ( | self, | |
args, | |||
kwargs | |||
) |
Definition at line 32 of file test_jit_volumes.py.
def test_sfc.test_jit_volumes.VolumeTest._testJitConstant | ( | self, | |
polygon, | |||
degree | |||
) | [private] |
Test that the integral of a constant coefficient over a unit cell mesh equals the constant times the volume of the unit cell.
Definition at line 73 of file test_jit_volumes.py.
References test_sfc::cell_assembly.assemble_on_cell(), test_sfc::cell_assembly.num_integrals(), and test_sfc.test_tempdir_base.TempDirTestBase.options.
Referenced by test_sfc.test_jit_volumes.VolumeTest._testJitConstantHexahedron(), test_sfc.test_jit_volumes.VolumeTest._testJitConstantQuadrilateral(), test_sfc.test_jit_volumes.VolumeTest.testJitConstantInterval(), test_sfc.test_jit_volumes.VolumeTest.testJitConstantTriangle(), and test_sfc.test_jit_volumes.VolumeTest.xtestJitConstantTetrahedron().
00073 00074 def _testJitConstant(self, polygon, degree): 00075 """Test that the integral of a constant coefficient over a unit 00076 cell mesh equals the constant times the volume of the unit cell.""" 00077 element = FiniteElement("CG", polygon, degree) 00078 f = Coefficient(element) 00079 a = f*dx 00080 form, module, formdata, prefix = sfc.jit(a, parameters = self.options) 00081 00082 self.assertTrue(form.rank() == 0) 00083 self.assertTrue(form.num_coefficients() == 1) 00084 self.assertTrue(num_integrals(form) == (1,0,0)) 00085 const = 1.23 00086 A = assemble_on_cell(form, polygon, coeffs=[const]) 00087 self.assertAlmostEqual(A, const*cell2volume[polygon])
def test_sfc.test_jit_volumes.VolumeTest._testJitConstantHexahedron | ( | self | ) | [private] |
Definition at line 108 of file test_jit_volumes.py.
References test_sfc.test_jit_volumes.VolumeTest._testJitConstant().
00108 00109 def _testJitConstantHexahedron(self): # Not supported by dolfin yet 00110 polygon = "hexahedron" 00111 self._testJitConstant(polygon, 1) 00112 self._testJitConstant(polygon, 2)
def test_sfc.test_jit_volumes.VolumeTest._testJitConstantQuadrilateral | ( | self | ) | [private] |
Definition at line 103 of file test_jit_volumes.py.
References test_sfc.test_jit_volumes.VolumeTest._testJitConstant().
00103 00104 def _testJitConstantQuadrilateral(self): # Not supported by dolfin yet 00105 polygon = "quadrilateral" 00106 self._testJitConstant(polygon, 1) 00107 self._testJitConstant(polygon, 2)
def test_sfc.test_jit_volumes.VolumeTest._testJitVolume | ( | self, | |
polygon | |||
) | [private] |
Test that the integral of 1.0 over a unit cell equals the length/area/volume of the unit cell.
Definition at line 45 of file test_jit_volumes.py.
Referenced by test_sfc.test_jit_volumes.VolumeTest._testJitVolumeHexahedron(), test_sfc.test_jit_volumes.VolumeTest._testJitVolumeQuadrilateral(), test_sfc.test_jit_volumes.VolumeTest.testJitVolumeInterval(), test_sfc.test_jit_volumes.VolumeTest.testJitVolumeTriangle(), and test_sfc.test_jit_volumes.VolumeTest.xtestJitVolumeTetrahedron().
00045 00046 def _testJitVolume(self, polygon): 00047 """Test that the integral of 1.0 over a unit cell 00048 equals the length/area/volume of the unit cell.""" 00049 c = Constant(polygon) 00050 a = c*dx 00051 form, module, formdata, prefix = sfc.jit(a, parameters = self.options) 00052 00053 self.assertTrue(form.rank() == 0) 00054 self.assertTrue(form.num_coefficients() == 1) 00055 self.assertTrue(num_integrals(form) == (1,0,0)) 00056 A = assemble_on_cell(form, polygon, coeffs=[1.0]) 00057 self.assertAlmostEqual(A, cell2volume[polygon])
def test_sfc.test_jit_volumes.VolumeTest._testJitVolumeHexahedron | ( | self | ) | [private] |
Definition at line 70 of file test_jit_volumes.py.
References test_sfc.test_jit_volumes.VolumeTest._testJitVolume().
00070 00071 def _testJitVolumeHexahedron(self): # Not supported by dolfin yet 00072 self._testJitVolume("hexahedron")
def test_sfc.test_jit_volumes.VolumeTest._testJitVolumeQuadrilateral | ( | self | ) | [private] |
Definition at line 67 of file test_jit_volumes.py.
References test_sfc.test_jit_volumes.VolumeTest._testJitVolume().
00067 00068 def _testJitVolumeQuadrilateral(self): # Not supported by dolfin yet 00069 self._testJitVolume("quadrilateral")
def test_sfc.test_jit_volumes.VolumeTest.setUp | ( | self | ) |
Definition at line 35 of file test_jit_volumes.py.
def test_sfc.test_jit_volumes.VolumeTest.tearDown | ( | self | ) |
Definition at line 38 of file test_jit_volumes.py.
Definition at line 88 of file test_jit_volumes.py.
References test_sfc.test_jit_volumes.VolumeTest._testJitConstant().
00088 00089 def testJitConstantInterval(self): 00090 polygon = "interval" 00091 self._testJitConstant(polygon, 1) 00092 self._testJitConstant(polygon, 2)
Definition at line 93 of file test_jit_volumes.py.
References test_sfc.test_jit_volumes.VolumeTest._testJitConstant().
00093 00094 def testJitConstantTriangle(self): 00095 polygon = "triangle" 00096 self._testJitConstant(polygon, 1) 00097 self._testJitConstant(polygon, 2)
Definition at line 58 of file test_jit_volumes.py.
References test_sfc.test_jit_volumes.VolumeTest._testJitVolume().
00058 00059 def testJitVolumeInterval(self): 00060 self._testJitVolume("interval")
Definition at line 61 of file test_jit_volumes.py.
References test_sfc.test_jit_volumes.VolumeTest._testJitVolume().
00061 00062 def testJitVolumeTriangle(self): 00063 self._testJitVolume("triangle")
def test_sfc.test_jit_volumes.VolumeTest.testSetup | ( | self | ) |
Definition at line 41 of file test_jit_volumes.py.
Definition at line 98 of file test_jit_volumes.py.
References test_sfc.test_jit_volumes.VolumeTest._testJitConstant().
00098 00099 def xtestJitConstantTetrahedron(self): # FIXME: Failing! 00100 polygon = "tetrahedron" 00101 self._testJitConstant(polygon, 1) 00102 self._testJitConstant(polygon, 2)
Definition at line 64 of file test_jit_volumes.py.
References test_sfc.test_jit_volumes.VolumeTest._testJitVolume().
00064 00065 def xtestJitVolumeTetrahedron(self): # FIXME: Failing! 00066 self._testJitVolume("tetrahedron")