try: py = int(sys.argv[4]) except: py = 2 geo = circle(radius=1. / sqrt(2), n=[nx, ny], p=[px, py]) #----------------------------------- # ... u_exact = lambda x, y: [-2.0 * log(x**2 + y**2 + 0.5)] # ... with context(): PDE = poisson_picard( geometry=geo \ , AllDirichlet=AllDirichlet ) # ... print(">>> Solving using Picard <<<") # ... if PDE.Dirichlet: U = PDE.unknown_dirichlet else: U = PDE.unknown # ... from pigasus.fem.utils import function # ... def func(U, x, y): _U = U.evaluate()
except: px = 2 try: py = int(sys.argv[4]) except: py = 2 geo = circle (radius = 1. / sqrt (2), n =[nx, ny], p =[px, py]) #----------------------------------- # ... u_exact = lambda x,y : [- 2.0 * log ( x**2 + y**2 + 0.5 )] # ... PDE = poisson_picard( geometry=geo \ , AllDirichlet=AllDirichlet ) # ... print ">>> Solving using Picard <<<" # ... if PDE.Dirichlet: U = PDE.unknown_dirichlet else: U = PDE.unknown # ... from pigasus.fem.utils import function # ... def func(U,x,y): _U = U.evaluate() return [4. * exp (_U)]
#----------------------------------- #----------------------------------- # ... # values of u at the boundary # ... bc_dirichlet = {} for data in geo.external_faces: patch_id = int(data[0]) face_id = int(data[1]) bc_dirichlet[patch_id, face_id] = u_exact # ... #----------------------------------- with context(): PDE = poisson_picard( geometry=geo \ , bc_dirichlet=bc_dirichlet) # ... print(">>> Solving using Picard <<<") # ... if PDE.Dirichlet: U = PDE.unknown_dirichlet else: U = PDE.unknown V = PDE.space V.nderiv_pts = 2 PDE.W.nderiv_pts = 2 # ...
#----------------------------------- geo = square (n =[nx, ny], p =[px, py]) #----------------------------------- #----------------------------------- # ... # values of u at the boundary # ... bc_dirichlet={} for data in geo.external_faces: patch_id = int(data[0]) ; face_id = int(data[1]) bc_dirichlet[patch_id,face_id] = u_exact # ... #----------------------------------- PDE = poisson_picard( geometry=geo \ , bc_dirichlet=bc_dirichlet) # ... print ">>> Solving using Picard <<<" # ... if PDE.Dirichlet: U = PDE.unknown_dirichlet else: U = PDE.unknown V = PDE.space V.nderiv_pts = 2 PDE.W.nderiv_pts = 2 # ... def func(U,x,y):