- Thank you received: 0
Visualise Eigensolution using Netgen/NGSolve
- creativeworker
- Topic Author
- Offline
- Senior Member
Less
More
6 years 9 months ago #390
by creativeworker
Visualise Eigensolution using Netgen/NGSolve was created 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!
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!
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
6 years 9 months ago #394
by christopher
Replied by christopher on topic Visualise Eigensolution using Netgen/NGSolve
Hi,
if you use the Arnoldi solver of NGSolve then you store the modes in the multidim gridfunction:
Then you can visualize the different eigenfunctions with Visual -> and change multidim component
Best
Christopher
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
- creativeworker
- Topic Author
- Offline
- Senior Member
Less
More
- Thank you received: 0
6 years 8 months ago #396
by creativeworker
Replied by creativeworker on topic Visualise Eigensolution using Netgen/NGSolve
Thank you very much! This really helped me out.
Time to create page: 0.124 seconds