- Thank you received: 1
FESpace.Element(BND) returns empty list for L^2 spaces
4 years 7 months ago #2625
by arieder
FESpace.Element(BND) returns empty list for L^2 spaces was created by arieder
Hi,
I'm trying to implement a DG-BEM coupling method. Therefore i would like to iterate over all the elements on the boundary to set up my coupling matrices. Everything works fine if I use a H^1 space, but if I use L^2 the resulting list is always empty.
To illustrate what I mean, I've attached a short sample script. If I change the space to H1 there, everthing works as expected.
I'm trying to implement a DG-BEM coupling method. Therefore i would like to iterate over all the elements on the boundary to set up my coupling matrices. Everything works fine if I use a H^1 space, but if I use L^2 the resulting list is always empty.
To illustrate what I mean, I've attached a short sample script. If I change the space to H1 there, everthing works as expected.
Attachments:
4 years 7 months ago #2626
by schruste
Replied by schruste on topic FESpace.Element(BND) returns empty list for L^2 spaces
Hi Alexander,
The space L2 does not provide Surface Elements. However, we have SurfaceL2 to obtain an L2 space that lives only on the surface.
Best,
Christoph
The space L2 does not provide Surface Elements. However, we have SurfaceL2 to obtain an L2 space that lives only on the surface.
Best,
Christoph
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
4 years 7 months ago #2629
by christopher
Replied by christopher on topic FESpace.Element(BND) returns empty list for L^2 spaces
Hi,
I guess what you need is the L2 function to be evaluated "at" the boundary. You can do that by iterating over mesh boundary elements and evaluating the L2 function (which will then be evaluated at the adjacent volume element) at your desired points.
I guess what you need is the L2 function to be evaluated "at" the boundary. You can do that by iterating over mesh boundary elements and evaluating the L2 function (which will then be evaluated at the adjacent volume element) at your desired points.
4 years 7 months ago #2630
by arieder
Replied by arieder on topic FESpace.Element(BND) returns empty list for L^2 spaces
Is there no way to get information on which degrees of freedom are attached to a surface element? Otherwise this sounds like a really unclean solution with lots of iterating to generate zeros.
To be more specific, what I would like to do is set up a sparse matrix representing the trace operator, but between the two libraries.
For the H1(and Maxwell) case, i iterate over the surface elements and for each element, i construct a local Dof map by evaluating the shapeset in the lagrange points (as Bem++ uses lagrange based elements). Then i use the local2global maps of both libraries to construct the global map.
While some solution based on a SurfaceL2 might be possible, I would like to keep my discretization of the surface values in the BEM++ format (because thats where the more involved computations are happening).
On a different, but related note: Is it possible in NGsolve to assemble a Mass matrix where test and trial functions are different FESpace? (one surface L^2 and one global L^2) BilinearForm seems to only allow test and trial space to be the same.
Thanks for your help,
Alex
To be more specific, what I would like to do is set up a sparse matrix representing the trace operator, but between the two libraries.
For the H1(and Maxwell) case, i iterate over the surface elements and for each element, i construct a local Dof map by evaluating the shapeset in the lagrange points (as Bem++ uses lagrange based elements). Then i use the local2global maps of both libraries to construct the global map.
While some solution based on a SurfaceL2 might be possible, I would like to keep my discretization of the surface values in the BEM++ format (because thats where the more involved computations are happening).
On a different, but related note: Is it possible in NGsolve to assemble a Mass matrix where test and trial functions are different FESpace? (one surface L^2 and one global L^2) BilinearForm seems to only allow test and trial space to be the same.
Thanks for your help,
Alex
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
4 years 7 months ago #2631
by christopher
Replied by christopher on topic FESpace.Element(BND) returns empty list for L^2 spaces
BilinearForms allow different test and trial spaces
but combining surface and volume L2 spaces does not make much sense, as they do not have any elements in common (surface l2 is only defined on surface elements, L2 only defined on volume elements)
You can project the function to the surface L2 by using:
and then do the dof mapping using the l2 surface elements.
Code:
a = BilinearForm(trialspace=fes1, testspace=fes2)
You can project the function to the surface L2 by using:
Code:
sgf.Set(BoundaryFromVolumeCF(gf), BND)
4 years 7 months ago #2633
by schruste
Replied by schruste on topic FESpace.Element(BND) returns empty list for L^2 spaces
Hi again,
Perhaps the following works for you?
1. Use a FacetFESpace, restrict it to the boundary.
fesf = FacetFESpace(mesh,order=..., dirichlet=".*")
fesf = Compress(fes,active_dofs=~fesf.FreeDofs())
2. Then, form a mixed BLF with fesf and the volume L2 space fesl2:
m = Bilinearform(trialspace=fesf, testspace=fesl2)
m += fesf.TrialFunction() * fesl2.TestFunction() * ds(skeleton=True,BND)
Best,
Christoph
Perhaps the following works for you?
1. Use a FacetFESpace, restrict it to the boundary.
fesf = FacetFESpace(mesh,order=..., dirichlet=".*")
fesf = Compress(fes,active_dofs=~fesf.FreeDofs())
2. Then, form a mixed BLF with fesf and the volume L2 space fesl2:
m = Bilinearform(trialspace=fesf, testspace=fesl2)
m += fesf.TrialFunction() * fesl2.TestFunction() * ds(skeleton=True,BND)
Best,
Christoph
Time to create page: 0.105 seconds