Ace Gen and Ace FEM packages by Joe
Ace. Gen and Ace. FEM packages by Jože Korelc www. fgg. uni-lj. si/Symech/
Contents • Ace. Gen – general code generator – targeted to deal with expression growth problems • Ace. FEM – finite element environment – new element oriented technology – multi-filed and multi-physics problems • First release of the packages scheduled for November 2006 2 J. KORELC, UNIVERSITY OF LJUBLJANA
Ace. Gen - highlights Simultaneous optimizations of expressions: vector of auxiliary variables Original matrix (input for code generator): internal data base user Ace. Gen Mathematic a • heuristic procedures • random signatures of expressions 3 J. KORELC, UNIVERSITY OF LJUBLJANA Result is simplified matrix, expressed with the new auxiliary variables
Ace. Gen - highlights Simultaneous generation of control structures: • "If" construct $V[i, 1] $V[i, 2] fictive variable $V[i, 3] • "Do" construct 4 J. KORELC, UNIVERSITY OF LJUBLJANA
Ace. Gen - highlights Automatic differentiation technique (AD): – differentiation of the whole program • Reverse mode / Forward mode • Enhancements with respect to the standard AD technique: – AD procedure can be initiated at any time and at any point of derivation of the formulas and as many times as required – AD as code-to-code translator is replaced by the method that consistently extends current code rather than produce a new one – the results of all previous uses of AD are accounted for when AD is used several times inside the same subroutine – exceptions handling mechanisms 5 J. KORELC, UNIVERSITY OF LJUBLJANA
Ace. Gen - highlights Multi-language code generation with Ace. Gen: 1. Mathematical description 2. Symbolic description in Ace. Gen 3. Automatically generated code "Fortran" SUBROUTINE Test(v, u 1, x, L, g) REAL*8 v(500), u 1(3), x, L, g(3) v(6)=x/L v(7)=1 d 0 - v(6) v(8)=v(6)*v(7) v(12)=2 d 0*(u(1)*v(6) + - u(2)*v(7) + u(3)*v(8)) g(1)=v(12)*v(6) g(2)=v(12)*v(7) g(3)=v(12)*v(8) END 6 J. KORELC, UNIVERSITY OF LJUBLJANA "C++" void Test(double v[501], double u 1[3], double *x, double *L, double g[3]) { v[6]=*x/*L; v[7]=1 e 0 - v[6]; v[8]=v[6]*v[7]; v[12]=2 e 0*(u[0]*v[6] + u[1]*v[7]+ u[2]*v[8]); g[0]=v[12]*v[6]; g[1]=v[12]*v[7]; g[2]=v[12]*v[8]; }; "Mathematica" "Matlab" Test[]: =Module[{}, $VV[6]=x$$/L$$; $VV[7]=1 - $VV[6]; $VV[8]=$VV[6]*$VV[7]; $VV[12]=2*(u$$[1]*$VV[6] + u$$[2]*$VV[7]+u$$[3]*$VV[8]); g$$[1]=$VV[6]*$VV[12]; g$$[2]=$VV[7]*$VV[12]; g$$[3]=$VV[8]*$VV[12]; ]
Ace. Gen - highlights Automatic interface to numerical environments: Ace. Gen - symbolic input - problem formulation - user subroutines - interface code - initialization - numerical integration -… numerical user subroutines C Math. Link Mathematica MATLAB FORTRAN Ace. FEM CDriver MDriver ELFEN J. KORELC, UNIVERSITY OF LJUBLJANA MATLAB ABAQUS Numerical environments 7 FEAP ….
Ace. FEM Multi-environment code generation FEAP #include "sms. h" void SKR(double v[5001], Element. Spec *es, Element. Data *ed, Node. S FILE *SMTFile; DLLEXPORT int SMTSet. El. Spec(Element. Spec *es, int *idata, int ic, in { intc, nd, i; static int pn[6]={1, 2, 3, 4, 0, 0}; static int dof[4]={5, 5, 5, 5}; static int nsto[4]={0, 0, 0, 0}; static int ndat[4]; …. . /********** S U B R O U T I N E *********/ void SSE(double v[5001], Element. Spec *es, Element. Data *ed, Node. Data **nd, double *rdata, int *idata, double *p) { int i 44, i 45, i 46, b 51, b 52, b 55, b 58; v[35]=-nd[0]->X[0]+nd[1]->X[0]; v[37]=-nd[0]->X[1]+nd[1]->X[1]; v[31]=es->Data[0]; v[32]=es->Data[1]; v[33]=es->Data[2]; v[34]=sqrt(Power(v[35], 2)+Power(v[37], 2)); 8 J. KORELC, UNIVERSITY OF LJUBLJANA Suplementary routines subroutine elmt 10(d, ul, xl, ix, tl, s, p, ndfe, ndme, nste, isw) implicit none include 'sms. h' integer ix(nen), ndme, ndfe, nste, isw, INTEGRATIONCODE double precision xl(ndme, nen), d(*), ul(ndfe, nen, *) double precision s(nste, nste), p(nste), tl(nen), sxd(24) double precision sall(33, 33), pall(33), du(24), dh(9) double precision ul 0(ndfe, nen), sg(24), sg 0(24) character*50 SELEM, datades(2), postdes(0) logical DEBUG parameter (INTEGRATIONCODE=7, DEBUG=. false. , # SELEM="Hypersolid") user subroutines integer i, j, jj, ll, ii, k, kk, i 1, i 2, i 3, hlen, icode double precision w, v(5409), gpost(64, 0), npost(8, 0) integer ipordl(30) data (ipordl(i), i=1, 30)/1, 4, 3, 2, 1, 2, 6, 5, 1, 2, 1, 5, 8, 4, 1, & 4, 8, 7, 3, 4, 3, 7, 6, 2, 3, 7, 8, 5, 6, 7/ 1235 format(i 3, ">", 3 g 17. 9) ……
Ace. FEM environment Ace. FEM Mathematica C language General procedures - input data processing - mesh generation - solution strategies - command language - graphic post-processing CDriver - data base Math. Link - evaluation of element quantities - assembly of element contributions - various linear solvers MDriver - Mathematica language - data base in MMA - evaluation of element quantities - assembly of element contributions - MMA linear algebra element 1 element 2. m file element. . m file 9 J. KORELC, UNIVERSITY OF LJUBLJANA dynamic link element 1. dll file element 2. dll file element. . dll file
Ace. FEM - highlights • general finite element environment – – – multi-physics multi-field problems standard library of elements all elements come with symbolic input. . LibraryEFEM. html • element oriented technology takes full advantage of combine symbolic-numeric environment – run time debugging – element controlled mesh generation – element controlled post processing • customized engineering applications based on Mathematica 10 J. KORELC, UNIVERSITY OF LJUBLJANA
Ace. FEM - highlights: Multi - field problems • induction heating • T. Šuštar , C 3 M - Ljubljana, Slovenia Magnetic 11 J. KORELC, UNIVERSITY OF LJUBLJANA Thermal Mechanical
Ace. FEM - highlights: Multi-scale problems S. Stupkiewicz, IPPT, Warsaw, Poland MICRO - 3 D surface roughness MACRO - elastic properties of contact surface MACRO - lubricant flow in contact surface 12 J. KORELC, UNIVERSITY OF LJUBLJANA MACRO - thermal properties of contact surface
Ace. FEM - highlights: structural analysis • Sensitivity analysis of single-storey steel building • four node shell elements and large displacement truss elements A 13 J. KORELC, UNIVERSITY OF LJUBLJANA
Ace. FEM - highlights: Simulation of technological process J. Lengiewicz, IPPT, Warsaw, Poland Two phase forging 14 J. KORELC, UNIVERSITY OF LJUBLJANA
Ways to use the system • Ace. Gen as multi-language code generator – translates MMA input into efficient C, Fortran, Matab code – no calls to external subroutines – AD • Ace. Gen as generator of finite elements for specific environments – templates provided for some commercial and research environments – finite element environments have large user groups (ABAQUS several 1000) and companies that make specialized elements – finite elements for specific purpose can be expensive • Ace. FEM (independent finite element environment) • Ace. Gen + Ace. FEM – complete Finite Element System – commercial linear solver (Intel MKL), meshing, … 15 J. KORELC, UNIVERSITY OF LJUBLJANA
- Slides: 15