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


Python Interpreter.build_EM_bloch_eq方法代码示例

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


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

示例1: write_solver_input

# 需要导入模块: from Interpreter import Interpreter [as 别名]
# 或者: from Interpreter.Interpreter import build_EM_bloch_eq [as 别名]
from Solver import Solver
from write import write_vtk, write_solver_input 
import matplotlib.pyplot as plt
from matplotlib import rc

filename = 'unit_cell_1-02_two_reg'
write_solver_input(filename +'.msh',dimension = 2, bc_type = 'Bloch', \
parameter = [], eq = 'EM', sol_type = 'Stationary',analysis_param \
= ['y', 'y', 15, 15, 21, 21, 5], bc_filename = filename +'_guide.bc')  

simu = Simulation()
simu.read_solver_input(filename +'.msh')
simu.domain.read_mesh_file(filename +'.msh',simu)

inter = Interpreter(vectorial = True)
eq = inter.build_EM_bloch_eq(simu)
my_solver = Solver()
k_coords, energy = my_solver.solve_bloch_Brillouin(simu, eq)

fig = plt.figure()
ax = fig.add_subplot(111)
plt.title("Dispersion relations for Square lattice")
k_div = k_coords.shape[0]/3

from numpy import sqrt, around
print max(energy[:,-1])
for i in range(energy.shape[1]):
    energy[:,i] = sqrt(around(energy[:,i],10))
    ax.plot(energy[:,i])
l = plt.axvline(x=k_div)
l = plt.axvline(x=k_div*2+1)
开发者ID:bebopsan,项目名称:peyeQM,代码行数:33,代码来源:Brillouin_test.py


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