Calculating an integral over the boundary

80 views
Skip to first unread message

Kyle Schwiebert

unread,
Sep 27, 2021, 3:43:35 PM9/27/21
to deal.II User Group
I'm trying to replicate the simulation described in this paper. How could I compute the integrals in equations 4 and 5? I'm sure it's covered in the tutorial, but I couldn't find it after searching in several different steps in the tutorial. Could someone please point me to an example in the tutorials where this type of computation with a computed solution? The only examples I could find seem to only discuss computing L2, or H1 errors with a special function that avoid manually computing the integral. Is the easiest thing to do as is done in the matrix assembly?

Finally, how would one initialize the vectors v_l and v_d? Could it be done easily with an appropriate AffineConstraints object?

Thanks in advance to anyone who can help.

Wolfgang Bangerth

unread,
Sep 27, 2021, 6:24:57 PM9/27/21
to dea...@googlegroups.com
On 9/27/21 1:43 PM, Kyle Schwiebert wrote:
> I'm trying to replicate the simulation described in this paper
> <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwias-berlin.de%2Fpeople%2Fjohn%2FELECTRONIC_PAPERS%2FJoh04.IJNMF.pdf&data=04%7C01%7CWolfgang.Bangerth%40colostate.edu%7Ce97881b432a742a2b53008d981ef1a37%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637683686653742835%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=dDqBEMcMDHgOSMr4G2McKiWUmifKo5sSZpc3ReFfUQ8%3D&reserved=0>.
> How could I compute the integrals in equations 4 and 5? I'm sure it's
> covered in the tutorial, but I couldn't find it after searching in
> several different steps in the tutorial. Could someone please point me
> to an example in the tutorials where this type of computation with a
> computed solution? The only examples I could find seem to only discuss
> computing L2, or H1 errors with a special function that avoid manually
> computing the integral. Is the easiest thing to do as is done in the
> matrix assembly?

Kyle,
in essence you just have to loop over all cells and integrate up the
quantity you have in the formula for a given choice of v_l and v_d. This
works in a similar way to this example here where we compute the angular
momentum:

https://github.com/geodynamics/aspect/blob/master/source/simulator/nullspace.cc#L357-L459


> Finally, how would one initialize the vectors v_l and v_d? Could it be
> done easily with an appropriate AffineConstraints object?

As long as you satisfy the boundary conditions, it's your choice. So you
could, for example, start with a zero vector, evaluate boundary values
as indicated on the boundary in question, and then just go through the
constraints you get as a result and apply them to your zero vector (via
AffineConstraints::distribute(), applied to the zero vector). That would
probably be what I'd do.

Or you just take v_l/v_d as functions that are analytically described
(i.e., that are not finite element functions to begin with).

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Kyle Schwiebert

unread,
Sep 28, 2021, 1:04:30 PM9/28/21
to deal.II User Group
Thank you for the help. I think that has the pretty much sorted out for me. One additional question: On this test problem people also like to know the pressure drop across the obstacle. This basically involves calculating the pressure at two points in the mesh and finding their difference. I see in step 13 this can be done by hoping that the points you need to evaluate are vertices of the mesh. Is there a more general solution--or a way to ensure a certain point is in the mesh? FYI I'm using the very helpful builtin meshing scheme for this problem: GridGenerator::channel_with_cylinder()

Thanks,
Kyle

Daniel Arndt

unread,
Sep 28, 2021, 2:13:20 PM9/28/21
to dea...@googlegroups.com

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/161d3d21-836f-43bf-b751-6da7de2a451dn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages