Re: Converting a Abaqus python Macro to Simple python script

"'Patel, Miten' [email protected] [Abaqus]" <[email protected]> Thu, 28 Feb 2019 15:36:56 +0000
Newsgroups gmane.comp.mathematics.abaqus.user
Message-ID <VI1PR06MB5279A36FB86DE29D40F33C6AD8750@VI1PR06MB5279.eurprd06.prod.outlook.com>
Hi,


If you mean run the script from the command line without opening the GUI then the syntax is as follows


        abaqus cae -noGUI <script-file>

        eg  abaqus cae -noGUI  /rds/fluid-mesh-gen/HEX-mesh/HEX-meshGen-full.py


note in the script you can invoke subscripts using the execfile command


       execfile('/rds/fluid-mesh-gen/HEX-mesh/HEX-mesh-1-genWires-compress.py')


Hope that helps. For more info see


Abaqus Scripting User's Guide  2.2 : How does the Abaqus Scripting Interface interact with Abaqus/CAE?

Miten


________________________________
From: [email protected] <[email protected]> on behalf of [email protected] [Abaqus] <[email protected]>
Sent: 26 February 2019 22:12:22
To: [email protected]
Subject: [Abaqus] Converting a Abaqus python Macro to Simple python script



Hi there,


I have  the following abaqus macro which I am using to extract the pressure value for the node.

With this macro, I have to open every time abaqus cae and run the script but this method is inefficient.

Can I convert it to  some python script and run from say Linux console. It would significantly reduce my work stress.


Here is the script, if somebody can help me with this:


# -*- coding: mbcs -*-

# Do not delete the following import lines

from abaqus import *

from abaqusConstants import *

import __main__


def pressure():

    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='blablabla_location/sphereincube2_main.odb')

    session.viewports['Viewport: 1'].setValues(displayedObject=o1)

    odb = session.odbs['blablabla_location/sphereincube2_main.odb']

    session.fieldReportOptions.setValues(printTotal=OFF, printMinMax=OFF)

    session.writeFieldReport(fileName='pressure.rpt', append=OFF,

        sortItem='Node Label', odb=odb, step=0, frame=15, outputPosition=NODAL,

        variable=(('S', INTEGRATION_POINT, ((INVARIANT, 'Pressure'), )), ))


Any suggestion would be appreciated.


BR,

Mamun