示例#1
0
文件: gen_f90.py 项目: dasmy/sdcquad
quads = {}
for q in [ 'G', 'GL', 'GR', 'CC' ]:
  quads[q] = {}

  # start with n0 nodes, and double the nodes maxsteps times
  for n0, maxsteps in [ (2, 5), (4, 2) ]:
    n = n0
    refine = [ 1 ]

    for i in range(maxsteps+1):
      quads[q][n] = {}

      for r in refine:
        print q, n, r
        try:
          (nodes, mask) = sdc.nodes(q, n)
          smat = sdc.smat(nodes[::r], mask[::r])
          qmat = sdc.qmat(nodes[::r], mask[::r])
          quads[q][n][r] = (nodes[::r], mask[::r], smat, qmat)
        except:
          print 'SKIPPED'
          pass

      if compute_refinements:
        refine.append(2**(i+1))

      n = 2*n-1


quads['U'] = {}
for n in range(2, 34):
示例#2
0
文件: mksmat.py 项目: dasmy/sdcquad
quads = {}
for q in [ 'G', 'GL', 'GR', 'CC' ]:
  quads[q] = {}

  # start with n0 nodes, and double the nodes maxsteps times
  for n0, maxsteps in [ (2, 4), (4, 2) ]:
    n = n0
    refine = [ 1 ]

    for i in range(maxsteps+1):
      quads[q][n] = {}

      for r in refine:
        print q, n, r
        try:
          (nodes, left) = sdc.nodes(q, n)
          smat = sdc.smat(nodes[::r], left)
          quads[q][n][r] = (nodes, smat)
        except:
          print 'SKIPPED'
          pass

      if compute_refinements:
        refine.append(2**(i+1))

      n = 2*n-1


##
## write fortran module 'quadrature.f90'
##