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.

Visualise Eigensolution using Netgen/NGSolve

More
6 years 1 month 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 1 month 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 1 month ago #396 by creativeworker
Thank you very much! This really helped me out.
Time to create page: 0.102 seconds