本文整理汇总了Python中fipy.variables.cellVariable.CellVariable.getArithmeticFaceValue方法的典型用法代码示例。如果您正苦于以下问题:Python CellVariable.getArithmeticFaceValue方法的具体用法?Python CellVariable.getArithmeticFaceValue怎么用?Python CellVariable.getArithmeticFaceValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fipy.variables.cellVariable.CellVariable
的用法示例。
在下文中一共展示了CellVariable.getArithmeticFaceValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Grid2D
# 需要导入模块: from fipy.variables.cellVariable import CellVariable [as 别名]
# 或者: from fipy.variables.cellVariable.CellVariable import getArithmeticFaceValue [as 别名]
asq = 1.0
epsilon = 1
diffusionCoeff = 1
from fipy.meshes.grid2D import Grid2D
mesh = Grid2D(dx, dy, nx, ny)
from fipy.variables.cellVariable import CellVariable
from fipy.tools.numerix import random
var = CellVariable(name = "phase field",
mesh = mesh,
value = random.random(nx * ny))
faceVar = var.getArithmeticFaceValue()
doubleWellDerivative = asq * ( 1 - 6 * faceVar * (1 - faceVar))
from fipy.terms.implicitDiffusionTerm import ImplicitDiffusionTerm
from fipy.terms.transientTerm import TransientTerm
diffTerm2 = ImplicitDiffusionTerm(coeff = (diffusionCoeff * doubleWellDerivative,))
diffTerm4 = ImplicitDiffusionTerm(coeff = (diffusionCoeff, -epsilon**2))
eqch = TransientTerm() - diffTerm2 - diffTerm4
from fipy.solvers.linearPCGSolver import LinearPCGSolver
from fipy.solvers.linearLUSolver import LinearLUSolver
##solver = LinearLUSolver(tolerance = 1e-15,steps = 1000)
solver = LinearPCGSolver(tolerance = 1e-15,steps = 1000)
from fipy.boundaryConditions.fixedValue import FixedValue
from fipy.boundaryConditions.fixedFlux import FixedFlux