[firedrake] Prescribe pressure at a corner for Darcy's equation
Lawrence Mitchell
lawrence.mitchell at imperial.ac.uk
Tue Feb 7 09:03:00 GMT 2017
Hi Justin,
> On 7 Feb 2017, at 04:13, Justin Chang <jychang48 at gmail.com> wrote:
>
> Sorry, forgot to mention this:
>
> For ID 5, I want this applied to all faces that have y == Ly and (150 <= x <= 450)
>
> For ID 6, I want this applied to only the top left and top right most element faces (i.e., the horizontal and vertical components).
>
> On Mon, Feb 6, 2017 at 10:11 PM, Justin Chang <jychang48 at gmail.com> wrote:
> Lawrence,
>
> I tried following the syntax of what I see in utility_meshes.py but for some reason it seems the boundary_ids are not registering
I had a look, I think the problem is like so. Our code assumes that each mesh facet only ever has one boundary id. So what's happening is that the plex is correctly getting the new boundary ids, but when we look them up the ones that were already created appear "first" and override your new ones.
What you can do is clear all the boundary id labels and then explicitly put in all the IDs you want (in such a way that they don't overlap).
I think the code could probably support multiple labels on each facet, but would need to unpick it a bit: can you raise an issue?
> Attached is my code. Run it as:
>
> python 2D_Darcy_Homo_Iso.py 600 150 0
>
> Thanks,
> Justin
>
> PS - In the attached code, I could also pass in either -flow_ksp_monitor or -tran_ksp_monitor to view the ksp monitors for the Darcy or transport equations, respectively, but if I try to pass in both, i get this error:
This one is easy (!). We inspect the PETSc options database like so:
from petsc4py import PETSc
PETSc.Options(prefix).getAll()
If I have options -foo_bar -baz_bar
then if I do:
PETSc.Options("foo_").getAll()
=> {"bar": "-baz_bar"}
I will push a fix for this one.
Lawrence
More information about the firedrake
mailing list