Acegen Contents 2 Acegen Code Generator
Total Page:16
File Type:pdf, Size:1020Kb
University of Ljubljana Ljubljana, 2012 Slovenia AceGen Contents 2 AceGen code generator AceGen Contents AceGen Tutorials .......................................................................................................................8 AceGen Preface ................................................................................................................8 AceGen Overview ............................................................................................................9 Introduction ........................................................................................................................10 AceGen Palettes ...............................................................................................................14 Standard AceGen Procedure ......................................................................................16 Mathematica syntax - AceGen syntax ....................................................................24 • Mathematica input • AceGen input • AceGen code profile • Mathematica input • AceGen input • AceGen code profile • Mathematica input • AceGen input • AceGen code profile • Mathematica input • AceGen input • AceGen code profile Auxiliary Variables ..........................................................................................................32 User Interface ....................................................................................................................37 Verification of Automatically Generated Code ...................................................43 Program Flow Control ....................................................................................................46 Symbolic-Numeric Interface ........................................................................................51 Automatic Differentiation .............................................................................................53 Theory of Automatic Differentiation ..53 SMSD function ...........55 Differentiation: Mathematica syntax versus AceGen syntax ...56 Examples ........58 Limitations: Incorrect structure of the program ...........64 Exceptions in Differentiation ......................................................................................65 Characteristic Formulae ...............................................................................................69 Non-local Operations .....................................................................................................73 Arrays ....................................................................................................................................75 Run Time Debugging ......................................................................................................79 User Defined Functions ................................................................................................83 Symbolic Evaluation .......................................................................................................94 Expression Optimization ..............................................................................................97 Signatures of the Expressions ..................................................................................100 Linear Algebra ...................................................................................................................101 Tensor Algebra .................................................................................................................103 Mechanics of Solids .......................................................................................................106 Bibliography .......................................................................................................................106 Numerical Environments Tutorials ...................................................................................108 AceGen code generator 3 Numerical Environments Tutorials ...................................................................................108 Finite Element Environments Introduction ..........................................................108 Standard FE Procedure .................................................................................................110 Template Constants ........................................................................................................115 Element Topology ............................................................................................................120 Node Identification ..........................................................................................................126 Numerical Integration .....................................................................................................128 • Implementation of Numerical Integration Elimination of local unknowns ..................................................................................135 Standard user subroutines ..........................................................................................137 • Initialization • Task type 1 • Task type 2 • Task type 3 • Task type 4 • Task type 5 • Task type 6 Data structures .................................................................................................................145 Integer Type Environment Data .................................................................................145 Real Type Environment Data ......................................................................................152 Node Specification Data ...............................................................................................153 Node Data ............................................................................................................................154 Domain Specification Data ..........................................................................................155 Element Data ......................................................................................................................161 Interactions Templates-AceGen-AceFEM .............................................................162 User defined environment interface ........................................................................166 AceFEM ................................................................................................................................167 • About AceFEM FEAP ......................................................................................................................................168 ELFEN ...................................................................................................................................172 ABAQUS ...............................................................................................................................177 MathLink, Matlab Environments ................................................................................179 AceGen Examples .....................................................................................................................180 Summary of AceGen Examples .................................................................................180 • Basic AceGen Examples • Advanced AceGen Examples • Implementation of Finite Elements in AceFEM • Implementation of Finite Elements in Alternative Numerical Environments Solution to the System of Nonlinear Equations .................................................182 Minimization of Free Energy .......................................................................................183 Troubleshooting and New in version ...............................................................................195 AceGen Troubleshooting .............................................................................................195 New in version ...................................................................................................................198 Reference Guide ........................................................................................................................199 AceGen Session ...............................................................................................................199 SMSInitialize . 199 SMSModule ...201 SMSWrite ......202 SMSVerbatim 204 SMSPrint ........206 SMSPrintMessage ......211 Basic Assignments .........................................................................................................211 SMSR 211 SMSV 212 SMSM ............213 SMSS .213 SMSInt ...........214 4 AceGen code generator SMSInt ...........214 SMSSimplify . 215 SMSVariables 215 Symbolic-numeric Interface ........................................................................................215 SMSReal ........215 SMSInteger ....216 SMSLogical ...217 SMSRealList ..217 SMSExport ....219 SMSCall .........221 • Example Smart Assignments ........................................................................................................223 SMSFreeze .....223 SMSFictive ....230 SMSReplaceAll ..........231 SMSSmartReduce ......232 SMSSmartRestore ......232 SMSRestore ...233 Arrays ....................................................................................................................................233 SMSArray ......233 SMSPart .........234 SMSReplacePart .........235 SMSDot .........235 SMSSum ........236 Differentiation ....................................................................................................................236 SMSD 236 SMSDefineDerivative 237 Program Flow Control ....................................................................................................238