Visualise Eigensolution using Netgen/NGSolve

More
6 years 9 months ago #390 by creativeworker
Hey community,

i'm quite new to NGSolve. I try to make some studies on acoustics in various geometries (2d and 3d).
After assembling the matrices (for Helmholtz PDE) i can solve the eigenproblem.

Next i want to visualise the different modes on the geometry. Can you give me a hint to the right approach or some examples? Perhaps it's very easy and i just didn't get the concept right.

Thanks for your support!
More
6 years 9 months ago #394 by christopher
Hi,
if you use the Arnoldi solver of NGSolve then you store the modes in the multidim gridfunction:
Code:
from netgen.geom2d import unit_square from ngsolve import * mesh = Mesh(unit_square.GenerateMesh(maxh=0.3)) fes = H1(mesh,order=5,dirichlet="bottom|left|right|top",complex=True) u,v = fes.TrialFunction(), fes.TestFunction() a = BilinearForm(fes) a += SymbolicBFI(grad(u)*grad(v)) b = BilinearForm(fes) b += SymbolicBFI(u*v) a.Assemble() b.Assemble() u = GridFunction(fes,multidim=50) vlam = ArnoldiSolver(a.mat,b.mat,fes.FreeDofs(),u.vecs,1) Draw(u)

Then you can visualize the different eigenfunctions with Visual -> and change multidim component

Best
Christopher
The following user(s) said Thank You: creativeworker
More
6 years 8 months ago #396 by creativeworker
Thank you very much! This really helped me out.
Time to create page: 0.124 seconds