Introduction to Adams/Solver C++ Jose L Ortiz, PhD. Adams User Meeting Munich - May 18, 2011
Agenda A Brief History of Adams/Solver C++ Advantages and Disadvantages of Adams/Solver C++ Side-to-side C++/FORTRAN Comparison Special Topics about the Adams/Solver C++ Q&A 5/26/2011 2
Agenda A Brief History of Adams/Solver C++ History Design objectives Facts Advantages and Disadvantages of Adams/Solver C++ Side-to-side C++/FORTRAN Comparison Special Topics about the Adams/Solver C++ Q&A 5/26/2011 3
A Brief History of Adams/Solver C++ MSC has invested in new C++ technology for Adams/Solver Quality here is a subjective measure 5/26/2011 4
A Brief History of Adams/Solver C++ FORTRAN solver development started circa 1975 FORTRAN solver went through two major code re-architectures Quality here is performance/robustness 5/26/2011 5
A Brief History of Adams/Solver C++ C++ solver development started circa 1997 Notice the current re-architecture work There is a negative gap in performance/robustness 5/26/2011 6
A Brief History of Adams/Solver C++ Negative gap in performance/robustness FORTRAN solver code has several recovery algorithms not coded into de C++ solver Data structures and memory management in FORTRAN solver code have been optimized after two major re-designs Performance issues in the C++ code have been identified and the development team is working on them 5/26/2011 7
A Brief History of Adams/Solver C++ Feature-wise there is a positive gap Notice C++ solver is under a current re-architecture FORTRAN solver is in maintenance mode 5/26/2011 8
A Brief History of Adams/Solver C++ Design objectives of Adams/Solver C++ Written from the ground up No copy of the FORTRAN code except linear algebra modules Object-oriented design New data structures and memory management Complete freedom of implementation Supervision by senior FORTRAN developers 5/26/2011 9
A Brief History of Adams/Solver C++ Design objectives of Adams/Solver C++ Symbolic toolkit embedded in the code No numerical differencing Software patterns 5/26/2011 10
A Brief History of Adams/Solver C++ Other facts about Adams/Solver C++ First prototype 3X faster FORTRAN code uses some C++ code 5/26/2011 11
A Brief History of Adams/Solver C++ Other facts about Adams/Solver C++ Layered architecture Software patterns Flexible API Extensible API 5/26/2011 12
Agenda A Brief History of Adams/Solver C++ Advantages and disadvantages of Adams/Solver C++ Modeling Simulation Side-to-side C++/FORTRAN Comparison Special Topics about the Adams/Solver C++ Q&A 5/26/2011 13
Advantages of Adams/Solver C++ Modeling capabilities not found in the FORTRAN solver: Non-linear BEAM and FIELD formulation Geometrically non-linear formulations are available Flexible bodies contact Flexible-rigid and flexible-flexible contact are available Flexible body dynamic limit This option stabilizes the simulation by ignoring high frequency modes 5/26/2011 14
Advantages of Adams/Solver C++ Modeling capabilities not found in the FORTRAN solver (cont.): Multiple-node location for MARKERs on flexible bodies MARKERs on flexible bodies can be located at arbitrary positions More general MFORCE definition FORTRAN solver only allows linear expressions Generalized constraints GCONs allow defining use-defined constraints easily 5/26/2011 15
Advantages of Adams/Solver C++ Modeling capabilities not found in the FORTRAN solver (cont.): Curve and Surface MARKERS New MARKER definitions on Curves and Surfaces allow creating complex constraints Richer set of symbolic expressions Three-dimensional expression, AO expressions, unit vectors, delay expressions, clearance, etc. Exact partials in user-written subroutines Users may provide exact partial derivatives to speed up the simulations 5/26/2011 16
Advantages of Adams/Solver C++ Modeling capabilities not found in the FORTRAN solver (cont.): Implicit GSEs Users may specify implicit equations in GSE objects MOTION expressions depending on any state Allows creating richer expressions for constraints Clearance measures Allow creating expression for the gap between two bodies 5/26/2011 17
Advantages of Adams/Solver C++ Simulation capabilities not found in the FORTRAN solver: Exact linearization algorithm FORTRAN algorithm is flawed and limited to static cases. Linearization in terms of user-defined states RM, MKB options Exact GTCMAT computations Based on linearization. Call is allowed from within dynamics Adams/Controls Bisection method in System Import option 5/26/2011 18
Advantages of Adams/Solver C++ Simulation capabilities not found in the FORTRAN solver (cont.): Settle simulation This simulation is similar to statics. Also called steady state. Given Mq + Φ T q λ = Φ = 0 z = g( z, q, t) f Find z (keeping q constant) such that z = 0 5/26/2011 19
Advantages of Adams/Solver C++ Simulation capabilities not found in the FORTRAN solver (cont.): Delay Differential equations Using the DELAY function we can solve systems with delays. Delays can be variable and depend on any state Mq + Φ T q λ = Φ = 0 z = g( z, z( t f τ ), q, t) τ = τ ( q, z, t) 0 5/26/2011 20
Advantages of Adams/Solver C++ Simulation capabilities not found in the FORTRAN solver (cont.): HHT, NEWMARK, and HASTIFF integrators New integrator types Activation/deactivation extensions A wider set of modeling objects can be activated/deactivated UMF package Option to use the UMF linear algebra package. Specially useful with very large equation sets 5/26/2011 21
Advantages of Adams/Solver C++ Simulation capabilities not found in the FORTRAN solver (cont.): SAVE/RELOAD extensions Options to save to buffer in memory Multi-threaded execution Jacobian evaluation, LU numeric factorization, results generation. Ongoing development. Multi-threaded execution of user-written subroutines Options to set parallel execution of user-written subroutines 5/26/2011 22
Advantages of Adams/Solver C++ Simulation capabilities not found in the FORTRAN solver (cont.): CBKSUB user-written subroutine Callback called for advanced user-written subroutine design. The solver will call the CBKSUB at specified milestones. Adams-to-Nastran export Automatic creation of an equivalent Nastran model. Exported files are fully editable and ready for SOL 107, 108. 5/26/2011 23
Disadvantages of Adams/Solver C++ Slower simulations for a class of models. Large models with heavy use of user-written subroutines run slower Slow sections of the code have been identified Data structures and memory management are being redesigned Adams/Solver C++ is faster only for a class of models 5/26/2011 24
Disadvantages of Adams/Solver C++ Lack of robustness Currently the Adams/Solver C++ is less robust than the FORTRAN solver This issue is more noticeable for large complex models running complex simulations There are very few models that the FORTRAN solver can not simulate while the C++ solver is able to solve 5/26/2011 25
Disadvantages of Adams/Solver C++ Actions taken As mentioned above, the Adams/Solver C++ development is concentrated on closing the performance/robustness gap Major issues have been identified 5/26/2011 26
Agenda A Brief History of Adams/Solver C++ Advantages and disadvantages of Adams/Solver C++ Side-to-side C++/FORTRAN Comparison Statements Commands Functions Special Topics about the Adams/Solver C++ Q&A 5/26/2011 27
Side-to-side C++/FORTRAN Comparison BEAM Statement C++ FORTRAN Resolution Geometrically nonlinear formulation available N/A CONTACT Flex-to-flex contact N/A CLEARANCE ENVIRONMENT Distance between two or more geometries Utility to set environment variables EQUILIBRIUM N/A Dynamic option Not in roadmap. No requests from users. FIELD Geometrically nonlinear formulation available N/A N/A N/A GSE Implicit equations N/A 5/26/2011 28
Side-to-side C++/FORTRAN Comparison Statement C++ FORTRAN Resolution FLEX_BODY Dynamic limit, stability, DB_FILE, etc. N/A GCON Generalized constraint N/A INTEGRATOR HHT, NEWMARK and HASTIFF options N/A N/A LSOLVER UMF package N/A CONSTANT_BDF, ABAM, RKF45 Will not be implemented MARKER Curve and surface N/A MFORCE Non-linear definitions N/A 5/26/2011 29
Side-to-side C++/FORTRAN Comparison Statement C++ FORTRAN Resolution MOTION Function depending on any state N/A PART 2D Parts N/A PREFERENCES Additional options N/A PSTATE User-defined states N/A SURFACE Surface definition N/A UCON N/A User-defined constraint Will not be implemented 5/26/2011 30
Side-to-side C++/FORTRAN Comparison Command C++ FORTRAN Resolution ACTIVATE More options N/A DEACTIVATE More options N/A ENVIRONMENT Utility to set environment variables N/A GCON User-defined constraints N/A LINEAR RM, PSTATE, MKB, export N/A LSOLVER Option to select UMF N/A 5/26/2011 31
Side-to-side C++/FORTRAN Comparison PART Command C++ FORTRAN Resolution RELOAD SAVE Option to set products of inertia Option to reload from a buffer in memory Option to save to buffer in memory N/A N/A N/A SIMULATE Settle simulation available N/A 5/26/2011 32
Side-to-side C++/FORTRAN Comparison Function C++ FORTRAN Resolution ACCXYZ 3D acceleration N/A AO *CLEAR* DELAY Isolates expression from reaction force in GCON Set of measures for CLEARANCE statement Defines delay differential equations N/A N/A N/A DXYZ 3D position N/A FXYZ 3D force N/A NJAC Utility. Number of Jacobian evaluations N/A 5/26/2011 33
Side-to-side C++/FORTRAN Comparison NRHS ORDER Function C++ FORTRAN Resolution Utility. Number of right-hand side evaluations Utility. Returns current integrator order N/A N/A Q Modal position N/A QDDOT Modal acceleration N/A QDOT Modal velocity N/A TXYZ 3D torque N/A UV Unit vector N/A 5/26/2011 34
Side-to-side C++/FORTRAN Comparison Function C++ FORTRAN Resolution UVX X component of unit vector N/A UVY Y component of unit vector N/A UVZ Z component of unit vector N/A VXYZ 3D velocity N/A WDTXYZ 3D angular acceleration N/A WXYZ 3D angular velocity N/A 5/26/2011 35
Side-to-side C++/FORTRAN Comparison Subroutine C++ FORTRAN Resolution ADAMS_DECLARE_ THREAD_SAFE ADAMS_SMP_GROUP CBKSUB GTCMAT Allows multiple threads to access a user-written subroutine Allows multiple threads to access user-written subroutines Callback subroutine. Informs user about milestones Allowed to be called from all simulation types N/A N/A N/A Limited to static/quasistatic 5/26/2011 36
Side-to-side C++/FORTRAN Comparison SYSPAR Subroutine C++ FORTRAN Resolution Provides analytical partials from within userwritten subroutines Limited to GSE only UCOVAR N/A Used by UCOSUB GSE_SET_IMPLICIT Allows defining implicit GSE N/A UCOSUB N/A Used to define user-written constraints Will not be implemented Will not be implemented 5/26/2011 37
Side-to-side C++/FORTRAN Comparison Other differences Jacobian and right-hand-side are computed using symbolic algebra PART command will generate a Jacobian refactorization FLEX_BODY s invar2 and invar3 are identically zero. This means the formulation of equations of motion are different YPR and Euler measures in results may be different but they define the same orientation 5/26/2011 38
Side-to-side C++/FORTRAN Comparison Other differences (cont.) No *.out files are generated. Minor differences in messaging files LINEAR command behaves differently. Historic rules have been relaxed to provide more analytical approach Velocity reconciliation is done iteratively Numerical differencing of user-written subroutines is done by perturbing the measures 5/26/2011 39
Agenda A Brief History of Adams/Solver C++ Advantages and disadvantages of Adams/Solver C++ Side-to-side C++/FORTRAN Comparison Special Topics about the Adams/Solver C++ Multi-threading Linearization Flexible Body Contact GCON usage CBKSUB callback subroutine Adams-to-Nastran Q&A 5/26/2011 40
Special Topics about the Adams/Solver C++ Multi-threading By default, a parallel thread computes results. Only available in stand-alone version or External Solver from within Adams/View Parallel evaluation of Jacobian is available. See PREFERENCES statement Parallel numeric LU factorization is available. Execution speed can be improved by providing declaring thread safe code for user-written subroutines 5/26/2011 41
Special Topics about the Adams/Solver C++ Linearization Advanced exact algorithm (any operating point) Historical rules have been modified a bit. Linearization is a new simulation type. Potential problems at time t=0 Traditionally (FORTRAN) simulate/statics linear/eigensolution Initial velocities are restored at time t=0 Reuses the previous Jacobian 5/26/2011 42
Special Topics about the Adams/Solver C++ Linearization (cont.) New approach (C++) simulate/statics linear/eigensolution User may stop restoring velocities at time t=0 Formal initial conditions done if model is not at a consistent state 5/26/2011 43
Special Topics about the Adams/Solver C++ Linearization (cont.) New approach (C++) simulate/statics linear/eigensolution Model may have objects with STATIC_HOLD STATIC_HOLD is not honored in eigensolution (is not static!) 5/26/2011 44
Special Topics about the Adams/Solver C++ Linearization (cont.) Users can select user-defined states 5/26/2011 45
Special Topics about the Adams/Solver C++ Linearization (cont.) Solutions using global and relative coordinates 5/26/2011 46
Special Topics about the Adams/Solver C++ Linearization (cont.) Virtual instrumentation. Random dynamic excitation 5/26/2011 47
Special Topics about the Adams/Solver C++ Linearization (cont.) Matching results 5/26/2011 48
Special Topics about the Adams/Solver C++ Flexible Body Contact Native flex-to-flex and flex-to-rigid contact implementation No need to create MFORCE to model contacts. Geometry is extracted automatically from the Modal Neutral File (mnf) Supports both solid and shell elements 5/26/2011 49
Special Topics about the Adams/Solver C++ GCON Adams/Solver C++ has a general constraint equation implementation This implementation is used by JOINT, JPRIM and MOTION. For example, a SPHERICAL JOINT will create 3 GCON equations which are created automatically in the upper layers of the code The general implementation has been extended for the user to create arbitrary constraint equations 5/26/2011 50
Special Topics about the Adams/Solver C++ CBKSUB Created for advanced users to optimize execution of user-written subroutines If the user provides a CBKSUB, Adams/Solver C++ will call the subroutine at specified milestones of the code Milestones examples are: start of iterations, start of time step, start dynamics, end dynamics, etc. The main usage is to let the users cache values before iterations begin 5/26/2011 51
Special Topics about the Adams/Solver C++ CBKSUB (cont.) All SYS* subroutines are allowed to be called. No dependencies are created This subroutines is called by the Adams/Solver C++ only. Users should not call it 5/26/2011 52
Special Topics about the Adams/Solver C++ CBKSUB (cont.) Execution without CBKSUB. Dynamic output step 5/26/2011 53
Special Topics about the Adams/Solver C++ CBKSUB (cont.) Execution with CBKSUB. (Not all events are shown) 5/26/2011 54
Special Topics about the Adams/Solver C++ Adams-to-Nastran Automatic model translation from Adams to Nastran 5/26/2011 55
Special Topics about the Adams/Solver C++ Adams-to-Nastran Matching Eigenvalues 5/26/2011 56
Agenda A Brief History of Adams/Solver C++ Advantages and Disadvantages of Adams/Solver C++ Side-to-side C++/FORTRAN Comparison Special Topics about the Adams/Solver C++ Q&A 5/26/2011 57