本文整理汇总了Python中Solver.Solver.solve_bloch方法的典型用法代码示例。如果您正苦于以下问题:Python Solver.solve_bloch方法的具体用法?Python Solver.solve_bloch怎么用?Python Solver.solve_bloch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Solver.Solver
的用法示例。
在下文中一共展示了Solver.solve_bloch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write_solver_input
# 需要导入模块: from Solver import Solver [as 别名]
# 或者: from Solver.Solver import solve_bloch [as 别名]
from Solver import Solver
from write import write_vtk, write_solver_input
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, 11, 11, 5], bc_filename = filename +'.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_mesh, energy = my_solver.solve_bloch(simu, eq)
from numpy import zeros, sqrt, around
nodes = zeros((k_mesh[0].shape[0],3))
nodes[:,0:2] = k_mesh[0]
triangles = k_mesh[1]
for i in range(energy.shape[1]):
energy[:,i] = sqrt(around(energy[:,i],10))
write_vtk('Bloch_periodic_r-a_1-02_two_reg'+str(i)+'.vtk','this shit','POLYDATA', nodes,\
triangles, ['SCALARS', ['sol'], [energy[:,i]]])
# from inform import inform
# inform('Iḿ done runing')