/[escript]/trunk/finley/test/python/generate_dumps.py
ViewVC logotype

Diff of /trunk/finley/test/python/generate_dumps.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2188 by caltinay, Tue Oct 14 04:23:21 2008 UTC revision 2189 by caltinay, Tue Dec 23 04:24:37 2008 UTC
# Line 39  for root, dirs, files in os.walk(MESH_DI Line 39  for root, dirs, files in os.walk(MESH_DI
39     for name in files:     for name in files:
40         f=name.split(".")         f=name.split(".")
41         if f[0].startswith("mesh_") and f[-1]=="fly":         if f[0].startswith("mesh_") and f[-1]=="fly":
42            print "start reading ",os.path.join(MESH_DIRECTORY,name)            print "Reading "+os.path.join(MESH_DIRECTORY,name)
43            dom=ReadMesh(os.path.join(MESH_DIRECTORY,name),optimize=True)            dom=ReadMesh(os.path.join(MESH_DIRECTORY,name),optimize=True)
           dom.dump(os.path.join(MESH_DIRECTORY,f[0]+".nc"))  
44            for fs_name in ["ContinuousFunction", "Solution", "Function", "FunctionOnBoundary", "FunctionOnContactZero", "FunctionOnContactOne",            for fs_name in ["ContinuousFunction", "Solution", "Function", "FunctionOnBoundary", "FunctionOnContactZero", "FunctionOnContactOne",
45                            "ReducedContinuousFunction", "ReducedSolution", "ReducedFunction", "ReducedFunctionOnBoundary", "ReducedFunctionOnContactZero", "ReducedFunctionOnContactOne"]:                            "ReducedContinuousFunction", "ReducedSolution", "ReducedFunction", "ReducedFunctionOnBoundary", "ReducedFunctionOnContactZero", "ReducedFunctionOnContactOne"]:
46               if fs_name == "ContinuousFunction":               if fs_name == "ContinuousFunction":
# Line 68  for root, dirs, files in os.walk(MESH_DI Line 67  for root, dirs, files in os.walk(MESH_DI
67                   fs = ReducedFunctionOnContactZero(dom)                   fs = ReducedFunctionOnContactZero(dom)
68               if fs_name == "ReducedFunctionOnContactOne":               if fs_name == "ReducedFunctionOnContactOne":
69                   fs = ReducedFunctionOnContactOne(dom)                   fs = ReducedFunctionOnContactOne(dom)
70               for type in [ "s", "v", "t" ]:               x=fs.getX()
71                   data_file=os.path.join(MESH_DIRECTORY,f[0]+"_"+fs_name+"_"+type+".nc")               v=normalize(x)/clip(length(x-Vector(0.5,fs)), 1.e-8)
72                   x=fs.getX()               t=outer(v,x)
73                   print "\t data file ",data_file               s=length(x-Vector(0.5,fs))
74                   if type == "t":               datasetName=f[0]+"_"+fs_name
75                      n=normalize(x)/clip(length(x-Vector(0.5,fs)),1.e-8)               try:
76                      d=outer(n,x)                   saveESD(datasetName, MESH_DIRECTORY, s=s, v=v, t=t)
77                   elif type == "v":               except:
78                      d=normalize(x)/clip(length(x-Vector(0.5,fs)),1.e-8)                   print "Could not save ESD file "+datasetName
79                   else:  
                     d=length(x-Vector(0.5,fs))  
                  d.dump(data_file)  

Legend:
Removed from v.2188  
changed lines
  Added in v.2189

  ViewVC Help
Powered by ViewVC 1.1.26