当前位置: 首页>>代码示例>>Python>>正文


Python CuIBMSimulation.plot_contour方法代码示例

本文整理汇总了Python中snake.cuibm.simulation.CuIBMSimulation.plot_contour方法的典型用法代码示例。如果您正苦于以下问题:Python CuIBMSimulation.plot_contour方法的具体用法?Python CuIBMSimulation.plot_contour怎么用?Python CuIBMSimulation.plot_contour使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在snake.cuibm.simulation.CuIBMSimulation的用法示例。


在下文中一共展示了CuIBMSimulation.plot_contour方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: CuIBMSimulation

# 需要导入模块: from snake.cuibm.simulation import CuIBMSimulation [as 别名]
# 或者: from snake.cuibm.simulation.CuIBMSimulation import plot_contour [as 别名]
"""
Computes, plots, and saves the 2D vorticity field from a cuIBM simulation at
saved time-steps.
"""

from snake.cuibm.simulation import CuIBMSimulation


simulation = CuIBMSimulation()
simulation.read_grid()

for time_step in simulation.get_time_steps():
  simulation.read_fields('vorticity', time_step)
  simulation.plot_contour('vorticity',
                          field_range=(-5.0, 5.0, 101),
                          view=(-1.0, -5.0, 15.0, 5.0),
                          cmap='viridis',
                          style='seaborn-dark',
                          width=8.0)
开发者ID:barbagroup,项目名称:cuIBM,代码行数:21,代码来源:plotVorticity.py

示例2: CuIBMSimulation

# 需要导入模块: from snake.cuibm.simulation import CuIBMSimulation [as 别名]
# 或者: from snake.cuibm.simulation.CuIBMSimulation import plot_contour [as 别名]
"""
Computes, plots, and saves the 2D vorticity field from a cuIBM simulation at
saved time-steps.
"""

from snake.cuibm.simulation import CuIBMSimulation


simulation = CuIBMSimulation()
simulation.read_grid()

for time_step in simulation.get_time_steps():
  simulation.read_fields('vorticity', time_step)
  simulation.plot_contour('vorticity',
                          field_range=(-5.0, 5.0, 40),
                          filled_contour=False,
                          view=(-1.0, -3.0, 15.0, 3.0),
                          colorbar=False,
                          cmap=None,
                          colors='k',
                          style='seaborn-dark',
                          width=8.0)
开发者ID:barbagroup,项目名称:cuIBM,代码行数:24,代码来源:plotVorticity.py

示例3: CuIBMSimulation

# 需要导入模块: from snake.cuibm.simulation import CuIBMSimulation [as 别名]
# 或者: from snake.cuibm.simulation.CuIBMSimulation import plot_contour [as 别名]
"""
Computes, plots, and saves the 2D vorticity field from a cuIBM simulation at
saved time-steps.
"""

from snake.cuibm.simulation import CuIBMSimulation


simulation = CuIBMSimulation()
simulation.read_grid()

for time_step in simulation.get_time_steps():
  simulation.read_fields('vorticity', time_step)
  simulation.plot_contour('vorticity',
                          field_range=(-5.0, 5.0, 101),
                          filled_contour=True,
                          view=[-2.0, -5.0, 15.0, 5.0],
                          style='mesnardo',
                          width=8.0)
开发者ID:barbagroup,项目名称:cuIBM,代码行数:21,代码来源:plotVorticity.py

示例4: Mesnard

# 需要导入模块: from snake.cuibm.simulation import CuIBMSimulation [as 别名]
# 或者: from snake.cuibm.simulation.CuIBMSimulation import plot_contour [as 别名]
# file: plotVorticity.py
# author: Olivier Mesnard ([email protected])
# description: Plots the 2D vorticity field.
# Run this script from the simulation directory.


from snake.cuibm.simulation import CuIBMSimulation


simulation = CuIBMSimulation()
simulation.read_grid()

for time_step in simulation.get_time_steps():
  simulation.read_fields('vorticity', time_step)
  simulation.plot_contour('vorticity',
                          field_range=[-5.0, 5.0, 101],
                          filled_contour=True,
                          view=[-2.0, -5.0, 15.0, 5.0],
                          width=8.0)
开发者ID:Haider-BA,项目名称:snake,代码行数:21,代码来源:plotVorticity.py

示例5: CuIBMSimulation

