⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demo.py

📁 利用C
💻 PY
字号:
"""This demo demonstrates how to move the vertex coordinatesof a boundary mesh and then updating the interior vertexcoordinates of the original mesh by suitably interpolatingthe vertex coordinates (useful for implementation of ALEmethods)."""__author__ = "Solveig Bruvoll (solveio@ifi.uio.no) and Anders Logg (logg@simula.no)"__date__ = "2008-05-02 -- 2008-05-28"__copyright__ = "Copyright (C) 2008 Solveig Bruvoll and Anders Logg"__license__  = "GNU LGPL Version 2.1"from dolfin import *# Create meshmesh = UnitSquare(20, 20)# Create boundary meshboundary = BoundaryMesh(mesh)# Move vertices in boundaryfor x in boundary.coordinates():    x[0] *= 3.0    x[1] += 0.1*sin(5.0*x[0])# Move meshmesh.move(boundary, hermite)# Plot meshplot(mesh, interactive=True)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -