Hi all,
I'm having a bit of trouble doing boundary forcing with a GeneralFunction. I do the usual things: create a function that takes the generic *args and calls a function (bump, in this case, which just is a function in C^\inf_0(R)). I create a GeneralFunction on that, and make it parseable. Finally, I call it on the Boundary, but of course, this gives
dedalus.tools.exceptions.SymbolicParsingError: LHS is constant but RHS is nonconstant along L axis.
It's fairly obvious why that's happening: the GeneralFuction is returning a 3D data cube, but of course a boundary condition should be a 2D array at the boundary of the third dimension. How can I work around this? I've seen some references to boundary forcing on this list, so I'm sure it's possible.
Sample code (not all of it) here:
# Boundary condtion forcing
def BoundaryFunc(*args):
V = args[0].data
K = args[1].data
hw = args[2].value
xmax = args[3].value
ampl = args[4].value
return ampl*bump(V,hw,xmax)*bump(K,hw,xmax)
def B(*args, domain=domain,F=BoundaryFunc):
return de.operators.GeneralFunction(domain,layout='g',func=F,args=args)
de.operators.parseables['BF'] = B
[stuff]
FP.add_bc("left(f) = 0")
FP.add_bc("right(f) = BF(V,K,hw,xmax,ampl)")
Any help would be most appreciated! After I get this working, I'll generate a simple example of boundary forcing for the docs.
thanks,
Jeff