#!/usr/bin/env python2
import util.FileProcessing as fp

input  = './Job-1.inp'
output = './cantileverbeam.dat'
fp.create_meshdata_from_abaqusfile(input, output)
Esempio n. 2
0
#!/usr/bin/env python2
import util.FileProcessing as fp
import numpy as np
inputpath = './Cook-Q4-Job-2.inp'
outputpath = './Cook_fe_fft_Q4.dat'
fp.create_meshdata_from_abaqusfile(inputpath, outputpath)

# Check input
try:
    inputfile = open(inputpath, 'r')
except IOError as e:
    print("Can't open file :" + e.filename)
    exit()
# Open output file to write
outputfile = open(outputpath, 'a+')
displacementNode = np.array(
    [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18])

tractionNode = np.array([
    540, 539, 538, 537, 536, 535, 534, 533, 532, 531, 530, 529, 528, 527, 526,
    525, 524, 523
])

outputfile.write('<NodeConstraints>\r')

for i in displacementNode:
    strg1 = 'u[' + str(i - 1) + '] = 0;\r'
    outputfile.write(strg1)
    strg2 = 'v[' + str(i - 1) + '] = 0;\r'
    outputfile.write(strg2)