Esempio n. 1
0
    ny = int(sys.argv[2])
except:
    ny = 31

try:
    px = int(sys.argv[3])
except:
    px = 2

try:
    py = int(sys.argv[4])
except:
    py = 2


geo   = domain(n=[nx,ny],p=[px,py])
# ...

# ...
try:
    bc_dirichlet
except NameError:
    bc_dirichlet = None
else:
    pass

try:
    bc_neumann
except NameError:
    bc_neumann = None
else:
Esempio n. 2
0
# ...

# ...
kx = 2. * pi

# ... exact solution
u = lambda x : [sin ( kx * x )]
# ... rhs
f = lambda x : [( kx**2) * sin ( kx * x )]

#-----------------------------------
nx      = 63
px      = 2
AllDirichlet = True

geo = domain(n=[nx],p=[px])
#-----------------------------------


# ...
try:
    bc_dirichlet
except NameError:
    bc_dirichlet = None
else:
    pass

try:
    bc_neumann
except NameError:
    bc_neumann = None
Esempio n. 3
0
#-----------------------------------
try:
    nx = int(sys.argv[1])
except:
    nx = 31

try:
    px = int(sys.argv[2])
except:
    px = 2
#-----------------------------------

# ...
from igakit.cad_geometry import line as domain
geo = domain(n=[nx],p=[px])
# ...

# ...
PDE = basicPDE(geometry=geo, testcase=tc)
# ...

# ...
PDE.assembly()
PDE.solve()

# ...
normU = PDE.norm(exact=u)
print "norm U   = ", normU
# ...
Esempio n. 4
0
            for li_j in range(0, li_ney):
                li_index = li_j * li_nex + li_i
                list_real_elts.append(li_index + 1)

        return np.array(list_real_elts)

    def get_real_elts_3D(self):
        # default
        print("boundary_grid : get_real_elts_3D : not done yet")

    def get_real_elts(self):
        if self.dim == 1:
            return self.get_real_elts_1D()
        if self.dim == 2:
            return self.get_real_elts_2D()
        if self.dim == 3:
            return self.get_real_elts_3D()
        if self.dim not in [1, 2, 3]:
            print("boundary_grid : get_real_elts : dimension not done yet")


if __name__ == "__main__":
    from igakit.cad_geometry import square as domain

    geo = domain(n=[3, 2], p=[1, 1])
    k = [2, 2]
    nrb = geo[0]
    grids_id = 0
    id = 0
    grid = boundary_grid(grids_id, id, nrb, k, faces=[0, 1])
Esempio n. 5
0
except:
    ny = 31

try:
    px = int(sys.argv[3])
except:
    px = 2

try:
    py = int(sys.argv[4])
except:
    py = 2

from igakit.cad_geometry import circle as domain
radius = 0.5
geo = domain(radius=radius, n=[nx, ny], p=[px, px])
#-----------------------------------

# ...
# exact solution
# ...
meanU = 0.60125862034
u = lambda x, y: [sin(1.0 - x**2 - y**2) - meanU / (pi * radius**2)]
# ...

# ...
# rhs
# ...
f = lambda x, y: [
    4.0 * (x**2 + y**2) * sin(1.0 - x**2 - y**2) + 4.0 * cos(1.0 - x**2 - y**2)
]
Esempio n. 6
0
            for li_j in range(0,li_ney):
                li_index = li_j * li_nex + li_i
                list_real_elts.append(li_index+1)

        return np.array(list_real_elts)


    def get_real_elts_3D(self):
        # default
        print("boundary_grid : get_real_elts_3D : not done yet")

    def get_real_elts(self):
        if self.dim==1:
            return self.get_real_elts_1D()
        if self.dim==2:
            return self.get_real_elts_2D()
        if self.dim==3:
            return self.get_real_elts_3D()
        if self.dim not in [1,2,3]:
            print("boundary_grid : get_real_elts : dimension not done yet")


if __name__ == '__main__':
    from igakit.cad_geometry import square as domain
    geo = domain(n=[3,2], p=[1,1])
    k = [2,2]
    nrb = geo[0]
    grids_id = 0
    id = 0
    grid = boundary_grid(grids_id, id, nrb, k, faces=[0,1])
Esempio n. 7
0
except:
    ny = 31

try:
    px = int(sys.argv[3])
except:
    px = 2

try:
    py = int(sys.argv[4])
except:
    py = 2

from igakit.cad_geometry import circle as domain
radius = 0.5
geo = domain(radius=radius,n=[nx,ny],p=[px,px])
#-----------------------------------

# ...
# exact solution
# ...
meanU = 0.60125862034
u = lambda x,y : [sin ( 1.0 - x**2 - y**2 )-meanU/(pi*radius**2)]
# ...

# ...
# rhs
# ...
f = lambda x,y : [4.0 * ( x**2 + y**2 ) * sin ( 1.0 - x**2 - y**2 ) + 4.0 * cos ( 1.0 - x**2 - y**2 ) ]
# ...