Skip to content

Modal Analisys #821

Answered by colinthart
WesleyFransin asked this question in Q&A
Discussion options

You must be logged in to vote

Here's a simple example that solves for eigenmodes of the Laplace equation on a rectangular domain with zero Dirichlet boundary conditions. Because we don't care about the right hand side vector and only need the assembled matrix, I set b(v) = 0.

using Gridap

N = 20
model = CartesianDiscreteModel((0, π, 0, π / 2), (N, N / 2))

reffe = ReferenceFE(lagrangian, Float64, 1)
V = FESpace(model, reffe; conformity=:H1, dirichlet_tags="boundary")
U = V

x = Triangulation(model)
dx = Measure(x, 2)

a(u, v) = ((u)  (v))dx
b(v) = 0.0

A = AffineFEOperator(a, b, U, V).op.matrix

using Arpack

nev = 10
λ, ϕ = eigs(A; nev=nev, which=:SM)

writevtk(
    x,
    "modes";
    cellfields=["mode$i" => FE…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by fverdugo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants