Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify all discrete FEM spaces when discretizing bilinear forms #397

Open
yguclu opened this issue Mar 27, 2024 · 0 comments
Open

Specify all discrete FEM spaces when discretizing bilinear forms #397

yguclu opened this issue Mar 27, 2024 · 0 comments
Assignees
Labels
FEM API Objects describing finite element concepts

Comments

@yguclu
Copy link
Member

yguclu commented Mar 27, 2024

domain = Square('Omega')
S = ScalarFunctionSpace('S', domain)
V = VectorFunctionSpace('V', domain)

u, v = elements_of(V, names='u, v')
w = element_of(S, name='h')

a = BilinearForm((u, v),  integral(domain, dot(curl(u), curl(v)) * w))
l = LinearForm(v, integral(domain, dot(f, v * w)))  # f is some analytical expression

l2norm = Norm(u - f, domain, kind='l2')

domain_h1 = discretize(domain, ncells=nc)
domain_h2 = discretize(domain, ncells=nc*2)

V_h1 = discretize(V, domain_h1, degree=p)
V_h2 = discretize(V, domain_h2, degree=p)

S_h1 = discretize(S, domain_h1, degree=p+1)
S_h2 = discretize(S, domain_h2, degree=p+1)

# Dictionary of spaces which maps SymPDE analytical spaces to Psydac discrete spaces
spaces_h1 = {V: V_h1, S: S_h1}

# Old vs. new interface
# a_h1 = discretize(a, domain_h1, (V_h1, V_h1), nquads=p+1)
a_h1 = discretize(a, domain_h1, spaces_h1, nquads=p+1) # Check: all spaces have the same domain

# l_h1 = discretize(a, domain_h1, V_h1, nquads=p+2)
l_h1 = discretize(l, domain_h1, spaces_h1, nquads=p+2)

# l2norm_h1 = discretize(l2norm, domain_h1, V_h1, nquads=p+1)  #-- but why?
l2norm_h1 = discretize(l2norm, domain_h1, spaces_h1, nquads=p+1)
@yguclu yguclu self-assigned this Apr 24, 2024
@yguclu yguclu added the FEM API Objects describing finite element concepts label May 22, 2024
@yguclu yguclu pinned this issue May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FEM API Objects describing finite element concepts
Projects
None yet
Development

No branches or pull requests

1 participant