Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

BlockMatrix Direct Solver

  • Krenn
  • New Member
  • New Member
More
1 year 2 weeks ago #4761 by Krenn
Dear NGSolve,

Is there a possibility to use a direct solver for a BlockMatrix?
I read through the Documentation and the NGS build-in solvers but I didn't figure out how to use/adapt things.
Here is a small example
Code:
from netgen.geom2d import unit_square from ngsolve import * mesh = Mesh(unit_square.GenerateMesh(maxh=0.2)) V = H1(mesh, order= 1) u,v=V.TnT() a=BilinearForm(V,symmetric=True) a+=grad(u)*grad(v)*dx a.Assemble() f=LinearForm(V) f.Assemble() f+=v*dx N=NumberSpace(mesh) p,q=N.TnT() b=BilinearForm(trialspace=V,testspace=N) b+=u*q*dx b.Assemble() g=LinearForm(N) g.Assemble() K=BlockMatrix( [[a.mat,b.mat.T],[b.mat,None]] ) rhs=BlockVector( [f.vec,g.vec] ) gfu=GridFunction(V) gfN=GridFunction(N) sol=BlockVector( [gfu.vec,gfN.vec] ) sol.data=K.Inverse(inverse="pardiso")*rhs #???

Best regards,
Nepomuk
Time to create page: 0.120 seconds