introduction to adams/solver c++ - msc...

57
Introduction to Adams/Solver C++ Jose L Ortiz, PhD. Adams User Meeting Munich - May 18, 2011

Upload: phammien

Post on 12-Mar-2018

408 views

Category:

Documents


15 download

TRANSCRIPT

Introduction to Adams/Solver C++

Jose L Ortiz, PhD.Adams User MeetingMunich - 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 andthe 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

• 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

Agenda

5/26/2011 13

Advantages of Adams/Solver C++

• Modeling capabilities not found in the FORTRAN solver:

− Non-linear BEAM and FIELD formulationGeometrically non-linear formulations are available

− Flexible bodies contactFlexible-rigid and flexible-flexible contact are available

− Flexible body dynamic limitThis 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 bodiesMARKERs on flexible bodies can be located at arbitrary positions

– More general MFORCE definitionFORTRAN solver only allows linear expressions

– Generalized constraintsGCONs 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 MARKERSNew MARKER definitions on Curves and Surfaces allow creatingcomplex constraints

– Richer set of symbolic expressionsThree-dimensional expression, AO expressions, unit vectors,delay expressions, clearance, etc.

– Exact partials in user-written subroutinesUsers may provide exact partial derivatives to speed up thesimulations

5/26/2011 16

Advantages of Adams/Solver C++

• Modeling capabilities not found in the FORTRAN solver (cont.):

– Implicit GSEsUsers may specify implicit equations in GSE objects

– MOTION expressions depending on any stateAllows creating richer expressions for constraints

– Clearance measuresAllow 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 algorithmFORTRAN algorithm is flawed and limited to static cases.Linearization in terms of user-defined statesRM, MKB options

– Exact GTCMAT computationsBased on linearization. Call is allowed from within dynamics

– Adams/ControlsBisection method in System Import option

5/26/2011 18

Advantages of Adams/Solver C++

• Simulation capabilities not found in the FORTRAN solver (cont.):

– Settle simulationThis simulation is similar to statics. Also called steady state.

Given

Find z (keeping q constant) such that

5/26/2011 19

),,(0

tqzgz

fqM Tq

==Φ

=Φ+

λ

0=z

Advantages of Adams/Solver C++

• Simulation capabilities not found in the FORTRAN solver (cont.):

– Delay Differential equationsUsing the DELAY function we can solve systems with delays.Delays can be variable and depend on any state

5/26/2011 20

0),,(

),),(,(0

≥=

−==Φ

=Φ+

tzq

tqtzzgz

fqM Tq

ττ

τ

λ

Advantages of Adams/Solver C++

• Simulation capabilities not found in the FORTRAN solver (cont.):

– HHT, NEWMARK, and HASTIFF integratorsNew integrator types

– Activation/deactivation extensionsA wider set of modeling objects can be activated/deactivated

– UMF packageOption 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 extensionsOptions to save to buffer in memory

– Multi-threaded executionJacobian evaluation, LU numeric factorization, results generation.Ongoing development.

– Multi-threaded execution of user-written subroutinesOptions 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 subroutineCallback called for advanced user-written subroutine design.The solver will call the CBKSUB at specified milestones.

– Adams-to-Nastran exportAutomatic 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

• 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

Agenda

5/26/2011 27

Side-to-side C++/FORTRAN Comparison

5/26/2011 28

Statement C++ FORTRAN ResolutionBEAM Geometrically nonlinear

formulation availableN/A

CONTACT Flex-to-flex contact N/A

CLEARANCE Distance between two or more geometries

N/A

ENVIRONMENT Utility to set environment variables

N/A

EQUILIBRIUM N/A Dynamic option Not in roadmap. No requests from users.

FIELD Geometrically nonlinear formulation available

N/A

GSE Implicit equations N/A

Side-to-side C++/FORTRAN Comparison

5/26/2011 29

Statement C++ FORTRAN ResolutionFLEX_BODY Dynamic limit, stability,

DB_FILE, etc.N/A

GCON Generalized constraint N/A

INTEGRATOR HHT, NEWMARK and HASTIFF options

N/A

N/A CONSTANT_BDF, ABAM, RKF45

Will not be implemented

LSOLVER UMF package N/A

MARKER Curve and surface N/A

MFORCE Non-linear definitions N/A

Side-to-side C++/FORTRAN Comparison

5/26/2011 30

Statement C++ FORTRAN ResolutionMOTION Function depending on any

stateN/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

Side-to-side C++/FORTRAN Comparison

5/26/2011 31

Command C++ FORTRAN ResolutionACTIVATE 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

Side-to-side C++/FORTRAN Comparison

5/26/2011 32

Command C++ FORTRAN ResolutionPART Option to set products of

inertiaN/A

RELOAD Option to reload from a buffer in memory

N/A

SAVE Option to save to buffer in memory

N/A

SIMULATE Settle simulation available N/A

Side-to-side C++/FORTRAN Comparison

5/26/2011 33

Function C++ FORTRAN ResolutionACCXYZ 3D acceleration N/A

AO Isolates expression from reaction force in GCON

N/A

*CLEAR* Set of measures for CLEARANCE statement

N/A

DELAY Defines delay differential equations

N/A

DXYZ 3D position N/A

FXYZ 3D force N/A

NJAC Utility. Number of Jacobian evaluations

N/A

Side-to-side C++/FORTRAN Comparison

5/26/2011 34

Function C++ FORTRAN ResolutionNRHS Utility. Number of right-hand

side evaluationsN/A

ORDER Utility. Returns current integrator order

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

Side-to-side C++/FORTRAN Comparison

5/26/2011 35

Function C++ FORTRAN ResolutionUVX 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

Side-to-side C++/FORTRAN Comparison

5/26/2011 36

Subroutine C++ FORTRAN ResolutionADAMS_DECLARE_THREAD_SAFE

Allows multiple threads to access a user-written subroutine

N/A

ADAMS_SMP_GROUP Allows multiple threads to access user-written subroutines

N/A

CBKSUB Callback subroutine. Informs user about milestones

N/A

GTCMAT Allowed to be called from all simulation types

Limited to static/quasistatic

Side-to-side C++/FORTRAN Comparison

5/26/2011 37

Subroutine C++ FORTRAN ResolutionSYSPAR Provides analytical

partials from within user-written subroutines

Limited to GSE only

UCOVAR N/A Used by UCOSUB

Will not be implemented

GSE_SET_IMPLICIT Allows defining implicit GSE

N/A

UCOSUB N/A Used to define user-written constraints

Will not be implemented

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

• 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

Agenda

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/staticslinear/eigensolution

5/26/2011 42

Initial velocities are restored at time t=0

Reuses the previous Jacobian

Special Topics about the Adams/Solver C++

• Linearization (cont.)

– New approach (C++)

simulate/staticslinear/eigensolution

5/26/2011 43

User may stop restoring velocities at time t=0

Formal initial conditions done if model is not at a

consistent state

Special Topics about the Adams/Solver C++

• Linearization (cont.)

– New approach (C++)

simulate/staticslinear/eigensolution

5/26/2011 44

Model may have objects with STATIC_HOLD

STATIC_HOLD is not honored in eigensolution

(is not static!)

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

– MatchingEigenvalues

5/26/2011 56

• 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

Agenda

5/26/2011 57