Dear,
I’m having problems using the “bddc” preconditioner for a mesh with many elements. It works correctly with a smaller number of elements, but when increasing it returns the following error:
netgen.libngpy._meshing.NgException: bad array new length
in Assemble BilinearForm ‘biform_from_py’
part of the code:
h = 8
mesh = MakeStructured3DMesh(hexes=False, nx=h, ny=h, nz=h , mapping=lambda x, y, z: (0.3x, 0.3y, 0.3*z))
orderMesh = 1refine=3
for i in range(refine):
mesh.Refine(2)def dpole(loc,ng,n_pbo, pbo):
with TaskManager(): condense = False precond="bddc" # precond="local" fes = VectorH1(mesh, order=orderMesh, dirichlet="bottom", complex=True) u,v = fes.TnT() fes.ndof nz=fes.ndof a = BilinearForm(fes, eliminate_internal=condense) a += (InnerProduct(sigma(u), epsilon(v)) -rho * omega**2 * InnerProduct(u, v)) * dx # compute auxiliaries problems e11=[[1,0,0],[0,0,0],[0,0,0]] htabR11=[] for i in range(ng): resR11= GridFunction(fes) cx=loc[[i],[0]] cy=loc[[i],[1]] cz=loc[[i],[2]] gdirX, gdirY, gdirZ = gdirac(cx,cy,cz) sorX11 = ((e11[0][0]*gdirX+e11[0][1]*gdirY+e11[0][2]*gdirZ)) sorY11 = ((e11[1][0]*gdirX+e11[1][1]*gdirY+e11[1][2]*gdirZ)) sorZ11 = ((e11[2][0]*gdirX+e11[2][1]*gdirY+e11[2][2]*gdirZ)) force11 = CoefficientFunction((sorX11,sorY11,sorZ11)) del sorX11, sorY11, sorZ11 hR11 = LinearForm(force11*v*dx).Assemble() del force11 c = Preconditioner(a, precond) # Register c to a BEFORE assembly steps=[] a.Assemble() inv = CGSolver(a.mat, c.mat, maxsteps=1000) resR11.vec.data = inv * hR11.vec steps.append ( (fes.ndof, inv.GetSteps()) ) if fes.ndof < 15000: Redraw() htabR11.append(resR11.vec) del resR11
I’m lost in this error. Thanks for any help.
Best,
Andressa.