- Thank you received: 0
Integrating over specific faces and edges
2 years 8 months ago - 2 years 8 months ago #4237
by alex.v
Integrating over specific faces and edges was created by alex.v
I have a 2d gridfunction and I would like to integrate it over specific element faces and edges. I have the edges and faces as objects from mesh.faces and mesh.edges.
I am not sure how to proceed.
I am not sure how to proceed.
Last edit: 2 years 8 months ago by alex.v.
- mneunteufel
- Offline
- Premium Member
Less
More
- Thank you received: 59
2 years 8 months ago - 2 years 8 months ago #4267
by mneunteufel
Replied by mneunteufel on topic Integrating over specific faces and edges
Hi Alex,
if you have defined the regions as specific materials/boundaries you can integrate over them by e.g. Integrate(gf*dx(“materialname”),mesh), Integrate(gf*ds(“boundaryname”),mesh).
Another possibility is to create an order zero L2 or FacetFESpace GridFunction and set the faces/edges of interest to 1. This GridFunction is then used as indicator function. E.g.
gfl = GridFunction(L2(mesh,order=0))
gfl.vec[...]=1
Integrate(gf*gfl, mesh)
Best,
Michael
if you have defined the regions as specific materials/boundaries you can integrate over them by e.g. Integrate(gf*dx(“materialname”),mesh), Integrate(gf*ds(“boundaryname”),mesh).
Another possibility is to create an order zero L2 or FacetFESpace GridFunction and set the faces/edges of interest to 1. This GridFunction is then used as indicator function. E.g.
gfl = GridFunction(L2(mesh,order=0))
gfl.vec[...]=1
Integrate(gf*gfl, mesh)
Best,
Michael
Last edit: 2 years 8 months ago by mneunteufel.
Time to create page: 0.116 seconds