Dear Simulia Community,
I have a Problem runing a macro (Python scri'pt) with abaqus cae 6.14, without graphic Interface.
Here is what I have done:
I have created a simple model: 1 C3D8R element, which is fixed on one side (nodes of a face), and where I applied a dislacement on the other face.
I create the macro locally (in my work Directory), with the "create macro" tool of abaqus.
I ask the macro to create the curve
combine(abs(xy1-xy2), abs(xy3))
, where xy1 and xy2 are the displacements of the top and bottom face of the element, and xy3 is the total reaction force on the fixed face of the elements. It means that I obtaines the global displacement-force curve of the element as result.
After that, I ask the macro to Export this curve in the file abaqus.rpt, where abscisse and ordinates of the curve are provides in colums.
Now,I want to start this macro without graphic Interface. It has worked in the past, but it was with a previous Version of Abaqus, (and this Version was a Commercial Version , not a Student Edition). I remember with the previous Version, I had to delete some lines at the begining of the Python script in order to be able to run it without GUI properly. But I don't know how it works in the Version 6.14.
I enter the command: abaqus cae noGUI=abaqusMacros.py
I do not have any error message, but the macro is not writing the abaqus.rpt file that I need as Output.
Could someone help me to solve this Problem ?
I enclosed the text of my .inp and of my .py Macro File in order to test the macro.
test.inp file:
*PREPRINT,CONTACT=NO,ECHO=NO,HISTORY=NO,MODEL=NO
**%
**% Test with 1 elmt
**%
*HEADING
*NODE, NSET=ALLNODES, SYSTEM=R
1,
2, 1.
3, 1., 1.,
4, 0., 1.,
5, 0., 0., 1.
6, 1., 0., 1.
7, 1., 1., 1.
8, 0., 1., 1.
*NSET,NSET=FACE1
1,2,3,4
*NSET,NSET=FACE2
5,6,7,8
*NSET,NSET=FACE3
1,2,5,6
*NSET,NSET=FACE4
2,3,6,7
*NSET,NSET=FACE5
3,4,7,8
*NSET,NSET=FACE6
4,1,8,5
*ELEMENT,TYPE=C3D8R,ELSET=ONE
1,1,2,3,4,5,6,7,8
**
*NSET, NSET=N_load
2,3,6,7
**NSET, NSET=N_Sym
*NSET,NSET=GU
1,2
*Elset, elset=E_steel
1
*BOUNDARY,OP=NEW
FACE6, 1, 1, 0.0
1, 2,3,0.0
*SECTION CONTROLS, NAME=hourglass, HOURGLASS=ENHANCED
** ,
*SOLID SECTION, ELSET=E_Steel, MATERIAL=Steel
1.0
**
*MATERIAL, NAME=Steel
*ELASTIC, TYPE = ISOTROPIC
210000.0 ,0.29 ,0.0
**
*Amplitude, Name=Evol1, Definition=Tabular
0.0, 0.0, 1.0, 1.0
**
*STEP, INC = 10000, NAME = Tensile, NLGEOM = YES
*STATIC
0.1 ,1.0 ,1.0000E-06,
**
*BOUNDARY, AMPLITUDE=Evol1
N_LOAD, 1, 1, 1.0
**
** OUTPUT REQUESTS
**
*Output, field, frequency=1
*Element Output
S
*Node Output
U,
*Output, history, frequency=1
*Node output, Nset=GU
U1,
*Node output, NSET=FACE6
RF1,
*END STEP
Python file: abaqusMacros.py
# -*- coding: mbcs -*-
# Do not delete the following import lines
from abaqus import *
from abaqusConstants import *
import __main__
def Macro1():
import section
import regionToolset
import displayGroupMdbToolset as dgm
import part
import material
import assembly
import step
import interaction
import load
import mesh
import optimization
import job
import sketch
import visualization
import xyPlot
import displayGroupOdbToolset as dgo
import connectorBehavior
session.mdbData.summary()
o1 = session.openOdb(name='D:/Test_HST/test abq allein/test.odb')
session.viewports['Viewport: 1'].setValues(displayedObject=o1)
odb = session.odbs['D:/Test_HST/test abq allein/test.odb']
xy0 = xyPlot.XYDataFromHistory(odb=odb,
outputVariableName='Reaction force: RF1 at Node 1 in NSET FACE6',
steps=('Tensile', ), suppressQuery=True)
xy1 = xyPlot.XYDataFromHistory(odb=odb,
outputVariableName='Reaction force: RF1 at Node 4 in NSET FACE6',
steps=('Tensile', ), suppressQuery=True)
xy2 = xyPlot.XYDataFromHistory(odb=odb,
outputVariableName='Reaction force: RF1 at Node 5 in NSET FACE6',
steps=('Tensile', ), suppressQuery=True)
xy3 = xyPlot.XYDataFromHistory(odb=odb,
outputVariableName='Reaction force: RF1 at Node 8 in NSET FACE6',
steps=('Tensile', ), suppressQuery=True)
xy4 = sum((xy0, xy1, xy2, xy3, ), )
xy_result = session.XYData(name='RF1', objectToCopy=xy4,
sourceDescription='sum((Reaction force: RF1 at Node 1 in NSET FACE6, Reaction force: RF1 at Node 4 in NSET FACE6, Reaction force: RF1 at Node 5 in NSET FACE6, Reaction force: RF1 at Node 8 in NSET FACE6, ),)')
c1 = session.Curve(xyData=xy_result)
xyp = session.XYPlot('XYPlot-1')
chartName = xyp.charts.keys()[0]
chart = xyp.charts[chartName]
chart.setValues(curvesToPlot=(c1, ), )
session.viewports['Viewport: 1'].setValues(displayedObject=xyp)
odb = session.odbs['D:/Test_HST/test abq allein/test.odb']
xy0 = session.XYDataFromHistory(name='XYData-1', odb=odb,
outputVariableName='Spatial displacement: U1 at Node 1 in NSET GU',
steps=('Tensile', ), )
c0 = session.Curve(xyData=xy0)
xy1 = session.XYDataFromHistory(name='XYData-2', odb=odb,
outputVariableName='Spatial displacement: U1 at Node 2 in NSET GU',
steps=('Tensile', ), )
c1 = session.Curve(xyData=xy1)
xyp = session.xyPlots['XYPlot-1']
chartName = xyp.charts.keys()[0]
chart = xyp.charts[chartName]
chart.setValues(curvesToPlot=(c0, c1, ), )
xy1 = session.xyDataObjects['XYData-2']
xy2 = session.xyDataObjects['XYData-1']
xy3 = session.xyDataObjects['RF1']
xy4 = combine(abs(xy1-xy2), abs(xy3))
xyp = session.xyPlots['XYPlot-1']
chartName = xyp.charts.keys()[0]
chart = xyp.charts[chartName]
c1 = session.Curve(xyData=xy4)
chart.setValues(curvesToPlot=(c1, ), )
xy1 = session.xyDataObjects['XYData-2']
xy2 = session.xyDataObjects['XYData-1']
xy3 = session.xyDataObjects['RF1']
xy4 = combine(abs(xy1-xy2), abs(xy3))
xy4.setValues(
sourceDescription='combine ( abs ( "XYData-2"-"XYData-1" ),abs ( "RF1") )')
tmpName = xy4.name
session.xyDataObjects.changeKey(tmpName, 'U1-RF1')
x0 = session.xyDataObjects['U1-RF1']
session.xyReportOptions.setValues(layout=SEPARATE_TABLES)
session.writeXYReport(fileName='abaqus.rpt', appendMode=OFF, xyData=(x0, ))
Thank you in advance for your help and best Regards.
Pierre