ADONIS
Reference Manual
×
Menu
Index
Introduction
 
This section gives an example of using a Python program to interact with ADONIS. First we import the adonis and module with the import statement. The adonis module defines the interaction between Python and ADONIS. We import the adonis module as the shortened name ad. The ad.command (adonis.command) function is used to issue a series of ADONIS commands.
 
Example:
These commands issues bunch of javascript commands. The triple quotes can also be used to define a multi-line string.
 
import adonis as ad
 
ad.command("newmodel()")
ad.command("""
rect('startPoint',-5,-20,'endPoint',5,0)
triangle('elemtype','T3')
discretize('auto')
triangle('auto')
material('create','IsoElastic','matid',1,'matname','Material 1','density',2500,'shear',2.8e+09,'bulk',3.9e+09)
material('assign','matid',1)
applybc('xfix','xlim',4.712,5.404,'ylim',-20.497,0.297)
applybc('xfix','xlim',-6.920,-4.646,'ylim',-20.596,0.857)
applybc('yfix','xlim',-5.866,6.129,'ylim',-20.925,-19.739)
set('gravity',0,10)
solve()
""")
The help manual was created with Dr.Explain