sfc_jit::test Namespace Reference


Classes

class  SFCJitTest

Functions

def num_integrals
def UnitCell
def assemble_on_cell
def test

Variables

dictionary cell2dim = { "interval": 1, "triangle": 2, "tetrahedron": 3, "quadrilateral": 2, "hexahedron": 3 }
dictionary cell2volume = { "interval": 1.0, "triangle": 0.5, "tetrahedron": 1.0/6.0, "quadrilateral": 1.0, "hexahedron": 1.0 }
string _test_temp_dir = "temp_dir"
string _done_test_temp_dir = "done_temp_dir"

Function Documentation

def sfc_jit::test::assemble_on_cell (   form,
  celltype,
  coeffs 
)

Definition at line 83 of file tests/sfc_jit/test.py.

00083                                             :
00084     "Assemble UFC form on a unit cell mesh and return the result as a float or numpy array."
00085     mesh = UnitCell(celltype)
00086     A = assemble(form, mesh, coeffs)
00087     if isinstance(A, float):
00088         return A
00089     return A.array()
00090 
_test_temp_dir = "temp_dir"

def sfc_jit::test::num_integrals (   form  ) 

Definition at line 34 of file tests/sfc_jit/test.py.

00034                        :
00035     return (form.num_cell_integrals(), form.num_exterior_facet_integrals(), form.num_interior_facet_integrals())
00036 
cell2dim = { "interval": 1, "triangle": 2, "tetrahedron": 3, "quadrilateral": 2, "hexahedron": 3 }

def sfc_jit::test::test (   verbosity = 0  ) 

Definition at line 219 of file tests/sfc_jit/test.py.

00219                      :
00220     shutil.rmtree(_done_test_temp_dir, ignore_errors=True)
00221     os.mkdir(_done_test_temp_dir)
00222     
00223     classes = [SFCJitTest]
00224     suites = [unittest.makeSuite(c) for c in classes]
00225     testsuites = unittest.TestSuite(suites)
00226     unittest.TextTestRunner(verbosity=verbosity).run(testsuites)
00227 
if __name__ == "__main__":

def sfc_jit::test::UnitCell (   celltype  ) 

Definition at line 42 of file tests/sfc_jit/test.py.

00042                       :
00043     tdim = cell2dim[celltype]
00044     gdim = tdim
00045     mesh = Mesh()
00046     editor = MeshEditor()
00047     editor.open(mesh, celltype, tdim, gdim)
00048     if celltype == "interval":
00049         vertices = [(0.0,),
00050                     (1.0,)]
00051     if celltype == "triangle":
00052         vertices = [(0.0, 0.0),
00053                     (1.0, 0.0),
00054                     (0.0, 1.0)]
00055     if celltype == "tetrahedron":
00056         vertices = [(0.0, 0.0, 0.0),
00057                     (1.0, 0.0, 0.0),
00058                     (0.0, 1.0, 0.0),
00059                     (0.0, 0.0, 1.0)]
00060     if celltype == "quadrilateral":
00061         vertices = [(0.0, 0.0),
00062                     (1.0, 0.0),
00063                     (1.0, 1.0),
00064                     (0.0, 1.0)]
00065     if celltype == "hexahedron":
00066         vertices = [(0.0, 0.0, 0.0),
00067                     (1.0, 0.0, 0.0),
00068                     (1.0, 1.0, 0.0),
00069                     (0.0, 1.0, 0.0),
00070                     (0.0, 0.0, 1.0),
00071                     (1.0, 0.0, 1.0),
00072                     (1.0, 1.0, 1.0),
00073                     (0.0, 1.0, 1.0)]
00074     editor.initVertices(len(vertices))
00075     editor.initCells(1)
00076     for i, p in enumerate(vertices):
00077         editor.addVertex(i, *p)
00078     editor.addCell(0, *range(len(vertices)))
00079     editor.close()
00080     return mesh
00081 
00082 
def assemble_on_cell(form, celltype, coeffs):


Variable Documentation

string sfc_jit::test::_done_test_temp_dir = "done_temp_dir"

Definition at line 92 of file tests/sfc_jit/test.py.

string sfc_jit::test::_test_temp_dir = "temp_dir"

Definition at line 91 of file tests/sfc_jit/test.py.

dictionary sfc_jit::test::cell2dim = { "interval": 1, "triangle": 2, "tetrahedron": 3, "quadrilateral": 2, "hexahedron": 3 }

Definition at line 37 of file tests/sfc_jit/test.py.

dictionary sfc_jit::test::cell2volume = { "interval": 1.0, "triangle": 0.5, "tetrahedron": 1.0/6.0, "quadrilateral": 1.0, "hexahedron": 1.0 }

Definition at line 39 of file tests/sfc_jit/test.py.


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