/[escript]/trunk/escript/test/python/ArchiveTests.py
ViewVC logotype

Annotation of /trunk/escript/test/python/ArchiveTests.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 158 - (hide annotations)
Thu Nov 10 03:51:03 2005 UTC (14 years, 11 months ago) by matt
File MIME type: text/x-python
File size: 1610 byte(s)
Added finley and bruce rectangle and brick Data archive tests.


1 matt 158 import sys
2     import unittest
3     import os
4    
5     from esys.escript import *
6     from esys import bruce
7     from esys import finley
8    
9     import numarray
10     from numarray import array,Float64,ones,greater
11    
12     """
13    
14     Miscellaneous escript/Data tests.
15    
16     Version $Id: MiscTests.py 153 2005-10-25 01:51:20Z jgs $
17    
18     """
19    
20     #
21     # ==============================================================
22    
23     print "\n\n"
24    
25     mshList=(bruce.Rectangle(),
26     bruce.Brick(),
27     finley.Rectangle(2, 5, 1, l0 = 7.0, l1 = 11.0),
28     finley.Brick(2, 5, 7, 1, l0 = 11.0, l1 = 13.0, l2 = 17.0),
29     finley.Rectangle(2, 5, 2, l0 = 7.0, l1 = 11.0),
30     finley.Brick(2, 5, 7, 2, l0 = 11.0, l1 = 13.0, l2 = 17.0))
31    
32     for msh in mshList:
33    
34     print "\nDataExpanded:"
35     archDataE=Data([[1.00001],[2.00001]],Function(msh),True)
36     archDataE.archiveData("data-archiveE")
37     exDataE=Data()
38     exDataE.extractData("data-archiveE",Function(msh))
39     exDataE.archiveData("data-archive2E");
40    
41     print "\nDataTagged:"
42     archDataT=Data([[1.00001],[2.00001]],Function(msh))
43     archDataT.tag()
44     archDataT.archiveData("data-archiveT")
45     exDataT=Data()
46     exDataT.extractData("data-archiveT",Function(msh))
47     exDataT.archiveData("data-archive2T");
48    
49     print "\nDataConstant:"
50     archDataC=Data([1.00001], Function(msh))
51     archDataC.archiveData("data-archiveC")
52     exDataC=Data()
53     exDataC.extractData("data-archiveC",Function(msh))
54     exDataC.archiveData("data-archive2C");
55    
56     print "\nDataEmpty:"
57     archDataM=Data()
58     archDataM.archiveData("data-archiveE")
59     exDataM=Data()
60     exDataM.extractData("data-archiveE",FunctionSpace())
61     exDataM.archiveData("data-archive2E")
62    
63     sys.exit(0)
64     # end

  ViewVC Help
Powered by ViewVC 1.1.26