# 需要导入模块: from snake.cuibm.simulation import CuIBMSimulation [as 别名]
# 或者: from snake.cuibm.simulation.CuIBMSimulation import plot_contour [as 别名]
"""
Computes, plots, and saves the 2D vorticity field from a cuIBM simulation at
saved time-steps.
"""

from snake.cuibm.simulation import CuIBMSimulation


simulation = CuIBMSimulation()
simulation.read_grid()

for time_step in simulation.get_time_steps():
  simulation.read_fields('vorticity', time_step)
  simulation.plot_contour('vorticity',
                          field_range=(-32.0, 32.0, 32),
                          filled_contour=False,
                          view=(-0.6, -0.8, 1.6, 0.8),
                          colorbar=False,
                          cmap=None,
                          colors='k',
                          style='seaborn-dark',
                          width=8.0)
开发者ID:barbagroup,项目名称:cuIBM,代码行数:24,代码来源:plotVorticity.py

示例6: Mesnard

# 需要导入模块: from snake.cuibm.simulation import CuIBMSimulation [as 别名]
# 或者: from snake.cuibm.simulation.CuIBMSimulation import plot_contour [as 别名]
# file: plotVorticitySnake.py
# author: Olivier Mesnard ([email protected])
# description: Plots the 2D vorticity field near the snake.
# Run this script from the simulation directory.


from snake.cuibm.simulation import CuIBMSimulation


simulation = CuIBMSimulation()
simulation.read_grid()

for time_step in simulation.get_time_steps():
    simulation.read_fields("vorticity", time_step)
    simulation.plot_contour(
        "vorticity", field_range=[-5.0, 5.0, 101], filled_contour=True, view=[-0.75, -1.0, 1.50, 1.0], width=8.0
    )
开发者ID:mesnardo,项目名称:snake,代码行数:19,代码来源:plotVorticitySnake.py

示例7: CuIBMSimulation

# 需要导入模块: from snake.cuibm.simulation import CuIBMSimulation [as 别名]
# 或者: from snake.cuibm.simulation.CuIBMSimulation import plot_contour [as 别名]
"""
Plots the vorticity field of a 2D cuIBM simulation.
"""

import os
from snake.cuibm.simulation import CuIBMSimulation
from snake.body import Body


simulation = CuIBMSimulation()
simulation.read_grid()

for time_step in simulation.get_time_steps():
  all_bodies = Body(file_path=os.path.join('{:0>7}'.format(time_step),
                                           'bodies'))
  n_total = all_bodies.x.size
  bodies = [Body(), Body()]
  bodies[0].x = all_bodies.x[:n_total // 2]
  bodies[0].y = all_bodies.y[:n_total // 2]
  bodies[1].x = all_bodies.x[n_total // 2:]
  bodies[1].y = all_bodies.y[n_total // 2:]
  simulation.read_fields('vorticity', time_step)
  simulation.plot_contour('vorticity',
                          field_range=(-2.0, 2.0, 40),
                          filled_contour=True,
                          bodies=bodies,
                          view=(-3.0, -5.0, 15.0, 5.0),
                          style='seaborn-dark',
                          cmap='viridis',
                          width=8.0)
开发者ID:barbagroup,项目名称:cuIBM,代码行数:32,代码来源:plotVorticity.py

示例8: CuIBMSimulation

# 需要导入模块: from snake.cuibm.simulation import CuIBMSimulation [as 别名]
# 或者: from snake.cuibm.simulation.CuIBMSimulation import plot_contour [as 别名]
"""
Plots the vorticity field of a 2D cuIBM simulation.
"""

import os
from snake.cuibm.simulation import CuIBMSimulation
from snake.body import Body


simulation = CuIBMSimulation()
simulation.read_grid()

for time_step in simulation.get_time_steps():
  body = Body(file_path=os.path.join('{:0>7}'.format(time_step), 'bodies'))
  simulation.read_fields('vorticity', time_step)
  simulation.plot_contour('vorticity',
                          field_range=(-10.0, 10.0, 10),
                          filled_contour=False,
                          bodies=body,
                          view=(-1.0, -1.0, 3.5, 1.0),
                          style='seaborn-dark',
                          colors='grey',
                          colorbar=False,
                          width=8.0)
开发者ID:barbagroup,项目名称:cuIBM,代码行数:26,代码来源:plotVorticity.py


注:本文中的snake.cuibm.simulation.CuIBMSimulation.plot_contour方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。