26 lines
429 B
Python
26 lines
429 B
Python
# coding: utf-8
|
|
import numpy as np
|
|
|
|
'''
|
|
y1 = np.arange(0, 30e-3, 1.5e-3)
|
|
y2 = np.arange(30e-3, 41e-3, 2.5e-3)
|
|
'''
|
|
y1 = []
|
|
y2 = np.linspace(0, 40.0e-3, 81)
|
|
|
|
y = np.hstack((y1, y2))
|
|
|
|
form = '''
|
|
boxToCell
|
|
{{
|
|
box ({0} -1 -1) ({1} 1 1);
|
|
|
|
fieldValues
|
|
(
|
|
volScalarFieldValue cellDist {2}
|
|
);
|
|
}}
|
|
'''
|
|
|
|
for i, yi in enumerate(y[:-1]):
|
|
print form.format(yi, y[i+1], i)
|