本文整理汇总了Python中esys.escript.linearPDEs.LinearPDE.resetRightHandSideCoefficients方法的典型用法代码示例。如果您正苦于以下问题:Python LinearPDE.resetRightHandSideCoefficients方法的具体用法?Python LinearPDE.resetRightHandSideCoefficients怎么用?Python LinearPDE.resetRightHandSideCoefficients使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类esys.escript.linearPDEs.LinearPDE
的用法示例。
在下文中一共展示了LinearPDE.resetRightHandSideCoefficients方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUpPDE
# 需要导入模块: from esys.escript.linearPDEs import LinearPDE [as 别名]
# 或者: from esys.escript.linearPDEs.LinearPDE import resetRightHandSideCoefficients [as 别名]
def setUpPDE(self):
"""
Return the underlying PDE.
:rtype: `LinearPDE`
"""
if self.__pde is None:
dom=self.__domain
x = dom.getX()
DIM=dom.getDim()
q=whereZero(x[DIM-1]-inf(x[DIM-1]))
for i in range(DIM-1):
xi=x[i]
q+=whereZero(xi-inf(xi))+whereZero(xi-sup(xi))
pde=LinearPDE(dom, numEquations=1)
pde.getSolverOptions().setTolerance(self.__tol)
pde.setSymmetryOn()
A=pde.createCoefficient('A')
X=pde.createCoefficient('X')
pde.setValue(A=A, X=X, q=q)
else:
pde=self.__pde
pde.resetRightHandSideCoefficients()
return pde
示例2: setUpPDE
# 需要导入模块: from esys.escript.linearPDEs import LinearPDE [as 别名]
# 或者: from esys.escript.linearPDEs.LinearPDE import resetRightHandSideCoefficients [as 别名]
def setUpPDE(self):
"""
Creates and returns the underlying PDE.
:rtype: `LinearPDE`
"""
if self.__pde is None:
if not HAVE_DIRECT:
raise ValueError("Either this build of escript or the current MPI configuration does not support direct solvers.")
pde=LinearPDE(self.__domain, numEquations=2)
D=pde.createCoefficient('D')
A=pde.createCoefficient('A')
A[0,:,0,:]=kronecker(self.__domain.getDim())
A[1,:,1,:]=kronecker(self.__domain.getDim())
pde.setValue(A=A, D=D)
if self.__fixAtBottom:
DIM=self.__domain.getDim()
z = self.__domain.getX()[DIM-1]
pde.setValue(q=whereZero(z-self.__BX[DIM-1][0])*[1,1])
pde.getSolverOptions().setSolverMethod(SolverOptions.DIRECT)
pde.getSolverOptions().setTolerance(self.__tol)
pde.setSymmetryOff()
else:
pde=self.__pde
pde.resetRightHandSideCoefficients()
return pde