Example #1
0
def Corner3D():

    "Calculate the variances for the corner point generation"

    a = [ [ 2, 3.0/2 , 0.5 ],
          [ 2, 2.0   , 0.5 ],
          [ 2, 3.0/2 ,  1  ]]
    a=numarray.array(a)
    f=PlainKolmogorovSpec2D

    r=numarray.array( [ f(1), f(2.0**0.5), f(3.0**0.5)])
    print r
    return la.solve_linear_equations(a,r)
Example #2
0
def Corner3DV2():

    "Experimetal -- look for better initialisation"

    a = [ [ 2, 3.0/2 , 0.5 ],
          [ 2, 3.0   , 0.5 ],
          [ 0, 3.0/2 ,  1  ]]
    a=numarray.array(a)
    f=PlainKolmogorovSpec2D

    r=numarray.array( [ f(1), f(2.0**0.5), f(3.0**0.5)])
    print r
    return la.solve_linear_equations(a,r)
Example #3
0
def Corner3DV3():

    "Test only"

    # This corresponds to even term on edges and odd terms on face
    # diagonals and body diagonals.
    a = [ [ 1.0  ,     3.0/2 , 1.0/2 ],
          [ 3.0/2, 2.0   , 1.0/2 ],
          [ 3.0/2, 3.0/2 ,  1.0  ]]
    a=numarray.array(a)
    f=PlainKolmogorovSpec2D

    r=numarray.array( [ f(1), f(2.0**0.5), f(3.0**0.5)])
    print r
    return la.solve_linear_equations(a,r)
Example #4
0
    [ 1,0,0,1,1,0  ],
    [ 0,1,0,1,0,1  ],
    [ 0,0,1,0,1,1  ],
    [ 0,1,1,1,1,0  ],
    [ 1,0,1,1,0,1  ] ]

rhs = [9, 1 ,1 ,1 , 4 , 4]    

    

        

    
    

#import sys; sys.path.extend(["/import/appcs/bn204/p/bnprog-devel-main/"+x for x in ["bin", "lib"] ])
#import pybnlib

p2=numarray.array([3,-1, -1, -1])

# Symetric  cube:
p3=numarray.array([7,-1, -1, -1, -1 ,-1, -1 , -1])
a,r=GenLinSystem(p3)
x=la.solve_linear_equations(a,r)
r2=la.mlab.innerproduct(a,x)


#ps=vtk.vtkPoints()
#ps.InsertPoint(0,1.1,1,1)
#et=vtk.vtkEdgeTable()