You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, everyone! When I run the example of Stokes equations with PressureFixBC, it always give some warnings. I want to cancel it, could you give some comments.
/home/firedrake/firedrake/src/firedrake/firedrake/bcs.py:277: DeprecationWarning: Selecting a bcs method is deprecated. Only topological association is supported
warnings.warn("Selecting a bcs method is deprecated. Only topological association is supported",
# We fix the pressure at one vertex on every level
class PressureFixBC(DirichletBC):
def __init__(self, V, val, subdomain, method="topological"):
super().__init__(V, val, subdomain, method)
sec = V.dm.getDefaultSection()
dm = V.mesh().topology_dm
coordsSection = dm.getCoordinateSection()
dim = dm.getCoordinateDim()
coordsVec = dm.getCoordinatesLocal()
(vStart, vEnd) = dm.getDepthStratum(0)
indices = []
for pt in range(vStart, vEnd):
x = dm.getVecClosure(coordsSection, coordsVec, pt).reshape(-1, dim).mean(axis=0)
if x.dot(x) == 0.0: # fix [0, 0] in original mesh coordinates (bottom left corner)
if dm.getLabelValue("pyop2_ghost", pt) == -1:
indices = [pt]
break
nodes = []
for i in indices:
if sec.getDof(i) > 0:
nodes.append(sec.getOffset(i))
if V.mesh().comm.rank == 0:
nodes = [0]
else:
nodes = []
self.nodes = numpy.asarray(nodes, dtype=IntType)
if len(self.nodes) > 0:
print("Fixing nodes %s" % self.nodes)
import sys
sys.stdout.flush()
The text was updated successfully, but these errors were encountered:
I'm not sure what example you're looking at - I can't find the PressureFixBC method in the current repo, and only in one example discussed in Issue #1923 . So, this may not be a Firedrake issue directly, if it isn't in code that we maintain and provide. If you did find this code somewhere in the repository, please do provide a pointer so that we can fix it!
In any case, the root of your problem is that in #2007 , we removed support for the method argument for DirichletBC that this subclasses. Just remove method="topological" from the arguments in the def init(... line above, and method from the arguments in the super().init line, and you shouldn't get the warning anymore.
Hello, everyone! When I run the example of Stokes equations with PressureFixBC, it always give some warnings. I want to cancel it, could you give some comments.
The text was updated successfully, but these errors were encountered: