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/