Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 4675 | fmk | 1 | # written: fmk |
| 2 | # |
||
| 3 | # purpose: example1 in the manual with existing truss element |
||
| 4 | # |
||
| 5 | # $Revision: 1.2 $ |
||
| 6 | # $Date: 2008/12/09 22:43:40 $ |
||
| 7 | # $Source: /usr/local/cvs/OpenSees/PACKAGES/NewElement/cpp/example1.tcl,v $ |
||
| 8 | |||
| 9 | #create the ModelBuilder object |
||
| 10 | model basic -ndm 2 -ndf 2 |
||
| 11 | |||
| 12 | # build the model |
||
| 13 | |||
| 14 | # add nodes - command: node nodeId xCrd yCrd |
||
| 15 | node 1 0.0 0.0 |
||
| 16 | node 2 144.0 0.0 |
||
| 17 | node 3 168.0 0.0 |
||
| 18 | node 4 72.0 96.0 |
||
| 19 | |||
| 20 | # add material - command: material <matType> matID <matArgs> |
||
| 21 | uniaxialMaterial Elastic 1 3000 |
||
| 22 | |||
| 23 | # add truss elements - command: truss trussID node1 node2 A matID |
||
| 24 | element truss 1 1 4 10.0 1 |
||
| 25 | element truss 2 2 4 5.0 1 |
||
| 26 | element truss 3 3 4 5.0 1 |
||
| 27 | |||
| 28 | # set the boundary conditions - command: fix nodeID xResrnt? yRestrnt? |
||
| 29 | fix 1 1 1 |
||
| 30 | fix 2 1 1 |
||
| 31 | fix 3 1 1 |
||
| 32 | |||
| 33 | pattern Plain 1 Linear { |
||
| 34 | # apply the load - command: load nodeID xForce yForce |
||
| 35 | load 4 100 -50 |
||
| 36 | } |
||
| 37 | |||
| 38 | # build the components for the analysis object |
||
| 39 | #system ProfileSPD |
||
| 40 | system SkylineSPD |
||
| 41 | constraints Plain |
||
| 42 | integrator LoadControl 1.0 |
||
| 43 | algorithm Linear |
||
| 44 | numberer RCM |
||
| 45 | |||
| 46 | # create the analysis object |
||
| 47 | analysis Static |
||
| 48 | |||
| 49 | # create a Recorder object for the nodal displacements at node 4 |
||
| 50 | recorder Node -file Example.out -load -nodes 4 -dof 1 2 disp |
||
| 51 | |||
| 52 | # perform the analysis |
||
| 53 | analyze 1 |
||
| 54 | |||
| 55 | # print the results at node and at all elements |
||
| 56 | print node 4 |
||
| 57 | print ele |
||
| 58 | |||
| 59 | system ProfileSPD |
||
| 60 | analyze 1 |
||
| 61 | |||
| 62 | system SkylineSPD |
||
| 63 | analyze 1 |
||
| 64 | |||
| 65 | exit |