[firedrake] Enforcing slip boundary condition strongly

Lawrence Mitchell lawrence.mitchell at imperial.ac.uk
Fri Jul 10 12:13:56 BST 2015


> On 10 Jul 2015, at 11:37, David Ham <David.Ham at imperial.ac.uk> wrote:
> 
> 
> That's quite yuck, however I can see the attraction as we're kind of sort of not mucking with the PyOP2 interface.
> 
> However the generated code is specific to BCs applied to a particular component, which doesn't satisfy Justin's (very standard) use case.
> 
> I think we need to encode *which* component we're changing into the map value. EG.
> 
> val = -val -(2**(30-i))
> 
> where i is the component. This can be decoded to zero the correct entry in a general purpose way. The downside is that we limit ourselves to about half a billion nodes per core. I think that's OK.

OK, so it may be that a node may have more than one component zeroed (e.g. at a corner).

So how about this:


Reserve top 2 (3?) bits to encode the component:

x = sum(2**idx for idx in indices)

val = val + (x << 29)

Convert to negative

val = -(val + 1)

In the generated code we can then unwind that and pull out the appropriate components.

This could work.  They're all pretty ugly solutions, tbf.

Lawrence
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mailman.ic.ac.uk/pipermail/firedrake/attachments/20150710/9d82def3/attachment.sig>


More information about the firedrake mailing list