本文整理汇总了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)
示例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)
示例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)
示例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)
示例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)
示例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
)
示例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)
示例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)