Home

Virtlab Project - Report - Department of Computing and Software

image

Contents

1. Fig 6 Virtlab modules dependencies and inputs material model spec material model class get gamma My PhiF 2 o F 3 F KappaF 4 k 00 depsilonvpNL 5 Q depsilonvp 6 Cp Cy dstressvp E dstressvpNL get De get Dvp get RM Jacobian 7 get RM F Y VirtLab MatGen MatCalc material test class Y setup E tick code generator material behaviour FEM g t constraints get displacements T get forces j get constraints i dataset we update geometry Y maple client experiment control A V 1 1 I Y Y Maple Ruby 9 uses relationship gt input file user o generated source code peo al pp compile amp link user E Except for the following user inputs typically set via MatCalc s GUI frontend or via a data input file for MatCalc s CLI frontend at run time time step test duration test specimen dimensions material model virtual test and the values for the respective constants for the latter two School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution 5 VIRTLAB PROJECT EVOLUTION School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution 5 1 Synopsis This section provides a synopsis of the initial and final states of the second stage of Virtlab Project which this report is addressing The initial state for
2. B 139 7 3 Eut re TesearcIi eias oso eios ode iei ce re EE GG GR OTT GI UG GU OH RI GI de E udo 141 B REFERENCE S isco RA 143 9 APPENDIK iii E E A 9 1 MatCalc ChangeLog 9 2 MatCalc TODO 9 3 MatGen ChangeLog 9 4 MatGen TODO UV INS TALE O1 os acto estate a abo Lo OA AD M ED AD ED a A a e St D Eae 9 6 matc lc driver txts eiie ttt ite deer dte dede ene tee ea te beider lat d de OU RE 167 9 7 ARES UIT RP TERRE 169 9 8 add material txt 51a ae a ete A AAA eds ment 171 99 generate material Du diee die seo dd PECTORE reete ode 177 9 10 dest miatcalc sIiz e Re ree a ete an e empate e am ed RUE codo 184 9 11 test_EvalMapleStatement cc cee cecceccsescesseeseceseeesecesecesecaeceseescecsceeseceseeeseceseceseceaeceseceeeceseceeeeeeeeeeeeeeenaeeeeees 188 9 12 MatCale 1 1 file list Doxys8eli 2 itr eiae ed ees id et hid etes 191 9 13 MatCalc 0 1 memory leak bug description and proposed fix sse 194 9 13 11 Despi dedecore cete adi t 194 913 2 F K CC P 195 9713 3 Additi naltfobmatiOn 3 oras o RR EROR EAR OR HMM Me MM EET e 195 9 13 3 1 C 9 13 3 2 C Ruby E EA O A A T A Jk TAN 9 14 Compilation Assembly and Linking Overview esee enne enne nnne nreter enne 197 School of Computational Engineering and Science McMaster University INDEX OF TABLES
3. A summary of the search progress is saved in a log file which for the test case being described was Hooke amp Jeeves search log iters funevals pro aia DZI il il 1 30000000e 03 3 00000000e 0 5 50000000e 04 2 24 7 80000000e403 3 00000000e 0 2 75000000e 05 S 61 9 10000000e 03 3 00000000e 0 1 37500000e 04 4 eye 1 17000000e 04 3 00000000e 0 6 87500000e 03 5 TENG 1 19437500e 04 3 00000000e 0 6 87500000e 03 6 128 1 19437500e 04 3 00000000e 0 5 15625000e 03 7 309 2 38875000e 04 3 00000000e 0 3 43750000e 03 8 320 2 38773438e 04 3 00000000e 0 3 00781250e 03 9 592 3 06921875e 04 3 00000000e 0 3 00781250e 03 10 643 3 05779297e 04 3 00000000e 0 3 00781250e 03 ial 665 3 05703125e 04 3 00000000e 0 3 00781250e 03 12 671 3 05703125e 04 3 00000000e 0 3 00781250e 03 13 683 3 05706299e 04 3 00000000e 0 3 00781250e 03 18 694 3 05706299e404 3 00000000e 0 3 01452637e 03 IMAX 100 FMAX 900 RHO 0 5 00000000e 01 EPSMIN 1 00000000e 04 The log shows that the method succeeded in converging to the following point in the parameter space which differs from the true solutions in about 2 and 0 5 respectively e ElasticE 1 3 05706299e 04 eta 1 3 01452637e 03 3 The coordinates of the point corresponding to the E1asticNu parameter p 1 are ignored since the algorithm was purposefully hacked to ignore that specific parameter see note 48 School of Computational Engineering
4. S 9 INDEX OF FIGURES reinen ETSE ER AAAA E REAA R EET a ANRA eret 11 TT ACKNOWLEDGEMENTS 2 20 cernere Eine set esn k o Eaa ANA OEN AA c e aaau NaRa Epa 13 2 REFERENCE MATERIAL cesar aaae AnA r EAER rene AARAA AE ERR 15 AURA AD A a 15 2 2 Terminology rant ree etr i rer b ei pe rb e ee prp n d p ebrei tbe 15 2 3 Abbreviations and Acro WS miii dedecore ee a ae idad dad aee ede oed due 16 2 4 Conventions ca 08 im t m etr i dai e e i i a i c i a t o d ai iom 17 2 5 Virtlab Project and Software Package Reference Information nennen 18 S INTRODUCTION RE 19 3 1 Virtlab Software Library and Virtlab Project eese E EEE K E 20 3 2 Purpose of the Repot ica omi ara ad ett etae ee aita et t d e e ett 21 ESE Mu MR EU no PAP EEEE E A E E ER 22 3 4 Related Documentation Overview eese eee non on non eterne nn none etre Eai taiate 23 3 5 Organization of the Doctrina oa 24 4 VIRTLAB PROJECT OVERVIEW eeeeeeeneeennnnn nennen nnnnnnnnnnen nnns innen nnn ee ee nnn nn nna 25 4 1 Iitrod ctiotis a e AN 26 4 2 Motivation A eee ete teet ee d ete tee eerte ete te PORE 27 4 3 Theoreucal Back sr a A iacta a a e ez e 28 4 3 1 Continuum mechanics goal description ssss ez eeeee r t t r t t t t r t t ette nennen 28 4 3 2 Stress 4 3 3 Strain 4 3 4 Stress strain relationship constitutive equati
5. Assuming administrator privileges for installation is only necessary if the developer desires to install the software in a system location as opposed to performing an installation under e g his her home folder School of Computational Engineering and Science McMaster University 6 Software Tools DEVELOPER configure ac Makefile am aclocal m4 config h in Makefile in Makefile Fig 34 Key GNU build system tools and files from a developer and a user perspective Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 6 Software Tools 6 3 Doxygen Doxygen is a tool for generating formatted browsable and printable documentation from specially formatted comment blocks in source code This allows for developer documentation to be embedded in the files where it is most likely to be kept complete and up to date http old lugatgt org articles doxygen Doxygen is a documentation system for C C Java Objective C Python IDL Corba and Microsoft flavors Fortran VHDL PHP Cfi and to some extent D It can help you in three ways 1 It can generate an on line documentation browser in HTML and or an off line reference manual in BTFX from a set of documented source files There is also support for generating output in RTF MS Word PostScript hyperlinked PDF compressed HTML and Unix man pages The documentation is extr
6. A See section 6 2 1 2 p 106 2 See section 6 2 1 3 p 108 26 See section 6 2 1 6 p 112 Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution AC CHECK FUNCS sqrt e ACC CONST AC HEADER STDBOOL Even though the software package could be built installed and used solely by inspection of the names of the macro that the tool suggests adding the developer is given an idea of the underlying portability issues at stake which could lead to code refactoring to eliminate possible portability troubles for future platforms As an example the following lines extracted from the configure script generated by Autoconf from the configure ac file corresponding to MatCalc show the tests included by the ac CHI ECK FUNCS pow macro added therein Checks for functions for ac func in pow do as mue war Gena ae ey Eu nego sca mc pes ee om echo Sas me LINENO checking for ac func gt amp 5 echo SECHO N checking for ac func SECHO C gt amp 6 if as var as ac var eval test S Sas_vartset set then echo SECHO_N cached SECHO C gt amp 6 else cat conftest ac ext ACEOF s contdets y _ACEOF cat confdefs h conftest ac ext cat conftest ac ext ACEOF H erid Comes sa 57 Define ac func to an innocuous variant in case limits h declares ac func For example HP UX 11i
7. Didnd t Converge in 5 31334e 05 0 883333 count 5 error Didnd t Converge in 5 steps final error 0 9 count 5 error 2 42644e 05 Didnd t Converge in 5 steps final erro Converged in 3 steps final error 4 59221e 0 933333 count 5 error 2 51432e 05 Didnd t Converge in 5 steps final error 2 51432e 05 0 95 count 5 error 2 56509e 05 Didnd t Converge in 5 steps final error 56509e 05 0 966667 count 5 error 2 60446e 05 Didnd t Converge in 5 steps final error 60446e 05 0 983333 count 5 error 2 64079e 05 Didnd t Converge in 5 steps final error 2 64079e 05 save to u0 grad sancheg Untitled csv sancheg mills Projects virtlab svn O 1 matcalc src cat uO grad sancheg Untit led csv cat uO grad sancheg Untitled csv No such file or directory sancheg mills Projects virtlab svn O 1 matcalc src Fig 9 MatCalc v 0 1 stdout E Besides a relatively difficult to read output the screenshot also shows that the write to file option is in fact not supported from MatCalc s v 0 1 GUI nor is the read from file option School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution 5 3 2 2 MatCalc v 1 1 GUI Fig 10 shows the GUI frontend for MatCalc v 1 1 FI Material Calculator BB File Edit View Help SIMULATION SETUP SIMULATION RESULTS General parameters pa Run Experiment UniaxialX Data tabl
8. Among the factors that contributed to the decision of using an input file for the simulation setup in lieu of command line switches was the number of parameters required for the simulation setup a command line invocation would result complicated for the user and from the code s perspective would imply parsing options with variable number of arguments for the material test and material model constant values School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution The file format was designed to accommodate both input and output needs thus having a header for holding the simulation setup parameter values and a data section for holding the simulation results A sample MatCalc input output setup data file is shown in Fig 18 060008 _ matcalc dat O 4 Pp matcalc dat Wy 1 B MatCale Simulation Data 4 2 s 3 Experiment UniaxialX 4 Yield function DC smi th material E2 S Algorithm Radial return map 5 Time step 1 8088e 02 7 Time span 2 500e 00 8 Specimen dim X 2 000e 01 9 Specimen dim V 5 088e 02 18 Specimen dim Z 5 8008e 02 11 Experiment constants 12 displacement rate x 3 8808e 81 13 Material constants 14 ElasticE 3 000e 04 15 ElasticNu 3 000e 01 16 eta 3 000e 03 17 18 Data records 250 19 20 T 1 Sx 2 Sy 3 Sz 4 Sxy 5 Suz 5 Sxz Ex 8 Ey 9 Ez 18 21 1 8088e 02 4 285e 4802 3 147e 06 3 1470 06 8 241e
9. Table 1 Related documentation diceret teet ee ede eet ete te d e E e eod 15 Table 2 Terminolo gy sss scsi sse faces g st ss k 15 Table 3 Abbreviations and Acronyms oinensis E i EE AEE EE AEEA AE elakad a l s s t 16 Table 4 Conventions 5 e t REPE RR EHE TRO EO RII TONRSU RH ERU SR ER EICHENSEER SOAM SE SIE In GER ti ag etes 18 Tables Project Reference InfOEImatlon s e de ce er e fee eee eae ir eae epe one Wise ae eee eae teens e pe n 18 School of Computational Engineering and Science McMaster University INDEX OF FIGURES Fig 1 Boundary valued problem with prescribed displacements u and an applied surface traction T CSMAKO07 Figure 4 93224 zs 5 9 0 nte et enn etd E a date ir FD n e 28 Fig 2 Resultant force Af on a small element AS of the surface S enclosing an arbitrary volume V about a point P within the material continuum occupying a region of space Q SMC09 Figure 6 p 24 sse 29 Fig 3 Stress tensor for a point within a body SMC09 Figure 6 p 24 nee 29 Fig 4 The initial configuration of neighbouring points PO and Q0 moving to their deformed configuration P and Q respectively SMC09 Figure 8 p27 ccccsceccrcescecsccuacsoscocetceacecoceudesutcoscheedelcdsescesaedesceecdenceset cescedvccbaecde desea desceeadeceserscevac 30 Fig 5 Yield function F the hardening effect and the plastic potential Q in stress space
10. The original Autoconf environment for MatGen had a hardcoded check for Maple in the corresponding configure ac file which was specifically tailored to the original developer s platforms but the dependency is in this case hardcoded depending on the platform so the latter issue is the one that actually breaks the build due to the platform not being found MatGen s configure ac file shows the hardcoding case Shost in O IS AA AC _DEFINE PLATFORM WIN32 1 Platform is Win32 AC MSG ERROR Win32 not supported seo IL ignis AC _DEFINE PLATFORM LINUX 1 Platform is Linux MAPLE ROOT opt maple9 5 OPENMAPLE LDFLAGS L MAPLE ROOT bin IBM INTEL LINUXA llas AC _DEFINE PLATFORM APPLE 1 Platform is Apple MAPLE ROOT Applications Maple 9 5 Maple 9 5 app Contents MacOS OPENMAPLE LDFLAGS L S MAPLE ROOT bin APPLE PPC OSXV ar AC MSG WARN Please add host to configure ac checks School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution The corresponding configure script output on OpenSolaris is Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution hecking for long yes hecking size of long 4 hecking for void yes hecking size of void 4 hecking for long long yes hecking size of long long 9 hecking whether byte ordering is bigendian no hecking for GT
11. 000 MatCalc executable wrapper that spawns MatCalc s CLI or GUI depending on the provided command line switches Run matcalc h matcalc driver cc code 002 matcalc driver h code 003 Header file for matcalc driver cc material class cc code 003 material class h code 003 Header file for material class cc HEADER REQUIRES REVISION material class list cc code 003 material class list h code 003 Header file for material class list cc output cc code 002 MatCalc setup and data text file output module output h code 003 Header file for output cc returnmap integrator cc code 003 Return map integrator algorithm returnmap integrator h code 003 Header file for returnmap integrator cc ruby helper cc code 003 ruby helper h code 003 Header file for ruby helper cc Contains code viscoplastic integrator cc code 003 Viscoplastic integrator algorithm use of Return map algorithm in lieu of this is encouraged viscoplastic integrator h code 003 Header file for viscoplastic integrator cc test B test cc code test CLI executable for testing the relative error in operations involving matrices B and J asociated to Uniaxial material tests DOC REQUIRES REVISION test configset test cc code test CLI executable to check configset h cc module
12. CES e The McMaster School of e School of Computational Engineering and Science O Computational Engineerin McMaster University 0 peus Virtlab 1 1 Virtual Material Testing Laboratory version 1 1 M Eng Report by Gonzalo S nchez sancheg a mcmaster ca Submitted to the School of Computational Engineering and Science McMaster University Hamilton Ontario Canada in partial fulfilment of the requirements for the degree Master of Engineering project option Supervisor Dr Spencer Smith smiths mcmaster ca Created 2010 02 20 Gonzalo Sanchez Updated 2010 04 26 Gonzalo Sanchez Doc n 151 Abstract This document reports the modifications and additions that were done to the Virtlab software package with the aim of leveraging its existing codebase and documentation to industrial grade and the impact thereof The improvement of the software qualities of Maintainability Performance Portability Reliability Reusability Understandability and Verifiability as well as the overall Usability improvement achieved obtained by application of Software Engineering techniques such as separation of concerns and information hiding are presented as a clear example of the benefits that Software Engineering principles and supporting tools can provide for Scientific Computing software development and maintenance TABLE OF CONTENTS INDEX OF Mp Vc
13. McC07 Figure 2 3 p 22 32 Fig 6 Virtlab modules dependencies and inputs nennen ener 35 Eig 7 MatCalc v 0 1 GULafter RESET 4 no aa tbi ie eie in ade gi odd ern 59 Fig 8 MatCalc v 0 1 GU Tafter RUN ee dz 60 Fig 9 MatCalc 0 LIE telae et dla oe etae ao d a aod eed 61 Fig 102 MatCalc v L1 GUL after RESET rere EE De DE EO Pep Ete 62 Fig 11 MatCalc v 1 1 GUI after RUN eese tette n tentant rete ndo noo tenen tenni ot Ok teinte tete see 63 Fig 12 MatCalc v 1 1 independent resizing capabilities of left and right panels sene 64 Fig 13 MatCalc v 1 1 graph section of the right panel sssssss ee ezee s r r t r t t r t t r t t t t t se 65 Fig 14 MatCalc v 1 1 data table section of the right panel sessi enne 65 Fig 15 MatcCalc v 1 1 file input parsing progress shown in StdOUt ocnononocncninnocncononoonnoncnn ono concnnonnc nn cnn con nn eene nre 66 Fig 16 MatcCalc v 1 1 information in stdout stream formatted to fit in 80 columns eee 66 Eig i17 MatCalexw 1 CLEL usage message a generen rere ere eee ae eoe ede der ers 69 Fig 18 MatCalc v 1 1 input output file sample esee ener eere eds st s t enne 70 Fig 19 Sample Gnuplot script for plotting data from a MatCalc v 1 1 data file sss 71 Fig 20 Gnuplot graph
14. as can be seen in Fig 31 B ES gonzalo sancheg Projects virtlab svn 1 1 matcalc src am E File Edit View Terminal Tabs Help Fig 31 FEM_test help message The linear viscoelastic model hardcoded into FEM test was selected because it has a closed form analytical solution against which the simulation results can be compared This tool alongside with the Material Model Parameters Fitting Tool described in section 5 3 6 p 81 and the dset diff tool described above is geared towards the verifiability and reliability software qualities of Virtlab library Note FEM test does not use the input output or configset modules developed for the library This is product of a specific design decision to make it independent as much as possible of the underlying library modules except those directly involved with the simulation that is the FEM engine since the purpose of the tool is to test the simulation engine itself Y It also permits changing two parameters used by the integration algorithm TOL and STRESS 0 which are not accessible by neither of MatCalc s GUI or CLI frontends Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution EJ Yet this decision comes along with a maintenance cost any changes to the output module that affects the file format has to be recoded into FEM test to maintain file format compatibility 5 3 8 5 Future wo
15. test data blue jagged trace produced with Octave by contamination of a closed form solution red smooth trace with random noise School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution The true solution the samples corresponding to the red smooth trace in Fig 26 was produced with the following values for the two parameters of interest in the material model ElasticE 3 0E 04 eta 3 0E 03 The real data produced by contamination of the true solution with noise the samples corresponding to the blue jagged trace in Fig 26 was copied into the appropriate columns of a valid MatCalc file like the one depicted in Fig 18 p 70 This file was then read in by the tool and the data therein taken as the reference data against which to perform the fitting A second MatCalc file with its header set up for the adequate material model and virtual material test was provided to the fitting tool where the initial guess for the parameters was the following ElasticE 0 1 3E 03 eta_0 5 5E 04 Fig 27 shows the tool s output upon reading the simulation file with the initial guesses indicated a E sanchegGmills Out eE File Edit View Terminal Tabs Help material model sancheg mills Out E sancheg mills o sancheg mills Pro EY sancheg mills Pro jpening matcalc dat line i MatCalc Simulation D
16. types or for indicating vector quantities The different uses should be unambiguous by context Within quotes the original formatting of the text will be preserved as much as possible Any deviation from the original or any emphasis highlighting that is not part of the original text will be explicitly indicated in a footnote Fixed font types Fixed font will be used for any code related text such as code statements and code comments as well as for reproducing program outputs to the system console see Program outputs below Sans serif font types Sans serif font types i e font types devoid of serifs small features at the end of the strokes such as the Arial font will be used to refer to elements in the GUI frontends to the software products such as labels or menu items The purpose is to differentiate those text items from the rest of the text which is rendered in a serif font type Times New Roman Emphasized paragraphs Paragraphs that are deemed of particular importance or requiring emphasis will be centered rendered on a grey background and will have significantly reduced margins as the following paragraph Sample emphasized paragraph Program outputs Program outputs typically to the system console which are not presented within a screenshot will be rendered with fixed font and with a grey background lighter than the emphasized paragraph s background as the following para
17. 3 3 Scope of the Report In the context of the purposes described in section 3 2 the current report will address what was done and why was that done to the Virtlab software package during the period May 2009 March 2010 This report will not address how the changes and or additions to the software package were accomplished neither how the software internals work nor how the software package should be built installed and used except to the extent necessary to understand what was done and why The how issues are dealt with in other documents a list of which is provided in Table 1 section 3 4 provides an overview of the projected contents The present report will assume the intended audience 1s neither familiar with the software package nor its application domain and will henceforth present in chapter 4 an overview of the Virtlab project which describes the software s functionality and capabilities and provides the essential theoretical background for both the software and its application domain 4 To the date of writing of this document VL REP of the remaining documents listed in Table 1 only the VL SCD documentation set exists For this reason an extensive appendix has been added to this report in which various of the currently existing documentation files which will require appropriate inclusion or merging into the VL UM and VL TM documents are listed as reference Gonzalo S nchez Virtlab 1 1 M Eng Re
18. 8 530E 02 3 896E 02 3 896E 02 8 535E 13 8 645E 13 x LOE EOD 011 9 000E 01 5 539E 02 2 209E 07 32209 07 2 646E 16 4501917 1 867E 16 8 622E 02 3 942E 02 3 942E 02 8 535E 13 B645E 13 Y 1 000 00 L 9 100 01 45 537E402 42 207E 07 42 207E 07 43404E 16 1 944E 16 4 330E 16 48 714E 02 3 988E 02 3 98BE 02 8 535E 13 8 645E 13 Z 1 000E 00 L 9 2006 01 35535E402 42 205E 07 2 205E 07 1 585E 16 i 2 545E 17 3423E 16 8 805E 02 4 034E 02 4034E 02 B 535E 13 j B 645E 13 49 300E 01 5 534E 02 2 203E 07 2 203E 07 45 353E 16 2 425 16 731E 16 48 897E 02 4 080E 02 4 080E 02 8 535E 13 B 645E 13 Specific parameters 49400E 01 45531E402 42 201E07 42201E07 4357216 9 301E 17 1 851E 17 8 988E 02 4125E 02 4 125E 02 8 535E 13 8 645E 13 Constant Name Constant Value 9 500E 01 f 5 529E 02 2 199E 07 2 199E 07 3 216E 16 j 3 601E 16 2 077E 16 49 080E 02 171E 02 4 171E j B 535E 13 8 645E 13 Y Experiment 9 600E 01 5 527E 02 2 197E 07 2 197E 07 3927E 16 7 024E 16 46964E 16 49171E 02 4217E 02 4217E 02 8 535E 13 8 B 645E 13 ent rate x 1 000E 01 49 700E 01 5 524E 02 2 196E o7 2 196E 07 41 531E 18 1 056E 16 1 512E 16 49 262E 02 4 263E 02 4 263E 02 B 535E 13 A B 645E 13 y 49 800E 01 5 522E 02 42 194E 07 42 194E 07 49262617 3 873E 16 2 821E 17
19. 9 353E 02 4 309E 02 4 309E02 8 535E 13 8 535E 13 8 645E 13 3 000E 04 49900E 01 45 519402 42 192E 07 2 192E 07 2 582E 16 1401E16 3 850E 16 9 445E 02 4 354E 02 4 354E 02 8 535E 13 8 535E 13 8645E13 f 3 000E 01 L eta 3 000E 03 Graph stress 2 098E 07 lt 2 106E 07 lt 2 273E 07 StressU straint 4 354E 02 lt 2 899E 02 lt 3 095E 04 L L EXE eee MT Fig 12 MatCalc v 1 1 independent resizing capabilities of left and right panels The right panel allows the user to resize its upper and lower sections by dragging the horizontal divider between these which ultimately allows the user to view exclusively the graph or data table as shown in Fig 13 and Fig 14 respectively 34 This feature though requires the underlying Gtk library to provide the corresponding support Given that is a minor usability issue which can be offset completely by the user s manual portability of this feature was not deemed a concern 35 These possibility was already provided by the underlying Virtlab library yet not exploited in the original GUI Further possibilities like plotting data against time can be easily implemented but the information provided in the graph panel would require a more involved code refactoring unless the physical units display is dropped therein a minor issue actually since the physical units can be easily hardcoded into the corresponding graph sele
20. An ad hoc attempt at regression testing for MatCalc was started with the creation of a shell script test matcalc sh that runs a series of memory leak checks using the memory checker tool in Valgrind on various MatCalc v 1 1 executables lists dset diff configset test FEM test Ruby test and matcalc itself For the memory leaks check just depending on the different exit paths the executable has at least a check has to be performed to verify if that particular termination path has not produced a leak The script listed in section 9 10 p 184 gives an 1dea of the various testing combinations the referred executables can undergo for this leak check School of Computational Engineering and Science McMaster University 6 Software Tools 6 5 System tracing tools As a systems administrator and often as a developer you are more likely to be interested in finding a fault with a program This can be why a particular program is causing other problems such as memory and other errors or why an application is not behaving as it should and how it has in the past Debugging the specifics of the application in this instance are not often useful Instead you need to examine how the application is being executed by the operating system With debugging you are examining the execution of the individual functions defined within the application Debugging concentrates on the application and the functions and structures within it
21. Evidence of this can be seen in the Valgrind callstacks that look like 30531 4 307 040 bytes in 626 blocks are indirectly lost in loss record 17 of 18 30531 at 0x4A06019 operator new unsigned long vg replace malloc c 167 30531 by 0x406BDD _ gnu cxx new allocator datachunk allocate unsigned long void const new allocator h 88 30531 by 0x406C04 std Vector base lt datachunk std allocator lt datachunk gt gt _M allocate unsigned long stl vector nizm 30531 by 0x40CBBA datachunk std vector lt datachunk std allocator lt datachunk gt gt M allocate and copy lt gnu cxx normal iterator datachunk const std vector lt datachunk std allocator lt datachunk gt gt gt gt unsigned long gnu cxx normal iterator lt datachunk const std vector datachunk std allocator lt datachunk gt gt gt gnu cxx normal iterator datachunk const std vector lt datachunk std allocator lt datachunk gt gt gt stl vector h 767 30531 by 0x40CC65 std vector lt datachunk std allocator lt datachunk gt gt operator std vector lt datachunk std allocator lt datachunk gt gt const amp vector tcc 141 30531 by 0x40D2D8 dataset operator dataset const amp dataset h 167 s305315 By 0x40D319 dataset r by eteateldataset conste dataset r by h 41 So the leak is caused by a call to dataset ruby create but the memory is allocated inside the assignment operator The proposed f
22. M Eng Report Apr 2010 9 Appendix School of Computational Engineering and Science McMaster University 9 Appendix Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix School of Computational Engineering and Science McMaster University 9 Appendix Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix 9 2 MatCalc TODO School of Computational Engineering and Science McMaster University 9 Appendix Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix School of Computational Engineering and Science McMaster University 9 Appendix Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix School of Computational Engineering and Science McMaster University 160 9 Appendix Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix 161 9 3 MatGen ChangeLog School of Computational Engineering and Science McMaster University 162 9 Appendix 9 4 MatGen TODO Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix School of Computational Engineering and Science McMaster University 164 9 Appendix 9 5 INSTALL2 Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix School of Computational Engineering and Science McMaster Universi
23. PROGRAM Cinstall_sh c 23 install sh SCRIPT tinstall sh c 7 all matcalc config h MAKE CAM_MAKEFLAGS all recursive 210 SUFFIXES 211 am ref Fach 3 Csrcdi A in sredir Makefile am am configure deps efor dep in do case am configure deps in dep X E echo cd sredir 88 CAUTOMAKE gnu cd srcdir amp amp CAUTOMAKE gnu amp amp exit 0 Blitz a A cd Ctop srcdir 88 CAUTOMAKE gnu Makefile X cd Ctop srcdir 88 5 CAUTOMAKE gnu Makefile 5 PRECIOUS Makefile 7 Makefile srcdiro Makefile in Ctop builddir2 config status case in config status X echo CSHELL config status usd config status echo cd Ctop builddir amp amp CSHELL config status amp am depfil cd top_builddir 88 CSHELL config status am depfiles mayb esac Ctop builddir config status top srcdir configure CCONFIG_STATUS_DEPENDENCI CSHELL config status recheck 3 240 top_sredirj configure am configure deps 241 cd srcdir amp amp a uN 242 CACLOCAL_M4 am aclocal m deps 243 cd sredir amp amp ACLOCAL PS CACLOCAL AMFLAGS 244 245 matcalc config h stamp h1 245 if test f e then A Fig 33 Makefile example School of Computational Engineering and Science McMaster University 6 Software Tools 6 2 1 4 Goals The GNU build system has two go
24. for the purposes of locating and fixing bugs it is vitally important to be able to retrieve and run different versions of the software to determine in which version s the problem occurs It may also be necessary to develop two versions of the software concurrently for instance where one version has bugs fixed but no new features branch while the other version is where new features are worked on trunk At the simplest level developers could simply retain multiple copies of the different versions of the program and label them appropriately This simple approach has been used on many large software projects While this method can work it is inefficient as many near identical copies of the program have to be maintained This requires a lot of self discipline on the part of developers and often leads to mistakes Consequently systems to automate some or all of the revision control process have been developed http en wikipedia org wiki Revision control There are basically two different approaches to version control systems the traditional centralized model and the distributed model e The centralized model relies on a server to hold the codebase repository from where each developer copies the source code files to work upon e The distributed approach relies on the copies of the codebase distributed in every developer s workstation 38 The boldface type applied here if for highlighting sections of particular releva
25. iters funevals p 0 je Lal p 2 1 il 1 30000000e 03 3 00000000e 0 5 50000000e 04 2 48 8 45000000e 03 3 00000000e 0 3 46500000e 05 S all 8 34600000e 03 3 00000000e 0 3 41000000e405 4 98 8 36550000e 03 3 00000000e 0 3 40175000e405 5 TS 8 36511000e 03 3 00000000e 0 3 40158500e405 6 136 8 36524000e 03 3 00000000e 0 3 40153000e 05 7 155 8 36523220e 03 3 00000000e 0 3 40152670e405 8 186 8 36523493e 03 3 00000000e 0 3 40152554e405 8 213 8 36523473e 03 3 00000000e 0 3 40152546e 05 IMAX 100 FMAX 1000 RHO 0 1 00000000e 01 EPSMIN 1 00000000e 08 School of Computational Engineering and Science McMaster University EJ 5 Virtlab Project Evolution It is clear in the light of the above results that there is significant work to be done with regards to this tool this is suggested in the following section 5 3 6 5 5 3 6 5 Future work Currently the tool can handle material models with arbitrary number of parameters but can only fit against a single real world material test run therefore the fit is done as per the cost function described in Eg 8 Future work should address multiple material tests so that the fitting is done as per the cost function in Eg 9 instead There is a clear need for performance improvement in the material model parameters fitting tool as well as a need to investigate possible non convergence issues or convergence to wrong results At the time of writing of this report there is a project enco
26. reliability and verifiability qualities develop a tool that allows the user to fit the material model parameters used for the simulation to data obtained from real world material tests Verify throughout the process if the software library qualities originally sought were effectively attained and in that case the benefits gained therefrom B MatGen was not considered in this usability quality improvements its GUI can be improved but only slightly and it already provides a command line tool for batch usage Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution 5 3 Report of Changes and Additions School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution 5 3 1 Building process From its inception Virtlab library was built using the GNU Build System to best address the usability portability and maintainability qualities of the software package An overview of the GNU Build System is provided in section 6 2 1 p 106 under the Build Systems section 6 2 The GNU build system has basically two goals GJ03 p 1 1 Simplify the development of portable programs 2 Simplify the building of programs that are distributed as source code The first goal is achieved by the automatic generation of a configure shell script which enables an end user to compile and install the program directly from the source code distribution b
27. 09 4 224e 18 8 241e 09 1 5808e 802 4 643e 03 4 643e 03 22 2 000e 02 8 304e 02 3 123e 06 3 123e 06 6 826e 09 1 783e 11 5 826e 80 2 978e 2 9 353e 03 9 353e 03 23 3 000e 02 1 207e 03 3 098e 06 3 0098e 06 5 682e 09 7 575e 13 5 682e 09 4 434e 02 1 412e 02 1 412e 02 24 4 000e 02 1 560e 03 3 873e 66 3 073e 86 4 751e 09 3 022e 14 4 751e 09 5 870e 02 1 885e 802 1 895e 02 25 5 000e 02 1 890e 03 3 049e 06 3 049e 06 3 901e 09 2 548e 15 3 901e 09 7 285e 02 2 383e 02 2 383e 02 26 6 000e 02 2 1988 03 3 024e 06 3 024e 06 3 367e 09 4 688e 15 3 367e 09 8 680e 02 2 874e 02 2 874e 02 27 7 000e 02 2 487e4803 2 900e 06 2 900e 06 2 852e 09 5 030e 15 2 852e 09 1 D06e 01 3 370e 02 3 370e 02 28 8 000e 02 2 755e 03 2 975e G6 2 9 5e 06 2 425e 09 2 445e 17 2 425e 09 1 14le 01 3 86 02 3 969e 62 29 9 000e 02 3 008e 03 2 058e 06 2 950e 06 2 070e 09 4 754e 15 2 070e 09 1 275e 01 4 371e 02 4 371e 02 30 1 000e 01 3 242e 03 2 0926e 06 2 926e 06 1 774e 09 2 362e 16 1 774e 09 1 407e 01 4 876e 02 4 876e 02 31 1 188e 81 3 460e 03 2 902e 06 2 962e 66 1 525e 09 4 9054e 15 1 525e 69 1 538e 01 5 383e 02 5 383e 82 _ 32 1 288e 81 3 663e 03 2 878e 806 2 878e 806 1 315e 09 1 651e 14 1 315e 898 1 557e 801 5 881e 82 5 89le 02 y 251 2 310e 00 2 1838 03 1 126e 04 1 126e 04 1 848e 14 1 539e 15 2 397e 13 1 502e 00 7 365e 01 7 365e 01 4 252 2 320e 00 2 175e 803 1 122e 04 1 122e 04 3 35le 14 2 685e 15 2 4180e 13 1 505e 00 7 382e 01 7
28. 1 M Eng Report Apr 2010 5 Virtlab Project Evolution The column and comment format were in fact chosen for compatibility with the cross platform Gnuplot plotting utility WK86 An example plot produced by the Gnuplot script in Fig 19 is displayed on Fig 20 where the interactive measurement facilities provided by Gnuplot is used ES matcalc 1 1 gnuplot plt lt gonzalo gt File Edit Search Preferences Shell Macro Windows et style data lines set border 31 Iw 0 75 set format x 1 1e set format y 1 1e set mxtics set mytics set grid set title MatCalc v 1 simulation results set xlabel set ylabel lt st su set key left top samplen 1 plot output dat using 8 2 with Ip lw 1 pt 1 ps 1 title X E2 Uniaxial X plot output dat using 3 with Ip lw 1 pt 2 ps 1 title v E2 Uniaxial X replot output dat using 1 with lp 1w 1 pt 3 ps 1 title z E2 Uniaxial X plot output dat using 11 5 wi pt 4 ps 1 title XY E2 Uniaxial X replot output dat using 12 i pt 5 ps 1 title Z E2 Uniaxial X replot output dat using i pt 6 ps 1 title XZ E2 Uniaxial X unset key unset ylabel unset xlabel unset title unset grid unset mytics Fig 19 Sample Gnuplot script for plotting data from a MatCalc v 1 1 data file FI Gnuplot e MatCalc v 1 1 simulation results 2 0e 04 di E2 Uniaxial X 1 8e 04 2 1 6er04 1 4e 04 1 2e 04
29. 1 0e 04 stress StressU 8 0e 03 6 0e 03 4 0e 03 1 0e 00 1 5e 00 strain L L 1 07744 Fig 20 Gnuplot graph data line 17 in Fig 19 showing the use of interactive measurements School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution Any default values assumed by MatCalc are displayed by invoking it with the switch c Fig 21 a BE gonzaloGsancheg Projects virtlab svn 1 1 matcalc src m File Edit View Terminal Tabs Help Fig 21 MatCalc v 1 1 CLI configuration printout The information provided with the h and c switches is intended to enable the user to quickly run and try the software a basic usability feature often overlooked To that same purpose sample input and output files named input dat and output dat are included in the software package The console output produced by MatCalc s CLI frontend at run time except for the usage message and configuration information shown in figures 17 p 69 and 21 p 72 is exactly the same as that produced by MatCalc s GUI frontend at run time please refer to figures 15 p 66 and 16 p 66 for an example This commonality stems from the fact that the underlying library usage is exactly the same for both CLI and GUI frontends and is a result of a design decision to address the maintainability understandability verifiability and reliability qualities see section 5 3
30. 2010 6 Software Tools An example of automatic cross referencing of entities and automatic call and caller graphs generation is provided in Fig 36 for the read matcalc file function File Edit View History Bookmarks Tools Help Function Documentation int read matcalc file dataset A ds Defritan at line 40 of fle input oc References dataset add_constant dataset add_datachunk datachunk dstrain x datachunk dstrain xy datachunk dstrain xz datachunk dstrain y datachunk dstrain yz datachunk dstrain z datachunk dstress x datachunk dstress xy datachunk dstress xz datachunk dstress y datachunk dstress yz datachunk dstress z du error du message EXIT FAILURE EXIT SUCCESS fs get mc dr get mc ifile HC1W datachunk q dataset reset set mc alg set mc dr set mc exp set mc Ix set mc ly set mc iz set mc mat set mc t set mc ts datachunk strain x datachunk strain xy datachunk strain xz datachunk strain y datachunk strain yz datachunk strain z datachunk stress m datachunk stress x datachunk stress xy datachunk stress xz datachunk stress y datachunk stress yz datachunk stress_z and datachunk time Referenced by cli main main and on_open Here is ta call graph kr fis function datasetz add datachunk Here is he caller gah kr tis incon Generated on Mon Mar 29 15 53 20 2010 for MatCalc by Clan er
31. 3 gel dataset resbt B ruby call method arguments N Mnaterial class zeet constonjs N B ruby error update cfg B ruby int Vo hooke_jeoves A best_nearby f E ruby new arguments B ruby object hash dataset reset dala B ruby scalar El ruby string Variable Documentation I vectorTest B Data Fields datasetds matcalc static B Graphical Class Hierarchy Definition at line 99 of fie parameters fit tool cc P File List I Directory Hierarchy El Globais Definition at line 100 of file parameters fit tool cc dataset ds test static int funevals 0 Definition at line 90 of file parameters fit tool cc Images 509 509 Loaded 13 KB Speed 2 59 KB s Time 5 272 Done Fig 25 Call graph for the Parameter Fitting Tool for MatCalc Material Models generated by Doxygen Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution 85 From the call graph it can be seen that several classes belonging to MatCalc s codebase are being used to set and retrieve information in the data structures that the simulation engine uses to configure the current session and store the simulation results get and set the material constants that are the parameters to be fitted by the Hooke and Jeeves algorithm and access the simulation data files to set up the initial run The decisi
32. 382e 01 253 2 338e 080 2 167e 83 1 118e 84 1 118e 84 5 353e 14 1 356e 15 2 499e 13 1 509e 00 7 400e 01 7 4808e 81 254 2 340e 00 2 159e 03 1 114e 04 1 114e 804 7 792e 14 2 858e 15 1 118e 13 1 512e 00 7 417e 81 7 417e 01 255 2 350e 00 2 152e 03 1 11le 04 1 111e 84 1 065e 13 1 519e 15 1 288e 14 1 515e G 7 434e 81 7 434e 01 256 2 360e 00 2 144e 803 1 107e 04 1 107e 04 6 208e 14 2 536e 16 1 255e 13 1 519e 00 7 45le 01 7 451e 01 257 2 370e 00 2 136e 03 1 103e 04 1 103e 04 2 732e 14 3 516e 16 1 507e 13 1 522e 00 7 468e 01 7 468e 01 258 2 380e 00 2 120e 03 1 090e 04 1 090e 04 7 302e 16 1 442e 15 9 375e 14 1 525e 88 7 485e 01 7 485e 81 259 2 390e 00 2 121e 803 1 005e 04 1 006e 04 2 233e 14 2 545e 15 1 857e 13 1 520e 00 7 502e 01 7 502e 01 260 2 408e 080 2 113e 83 1 092e 04 1 092e 04 3 747e 14 2 407e 15 4 021e 14 1 532e 00 7 519e 61 7 519e 01 261 2 410e 00 2 106e 03 1 080e 04 1 080e 04 4 653e 14 3 458e 15 4 905e 14 1 535e 00 7 536e 01 7 536e 01 262 2 420e 00 2 099e G3 1 085e 04 1 085e 04 5 020e 14 2 053e 15 5 218e 14 1 538e 00 7 552e 01 7 552e 81 263 2 438e 080 2 8001e 803 1 081e 04 1 081e 04 4 857e 14 3 382e 15 5 057e 14 1 542e 00 7 569e 01 7 569e 01 264 2 440e 00 2 084e 03 1 078e 04 1 078e 04 4 171e 14 8 318e 16 4 415e 14 1 545e 88 7 586e 01 7 586e 01 265 2 450e 00 2 077e403 1 074e 04 1 074e 04 3 069e 14 4 536e 15 3 273e 14 1 548e 00 7 602e 01 7
33. 5 3 1 3 Future work Fixes and enhancements to the building process of both MatCalc and MatGen should include Diagnose and fix the problems that prevent make dist to generate proper packages of MatCalc and MatGen for the end users Diagnose and fix the problems that prevent make install to properly install MatCalc and MatGen packages at the end user s specified location using prefix path as option to configure Provide support for running checks at the building stage with make check see section 5 3 8 5 p 99 Embed in the building process the location of the XML definition files for both GUI frontends to eliminate the hardcoded relative path currently in effect see section 5 3 2 D 59 MatGen Automate Maple dependency checks Provide a without gui option in both configure scripts that would enable the user to build the software package in systems devoid of Gtk dependencies or interested solely on the CLI frontends to the library see section 5 3 2 p 59 MatCalc Provide an option to build the material model class files as shared objects loadable at runtime 2 Tests for installation in different system locations should be performed Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution 59 5 3 2 MatCalc s GUI The GUI frontend for MatCalc is built on the Gtk toolkit KP97 Gtk is implemented in C but seeking portability to all Unix flav
34. 602e 01 266 2 468e 080 2 069e 03 1 071e 04 1 071e 04 1 529e 14 7 403e 16 9 285e 14 1 551e 00 7 619e 01 7 619e 01 267 2 470e 00 2 062e 03 1 067e 04 1 067e 04 4 044e 15 1 666e 15 1 448e 13 1 555e 00 7 535e 81 7 635e 01 268 2 480e 00 2 055e G3 1 064e 04 1 064e 04 2 729e 14 2 565e 15 3 776e 14 1 558e 00 7 652e 01 7 652e 01 269 2 490e 00 2 048e 03 1 06le 04 1 06le 04 5 377e 14 3 0l6e 15 1 170e 14 1 561e 00 7 668e 01 7 668e 01 279 2 500e 00 2 041e 803 1 057e 04 1 057e 04 8 35le 14 1 050e 16 9 734e 14 1 564e 88 7 584e 81 7 684e 01 271 STRESS_ 1 000e 08 272 TOL 1 000e 05 273 274 EOF 0 275 v iji Data File Western Mac OS Roman Unix LF 3 gt Fig 18 MatCalc v 1 1 input output file sample The rationale behind the adoption of the above format is based on the following ideas A single file containing both the simulation setup with the simulation results is essential for proper future reference Hence if unmodified it is particularly suited for loading into MatCalc s GUI for display since it ensures consistency between the displayed simulation setup and results A plain ASCII text file is almost universally portable and ensures readability by human readers with a simple text editor It is particularly suitable for analysis with software tools like Octave Eat94 computing environments and plotting utilities such as Gnuplot WK86 Gonzalo S nchez Virtlab 1
35. Engineering and Science McMaster University 5 Virtlab Project Evolution 5 3 5 Separation of Concerns and Information Hiding Basic principles play a key role in handling the difficult problems that arise in multi person multi version programming The most important principle in software engineering and in problem solving generally is separation of concerns 2 A problem that is too complex to be solved directly is decomposed into subproblems Subproblems that are still too difficult to solve directly are further decomposed The decomposition is most useful if the subproblems are independent or nearly so Thus considerable effort in software engineering is devoted to 1 the search for decompositions that maximize the independence of the subproblems and 2 careful documentation of the dependencies that remains HS99 s 1 2 pp 3 4 information hiding is the principle of segregation of design decisions in a computer program that are most likely to change thus protecting other parts of the program from extensive modification if the design decision is changed The protection involves providing a stable interface which protects the remainder of the program from the implementation the details that are most likely to change A software module hides information by encapsulating the information into a module or other construct which presents an interface A common use of information hiding is to hide the phy
36. Evolution 5 3 8 2 dset diff tool The dset diff tool originally difftool which compares two datasets has been refactored to use the new file input module and has been extended to compare shear stresses strains This is apparent from the console output which is identical to that of MatCalc s GUI ad CLI frontends upon reading an input file c f Fig 15 p 66 Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution 97 5 3 8 3 configset test utility A configset test test was created to check the workings of the newly created configset module It essentially exercises the allocation and deallocation of the members of type string in the configuration structure and the use of the set and get functions for each of the structure members School of Computational Engineering and Science McMaster University El 5 Virtlab Project Evolution 5 3 8 4 FEM_test tool The FEM test tool originally femtest has been completely rewritten and is now a standalone CLI tool that performs the same FEM simulation as MatCalc s CLI frontend Besides accepting an input file for defining the simulation FEM_test by default computes a simulation for a linear viscoelastic material model under an Uniaxial test for that particular setup it admits a number of command line switches to tweak the simulation that the normal CLI frontend to MatCalc does not accept
37. Maple computer algebra system installed in the CAS server mills cas mcmaster ca from within MatGen code generator for Virtlab The proper use of the tool showed the application MatGen failing to find some Maple shared objects by searching for them underneath its working directory as opposed to the system locations 21842 21842 21842 open proc stat O RDONLY 8 DANS ia si mode S MS Or se En e 0r sol 0 21842 mmap NULL 4096 PROT READ PROT WRITE MAP PRIVATE MAP ANONYMOUS 1 0 0x2aeaa0ba2000 DS eoi eT ZSZ AZ ASAS O II S ey AUS SS 21842 read 8 4096 0 21842 close 8 0 21842 munmap 0x2aeaa0ba2000 4096 0 21842 stat nfs u0 grad sancheg Projects virtlab svn mapleclient src ATHLON641024SSE3 4 libgmp So Ox7fff0ef40910 1 ENOENT No such file or directory 21842 stat nfs u0 grad sancheg Projects virtlab svn mapleclient src ATHLON641024SSE2 4 libgmp So Ox7fff0ef40910 1 ENOENT No such file or directory 21842 stat nfs u0 grad sancheg Projects virtlab svn mapleclient src ATHLON641024SSE3 2 libgmp So Ox7fff0ef40910 1 ENOENT No such file or directory 21842 stat nfs u0 grad sancheg Projects virtlab svn mapleclient src ATHLON641024SSE2 2 libgmp So Ox7fff0ef40910 1 ENOENT No such file or directory 21842 stat nfs u0 grad sancheg Projects virtlab svn mapleclient src ATHLON641024SSE3 libgmp s o
38. Ox7fff0ef40910 1 ENOENT No such file or directory 21842 stat nfs u0 grad sancheg Projects virtlab svn mapleclient src ATHLON641024SSE2 libgmp s o Ox7fff0ef40910 1 ENOENT No such file or directory 21842 stat nfs u0 grad sancheg Projects virtlab svn mapleclient src X8664SSE2 libgmp so Ox7fff0ef40910 1 ENOENT No such file or directory 21842 open nfs u0 grad sancheg Projects virtlab svn mapleclient src libgmp so Ol INDIONIEN E al ENMONHNIE Ner sshuvele icublues oe ASS yO a 2812 nete 2 recrea emo mith locas EMI o oy OS Q5 21842 rt sigprocmask SIG UNBLOCK ABRT NULL 8 0 21842 tgkill 21842 21842 SIGABRT 0 21842 SIGABRT Aborted 0 0 21842 killed by SIGABRT A soft link created to that library and other shared objects also sought in the inappropriate place allowed the application to initialize Gonzalo Sanchez Virtlab 1 1 M Eng Report Apr 2010 6 Software Tools School of Computational Engineering and Science McMaster University 7 Conclusions amp Future Work Research 7 CONCLUSIONS amp FUTURE WORK RESEARCH School of Computational Engineering and Science McMaster University 7 Conclusions amp Future Work Research 7 1 Conclusions The goals set for the period May 2009 March 2010 stated in section 5 2 3 p 42 have been globally achieved The overall usability of the software product has been signif
39. Report Apr 2010 3 Introduction 3 INTRODUCTION School of Computational Engineering and Science McMaster University 3 Introduction 3 1 Virtlab Software Library and Virtlab Project The Virtual Material Laboratory Virtlab is an extensible software library that implements a material modelling environment and material testing simulator From a user defined material behaviour model and virtual material test Virtlab will simulate the behaviour of the modelled material that 1s the material stress strain and deformation history are simulated under the conditions imposed by the virtual material test settings McC07 The software library includes a default set of models for elastic plastic viscous viscoelastic viscoplastic and elasto viscoplastic materials and a default set of load and displacement controlled virtual material tests Both material models and virtual tests are parametrized and the corresponding parameters are set at run time Additional material models and virtual tests can be added by the user to extend the software library as desired Virtlab software library was developed by John McCutchan for his M Sc Thesis under the supervision of Dr Spencer Smith at McMaster University McC07 It was originated as a proof of concept software being its underlying purpose that of applying software engineering techniques such as commonality analysis program families development and model
40. SMC09 SY09 VETTO00 vHe97 WK86 Commonality Analysis for a Family of Material Models S Smith J McCutchan J Carette Computing and Software Department McMaster University Draft Technical Report unpublished May 6 2009 A document driven methodology for developing a high quality Parallel Mesh Generation Toolbox S Smith W Yu Computing and software Department McMaster University Copyright O 2009 Elsevier Ltd Available June 2009 Advances in Engineering Software Journal doi 10 1016 j advengsoft 2009 05 003 GNU Autoconf Automake and Libtool G Vaughan B Elliston T Tromey I Taylor Copyright O 2000 2006 Gary V Vaughan URL http sources redhat com autobook Doxygen Source code documentation generator tool D van Heesch Copyright O 1997 2009 by Dimitri van Heesch URL http www stack nl dimitri doxygen redirected from http www doxygen org Gnuplot portable command line driven graphing utility for linux OS 2 MS Windows OSX VMS and other platforms T Williams C Kelley Copyright 1986 1993 1998 2004 Thomas Williams Colin Kelley URL http www gnuplot info Gonzalo Sanchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix 9 APPENDIX This chapter lists the contents of specific documentation files for the Virtlab software package and is meant as a reference while the documents listed in Table 1 where the information herein should be appr
41. Science McMaster University 6 Software Tools 6 2 Build Systems The build tool is always just a piece in the larger software development system Let us define more precisely the terms used below The build tool reads a build description and then directly starts other tools to actually produce the result of the build a report a compiled file etc A build system is a set of tools including a build tool by the way a good build system will support several competing build tools A build system may produce or adapt the build descriptions before they are used by the build tool A build system may in some way manage the build result for example it may post the summary of an automatic build on a Web site Next to the build tool the other important tool in a build system is the configuration tool the one that adapts or automatically generates the build descriptions used by the build tool To understand the paradigm shift introduced by build systems it is important to first know the new requirements addressed by build systems software distribution as a package of sources The typical usage scenario for a build tool is C sourcecode development Here the genuine input changes frequently and locally Avoidance is a crucial feature in this use case How building works elsewhere is less important Also the addition of new components to a build has to be easy By contrast for software distribution the crucial need is the ability to cu
42. StressU StressU 1 000E 02 2 000E 02 I me StressX 7 000E 02 8 000E 02 9 000E 02 1 300E 01 1 400E 01 StressY Stress Fig 14 MatCalc v 1 1 data table section of the right panel The aforementioned improvements did not involve significant code refactoring but mostly understanding the interaction between the GUI driver code and the GUI layout description A significantly more involved understanding was required though to match the underlying library functions to the GUI driver code School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution As expected the insight gained while improving the usability of the GUI frontend helped to implement file input output functionality Output files can be used as input e g for viewing in the GUI The input file parsing steps are dumped to the console as reference Fig 15 B Bl gonzalo sancheg Projects virtlab svn 1 l matcalc src e t3 File Edit View expo line line line line line line line line line line line line line line line line line line line line OODONOUBWNE Terminal Tabs Help home gonzalo Desktop output dat MatCalc Simulation Data Experiment Yield function Algorithm Time step Time span Specimen dim X Specimen dim Y Specimen dim Z Experiment constants displacement rat Material constants Elast Elasti Data record
43. TOOLS School of Computational Engineering and Science McMaster University 6 Software Tools 6 1 Subversion Subversion is a version control system that can be used to manage any collection of computer files Col00 Revision control also known as version control source control or source code management SCM is the management of changes to documents programs and other information stored as computer files It is most commonly used in software development where a team of people may change the same files Changes are usually identified by a number or letter code termed the revision number revision level or simply revision Each revision is associated with a timestamp and the person making the change Revisions can be compared restored and with some types of files merged http en wikipedia org wiki Revision control Version control systems basically contain the history of each of the files under version control so that at any time any file can be rolled back to a previous state in history As teams design develop and deploy software it is extremely common for multiple versions of the same software to be deployed in different sites and for the software s developers to be working simultaneously on updates Bugs and other issues with software are often only present in certain versions because of the fixing of some problems and the introduction of others as the program develops Therefore
44. an arbitrary volume V about a point P within the material continuum occupying a region of space Q SMCO9 Figure 6 p 24 It is possible to summarize the state of stress 6 at a point within a body by considering only three directions for n For an arbitrarily chosen infinitesimal cube centred at the point within the body this yields three traction forces acting on the faces of the infinitesimal cube SMCO 9 pp 24 25 Fig 3 Stress tensor for a point within a body SMC09 Figure 6 p 24 The nine components of the state of stress c depicted in Fig 3 define the stress tensor which under reasonable assumptions is symmetric implying that only six of its components are independent School of Computational Engineering and Science McMaster University 30 4 Virtlab Project Overview 4 3 3 Strain Strain is a measure of the deformation undergone by a body independent of the rigid rotations of the body For the body shown at two different instants in time in Fig 4 dx dX is a convenient expression for the deformation that the body suffered during the considered interval SMC09 p 25 Fig 4 The initial configuration of neighbouring points Po and 09 moving to their deformed configuration P and Q respectively SMCO9 Figure 8 p 27 The overall body deformation can be ultimately expressed as a symmetric nine element tensor which has only six independ
45. and Science McMaster University El 5 Virtlab Project Evolution For the test case selected which is two dimensional the search evolution can be plotted from the third and fifth columns of the above search log file Fig 29 300000 pattern log using 3 5 250000 200000 150000 100000 50000 0 5000 10000 15000 20000 25000 30000 35001 Fig 29 Search progress plot X axis ElasticE Y axis eta The plot in Fig 29 cannot provide much detail given that the algorithm implementation used does not return information on the trial centres tested as the sample search path in Fig 23 p 83 shows An implementation of the algorithm following the description provided in SHL83 see section 5 3 6 2 was developed with the result that a finer insight into the search is provided The insight comes at a cost the custom algorithm is far more inefficient than the algorithm originally downloaded from netlib org as the following excerpt from the resulting log shows Hooke amp Jeeves pattern search log eps 1 00000000e 03 rho 5 00000000e 01 r max 1000 e E ev f p p 0 p i p 2 0 1 86084132e 05 1 30000000e 03 3 00000000e 0 5 50000000e 04 1 5 0 549755e 05 1 95000000e 03 3 00000000e 0 8 25000000e 04 2 9 08670337e 05 3 25000000e 03 3 00000000e 0 1 37500000e 05 intermediate output omitted here 174 SE 09503500e 02 3 08934082e 04 3 00000000e 0
46. and the runtime platform are separate and very different in nature In that case automatic inspection of the build platform before the build will not get you very far In the embedded world some kind of database holding the characteristics of the different platforms turns out better The database is painful to maintain but is the only solution that works Autoconf has lately added some features to support cross compilation Last but not least one issue with GBS is the fact that it uses GNU Make and nothing other than GNU Make as a build tool You will frequently have inconsistent builds you will have a hard time debugging an inconsistent or a broken build you will not be able to build a program called clean or install etc All these issues with GNU Make undermine the important achievements of autoconf http freshmeat net articles make alternatives 9 See for example the whitepaper What s Wrong With GNU make at http www conifersystems com whitepapers gnu make 9 The boldface type used here is for highlighting passages of the quote but is not present in the original text Gonzalo Sanchez Virtlab 1 1 M Eng Report Apr 2010 6 Software Tools 111 6 2 1 5 User s perspective From the user s perspective the utility of the GNU build system is addressed by the aforementioned second goal the simplification it provides when it comes to building software distributed as source code as opposed to a b
47. but typically ignores the system calls and calls to library functions that are made by the application to the operating system Debugging provides a wealth of information about your application but not necessarily how the operating system is executing that application With tracing you are monitoring the interaction between the application and the operating system usually by looking at the operating system functions that are called by the application during its execution Despite these semantic differences the major difference between tracing and debugging is that tracing can take place without you having to have access to the source code or to compile the application in any special way This means that you can trace an application that comes with the operating system or from a third party vendor to find out what is wrong Bro09 p 4 Tracing an application enables you to find out Memory usage and calls to map memory e Files being opened and closed during execution Reads and writes to different files Libraries loaded for a given application Tracing tools therefore are usually included among the operating system tools e Linux strace ltrace e Solaris OpenSolaris truss dtrace e MacOS X ktrace dtrace dtruss Typically a tracing tool is used either to aunch an application so its interaction with the operating environment can be traced and observed or to attach to a currently running application for the same purpos
48. code for file input output but was embedded in the dataset module that holds the main data structure for the simulation results Given that storing retrieving the simulation data from to a file requires access to the said data structure having this code within the same module provided some simplifications However addition of any data structures in a foreign module such as the added configset module described below strongly suggested separating the concerns for the sake of understandability and maintainability Several of the tools the original developer had devised for testing specific aspects of the application had to be refactored to make use the new modules but overall the easiness with which these changes could be done and the understandability gained made the extra work worthwhile 5 3 5 2 GUI and CLI modules Another aspect of the separations of concerns achieved is that the GUI is now almost completely detached from the library s core as 1s the newly developed CLI frontend This should enable a developer to completely substitute the Gtk based GUI for another GUI frontend based on another widget toolkit or eventually producing a GUI oriented to web operation as well as compile Virtlab without GUI support see sections 5 3 1 and 5 3 2 5 3 5 3 stdout and stderr handling Part of the code refactoring effected with separation of concerns and information hiding in mind was to consistently enforce in the codebase
49. configure script produced by the Autoconf tool is the configuration tool for the GNU build system that adapts or automatically generates the build descriptions used by the build tool so that the software package distributed as source code behaves like an installer package like the commonly used for distributing executable code binary code In the case of the GNU Build system con sections of a sample configure script that screenshot in Fig 32 p 107 figure is a highly complex shell script Two spans a total of 11761 lines are shown on the Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 6 Software Tools bin sh H Guess values for system dependent variables and create Makefiles Generated by GNU Autoconf 2 61 for matcalc 1 1 1 5 H Report bugs to john amp johnmccutchan com sancheg mcmaster ca gt 7 Copyright C 1992 1993 1994 1995 1996 1998 1999 2000 2001 H 2002 2003 2004 2005 2006 Free Software Foundation Inc 5 H This configure script is free software the Free Software Foundation 3 gives unlimited adis e to copy distribute and modify it 1 A 11 HH 12 8t Msh Initialization gt 4 gt Be more Bourne compatible 5 DUALCASE 1 export DUALCASE for MKS sh 7 if test n ZSH_VERSION set 88 emulate sh gt dev null 2 81 then emulate sh NULLCMD zsh 3 x and 4 x performs word splittin
50. disable updating the coordinates while hovering with the input device over the graph panel to avoid the constant redrawing parsing of the data Improve its layout to avoid the overlap of the plot and the numerical legend add axis marks and a grid with major and minor divisions Add option to retain a plot to enable comparison with successive plots produced by new simulations e g for immediate feedback after a parameter value change Add controls for drawing lines between data points or changing the colour specially if plot superposition is implemented Enable plotting every column of the data table against any other e g stress or strain values against time Alternatively or additionally use an external plotting utility e g Gnuplot WK86 to manage all graphical output The linking of this external utilities to Virtlab should be handled by appropriate Autoconf options at compile time and depending on the availability of the dependencies or specific user choices might result in that functionality being available or not at run time see section 5 3 1 p 44 Other possible GUI improvements or fixes are Enable the display of stdout stderr streams on a window for those users who are not aware of or do not prefer the use of the console terminal Implement a status bar Implement a progress bar for providing feedback on the simulation running status this could be included in t
51. dist these fail to build from the generated packages so an end user cannot use the software And even if built as a developer by application of the whole GNU Build System toolchain make install does not perform any action towards installing the generated executables in whichever location is specified at build time This issue is stil unresolved The following sections describe the original situation of the building process of MatCalc and MatGen and the changes effected thereafter 5 3 1 2 1 MatCalc v 0 1 The original Autoconf environment for MatCalc had a hardcoded check for Ruby in the corresponding configure ac file which was specifically tailored to the original developer s platforms since at the time of development automated checks for Ruby were unavailable Check for ruby AC_CHECK_HEADERS usr lib ruby 1 8 i486 linux ruby h RUBY CFLAGS I usr lib ruby 1 8 i486 linux RUE Ye dures s M sedens Ao lhe AC CHECK HEADERS usr lib ruby 1 8 universal darwin8 0 ruby h RUBY CFLAGS I usr lib ruby 1 8 universal darwin8 0 RUBY LIBS lruby lle AC CHECK HEADERS usr lib ruby 1 8 powerpc darwin8 0 ruby h RUBY CFLAGS I usr lib ruby 1 8 powerpc darwin8 0 RUBY LIBS lruby lle AC MSG ERROR libruby 1 8 is needed to compile 1 1 1 AC SUBST RUBY CFLAGS AC SUBST RUBY LIBS Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution For examp
52. even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License version 2 for more details You should have received a copy of the GNU General Public License along with this program if not write to the Free Software Foundation Inc 59 Temple Place Suite 338 Boston MA 02111 1387 USA 00840 include cli h 08841 Winclude debug utils h 868842 minclude gui h 00043 00944 08845 int main int argc char argv MatCalc GUI mode if argc 1 du message MatCalc GUI mode du message Type matcalc h for CLI options Call GUI interface NB if without gui switch is enabled check if GUI was built gui main argc argv Will quit when GUI is destroyed MatCalc CLI mode else du message MatCalc CLI mode du message Type matcalc h for CLI options du message Type matcalc for GUI mode Call CLI interface cli main argc argv Will quit when CLI returns Quit return EXIT SUCCESS Generated on Mon Mar 29 15 52 51 2010 for MatCalc by dagan Fig 38 matcalc cc code listing generated by Doxygen Note the missing lines between line 18 and 37 these correspond to the brief and detailed comments targeted to Doxygen parser which are excluded in the code listing and posted to the corresponding File Reference Fig 37 School of Computational Engineering an
53. for each instance The tests revealed the following The simulation results are completely different for simulations computed with the Radial Return map or Viscoplastic integration algorithms the relative error between results reaches 10096 for some of the data columns in the datasets compared The simulation results are identical for simulations computed with the Elastic integration algorithm the relative error between results is 096 in all data vectors compared Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution 5 3 4 2 Future work Future work in MatGen should cover the following issues Diagnose and fix the code generation problems e Eliminate the relative path reference to the XML definition file for the GUI which prevents the software to be called from any directory except from that where the XML file is found as data yieldf glade This should be dealt with by means of the Autoconf framework see section 5 3 1 Additional enhancements could be similar to those stated for MatCalc see section 5 3 2 3 p 67 Enable the display of stdout stderr streams on a window for those users who are not aware of or do not prefer the use of the console terminal Implement a status bar Implement a progress bar for providing feedback on the code generation status this could be included in the status bar previously suggested School of Computational
54. invoke make again with the target install GJO3 p 9 The aforementioned commands assume that the user has a working compiling environment on his her platform the make tool and a properly installed compiler suite like the GNU Compiler Collection GCC invoked with the command gcc and the unpacking tools gunzip and tar These tools are standard in any Linux distribution and are available for MacOS X and Solaris OpenSolaris platforms as well li Solaris OpenSolaris platforms can also include SunStudio compiler suite that could be used in lieu of GCC however programs build around the GNU Build System expect GCC so some changes might be required to use other compiling suite Additionally Solaris nake command is not compatible with GNU s make command and the latter is renamed gmake in Solaris platforms but not in OpenSolaris Since the GNU Build Systems expects make depending on the platform the user might have to ensure the GNU tools are found first in the command search path and eventually provide an appropriate symbolic link for gnake named make School of Computational Engineering and Science McMaster University 6 Software Tools 6 2 1 6 Developer s perspective From the developer s perspective apart from the same usability improvements provided for the end user the other underlying qualities addressed by the GNU build system are clearly that of maintainability portability verifiability and reliability
55. limits h declares gettimeofday define ac func innocuous ac func System header to define stub macros and hopefully few prototypes which can conflict with char ac func below Prefer lt limblies INS tO eewexexcibciab dt SMC as Glewtsosrexele ginte lt limits h gt exists even on freestanding compilers ifdef STDC include lt limits h gt else include lt assert h gt tendif fundef ac func Override any GCC internal prototype to avoid an error Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply tifdef cplusplus extern C tendif hom Sara SU cM NT The GNU C library defines this for functions which it implements to always fail with ENOSYS Some functions are actually named something starting with _ and the normal name is an alias fif defined stub ac func defined _ stub Sac func choke me tendif NE Meaning the above checks were in practise unnecessary for the tested platforms School of Computational Engineering and Science McMaster University 46 5 Virtlab Project Evolution As can be inferred from the above code snippet the checks include information gathered out of years of experience of countless experts with different systems It is highly unlikely that this complex and detailed information can be understood and handled by a single developer without the aid of th
56. manipulation to improve the qualities of a scientific computing software package Accuracy Maintainability Performance Portability Reliability Reusability Understandability and Verifiability At this stage Virtlab Project s main objective was developing library modules that could be easily embedded in larger applications This first stage was successfully finalized by September 2007 see section 5 1 1 Virtlab Project s second stage May August 2009 January Marchl 2010 see section 5 1 2 shifted the objectives towards leveraging the software library qualities to industrial grade In this context software engineering techniques such as separation of concerns and information hiding and tools such as memory leak checkers and automated code documentation generators have been applied with the following results the overall usability of the software package has been improved by enhancing the building process and user interfaces its portability has been extended from Linux and MacOS X to Solaris and OpenSolaris platforms its understandability and maintainability has been significantly improved by adequate documentation its performance has been improved by detection and correction of defects its capabilities were extended by addition of tools which in turn will aid to improve the accuracy and reliability of the software library and its maintainability and reusability have been improved by addition and refactoring of library module
57. material model class using MatGen Section 9 10 lists the contents of the shell script test matcalc sh which performs a number of memory leak checks using Valgrind see section 6 4 p 123 on several of MatCalc tools Section 9 11 lists the contents of test EvalMapleStatement cc C source code file which uses the EvalMapleStatement function defined in Maple s application programming interface to execute Maple commands and get their result e Section 9 12 contains a copy of the source code file listing for MatCalc v 1 1 generated by Doxygen e Section 9 13 reports the memory leak problem in MatCalc v 0 1 and its fix e Section 9 14 presents an overview of the preprocessing compilation assembly and static dynamic linking process l Note the content of this section is in its entirety based on the information provided by original developer of Virtlab John McCutchan who diagnosed the problem and proposed the corresponding fix School of Computational Engineering and Science McMaster University 9 Appendix 9 1 MatCalc ChangeLog Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix School of Computational Engineering and Science McMaster University 9 Appendix Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix School of Computational Engineering and Science McMaster University 9 Appendix Gonzalo S nchez Virtlab 1 1
58. of reading Allows inclusion of function member class definitions in the documentation All options are read from an easy to edit and optionally annotated configuration file Documentation and search engine can be transferred to another location or machine without regenerating the documentation School of Computational Engineering and Science McMaster University 6 Software Tools An example of the graphical output capabilities and syntax highlighting of Doxygen is provided by Doxygen s graph legend page for C classes Fig 35 File Edit View History Bookmarks Tools Help Graph Legend This page explains how to interpret the graphs fust are generated by daxygen Consider the following example Invisible class because of truncation class Invisible Truncated class inheritance relation is hidden class Truncated public Invisible Class not documented with doxygen comments class Undocumented Class that is inherited using public inheritance class PublicBase public Truncated A template class templatecclass T class Templ Class that is inherited using protected inheritance class ProtectedBase Class that is inherited using private inheritance class PrivateBase Class that is used by the Inherited class class Used Super class that inherits a number of other classes class Inherited public
59. order regardless of the operating system compiler these are graphically illustrated in Fig 40 1 Preprocessing is the first pass of any C compilation It processes include files conditional compilation instructions and macros 2 Compilation is the second pass It takes the output of the preprocessor and the source code and generates assembler source code 3 Assembly is the third stage of compilation It takes the assembly source code and produces an assembly listing with offsets Assembler output is stored in an object file 4 Linking is the final stage of compilation It takes one or more object files or libraries as input and combines them to produce a single usually executable file In doing so it resolves references to external symbols assigns final addresses to procedures functions and variables and revises code and data to reflect new addresses a process called relocation OBJECT FILES and EXECUTABLE After the source code has been assembled it will produce an Object file e g o obj When linked produces an executable file RELOCATION RECORDS Because the various object files will include references to each others code and or data these shall need to be resolved during the link time For example in Fig 41 the object file that has main includes calls to functions unct and printf After linking all of the object files together the linker uses the relocation records to find all of the addresse
60. others will be linked at run time deferred dynamic linking STATICALLY LINKED PROGRAM The term statically linked means that the program and the particular library that it s linked against are combined together by the linker at link time This means that the binding between the program and the particular library is fixed and known at link time before the program run It also means that we can t change this binding unless we re link the program with a new version of the library Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix Programs that are linked statically are linked against archives of objects libraries that typically have the extension of a An example of such a collection of objects is the standard C library libc a You might consider linking a program statically for example in cases where you weren t sure whether the correct version of a library will be available at runtime or if you were testing a new version of a library that you don t yet want to install as shared DYNAMICALLY LINKED PROGRAM The term dynamically linked means that the program and the particular library it references are not combined together by the linker at link time Instead the linker places information into the executable that tells the loader which shared object module the code is in and which runtime linker should be used to find and bind the references This means that the binding between the program
61. s output device typically a screen or a file c f GUI SC Scientific Computing the use of computers and programs with scientific and or engineering purposes SE Software Engineering the application of engineering principles a systematic disciplined quantifiable approach to the development operation and maintenance of software and the study of these approaches SQ Software Qualities A collection of measures that together define the excellence or worth of a software product or process Accuracy Maintainability Performance Portability Reliability Reusability Understandability Verifiability Table 3 Abbreviations and Acronyms Wikipedia English URL http en wikipedia org except for Virtlab SQ SY09 s 2 Gonzalo Sanchez Virtlab 1 1 M Eng Report Apr 2010 2 Reference Material 2 4 Conventions Issue Convention References naming Bibliographical references are indicated in square brackets with the following criteria References by a single author will be indicated with the first three letters of the author s surname followed by the last two digits of the publication year of the referred work e g Sur08 Conflicting cases will be distinguished by appending a letter e g Sur08a Sur08b etc References by multiple authors will include each author s surname first letter followed by the year eg AB08 ABCD08 Conflicting cases will be resolve
62. typical behaviour in fluids Viscoelastic viscoplastic and elasto viscoplastic materials present combinations of the aforementioned characteristic behaviours 7 In load controlled tests a known force is applied over time to the test specimen and the resulting specimen s deformation is measured from which the strain state can be calculated In displacement controlled tests the test specimen is subject to a known sequence of deformations over time and the resulting specimen s internal loading condition stress state is calculated see section 4 3 for an overview of continuum mechanics basic concepts The Virtlab software library is compiled by default into two programs MatCalc and MatGen but is not limited to be used in such a way its modules can be reused in the context of larger applications Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 4 Virtlab Project Overview 27 4 2 Motivation The key enabling factor for developing an extensible material behaviour simulator such as Virtlab results from a commonality analysis for a family of material models SMC09 The commonality analysis suggests that a single constitutive equation can be used for a variety of materials elastic plastic viscous viscoelastic viscoplastic and elasto viscoplastic materials Hence rather than developing individual programs to simulate the behaviour of each class of materials the commonalities enable the dev
63. visible in the screenshot but implemented in v 1 1 of MatCalc s GUI frontend is the possibility of displaying the shear stresses and strains in graphical format which significantly improves the ability of the user to explore the simulated material behaviour In v 1 1 the right panel can be resized independently of the left panel which in wide displays allows the user to view the whole width of the data table Fig 12 M Material Calculator e File Edit View Help SIMULATION SETUP SIMULATION RESULTS General parameters m pee Experiment Uniaxialx m Yield Function OC smith material EZ 7 Time StressX StressY StressZ StressXY StressXZ StressYZ StrainX StrainY StrainZ StrainXY StrainXZ StrainYZ Algorithm Radial return map It StressU StressU Stressu Stressu StressU Stressu fu iUt Jiu uu LL Jiu Time step 8 600E 01 45 544E 02 2 216E 07 221007 7 399E 18 44 ATOE 16 47212616 8 254E 02 3 757E 02 3 757 02 8535613 8535613 B 645E 13 Time span 8 700E 01 5 543E 02 42 214E 07 2 214E 07 3 1285 16 6 824E 16 8 916E 16 8 346E 02 3 804E 02 3 804E 02 B 535E 13 8 j B 645E 13 38 800E 01 5 542E 02 2 212E 07 2 212E 07 8 283E 17 i 4 500E 16 1 126E 16 i 38 438E 02 3 850E 02 3 850E 02 8 535E 13 13 B 645E 13 Spscroan dimansion 48900E 01 45 540E402 2 210E 07 2 210E 07 44127E 16 42 892E16 3 185E 16
64. 0 Tas ol ep aras Alo AS 1 9 5 Uu Al OA CS OO SAIZ getcwd export home mc 1014 0 resolvepath export home mc errnoacc export home mc errnoacc 1023 24 xstat 2 export home mc errnoacc 0x080477E4 0 open var ld ld config O RDONLY 3 fxstat 2 3 0x080476C4 0 mmap 0x00000000 144 PROT READ MAP SHARED 3 0 OxFEFA0000 close 3 0 sysconfig CONFIG PAGESIZE 4096 xetstdigs se iby ibe se 1 esos or 0d ES resolvepa 9 iie Mato lave 5010 Wale ido O 10 UI de open usr lib libc so 1 O RDONLY 3 mmap 0x00010000 32768 PROT READ PROT EXEC MAP PRIVATE MAP ALIGN 3 0 OxFEF90000 mmap 0x00010000 1413120 PROT NONE MAP PRIVATE MAP NORESERVE MAP ANON MAP ALIGN 1 0 OxFEE30000 mmap OxFEE30000 1302809 PROT READ PROT EXEC MAP PRIVATE MAP FIXED MAP TEXT 3 0 OxFEE30000 mmap OxFEF7F000 30862 PROT READ PROT WRITE PROT EXEC MAP PRIVATE MAP FIXED MAP INITDATA 3 1306624 OxFEF7F000 mmap OxFEF87000 4776 PROT READ PROT WRITE PROT EXEC MAP PRIVATE MAP FIXED MAP ANON 1 0 OxFEF87000 munmap OxFEF6F000 65536 0 memcntl OxFEE30000 187632 MC ADVISE MADV WILLNEED 0 0 20 close 3 0 mmap 0x00010000 24576 PROT READ PROT WRITE PROT EXEC MAP PRIVATE MAP ANON MAP ALIGN 1 0 OxFEE20000 munmap OxFEF90000 32768 0 getcontext 0x08047534 getrlimit RLIMIT STACK 0x0804752C 0 getpid ate babe read lwp private 0 1 OxFEE22A00 0x000001C3 setustack 0x
65. 2 1 13 8 success failure 16 3 2 12 l 15 failure 17 3 2 12 3 15 failure 8 4 0 10 3 E Qu quu return 18 4 1 123 8 failure 19 4 1 8 3 8 failure 20 4 2 10 1 8 failure 21 4 2 10 5 8 failure 8 5 0 10 3 z Lo 1 step lengths halved 22 5 1 11 3 3 failure 23 5 1 9 3 8 success 24 5 2 9 2 23 8 SUCCESS SUCCESS 25 6 0 8 I IE extrapolation Fig 24 Tabular description of the sample search path in Fig 23 School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution 5 3 6 3 Design decisions and implementation overview The implementation of the parameter fitting tool for MatCalc used as basis for the Hooke and Jeeves direct search method a C code obtained from netlib org which was just tailored to the case of interest The code does not exactly follow the Hooke and Jeeves method as described in the preceding section 5 3 6 2 but implements a close version of the basic algorithm with some enhancements At the a version stage a single monolithic wrapper routine was developed to make use of the aforementioned code to perform the following tasks interface with MatCalc s codebase to set up the simulation environment that is using the codebase directly as a library and not using MatCalc CLI as a tool e setup the cost function for minimization e launch the direct search method The resulting call graph for this routin
66. 2057 32057 32057 32057 32057 38059 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 32057 Memcheck a memory error detector Copyright C 2002 2006 and GNU GPL d by Julian Seward et al Using LibVEX rev 1658 a library for dynamic binary translation Copyright C 2004 2006 and GNU GPL d by OpenWorks LLP Using valgrind 3 2 1 a dynamic binary instrumentation framework Copyright C 2000 2006 and GNU GPL d by Julian Seward et al My PID 32057 parent PID 29514 Prog and args are of Lakes several lines suppressed here ERROR SUMMARY 0 errors from 0 contexts suppressed 4 from 1 supp 4 Fedora Core 6 hack3 1d25 malloc free in use at exit 816 531 bytes in 9 475 blocks malloc free 10 114 allocs 639 frees 884 066 bytes allocated Searching for pointers to 9 475 not freed blocks checked 1 545 680 bytes several lines suppressed here 400 040 bytes in 1 blocks are still reachable in loss record 4 of 5 at 0x4A05809 malloc vg replace malloc c 149 by 0x4C798FD add heap gc c 383 by 0x4C6E915 ruby init eval c 1388 by 0x40AA54 ruby boot ruby helper cc 90 by 0x40508A experiment list experiment list exper
67. 3 00781250e 03 175 Sil 09503500e 02 3 08934082e 04 3 00000000e 0 3 00781250e 03 176 927 09503500e 02 3 08934082e 04 3 00000000e 0 3 00781250e 03 176 27 09503500e 02 3 08934082e 04 3 00000000e 0 3 00781250e 03 EOF Note the file layout has been modified in the last tried version of the algorithm Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 irtlab Project Evolution 5 Virtlab Project Evoluti 89 Fig 30 clearly shows the step size reduction which gives an idea of the time progress of the search painfully slow once eta has reached an almost stable value circa 3E 3 and ElasticE is about 10E 3 300000 pattern log using 4 6 250000 200000 150000 100000 50000 0 5000 10000 15000 20000 25000 30000 3500 Fig 30 Search progress plot X axis ElasticE Y axis eta with custom algorithm In terms of the number of cost function evaluations the original algorithm required 694 versus the 927 required by the custom version Already the original algorithm takes 20 minutes of wall clock time to run on CAS server mills mcmaster ca and the custom one surpasses the half hour for the test case used Additionally some specific choices for the original algorithm convergence stepsize factors can produce completely wrong results for the same initial guesses as the following log shows Hooke amp Jeeves search log
68. 3 3 Ruby Whenever an instance of dataset datachunk or m vector is accessed it causes C code to be executed and possibly allocate memory inside of a dataset or m vector So it is the C objects that grow and resize not the Ruby objects There is a tiny leak from the call to Data Make Struct the real leak is because the C destructors are never called The following example shows how to pass a dataset to Ruby so that the tick method can be run VALUE Ada tasstivolue datassStruoya create ds Mil VATU cle valts mwgy scaler scree elt Varun Cie valis Tuy Caler senses Ct a VALU morusce ie ezi methoci sa nsitance mantle 3 eetesze value eater et veluwe First the code allocates memory for a Ruby VALUE type The VALUE type is a generic Ruby handle pointer type VALUE dataset_value dataset_ruby create ds It also allocates memory for a native C dataset type Both of those allocations are small The memory used for the VALUE type is collected by the Ruby GC and currently the memory used for the native C dataset type is leaked but this is small Inside dataset value there is a pointer to a C dataset instance which will be referred as inner Second the code copies the contents of ds into inner this is where the real memory leak is After 1 is executed we have two copies of the dataset One in ds and the other in inner The leak happens because the destructor of the inner is never called
69. 4 Virtlab Project Overview 4 3 5 Body environment relationship equilibrium equation If at every instant the body is assumed to be in equilibrium then neglecting inertia self weight and other body forces the following equilibrium equation must always be satisfied McCO7 p 18 5 lo 0 0 0 Ox O y 0 z I 0 0 On _ 0 By 0 E ox 0 7 0 0 0 0 0 Oy Oz Oy Ox lo L LI u Eg 5 Eguilibrium eguation 4 3 6 Continuum mechanics problem statement For the problem and goal of continuum mechanics stated in section 4 3 1 and given e the kinematic equation Eg 1 a constitutive equation Eq 4 that assumes additivity of elastic and viscoplastic effects as per Eq 2 and models the viscoplastic strain rate tensor as per Eq 3 anequilibrium state as defined in Eq 5 the continuum mechanics problem can be stated as follows To solve for the changes of deformation and stress within a given body the following system of partial differential equations PDE need to be solved simultaneously subject to initial and boundary conditions Lu b 0 6 DEE v y F k e o 22 090 Eg 6 Continuum mechanics problem statement in terms of the kinematic equation the equilibrium equation and the constitutive equation based on Perzyna s model of the viscoplastic rate tensor and the additivity postulate of elastic and viscoplastic effects which are described in th
70. 5 Fig 22 p 80 Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution 5 3 4 MatGen Except for slight updates in the building process see section 5 3 1 p 44 and the documentation improvements see section 5 3 7 p 91 no specific work was performed on MatGen modules The reason for the scarce improvements to MatGen specific modules reside in two facts Virtlab Project goals implied focusing mainly on MatCalc modules 2 MatGen s basic purpose the material model classes code generation produced inconsistent results o Sometimes no code is generated o Sometimes code is generated that would not compile o Sometimes code is generated that would successfully compile but would produce wrong results when run within MatGen A significant effort was effected towards diagnosing and fixing the problem but unfortunately without success This problem was put aside in the face of the other priorities of the Virtlab project and is now the first one indicated as future work on Virtlab Project see section 7 2 p 139 5 3 4 1 Code generation statement test A tool test EvalMapleStatement was developed with the intention to diagnose and fix the code generation problem detected with MatGen Section 9 11 p 188 liss the contents of the test EvalMapleStatement cc file The tool uses the existing MatGen modules to interface the Maple computer algebra system in the same way MatGen do
71. 5 6 5 3 6 5 5 3 7 6 and 5 3 8 5 School of Computational Engineering and Science McMaster University 7 Conclusions amp Future Work Research fallback option this requires support in the building process by way of appropriate with lt feature gt or without lt feature gt options Improve the separation of concerns to achieve o memory safety in all material test and material model operations o the choice of using the BLAS libraries http www netlib org blas in lieu of the currently implemented classes for matrix vector operations this requires support in the building process by way of appropriate with feature or without feature options Improve the FEM algorithm at the core of MatCalc either by optimization of the existing code or substitution of the currently implemented algorithm Improve the performance of the Material Model Parameters Fitting Tool apply MPI constructs for parallel computation requires redefining convergence criteria Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 7 Conclusions amp Future Work Research 141 7 3 Future research Future research envisioned around Virtlab project could include Research into automated documentation tools and techniques towards the purpose of faking the rational process promoted in PC86 and facilitating the maintenance of up to date and consistent documentation Researc
72. 67D0 strcmp 17925 REDIR 0x383CA14620 strlen redirected to 0x4A06700 strlen 17925 Reading syms from usr lib64 libgtk x11 2 0 s0 0 1000 4 0x3847A00000 EI eM object doesn t have a symbol table 17925 Reading syms from usr 1ib64 libgdk x11 2 0 so 0 1000 4 0x384A000000 med pg em object doesn t have a symbol table several lines suppressed here 7925 2 ERROR SUMMARY 0 errors from 0 contexts suppressed 4 from 1 T9295 POLOS NE 4 Fedora Core 6 hack3 1d25 7925 2 malloc free in use at exit 0 bytes in 0 blocks 7925 2 malloc free 5 461 allocs 5 461 frees 454 809 bytes allocated 17925 17925 All heap blocks were freed no leaks are possible 17925 memcheck sanity checks 39 cheap 2 expensive 17925 memcheck auxmaps 1381 auxmap entries 88384k 86M in use 17925 memcheck auxmaps 6016040 searches 57284561 comparisons 179259 ies OMS a issues 64 1024k 1M 17192392 mencnecalss Mes m cleubsswieel 0 Ole OM MM mensae M Ses mer moscas HZ TE ODIO Si N 17 929 iilewielnecies Sue MEZ MESELTE M QU s OM PI meme Mec dme mm ecl AO 2024929 Kee l 920 memcheck SMS max nem DSM 64 1024k 1M L 925 Memcheck max sec V Dit nodes D Ok DM ub MEmememecke sel Sec vales cade 0 ewe OM Cate szamon 17925 memcheck max shadow mem size 5168k 5M SAL ADS Trans ete fast SP updates identified 5 456 88 3 1 des translate generic kn
73. 9 6 9 7 9 8 and 9 9 list the contents of the aforementioned files 5 3 7 6 Future work Future work in documentation should address the following issues Complete the source code documentation brief and detailed comments for use by the Doxygen documentation tool Document the objects classes methods functions structures etc in the codebase using Doxygen s appropriate keywords to improve the automatically generated documentation thereafter Automate the maintenance of the documentation set One step towards this goal would be to study the possibility of using Doxygen to automatically extract TODO and FIXME comments within the code with the purpose of automating the maintenance of the TODO tasks e Produce the complete set of documents listed in Table 1 p 15 The VL TM document should actually be a document set System Requirements Specification SRS Module Guide MG Module Interface Specification MIS as suggested in HS99 Any step towards automating the maintenance of this document set should be pursued Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution 5 3 8 Virtlab tests and tools Virtlab software library included a number of files that even undocumented clearly were intended either as tests for specific aspects of the codebase or as tools for accessing specific information of the software library and checking simulation r
74. 97 9 of the computer s memory 9 Which for the sample test case used throughout amounts to roughly 10MB the size of the dataset structure that holds the complete simulation results Leaving the system unusable for about 15 minutes wall clock time it is assumed that a system s garbage collector could correct the situation The memory flooding was tested three times with identical results Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 6 Software Tools The problem was tracked by the use of Valgrind memory checker module and the most severe leak was almost immediately isolated and fixed by the original developer upon observing Valgrind s logs The leak and the corresponding fix are described extensively in section 9 13 starting at p 194 This is a clear example of how adequate software engineering practices and appropriate tools can significantly improve the performance and reliability qualities of any software package It needs to be stressed that the use of Valgrind in Virtlab v 1 1 still shows the occurrence of memory leaks that therefore need to be resolved Yet their practical impact is tolerable enough for the software package to be usable whilst the leaks are fixed The use of memory checkers in unit and regression tests will alert of memory leaks in a software package as from their inception These kind of tools should be a key resource in the development of any software package
75. Engineering and Science McMaster University 4 Virtlab Project Overview 4 1 Introduction Virtlab is an extensible software library that implements a material modelling environment and material testing simulator From a user defined material behaviour model and virtual material test Virtlab will simulate the behaviour of the modelled material that is the material stress strain and deformation history are simulated under the conditions imposed by the virtual material test settings McC07 The software library includes a default set of models for elastic plastic viscous viscoelastic viscoplastic and elasto viscoplastic materials and a default set of load and displacement controlled virtual material tests Both material models and virtual tests are parametrized and the corresponding parameters are set at run time Additional material models and virtual tests can be added by the user to extend the software library as desired The Virtlab software library consists of two programs MatCalc and MatGen MatGen is a material model generator which takes a material model specification described in a simple DSL Domain Specific Language and uses the Maple computer algebra system Map80 to perform symbolic computations and generate C code which is then inlined in a C class that implements the material model The set of these classes are linked at compile time with the material test simulator MatCalc to be available a
76. FEE22A60 Sysi86 SI86FPSTART OxFEF879BC 0x0000133F 0x00001F80 0x00000001 open etc shadow O RDONLY Err 13 EACCES file dac read ioctl 1 TCGETA 0x08046BB0 0 fstat64 1 0x08046B10 0 ERROR Application failed to initialize are MA IRE TRL 0 det B IX ig ig db avs ss 9 40 sale 00 From the trace it can be seen that the issue is in this 6th line counting from the bottom that reads open etc shadow O RDONLY Err 13EACCES file dac read The problem with the application is that it is trying to open a file to which the user running the application has no permission to access School of Computational Engineering and Science McMaster University 6 Software Tools As can be inferred from the aforementioned tracing example each line of output shows the application executing one function call alongside with the arguments to the function and its call return value Unlike in debugging each function call listed is a function within the system or system libraries and therefore represents a lower level interface to the functions called For example opening a file within an application may use the popen function within C or C but this is in fact a wrapper to the more primitive open function Bro09 pp 7 8 The tracing tool strace was actually used by the System Administrator in CAS Department at McMaster University for troubleshooting an initialization problem of the
77. Fig 36 input cc call and caller graphs generated by Doxygen All entities listed under the References and Referenced by labels as well as all entities in the call and caller graphs are hyper links to the corresponding sections of the Doxygen documentation School of Computational Engineering and Science McMaster University 6 Software Tools An example of the brief comment under matcalc cc File Reference heading and the detailed comment under the Detailed Description heading in the source code extracted by Doxygen and posted to the File Reference for the file matcalc cc alongside the include dependency graph for the file is shown in Fig 37 File Edit View History Bookmarks Tools Help matcalc cc File Reference 000 MatCaic executable wrapper that spawns MatCak s CLI or GUI depending on the provided command line switches Run matcak h More include cli h include debug utils h include gui h Include dependency graph for matcalc oc debug utils h glade glade h Go to the source code of this file Functions int main int argc char argv Detailed Description 000 MatCaic executable wrapper that spawns MatCak s CLI or GUI depending on the provided command line switches Run matcalc h MatCaic FEM engine is run by the executable matcalc which is just a wrapper that spawns either the CLI or GUI frontends depending on t
78. K yes hecking for GLADE yes configure WARNING Please add i386 pc solaris2 11 to configure ac checks configure creating config status config status creating Makefile config status creating src Makefile config status creating config h config status executing depfiles commands eh eh Wey er ex ey 18 tel Tel 5 3 1 2 4 MatGen v 1 1 Contrary to MatCalc s building process at the time of writing this report MatGen s building process has not yet been fully automated MatGen s main dependency location the Maple computer algebra system still needs to be specified by the user by passing to MatGen s configure script certain environment variables A reminder has been included in the corresponding configure ac file which alerts the user of this issue upon running the configure script The following code snippet shows the warnings for the case of Solaris OpenSolaris platforms Warning for Maple dependencies G S 2009 07 08 case Shost in WoW goleia AC DEFINE PLATFORM SOLARIS 1 Platform is Solaris OpenSolaris AC MSG WARN Please specify Maple environment on the command line AC MSG WARN MAPLE ROOT path to maple folders AC MSG WARN OPENMAPLE CFLAGS I SMAPLE ROOT extern include AC MSG WARN OPENMAPLE LDFLAGS LN MAPLE ROOT bin SOLARIS AC MSG WARN OPENMAPLE LIBS lmaplec lmaple lgmp Er AC MSG WARN Please add host to conf
79. PublicBase protected ProtectedBase private PrivateBase public Undocumented public Templ lt int gt t private Used m_usedClass y This will resit in the flowing graph icecsiad PublicBase ProtectedBase PrivateBase The baxes in the above gagh have the following mering e A Slled gray bax represents the struct or dass for which the graph is generated A bax with a lack border denotes a documented struct ar dass A bax wif a grey border denotes an undoournertied struct or dass A bax with a red border denotes a documented struct ar dass foratich nat all inheritenoalcontrmment reasons are shown A graph is truncated if it does not 8t within the specified boundaries The arrows have the fallawing mering A dark blue arrow is used to visualize a public inheritance relation between two dasses Adark green arrow is used for protected inheritance Adark red arrow is used for private inhernitanos A purple dashed arrow is used if a dass is contained ar used by another dass The arrow is labeled with the variable s trough which the pared dass ar struct is accessible A yellow dashed arrow denotes a relatan between a Sermgplarte instance and the templa e dass it was instartiaied fom The arrow is labeled with te tengiaie parameters al the instanoe Generated on Mon Mar 29 15 54 16 2010 for MatCalc by ela s Fig 35 Doxygen graph legend Gonzalo S nchez Virtlab 1 1 M Eng Report Apr
80. Some tasks that are simplified by the GNU build system include Building multidirectory software packages It is much more difficult to use raw make recursively Having simplified this step the developer is encouraged to organize his source code in a deep directory tree rather than lump everything under the same directory Developers that use raw make often can t justify the inconvenience of recursive make and prefer to disorganize their source code With the GNU tools this is no longer necessary Automatic configuration You will never have to tell your users that they need to edit your Makefile You yourself will not have to edit your Makefiles as you move new versions of your code back and forth between different machines Automatic makefile generation Writing makefiles involves a lot of repetition and in large projects it will get on your nerves The GNU build system instead requires you to write Makefile am files that are much more terse and easy to maintain Support for test suites You can very easily write test suite code and by adding one extra line in your Makefile am make a check target available such that you can compile and run the entire test suite by running make check Automatic distribution building The GNU build tools are meant to be used in the development of free software therefore if you have a working build system in place for your programs you can create a source code distribution out of it by running make
81. Washington M Jimenez Pontificia Universidade Cat lica do Rio de Janeiro PUC Rio Last updated 3 April 2003 Copyright O 1998 2003 Eleftherios Gkioulekas and Marcelo Roberto Jimenez All rights reserved Glade Interface Designer cross platform graphical user interface builder for GTK GNOME Foundation 1998 URL http glade gnome org Message Passing Interface language independent communications protocol used to program parallel computers W Gropp et al 1996 OpenMPI is an Message Passing Interface MPI library project combining technologies and resources from several other projects FT MPI LA MPI LAM MPI and PACX MPI URL http www open mpi org Software Design Automated Testing and Manteinance A Practical Approach electronic edition D Hoffman P Strooper July 22 1999 Gtk GNU Image Manipulation Program GIMP Toolkit S Kimball P Mattis eXperimental Computing Facility XCF at University of California Berkeley 1997 Cross platform widget toolkit for creating graphical user interfaces Maintained by the GNOME Foundation URL http www gtk org Maple general purpose computer algebra system Symbolic Computation Group University of Waterloo Waterloo ON Canada Since 1988 developed and sold commercially by Waterloo Maple Inc a k a Maplesoft Waterloo ON Canada URL http www maplesoft com Ruby dynamic reflective general purpose object oriented programming language Y Matsumoto et al 1st r
82. a set of files Output files are marked as depending on their source files for example and on files which they include internally since they all affect the output After each dependency is listed a series of lines of tab indented text may follow which define how to transform the input into the output if the former has been modified more recently than the latter In the case where such definitions are present they are referred to as build scripts and are passed to the shell to generate the target file A makefile also can contain definitions of variables and inclusion of other makefiles Variables in makefiles may be overridden in the command line arguments passed to the make utility This allows users to specify different behaviour for the build scripts and how to invoke programs among other things For example the variable CC is frequently used in makefiles to refer to a C compiler and the user may wish to provide an alternate compiler to use http en wikipedia org wiki MakefilezzMakefile structure Below is a very simple makefile that would compile a source called helloworld c using cc a C compiler and specifies a clean target to remove the generated files for example to start over The PHONY tag is a technicality that tells make that a particular target name does not produce an actual file The 8 and lt are two of the so called internal macros also known as automatic variables and stand for the target name and implicit
83. acted directly from the sources which makes it much easier to keep the documentation consistent with the source code 2 You can configure doxygen to extract the code structure from undocumented source files This is very useful to quickly find your way in large source distributions You can also visualize the relations between the various elements by means of include dependency graphs inheritance diagrams and collaboration diagrams which are all generated automatically 3 You can even abuse doxygen for creating normal documentation http www stack nl dimitri doxygen Doxygen is a command line utility To generate the documentation for a project these steps are typically followed 1 Document the source code with special documentation blocks file Nbrief FEM test CET tool for testing MatCalc s FEM algorithm eff 2 Generate a configuration file by calling Doxygen with the g option doxygen g lt config file gt 3 Edit the configuration file config file so it matches the project The PROJECT NAME tag is a single word or a sequence of words surrounded by quotes that should identify the project PROJECT NAME MatCalc The OUTPUT DIRECTORY tag is used to specify the relative or absolute Calling doxygen with the he1p option at the command line will give you a brief description of the usage of the program 66 That is comment the code using doxygen supported comment format so tha
84. al test data i e artifacts of the simulation and or real world experiment runs but not of the underlying physical model reality the objective function can be extended to include several pairs of simulations tests min f p 22 oj a7 y p Ayn P i l j l Eq 9 Objective function for the material model of Eq 7 77 That is different tests and corresponding simulations for the same material model the model parameters have to satisfy all tests School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution Given the current state of the Virtual Material Laboratory Project software library the model fitting algorithm to be developed cannot access the simulation internal workings but only the simulation results that are provided either in a data structure in memory or in a text file like the one depicted in Fig 18 section 5 3 3 p 70 This black box situation impedes the use of any method that requires the use of e g derivatives of the objective cost function to be minimized so a workaround is to use a direct search method to fit the experimental data to the simulation results 5 3 6 2 Hooke amp Jeeves Pattern Search method overview One popular direct search method is the Hooke and Jeeves pattern move or pattern search algorithm 1975 A detailed description of the method alongside an application example can be found in SHL83 pp 180 185 As described therein
85. als GJ03 p 1 1 Simplify the development of portable programs 2 Simplify the building of programs that are distributed as source code The first goal is achieved by the automatic generation of a configure shell script The second goal is achieved by the automatic generation of Makefiles and other shell scripts that are typically used in the building process It must be noted that the GNU Build System is not devoid of problems The GNU build system GBS If GBS is so smart why isn t everybody using it One reason is that GBS is very Unix centric and C C dedicated And even if you build C programs on Unix GBS only works effectively if your sourcecode complies with the GNU coding guidelines Another reason why GBS is not used everywhere is the price it pays for its portability For example the probes of autoconf are encoded as M4 macros M4 isa powerful text processor but its syntax is pretty low level and difficult Difficult enough to make this a major obstacle for extending the reach of GBS While a godsend for less capable platforms GBS has a much harder time winning the favor of developers on mainstream platforms People simply don t want to give up their convenience when writing probes for the sake of some obscure platform no one s heard of Another thorny issue is weak support for embedded software development and associated issues In the embedded world everybody is cross compiling the build platform
86. an overview of the GNU Build System Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution 5 1 2 Final State 2010 03 Virtlab v 1 1 At completion of Virtlab Project s second stage March 2010 the graphical user interface for MatCalc has been significantly enhanced providing a flexible and intuitive front end to the library for setting up simulations better graphical and text based feedback controls for examining simulation runs and file input output capabilities to save retrieve simulation parameters and data These improvements part of the usability quality improvements intended for the software package enable the user to quickly experiment with material model parameters and virtual tests A command line interface has also been developed with the aim of performing batch simulations particularly in high performance clusters which not only adds to the usability purposes but can potentially promote the performance quality and pave the way to enhance the portability quality e g enabling its compilation for use on systems devoid of graphical display capabilities but able to perform text based and or file input output Code refactoring stages were effected with separation of concerns in mind thus enabling both the GUI and CLI frontends to share the underlying library and auxiliary modules the simulation engine is exactly the same for both frontends and the input output files
87. and RTF simultaneously any of these can be disabled if desired All formats are optimized for ease of reading Includes a full C preprocessor to allow proper parsing of conditional code fragments and to allow expansion of all or part of macros definitions Automatically detects public protected and private sections Extraction of private class members is optional Automatically generates references to documented classes files namespaces and members Documentation of global functions global variables typedefs defines and enumerations is also supported References to base super classes and inherited overridden members are generated automatically Includes a fast rank based search engine to search for strings or words in the class and member documentation Gonzalo Sanchez Virtlab 1 1 M Eng Report Apr 2010 6 Software Tools Allows references to documentation generated for other projects or another part of the same project in a location independent way e Allows inclusion of source code examples that are automatically cross referenced with the documentation e Inclusion of undocumented classes is also supported allowing to quickly learn the structure and interfaces of a large piece of code without looking into the implementation details Allows automatic cross referencing of documented entities with their definition in the source code e All source code fragments are syntax highlighted for ease
88. and the shared object is done at runtime that is before the program starts the appropriate shared objects are found and bound This type of program is called a partially bound executable because it isn t fully resolved The linker at link time didn t cause all the referenced symbols in the program to be associated with specific code from the library Instead the linker simply said something like This program calls some functions within a particular shared object so I ll just make a note of which shared object these functions are in and go on Symbols for the shared objects are only verified for their validity to ensure that they do exist somewhere The linker stores in the executable program the locations of the external libraries where it found the missing symbols This effectively defers the binding until runtime Programs that are linked dynamically are linked against shared objects that have the extension so An example of such an object is the shared object version of the standard C library Llibc so The advantage of deferring the linkage of some of the objects modules during the static linking step until they are finally needed during the run time includes I Program files on disk become much smaller because they need not hold all necessary text and data information It is very useful for portability 2 Standard libraries may be upgraded or patched without every one program need to be re linked This clearly reguires so
89. are fixed The automation incorporated into the code documentation and software package testing albeit incipient sets a roadmap for future improvement on both aspects contributing to the maintainability quality of the software package The benefits provided by the judicious application of software quality concerns in the development of the original Virtlab library were constated and exploited Evidence of this claim is supported by these facts o The actual ability to refactor existing tools like the currently named diff dset FEM test lists Ruby test as well as the rapid development of the parameter fitting tool for MatCalc just by intuitively reusing methods from the existing modules and easily integrating them with those of newly developed modules o The ability to port the software library to other Unix platforms and to automate the build process for MatCalc which despite the work involved was feasible under the originally selected building environment the GNU Build System and done squarely within its capabilities School of Computational Engineering and Science McMaster University 138 7 Conclusions amp Future Work Research Nicolas Bourbaki is the collective pseudonym under which a group of mainly French 20th century mathematicians wrote a series of books presenting an exposition of modern advanced mathematics beginning in 1935 With the goal of founding all of mathematics on set theory the
90. ase specify Maple environment on the command li configure WARNING MAPLE ROOT path to maple folders configure WARNING OPENMAPLE CFLAGS IS MAPLE ROOT extern include configure WARNING OPENMAPLE LDFLAGS LS MAPLE ROOT bin Na configure WARNING OPENMAPLE LIBS lmaplec lmaple lgmp configure creating config status config status creating Makefile config status creating src Makefile pontfig status Creating contig config status executing depfiles commands DAI TO OO CONS AO Note that despite the pertinent flags have been specified in the coni neg command line the warnings are still issued figure script It is worth to remark again that the different compilers assemblers linkers require different flags and passing conventions to achieve the same goals in this case so that the linker can find the dependencies at compile time and at run time Please refer to section 9 5 in the Appendix where the compile time and run time linking issues are discussed As a final remark on the building process changes it should be clear from all of the above that portability is not an easy quality to achieve not even with a specific build system that was devised to address that need Reusability is therefore another software quality that might be affected by cross platform issues School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution
91. ata initial guess for parameter 1 initial guess for parameter 2 LEE dt tt dt tt ott Ott ott tt 11 dt dt tt tt LO z t Data table heading not displi Fig 27 The parameter fitting tool s console output upon reading a MatCalc file containing the simulation setup and initial guesses As the search progresses the FEM algorithm output is interspersed with that of the fitting tool Fig 28 48 The third parameter ElasticNu is not of interest for the fitting objective so regardless that the algorithm can handle that parameter it was purposefully ignored in the tool s implementation Also note that even though the file contains data it is ignored by the tool This output can be filtered with a simple J rep command to eliminate the FEM algorithm information if desired Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution 87 64 Bl sancheg mills Out A File Edit View Terminal Tabs Help sanchegGmills Pro E sancheg mills Pro sancheg mills Out E sancheg mills eo finale FEM engine output f f 4i 4l H A M ot cost function evaluation at basepoint selected after 24 local explorations turn map i ar e start of new cost function verged in 2 al e 3 rqad in pue gore evaluation requires a whole rg eps final error 06 simulation run Fig 28 Hooke amp Jeeves search progress sample
92. ating new mapleclient instance Setting mapleclient output to stdout Starting Maple Resetting Maple fals Evaluating expression CodeGeneration C 2 3 x 5 resultname y y KKK KKK Ds e 0 cit pow Ge US Stopping Maple Freeing allocated memory However when MatGen is used instead of the tool the inconsistent results listed at the start of section 5 3 4 would be observed MatGen was tested in two different platforms Linux x86_64 and MacOSX x86_32 with two different versions of Maple versions 11 and 13 respectively On the Linux platform MatGen would initially fail to communicate with Maple after this issue related to system setup was resolved see section 6 5 p 130 the code generation would fail to produce code with the result that MatCalc s build would break when the offending material classes were tried to be compiled On the MacOS X platform code generation produces files that are an order of magnitude bigger than the originally generated code MatCalc would require 13 hours of wall clock time to build and which would produce wrong results The latest tests performed involved a linear viscoelastic material model in one instance using the originally generated code and in the other instance using code generated recently in the MacOS X platform The dset diff tool see section 5 3 8 2 p 96 was used to compare the modelled material behaviour results simulated with MatCalc
93. ation An equation or set of equations involving an unknown function or functions of several independent variables and its or their partial derivatives with respect to those variables FEM Finite Element Method also known as Finite Element Analysis A technique used in the numerical computation of approximate solutions to PDE problems DSL Domain Specific Language A specification oriented programming language tailored to a particular problem domain which allows one to express that domain s particular type of problems more easily and clearly than with a general purpose programming language 1D 1 Dimensional Pertaining to a unidimensional object either in the usual physical space or in a mathematical space 3D 3 Dimensional Pertaining to a tridimensional object either in the usual physical space or in a mathematical space GUI Graphical User Interface Interface to an application running on a computing device that enables the user to interact with the application by means of text entered by keyboards and actions performed with haptic devices such as pointers these usually require the system to have a screen that can display graphical information c f CLI CLI Command Line User Interface Interface to an application running on a computing device that enables the user to interact with the application by text input from keyboard devices and primarily text output to the computing system
94. be used in other applications understandability The degree to which a developer finds a software package easy to understand usability The degree to which an end user of a software package finds the package easy to install and use verifiability The effort necessary to verify the properties of a software package Table 2 Terminology SY09 s 2 except for software package software codebase software product School of Computational Engineering and Science McMaster University 2 Reference Material 2 3 Abbreviations and Acronyms Abbreviation Acronym Reference Virtlab Virtual Material Laboratory A software package which in essence constitutes an user extensible software library that implements a material modelling environment and material testing simulator The present report addresses the work done on the software package during the period May 2009 March 2010 HTML Hyper Text Markup Language The current and predominant markup language for coding web pages developed by the World Wide Web Consortium W3C amp Web Hypertext Application Technology Work Group WHATWG requires a web browser for viewing XML Extensible Markup Language Encoding rules for electronic format documents Defined in the XML 1 0 specification produced by the World Wide Web Consortium W3C and several other related specifications all are fee free open standards PDE Partial Differential Equ
95. been selected from the respective tools websites manuals or articles describing the tools usage This reference information is intended for readers unfamiliar with the tools purpose and or basic usage Examples of the use of these tools in Virtlab project are presented whenever appropriate Conclusions amp Future Work Research This chapter evaluates the effects of the modifications and additions effected in the software codebase during the period May 2009 March 2010 and presents ideas for future work on the software package as well as future research ideas based on the Virtlab project References This chapter lists the bibliographical references that are used throughout this document Appendix This chapter lists the contents of specific documentation files for the Virtlab software package and is meant as a reference while the documents listed in Table 1 where the information herein should be appropriately included undergo development Note The reader using the Portable Document Format PDF version of this document can take advantage of the hyper text links provided for each of the cross references within the document such as sections footnotes captions figures and equations numbering corresponding page references and bibliographical references Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 4 Virtlab Project Overview 25 4 VIRTLAB PROJECT OVERVIEW School of Computational
96. bjects therein are cross referenced through hyper text links to facilitate browsing Due to its hyper linked structure and extension it is pointless and impractical to include the generated documentation as an appendix to the School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution present report Fig 25 p 84 Fig 35 p 118 Fig 36 p 119 Fig 37 p 120 and Fig 38 p 121 show screenshots of a typical Doxygen generated pages For convenience the documentation corresponding to the latest snapshot of the code can be viewed by pointing a web browser to the following locations http www cas mcmaster ca sancheg MatCalc 1 1 http www cas mcmaster ca sancheg MatGen 1 1 The generation options for Doxygen are defined in a configuration file which for the case of MatCalc and MatGen has been tailored appropriately Most of the source code files in Virtlab s library have been provided with a brief comment about the file s purpose following Doxygen s expected format This specially formatted comments are automatically parsed by Doxygen and used for the generated HTML documentation Several of the source code files have also been provided with an extended comment in Doxygen s expected format so that are also included appropriately in the generated HTML documentation The comments included in the source code files try to warn about the state of knowledge of the file given tha
97. brary and as a consequence its verifiability and reliability specific effort was dedicated to improve the software package documentation As of May 2009 the documentation for Virtlab library was limited to the original developer s M Sc Thesis McC07 and a few text files that addressed some very specific issues of the software library In the period from May 2009 to March 2010 the following documentation elements were created and or improved e Doxygen generated documentation for the codebase e INSTALL2 TODO and ChangeLog files Subversion commit log e Other text files for specific issues These documentation items are described in the following sections 5 3 7 1 Doxygen codebase documentation The documentation generated by Doxygen vHe97 is an organized collection of HTML files that are automatically generated by parsing the software s source code files An overview of Doxygen is provided in section 6 3 p 115 The generated documentation set includes complete source code files listing index of data structures class hierarchy and data fields e folder directory hierarchy indexes of all functions structures unions enumerations variables type definitions and definitions Graphics are provided for all class inheritance diagrams dependency graphs and function call caller graphs The generated documentation pages use syntax highlighting and or colour coding for enhanced readability and all o
98. check sail 9255 leak check yes 1 19259 show reachable yes 17925 log file u0 grad sancheg Out valgrind log 17925 Contents of proc version SEEN e Linux version 2 6 16 164 9 1 e15 mockbuild8x96 005 build bos redhat com gcc version 4 1 2 20080704 Red Hat 4 1 2 46 1 SMP Wed Dec 9 03 27 37 EST 2009 6 The boldface type applied here if for highlighting sections of particular relevance in the quote it is not part of the original text The shell script listed in section9 10 p 184 provides several and very similar examples Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 6 Software Tools 125 17925 Arch and hwcaps AMD64 amd64 sse2 17925 Valgrind library directory usr lib64 valgrind L 925 Reading syms from nfs u0 grad sancheg Projects virtlab svn 1l 1 matcalc src dset diff 0x400000 17925 Reading syms from usr lib64 valgrind amd64 linux memcheck 0x38000000 SS 1925 object doesn t have a dynamic symbol table 17925 Reading syms from 1lib64 1d 2 5 so 0x383CA00000 17925 Reading suppressions file usr lib64 valgrind default supp 17925 Reading syms from usr lib64 valgrind amd64 linux vgpreload core so 0x4802000 17925 Reading syms from usr lib64 valgrind amd64 linux vgpreload memcheck so 0x4A03000 17925 REDIR 0x383CA14440 index redirected to 0x4A06550 index 17925 REDIR 0x383CA145F0 strcmp redirected to 0x4A0
99. chool of Computational Engineering and Science McMaster University 3 Introduction 3 5 Organization of the Document The first part of this document includes the Table of Contents Indexes of Tables and Figures Acknowledgements the Reference Material tables Related Documentation Terminology Abbreviations and Acronyms Conventions as well as the current Introduction The rest of the document which constitutes the core of the Report is organized as follows Virtlab Project Overview This chapter provides an overview of the Virtual Material Laboratory Virtlab Project and corresponding software package It briefly describes the software s functionality and capabilities states the underlying project s motivation and purpose and provides the essential theoretical background for understanding the software package underpinnings and the report s contents Virtlab Project Evolution This chapter reports the project history from its state as of September 2007 the evolution undergone in the period May 2009 to March 2010 and up to its current state It is the core section of the Report in which the goals for the modifications and additions introduced to the Virtlab software package are stated the actual modifications and additions are reported and the rationale behind these are described Software Tools This chapter presents an overview of key software tools that were used in the Virtlab Project Most of the contents herein have
100. ction combobox label Gonzalo Sanchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution File Edit View Help SIMULATION SETUP General parameters Experiment UniaxialX Yield Function OC smith material E2 Algorithm Radial return map 1 000E 02 t 1 000E 00 t Time step Time span Specimen dimensions 1 000E 00 L 1 000E 00 L 1 000E 00 L Specific parameters Constant Name Constant Value S Experiment displacement rate x 1 000E 01 s Yield Function 3 000E 04 ElasticNu 3 000E 01 eta 3 000E 03 ElasticE SIMULATION RESULTS Run Graph stress 2 857E 01 4 5 433E 02 lt yp repre strain 1 000E 03 lt 4 948E 02 lt 12 ES 2 EL L1 Fig 13 MatCalc v 1 1 graph section of the right panel File Edit View Help SIMULATION SETUP General parameters Experiment UniaxialX Yield Function OC smith material E2 Algorithm Radial return map Time step 1 000E 02 t Time span 1 000E 00 t Specimen dimensions 1 000E 00 L 1 000E 00 L 1 000E 00 L Specific parameters Constant Name Constant Value Y Experiment displacement rate x 1 000E 01 Yield Function ElasticE ElasticNu eta 3 000E 03 3 000E 04 3 000E 01 SIMULATION RESULTS Run Data table StressZ StressU 2 098E 0 StressXY StressU StressXZ StressU StressY It
101. d Science McMaster University 6 Software Tools The rationale for using an automated documentation system is mainly that of precisely automation Why use an automated system Documentation is up to date You are much more likely to change a comment atop of the function you fiddle with than fire up MS Word look for the function documentation and change it there Reuse of your own comments Assuming you already discovered the virtue of commenting your own code the market value of your comments just doubled Automatic formatting and cross linking With a few simple markups you get documentation that looks professional and consistent and creates links to the description of all important entities Forget about struggling with MS Word In code comments carry important meta information Not all important information is available from the actual raw source code Interface contracts pre and post conditions side effects meaning of special parameters etc need to be known to anyone who is to maintain the code be it yourself or someone else A formal style for these comments in conjunction with a parser like doxygen s XML export can make this information available in customized format for various recipients be it project management testers and the like http www codeproject com KB tips doxysetup aspx rationale Gonzalo Sanchez Virtlab 1 1 M Eng Report Apr 2010 6 Software Tools 123 6 4 Val
102. d a hardening parameter x Perzyna s viscoplastic strain rate tensor is given in terms of a fluidity parameter y a yield function F and an associated function q a viscoplastic potential O and a hardening parameter c dependent on the accumulated viscoplastic strain which determine the possible different material behaviours The viscoplastic strain rate tensor in Perzyna s model has magnitude given by y p F x 6 and a direction given by 90 00 McC07 pp 21 22 e The magnitude depends on the surface defined by F 0 in the six dimensional stress space which is depicted as the innermost continuous line in the diagram in Fig 5 Given the definition of F in Eq 3 inside the surface the viscoplastic strain rate tensor de dt 0 and thus the material will actually behave in a purely elastic fashion as per Eq 2 If the stress history is such that the yield surface F 0 is reached the yield surface might change shape depending on the parameter k e which allows for the expansion or contraction of the yield surface This allows modelling any strain hardening or softening behaviour of the material as shown with a dashed line in the diagram in Fig 5 for the hardening case e The direction is defined by the normal to the surface O 0 of the viscoplastic potential O c see Fig 5 12 The elastic behaviour is typically modelled as a spring whereas the viscoplastic behaviour is that of a material relucta
103. d similarly as for references by single authors For references other than publications e g software products packages the single author criteria will be applied taking the original author of the software and the year of the first release of the software Other cases will be dealt with by following as much as possible the aforementioned criteria References usage Where appropriate the cited reference will be accompanied by a chapter ch section s page p and or page range pp indicating as precisely as possible the respective chapter section page or page range being cited in any of these cases the complete reference citation will be presented within brackets e g Sur08 s 1 3 ABOS ch 4 p 32 ABCD08 pp 25 29 Original Previous References References ancestry Cited references are those references actually read in the preparation of the present document In case the cited references cite a previous original reference or references which have not been read the latter reference or references will not be cited herein The rationale behind this scheme is that the citation will correspond to where the current author read took the idea in its closest form to the actual use it assumes that any referred authors will have in turn appropriately cited any previous reference to their own work Boldface Italicized Boldface or italics are used in the text either for emphasis highlighting purposes
104. data line 17 in Fig 19 showing the use of interactive measurements eee 71 Fig 21 MatCalc v 1 1 CLI configuration printout eeseeseeeeeeseeeeeeeeenen enne tnnt pee geg t beg el et 72 Fig 22 Virtlab files relationship overview for the files affected by the separation of concerns applied to the codebase 80 Fig 23 Sample search by Hooke and Jeeves pattern move algorithm The table in Fig 24 describes in detail the complete jo e RR NON 83 Fig 24 Tabular description of the sample search path in Fig 23 sse ener 83 Fig 25 Call graph for the Parameter Fitting Tool for MatCalc Material Models generated by Doxygen 84 Fig 26 Viscoelastic material experimental test data blue jagged trace produced with Octave by contamination of a closed form solution red smooth trace with random noise sse em eene nennen 85 Fig 27 The parameter fitting tool s console output upon reading a MatCalc file containing the simulation setup and OE ER 86 Fig 28 Hooke amp Jeeves search progress sample eterne nene tene tenete etre eerte retener nenne 87 Fig 29 Search progress plot X axis ElasticE Y axis eta ennemis 88 School of Computational Engineering and Science McMaster University Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig 30 Search progress plot X axis ElasticE Y axis eta with custom alg
105. de Ete toute reet eee eR DER 5 3 2 MatCalc s GUI 5 3 2 1 MatCale y 0 1 GUL s iei eh eere rre tete E PRENDE INR TE ERE ER EDT Re i iret rie T Ere cir 59 53 22 Ma tCalGv DNI CIO e TER EE 62 5 3 2 3 Fut te NON 67 5 3 3 MatCale S CET 3 20 28 ois o3 en edt E HD E RE A RD DERE GEHE AA odi teta 69 SA MA TM 73 5 3 4 1 Code generation statement test i Sire AA n 73 5 3 42 Future NN 75 5 3 5 Separation of Concerns and Information Hiding eseseseeeeeeeeeeneen ener nnne 76 33 31 File Input atid Output Md a IRURE el RR D ERR 76 5 3 5 2 GUI and CLI modules TI 5 3 5 3 stdout and stderr handling all 5 3 5 4 configset module EL 5 3 5 5 Virtlab v 1 1 restructure overview 79 5 39920 E tute odiar 79 5 3 6 Material Model Parameters Fitting Tool seeseeeeeeeseeseeeeeeenenne nennen nennen tenere 81 5 3 6 1 Tool overview 81 5 3 6 2 Hooke Jeeves Pattern Search method overview 5 3 6 3 Design decisions and implementation overview 5 3 6 4 Tool preliminary performance and results 5 3 6 5 B tute WOTK z s td roD rie eere che hoa aite ven e m e OR ORG 90 5 3 7 Documient tion ciere rete eee t be t eie dee ene A e eed ee eed anto leeren eoe 91 5 97 1 Doxygen codebase docuitientations ses re A Rt HF eem e 91 5 39 72 ChangeLog and TODO files nr m
106. ded to configure ac file to deal with other portability issues f Link against libruby at compile time and runtime t G S 2009 07 03 case Shost in eo lia a ves S Sano boba an o y aa AC MISS RSC 6 towel iio so ate suolo Maloy s sd qp RUBENS S MS o y a co MN Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution Ai oda Ai Melo o o AUN curio else AGSMSESERRORS 559599 teyewarU E nT BUS Soy o o A c ou Hy sen ES if test e Sruby libdir libruby dylib then ACIMSCIRESUNNO e roundi UV dLSUSeyPo chilly ae WSrebioyy S ee ZS ou Mp RUBY _CFLAGS I ruby archdir RUIN ISS esie Maley 3 eo ON lruby else ANS CAPO CU Ud eros a UOVA o o oof cod a E Bs ciam if test e Sruby libdir libruby so then ING MSG ISI ESO UC ys OSO y Malloch Sc oa Ip RUBY _CFLAGS I ruby archdir RUB YATIB in Uere Mallelabiey a a s sy ON SR Suelo lids ss sod N iu else AGNS CHURROS E AS CN So cJ cy Il arat D is AC MSG WARN Check search and run paths for the linker if you have libraries installed in non standard locations Refer to INSTALL2 esac Pr AC SUBST RUBY CFLAGS AC SUBST RUBY LIBS In particular the above code fragment highlights the differences between Unix flavors when it comes to linking the software package to system or other dependencies libraries To the purpose of enhancing the usability reusability portability a
107. duced in the new code When a bug occurs Get instant feedback about what the bug is where it occurred and why When a bug is suspected Is your program behaving oddly Use a Valgrind tool to discover if a bug is the cause As for Valgrind s profiling tools use those whenever you want information about how your program is spending its time or you want to speed it up http valgrind org info about html Using Valgrind for memory checking purposes is absolutely straightforward A typical invocation would be valgrind v memcheck leak check yes log fil xactly logfile prog A program devoid of memory leaks would produce results similar to the following corresponding to the dset diff tool for MatCalc see section 5 3 8 2 p 96 17925 Memcheck a memory error detector 17925 Copyright C 2002 2006 and GNU GPL d by Julian Seward et al 17925 Using LibVEX rev 1658 a library for dynamic binary translation 17925 Copyright C 2004 2006 and GNU GPL d by OpenWorks LLP 17925 Using valgrind 3 2 1 a dynamic binary instrumentation framework 17925 Copyright C 2000 2006 and GNU GPL d by Julian Seward et al 17925 17925 My PID 17925 parent PID 29514 Prog and args are 17925 dset diff 17925 dsetl dat 17925 dset2 dat 17925 SS ees 17925 Conmimenel latins AS dset diff Sa dsetl dat SOS dset2 dat 119259 Bist vida 35 leves ced qe y Edu gt tool mem
108. e Yield Function Algorithm Radial return map Time step 1 000E 02 t Time span 1 000E 00 t Specimen dimensions 1 000E 00 L 1 000E 00 L 1 000E 00 L Graph Specific parameters Stress 7 172E 316 lt 7 172E 316 lt 7 172E 316 StressUl straint 7 172E 316 lt 7 172E 316 lt 7 172E 316 L L Constant Name Constant Value S Experiment displacement_rate_x s Yield Function ElasticE ElasticNu eta StressX StrainX Fig 10 MatCalc v 1 1 GUI after RESET The main usability issues of MatCalc s v 0 1 GUI were addressed by firstly providing a meaningful and more intuitive overall organization to the interface e The left panel is dedicated to the SIMULATION SETUP controls and has two sections o A General parameters upper section that allows selection of the material test material model and algorithm and allows the edition of the time step time span and test specimen dimensions o A Specific parameters lower section that allows the edition of the specific material test and model parameter values e The right panel is dedicated to the SIMULATION RESULTS widgets and has two sections o A Data table upper section for the numerical output of the simulation results o A Graph lower section for the graphical output of the simulation results Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 V
109. e current section 4 3 5 This hypothesis is consistent with a typical real material mechanical test in which the test specimen is kept in a static position throughout the experiment Where the stress tensor 6 has been expressed as a 1D vector where the first three components correspond to the normal stresses and the last three to the shear stresses of the infinitesimal cubic element School of Computational Engineering and Science McMaster University 4 Virtlab Project Overview 4 3 7 Virtlab s computational approach to continuum mechanics problem Virtlab s approach to the continuum mechanics goal and computational problem statement described in section 4 3 is to have one of its components MatGen to deal with the coding aspects of the constitutive equation Eq 4 in terms of Perzyna s viscoplastic strain rate tensor model Eq 3 and leave to its other component MatCalc the actual numerical integration of the resulting system in Eq 6 At MatCalc s core a FEM algorithm will solve the PDE system in Eq 6 This method was selected because FEM naturally accommodates both displacement and load controlled boundary conditions With the same finite element algorithm all potential material tests can be simulated all that changes between experiments is the input describing the boundary conditions Details of FEM can be found in Zienkiewicz et al 2005 The derivation of the finite element equations for
110. e generated Hence only the specific member properties need to be described for the code generation stage and this task is accomplished with the DSL CSMAKOT pp 29 30 Therefore underlying the motivation for the Virtlab project there is a specific intention of applying software engineering techniques such as commonality analysis program families development and model manipulation in this case by means of symbolic transformations and code generation to improve the qualities of this scientific computing software package Reliability Accuracy Performance Understandability Maintainability Verifiability Reusability Portability SY09 s 2 The constitutive equation for a material model relates the material s stress and strain tensor histories See section 4 3 for a brief theoretical background on continuum mechanics in which these terms are succinctly explained 10 These concepts are succinctly described in Table 2 Terminology and in section 5 2 2 p 41 Software Qualities School of Computational Engineering and Science McMaster University 4 Virtlab Project Overview 4 3 Theoretical Background This section presents the essential theoretical background of Virtlab s software package computational approach to the continuum mechanics problem presented by material modelling and material testing simulation 4 3 1 Continuum mechanics goal description n continuum and computational mechanics the g
111. e is depicted in Fig 25 generated automatically by Doxygen 7 Sj MatCalc Mozilla Firefox el File Edit View History Bookmarks Tools Help e gt ta o e a file export home gonzalo Projects virtlab svn 1 0 matcalc doc html index html W v Wikipedia en a nt e Md E 6 matcalc Graph Legend o matcale I Matcen ojo H o MatCalc int main int argc A T Data Structures char argv 5 PU class Hierarchy El MatcalcGraph Definition at line 107 of file parameters fit tool cc de El MatcalcGraphClass References du error EPSMIN EXIT FAILURE EXIT SUCCESS get cfg dataset get constant material class get constants material class list get instance hooke_jeeves B MascalcGrapherivate IMAX configset MC IFILE configset MC MAT PMAX read matcalc file dataset reset dataset reset_data RHO 0 set cfg J and update cfg a Here is the call graph for this function E contigse D El datachunk Y EEE cea material class list find material clss E dataset j PO B DEmatrix fo m dataset teet constank LEM 4 du_error 9 element f E experiment descriptor El experiment list B experiment runner integrator El m matrix El m vector El material class El material class descriptor El material class list dataset zadd_constant E MaterialClassTest o El MatrixTest 4 datachunk B ruby array A 9 ruby base a
112. e the create functions are never called Memory leaked from Data Make Struct calls shouldn t be too large chunks because it is always related to small allocations datachunk m vector and dataset don t need much memory themselves But the memory leaks from the create methods can be potentially huge inside dataset and m vector lots of memory can be allocated and this memory is only ever freed when the destructor is called TI VALUE Data Make Struct VALUE class c type void mark void free c type Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix 9 13 2 Fix The fix is straightforward e Each create function should be changed to call the constructor instead of the assignment operator That would look like vold pl construct object m vectors inerente MEg o m vector salas y e A destroy method should be written that would look something like la vector instances Mises Cole E instance gt m vector call the destructor explicitly e Calls to destroy should be paired with the existing calls to create All of the ruby object T create calls are inside experiment runner methods Data Make Struct should be passed the standard ree function 9 13 3 Additional information 9 13 3 1 C m vector base size 8 bytes constructor allocates an array of scalars to the size passed into the constructor elements destructor free
113. ect file main jmp xxxx call printf main jup print f jup funct printf funct Fig 41 The relocation record Figure w 2 http www tenouk com ModuleW html School of Computational Engineering and Science McMaster University 200 9 Appendix The following figure shows how the assembly process can proceed in parallel followed by a linking process Program library Source Lar REA zn file 1 prine Source ne ADA eom ina add J Executable ose m Source TM a file 3 i Assembler Fig 42 The object files linking process Figure w 3 http www tenouk com ModuleW html SHARED OBJECTS In a typical system a number of programs will be running Each program relies on a number of functions some of which will be standard C library functions like printf malloc strcpy etc and some are non standard or user defined functions If every program uses the standard C library it means that each program would normally have a unique copy of this particular library present within it This would result in wasted resources and would degrade the efficiency and performance Since the C library is common it is better to have each program reference the common one instance of that library instead of having each program contain a copy of the library This is implemented during the linking process where some of the objects get linked during the link time static linking and some
114. elease December 21 1995 URL http www ruby lang org en A generative approach to a virtual material testing laboratory J McCutchan M Sc Thesis McMaster University September 2007 A Rational Design Process How and Why to Fake It D Parnas P Clements IEEE Transactions on Software Engineering Vol SE 12 No 2 Feb 1986 pp 251 257 0098 5589 86 0200 0251 01 00 Copyright O 1986 IEEE CES 701 Project Proposal G S nchez School of Computational Engineering and Science McMaster University Project proposal for CES 701 Foundations of Modern Scientific Programming course 2009 unpublished CES 713 Project Proposal G S nchez School of Computational Engineering and Science McMaster University Project proposal for CES 713 The Message Passing Interface for Parallel Applications course 2010 unpublished Valgrind programming tool for memory debugging memory leak detection and profiling J Seward et al Copyright 2000 2009 Authors URL http valgrind org Civil Engineering Systems Analysis and Design A Smith E Hinton R Lewis Copyright 1983 John Wiley and Sons Ltd ISBN 0 471 90060 5 Program Families in Scientific Computing S Smith J McCutchan F Cao Computing and Software Department McMaster University 7th OOPSLA Workshop on Domain Specific Modelling DSM 07 pp 37 49 School of Computational Engineering and Science McMaster University 8 References
115. elopment of a program family for material behaviour simulation which improves the usability and reusability of the resulting program SMC07 However the aforementioned common constitutive equation for the family of material models can lead to potentially complex constitutive equations for the family member instances since the relationship between material stress and deformation can rely on multiple non linear equations involving second order tensors Therefore developing the actual code that models each specific material is a difficult and error prone task that requires significant expertise in scientific computing and materials science Virtlab overcomes the problem of hand coding the material model by using a generative programming approach that actually takes advantage of the materials common constitutive equation Generative programming is the practice of having one program write the source code for another program where typically the input to the first program is a simple description of the code to be generated for the second program Typically the descriptions fed to the first program are conveyed in a DSL which being domain specific by definition makes it easier than using a general purpose programming language to manually develop the code for the second program directly In this context the common constitutive equation provides an abstract material description from which the code for each specific member of the family can b
116. en developed to address the accuracy reliability and verifiability qualities of the software product o The tool currently operational as a serial computing application is undergoing work towards a parallel version by incorporation of MPI constructs B The parallelization of the tool will not only address time savings in the computation but will also be used to experiment with slight variations of the underlying algorithm that exploit the potential advantages that a parallel operation can bring for parameter space exploration Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 7 Conclusions amp Future Work Research Additional consequences of the work effected in the period May 2009 March 2010 The separation of concerns within the software library has been improved with the addition of file input file output and configuration modules each of which apply information hiding policies to the best extent possible thus improving the maintainability understandability and reusability qualities of the software package A severe memory leak residing in MatCalc s modules was detected diagnosed and fixed thus improving the performance quality of the software and contributing to its reliability Other memory leaks have been uncovered and documented for future resolution contributing thus to the maintainability of the software and paving the road to improve its performance and reliability once the problems
117. ences to each symbol all previously zeroed to memory references relative to the beginning of the program 2 Run time dynamic linking the application program is read from disk disk file into memory and unresolved references are left as invalid typically zero The first access of an invalid unresolved reference results in a software trap The run time dynamic linker determines why this trap occurred and seeks the necessary external symbol Only this symbol is loaded into memory and linked into the calling program Adapted from http www tenouk com ModuleW html Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010
118. ent components The relationship between the displacement u of a point and the corresponding strain state at the point is given by the kinematic matrix L Q Q Q qc YU 9 an e Lu L 0 E 0 9 0 0 Q y Ox Ox Q 0 0 Oz y Oy Ox Eq 1 Kinematic equation relating the strain state e at a point with its displacement u Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 4 Virtlab Project Overview 31 The strain rate of a body is then given by the corresponding symmetric nine element strain rate tensor de dt which also has only six independent components SMC09 pp 26 28 If the thermal effects are neglected that is the process is assumed to be isothermal and superposition of elastic e and viscoplastic e effects can be assumed for modelling the material behaviour then the strain rate de dt undergone by a material can be expressed in terms of the viscoplastic strain rate tensor de dt as follows McC07 p 21 c e Eq 2 Additivity postulate of elastic and viscoplastic effects An expression for the viscoplastic strain rate tensor that allows modelling a wide variety of materials was proposed by Perzyna in 1966 McC07 p 21 ev PE y p F 22 00 Og Flo y eC Gr F a x e gt 0 p F a x Flo e lt 0 Eq 3 Perzyna s viscoplastic strain rate tensor in terms of a fluidity parameter y a yield function F a viscoplastic potential Q an
119. erein to ensure portability among systems with compliant compilers As said it is highly unlikely that a single developer can understand and handle this kind of information without the aid from a specific tool After performing the aforementioned changes MatCalc builds on Linux MacOS Solaris and OpenSolaris platforms Specifically MatCalc was built and executed using the GNU Compiler Collection tool chain on e Linux x86 64 MacOS X x86 32 e Solaris 10 UltraSPARC e OpenSolaris 2009 06 x86 32 School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution 5 3 1 2 Automation issues From the original codebase neither of Virtlab s components MatCalc and MatGen could be built by just calling the corresponding configure scripts without further command line options as is the goal of the GNU Build System This stems from the fact that despite the significant flexibility provided by the GNU build system some dependencies do present a challenge for achieving complete building automation by generated configure scripts Currently only MatCalc s building process has been fully automated MatGen s building process although still requires user intervention has been documented adequately to facilitate the task Additionally neither make dist nor make install targets for MatCalc nor MatGen work as expected Even though the packages are generated for distribution with make
120. es For the latter case a wealth of other system tools such as ps and its relatives allow to examine the running processes in the system and observe obtain useful information for understanding their behaviour in relation to the operating environment Similarly tools like 1dd in Solaris or Linux list the dynamic dependencies of executable files or shared objects and can provide additional help to track down issues between the application and the operating environment 7 The boldface type applied here if for highlighting sections of particular relevance in the quote it is not part of the original text Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 6 Software Tools 131 The following example copied verbatim from Bro09 p 8 assumes the existence of an application errnoacc which fails with a not altogether informative error message errnoacc ERROR Application failed to initialize Either in the absence of the source code for the application or because the issue is suspected to lie in the interaction with the system rather than internally tracing is done in place of debugging The following lines are the typical output of the trace tool applied to the malfunctioning program of the example copied verbatim from Bro09 p 9 truss errnoacc execve errnoacc 0x08047B20 0x08047B28 argc 1 mmap 0x00000000 4096 PROT READ PROT WRITE PROT EXEC MAP PRIVATE MAP ANON il 19 OxFEFBO0O00
121. es for the purposes of generating the code for the material model classes The tool is designed to simply pass Maple an expression assumed to be a valid expression for the Maple system and return the output that Maple produces after evaluating it sancheg mills test EvalMapleStatement Usage test EvalMapleStatement lt expression gt where expression is a Maple expression terminated with e g CodeGeneration C expression resultname var name WIL esie V As suggested in the above Usage message the example expression 1 0 3 0 is given as argument to the tool so that it forwards the expression to Maple for evaluation This returns the expected numerical answer sancheg mills test EvalMapleStatement 1 0 3 0 Creating new mapleclient instance School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution KKK erue Setting mapleclient output to stdout Starting Maple Resetting Maple Dale e Evaluating expression 1 0 3 0 sass KKK KKK 33333353 Stopping Maple Freeing allocated memory When the tool is instructed to submit Maple an expression for generating C code as the statement to evaluate the returned answer is again within the expected answers Maple could provide sancheg mills test EvalMapleStatement CodeGeneration C 2 3 x 5 resultname y kkk kkk trus Cre
122. esults Various of these tests and tools have been refactored to adapt to the changes in the codebase particularly those effected towards improving the separation of concerns section 5 3 5 p 76 some others have been improved and some have been completely rewritten or developed from scratch The following sections highlight the major tests and tools changes 5 3 8 1 lists tool The 1ists tool which informs the user of the material tests and material models available for simulation alongside with their particular constants has been improved from its original version for providing a better console output and has been refactored to avoid memory leaks although some potential problems still remain see p 126 in section 6 4 gonzalo sancheg Projects virtlab svn 1 1 matcalc src lists SEoupponsccdEM cisco Medo MEE pari Materials AC 65 mezes Constants 1 ElasticE 23 ElasticNu 35 e 4 phi 5 psi 21 Material OC hardening material Constants 1 ElasticE 025 ElasticNu En A 4 m 57 n 3 Material OC plfluid material_E3 Constants 1 ElasticE 2 ElasticNu 3 A 4 m 4 Misne Great el OC_smith_material_E2 Constants 1 ElasticE 125 ElasticNu 35 eta ES Material OC vonmises material E5 Constants 1 ElasticE 020 ElasticNu 3 Kyield AR A ECCE Booted Ruby 1 Experiment UniaxialX School of Computational Engineering and Science McMaster University 5 Virtlab Project
123. ething useful with the sophisticated code he developed and learn from it to Dr Spencer Smith for his guidance constant support and encouragement a keystone in my life as a student at Mac and a turn point in my life in Canada to Dr Tim Davidson and Laura Kobayashi M Sc for their assistance throughout my studies at CES Department the compass and map that guided me in hitherto unknown territories to my parents for their lifelong unconditional moral and financial support without whom I would not exist in any imaginable sense and to my friends back in Uruguay my friends and the Outdoors Club gang at Mac my office mates at ITB115 and my house mates and the crew at the Bean Bar in Westdale for providing a joyful environment for all of the above my most sincere gratitude I am truly indebted gonzalo April 2010 ITB115 CES Department McMaster University Hamilton ON Canada School of Computational Engineering and Science McMaster University 2 Reference Material 2 REFERENCE MATERIAL 2 1 Related Documentation Document ID Description VL REP Virtlab 1 1 Virtual Material Testing Laboratory version 1 1 MEng Report by Gonzalo S nchez May 2010 this document VL TM Virtlab Technical Manual VL UM Virtlab User Manual VL SCD Virtlab Source Code Documentation Table 1 Related documentation Please refer to sections 3 2 3 3 and 3 4 for an overview of the purpose co
124. f the corresponding file s code or purpose thereof they try to illustrate the access functions or class methods offered or the logic control flow and are intended to provide a rough idea of the application s organization specially of its outer layers 5 3 5 6 Future work Further work can still be done in specific aspects of the code particularly where material test and material model aspects need to be handled Currently the gui matcalc driver and output modules need to extract the name or constant values of the material virtual tests experiments and or of the material models for which a series of steps are required creating a test or model list querying it in different ways depending on the information at hand then deleting the list and intermediate objects It is easy to overlook an object deletion thus creating memory leaks in the application so a solution would be implementing specific access functions for each of this purposes that would further ease the development of new tools and tests for the application while ensuring the overall reliability This seemingly minor issue is still a further step in achieving better separation of concerns within the library 4 Recall that all work was performed with MatCalc simulation engine in mind and did not address MatGen code generation engine School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution i or cho
125. from either interface are compatible with that of the other thus addressing reusability understandability and maintainability qualities of the software package The library itself benefits from this separation of concerns primarily for the enhanced reusability of the modules The building process for the software package has been largely automated and has also been extended to Solaris and OpenSolaris platforms which addresses the portability quality in the first place and as a consequence its reusability as well as indirectly contributing to its reliability The codebase documentation is currently in development targeted to the Doxygen automated documentation generator vHe97 technical documentation of the whole project is also currently being developed addressing the understandability reusability and maintainability qualities A material model parameter fitting tool has also been developed using the codebase as a software library The tool uses the Hooke and Jeeves pattern search algorithm SHL83 s 5 7 that runs the FEM engine iteratively to minimize a cost function that involves the sum of the squares of the differences between the simulation data and the real world data samples San09 This tool is currently being refactored to enable parallel computation San10 by application of MPI constructs Gro96 As of March 2010 Virtlab Software Library reached version 1 1 This is the final state of the software library at com
126. g on 1 3 which H is contrary to our usage Disable this feature alias g 1 Find a good install program We prefer a C program faster so one script is as good as another But avoid the broken or incompatible versions SysV etc install usr sbin install SunOS usr etc install IRIX sbin install AIX bin install Amiga0s C install which installs bootblocks on floppy discs AIX 4 usr bin installbsd which doesn t work without a g flag AFS usr afsws bin install which mishandles nonexistent args SVR4 usr ucb install which tries to use the nonexistent group staff 0S 2 s system install which has a completely different semantic install which can be erroneously created by make from install sh echo as_me LINENO checking for a BSD compatible install gt amp 5 echo ECHO N checking for a BSD compatible install ECHO C gt amp 6 3 if test z INSTALL then if test fac cv path installeseti set then TEENS ECHO N cached ECHO C gt amp 6 else gt as save IFS IFS IFS PATH SEPARATOR 3 ug as dir in PATH o IFS as save IFS test z as dir amp amp as dir Account for people who put trailing slashes in PATH elements case as dir in ap M aser Petey pos fetc usr sbin usr etc sbin usr afsws bin P MM Os2XX installXX P XX OS2XX INSTALLXXZ X fusr ucb a BS OSF1 and SCO ODT 3 0 have their own names for install Don t use in
127. gically and on a file per file basis alongside the developer that introduced the change Sections 9 1 and 9 3 contain a copy of the ChangeLog files for MatCalc and MatGen respectively to the date of writing of the present report Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution Arguably the purpose and contents of these files duplicate those of the Subversion commit log see section 5 3 7 4 and as such can lead to maintenance problems and what is worse inconsistencies between the said log files For the particular case of Virtlab the ChangeLog files were maintained for the sake of keeping MatCalc and MatGen issues in separate files given the fact that the repository for the code and hence its corresponding commit log is unique The TODO files are intended to keep a list of tasks to be done on the software s codebase This range from needed bug fixes to enhancements or ideas for experimenting and are meant as a reminder to the developers that might be assigned work on the codebase Sections 9 2 and 9 4 contain a copy of the TODO files for MatCalc and MatGen respectively to the date of writing of the present report 5 3 7 3 INSTALL2 file As mentioned in section 5 3 1 towards the portability quality a file INSTALL2 with advanced building and installation instructions was generated and added to Virtlab software package In particular compile time and
128. given an objective function the pattern search algorithm proposed by Hooke and Jeeves establishes a search direction by setting a series of position vectors b called base points which tend to follow a principal axis of the objective function Each move involves an extrapolation of any success achieved by moving from the previous base point to the current one followed by an exploration of the surface around the extrapolated point to provide corrections for local conditions The algorithm thus employs a double strategy and the rth iteration comprises i a pattern move from base point b to a new trial centre c ii a local exploration around the trial centre c as a result of which a new basepoint b is established These position vectors may be defined as b 01 bs e C1 r CT in which bi the value of the ith variable at the rth basepoint ci the value of the ith variable at the rth trial centre ISHL83 pp 180 181 In the aforementioned description the vectors b and c are simply appropriate names for the parameters vector p un in the example at the rth iteration of the algorithm that only describe the stage of the strategy within the iteration step This implies that for each iteration of the Hooke and Jeeves method several simulations have to be run to evaluate the objective function f given by Eq 8 or Eq 9 and after each iteration the updated parameter values in b have to be pr
129. graph Sample program output typically to the system console Consisting of two lines of output School of Computational Engineering and Science McMaster University 2 Reference Material Issue Convention Verbatim quotes Text that is quoted verbatim will be enclosed in quotation marks and rendered with italicized font on a grey background similar to that of the emphasized paragraphs see Emphasized paragraphs above Appropriate reference will be made after the closing quotation marks and any particular observation concerning the quotation will be done on a footnote Sample verbatim quotation where the original text having no particular emphasis has been selectively emphasized by the current author with boldface type fact that would be acknowledged on the associated footnote Ref00 p 1 Table 4 Conventions 2 5 Virtlab Project and Software Package Reference Information Virtlab Project Stage Virtlab Software Version Evolution Developer Period 1 0 0 to 0 1 John McCutchan Up to September 2007 2 0 1 to 1 1 Gonzalo S nchez May 2009 March 2010 Table 5 Project Reference Information i Sample verbatim quotation paragraph footnote acknowledging that the boldface type used for emphasis in the quoted text was not part of the original and that the reference Ref01 is a fake reference for example purposes Gonzalo S nchez Virtlab 1 1 M Eng
130. grind Valgrind Sew00 is a binary instrumentation framework for memory debugging memory leak detection and profiling Valgrind is an award winning instrumentation framework for building dynamic analysis tools There are Valgrind tools that can automatically detect many memory management and threading bugs and profile your programs in detail You can also use Valgrind to build new tools The Valgrind distribution currently includes six production quality tools a memory error detector two thread error detectors a cache and branch prediction profiler a call graph generating cache profiler and a heap profiler It also includes two experimental tools a heap stack global array overrun detector and a SimPoint basic block vector generator It runs on the following platforms X86 Linux AMD64 Linux PPC32 Linux PPC64 Linux and X86 Darwin Mac OS X http valgrind org Why should you use Valgrind Valgrind is easy to use Valgrind uses dynamic binary instrumentation so you don t need to modify recompile or relink your applications Just prefix your command line with valgrind and everything works Valgrind works with programs written in any language Because Valgrind works directly with program binaries it works with programs written in any programming language be they compiled just in time compiled or interpreted Valgrind gives 10096 coverage of user space code even within system libraries You can even use Valgrind on program
131. group strove for rigour and generality The emphasis on rigour may be seen as a reaction to the work of Henri Poincar who stressed the importance of free flowing mathematical intuition at a cost of completeness in presentation It rs some hostility too mostly on the side of aa analysts they apir ovea of rigour but not of high abstraction From http en wiki Bourbaki G Chaitin htt cs auc chaitin has criticized Bourbaki s group policy of polishing mathematical proofs until perfection on the pies that the ideas behind the proof are progressively lost on that quest for attaining most concise formal proof possible in this sense much like keeping the latest revision of the code but devoid of the documentation that explains what it is intended to do and the design decisions thereafter Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 7 Conclusions amp Future Work Research 7 2 Future work Having reached a minimal usability grade future work on the Virtual Material Laboratory Project software library will pursue the following objectives to leverage it to industrial or production grade Fix the code generation problem of MatGen Improve the documentation o produce the complete set of documents listed in Table 1 p 15 the VL TM document should actually be a document set System Requirements Specification SRS Module Guide MG Module Interface Spec
132. h of automatic differentiation techniques to substitute the symbolic computation of the required derivatives for the material classes formulations and the automated code generation stage that follows the symbolic manipulation and comparison of the numerical and symbolic generative approaches thereafter School of Computational Engineering and Science McMaster University 8 References 8 REFERENCES Bro09 Col00 CSMAKO7 Eat94 GJ03 Gla98 Gro96 HS99 KP97 Map80 Mat95 McC07 PC86 San09 San10 Sew00 SHL83 SMC07 Solutions for tracing UNIX applications M Brown 31 Mar 2009 IBM developerWorks ibm com developerWorks O Copyright IBM Corporation 2009 Subversion SVN version control system CollabNet Elego WANdisco initiated in 2000 by CollabNet Inc URL http subversion apache org Model Manipulation as Part of a Better Development Process for Scientific Computing Code J Carette S Smith J McCutchan C Anand A Korobkine SORL Report 48 McMaster University December 2007 GNU Octave a high level language primarily intended for numerical computations J Eaton et al Department of Chemical Engineering University of Wisconsin 1994 Copyright O 1998 2006 John W Eaton URL http www gnu org software octave Learning the GNU development tools edition 0 11 4 E Gkioulekas Department of Applied Mathematics University of
133. he status bar previously suggested e Implement a Stop button to interrupt the simulation 37 This can be implemented with relative ease by providing a combobox for each graph axis in which the entries would simply correspond to every column of the data table the underlying rendering does not assume anything except that it is passed two data vectors 38 This would require modifying the core FEM algorithms and respective interfaces so that the current simulation time is accessible from outside of these A simple current time variable passed by reference to the integration algorithms could be a starting point 39 This would require modifying the core FEM algorithms and perhaps their respective interfaces so that these are aware of a stop signal The main loop in the algorithm could check the stop condition at the same time when it checks if the time span for the simulation is reached Combined with a general knowledge of the current simulation time this might enable pausing the simulation or even execute it in stepping mode School of Computational Engineering and Science McMaster University E 5 Virtlab Project Evolution The separation of concerns that was performed under the hood while updating the GUI could be exploited to develop a Java Applet based GUI that would enable the operation of the software product from a web browser see section 5 3 5 p 76 This would be a significant further usabili
134. he command ine switches appended or not when invoked Behind both GUI and CLI frontends the MatCalc FEM engine is shared as well as are the input and output modules that allow text file 1 0 for simulation setup parameters and data The GUI and CLI frontends are completely independent to allow the application to be built without the GUI and therefore the Gtk libraries and associated dependencies Therefore the GUI frontend to MatCalc might not be available depending on the configuration phase before compilation Definition in file matcalc cc Fig 37 Brief detailed comments and include dependency graph for matcalc cc generated by Doxygen Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 6 Software Tools 1 N An example of syntax highlighted source code fragment and automatic cross referencing of entities with their definition therein is given in Fig 38 for the file matcalc cc File Edit View History Bookmarks Tools Help AAA F amd mun son matcalc cc Gata fs documeniatan af tis fle 00001 00992 Copyright C 2087 John McCutchan 00003 Copyright C 2009 Gonzalo Sanchez 00084 00585 This program is free software you can redistribute it and or modify it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation version 2 This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without
135. icantly enhanced o The GUI frontend to MatCalc is intuitive to use the information is laid out clearly all the controls work as intuitively expected and the underlying library functionality is completely accessible A CLI frontend to MatCalc has been developed and is as functional as the GUI frontend by way of file input and output Both frontends are compatible in terms of file input output and make the exact same use of the underlying simulation engine MatCalc s building process is fully automated MatGen s building process albeit not completely automated is now appropriately documented e Virtlab library portability has been enhanced o Virtlab now builds on Solaris OpenSolaris platforms apart from Linux and MacOS X the original development platforms e Virtlab library documentation albeit not complete has been significantly enhanced and the future documentation roadmap has been traced thereupon improving the understandability and maintainability of the software package o A systematic and automated documentation of the codebase has been initiated upon the framework provided by Doxygen Virtlab s documentation has been enhanced by way of improving or creating the files listed in chapter 9 p 145 as well as specific figures and sections included in this report which can later be included in the appropriate documents listed in Table 1 p 15 A Material Model Parameters Fitting tool has be
136. ice at runtime uses relationship more files not listed gui main new configset new dataset gu _init gtk main elastic integrator while time t viscoplastic integrator while tine t returnmap integrator while tine exp get s r experiment runner ruby helper material class list V fem gq3 brick element a E Fig 22 Virtlab files relationship overview for the files affected by the separation of concerns applied to the codebase Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 irtlab Project Evolution 5 Virtlab Project Evoluti 81 5 3 6 Material Model Parameters Fitting Tool Towards the goal of testing and improving the software s package accuracy reliability and verifiability qualities a tool was developed to fit the material model parameters against a real world material test Note The work on this tool was encompassed within the CES 701 2009 course at CES Department McMaster University Foundations of Modern Scientific Programming The current section contents are almost entirely based on the project report for the referred course San09 5 3 6 1 Tool overview The purpose of a material model parameters fitting tool for MatCalc is to take data from a real world material test and data produced from a simulation in MatCalc for the corresponding material model a
137. iff cc code tool CLI tool for testing the relative error in Stress and Strain between two MatCalc datasets tools hooke jeeves cc code tool CLI frontend for the Hooke amp Jeeves driven fitting tool for MatCalc s material models parameters ALPHA VERSION tools lists cc code tool CLI executable that dumps the Material Models built into MatCalc and the Experiments available for MatCalc Generated on Sun Mar 7 19 52 18 2010 for MatCalc by e e Ac E3157 School of Computational Engineering and Science McMaster University 9 Appendix 9 13 MatCalc 0 1 memory leak bug description and proposed fix Note the content of this section 1s in its entirety based on the information provided by original developer of Virtlab John McCutchan who diagnosed the problem and proposed the corresponding fix The memory leak reported in MatCalc 0 1 is related to Ruby The leak is not generated inside of Ruby but is a side effect from the wrapper class that is used which in specific points fails to free some allocated memory and also fails to call certain object s destructors thus creating a memory leak thereafter 9 13 1 Description Whenever an instance of a native class T a C class T is needed inside of Ruby a ruby object T instance is created For example tracing the code ofm vector ruby the following happens e m vector ruby create is called which the
138. ification MIS as suggested in HS99 complete the source code documentation brief and detailed comments for use by the Doxygen documentation tool document the objects classes methods functions structures etc in the codebase using Doxygen s appropriate keywords to improve the generated documentation thereafter try to automate the maintenance of the complete documentation set as much as possible Implement proper unit and regression testing linked to the make check target of the build system e Fix the documented memory leaks Improve the building process to achieve o support for running unit and regression tests at the building stage with make check elimination of any hardcoded paths leaving make install target operational complete automation of MatGen building process support for without gui option to enable building the software package support for other with feature or without feature options as needed Improve the GUI frontend to MatCalc to achieve o o a Stop button to interrupt the simulation a progress bar or percentage indicator to provide feedback on the simulation running status better performance and capabilities of the graphics panel and or capabilities to link to an external plotting utility and leave the current graphics panel as a 75 These include a prioritized summary of sections 5 3 1 3 5 3 2 3 5 3 4 2 5 3
139. igure ac checks esac AC SUBST OPENMAPLE CFLAGS AC SUBST OPENMAPLE LDFLAGS AC SUBST OPENMAPLE LIBS The following command gives an example of the use of the appropriate linker switches for configuring MatGen on a specific Linux platform the Computing and Software Department at McMaster University server nills cas mcmaster ca configure OPENMAPLE CFLAGS I usr local maplell extern include OPENMAPLE LDFLAGS L usr local maplell bin X86 64 LINUX Xlinker rpath Xlinker usr local maplell bin X86 64 LINUX OPENMAPLE LIBS 2 lmaplec lmap lgmp 2 At the time of writing the present report Any changes in the version or location of Maple in the referred server should be updated appropriately in the given command School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution The corresponding configure script output on the said Linux server is Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution hecking for void yes nectngaesudzecectevosc m E hecking for long long yes hecking size of long long 8 hecking whether byte ordering is bigendian no NECISME Or cre MN Loss Wes hecking return type of signal handlers void hecking for an ANSI C conforming const yes hecking for GTR yes hecking for GLADE yes configure WARNING Ple
140. iment list cc 44 by 0x4040D7 main lists cc 66 411 214 bytes in 9 310 blocks are still reachable in loss record 5 of 5 at 0x4A05809 malloc vg replace malloc c 149 by 0x4C7B156 ruby xmalloc gc c 144 IN sedo e d OEC Se ae ato Mv LUNES 25 Z NN IS o 081199 by 0x4C986CD Init sym parse y 5998 low Macias ido Sed subes abinah eis e 255 by 0x4C6EA16 ruby init eval c 1398 by 0x40AA54 ruby boot ruby helper cc 90 by 0x40508A experiment list experiment list experiment list cc 44 by 0x4040D7 main lists cc 66 LEAK SUMMARY definitely lost 0 bytes in 0 blocks possibly lost 0 bytes in 0 blocks Still reachable 816 531 bytes in 9 475 blocks suppressed 0 bytes in 0 blocks several lines suppressed here This type of leak could signal a potential flaw in the system libraries that might or not be retaining allocated memory just in case another application that uses the library might need 1t As the example shows apart from a memory leak summary Valgrind actually logs the call stack for every type of memory leak so that the process of debugging the offending functions is greatly simplified In the particular example shown above the eventual leaks Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 6 Software Tools 127 are produced around some Ruby related operations hinting that the interaction between C and Ruby objects has to be checked The following example correspond
141. inary distribution of a package which squarely addresses the usability quality of a software package The typical commands an end user has to perform to build a software package which has been prepared using the GNU Build System are commented below When you download an autoconfiguring package it usually has a filename like 00 1 0 tar gz where the number is a version number To install it first you have to unpack the package to a directory someplace o z gunz LOO 1 0 car cu de tar xi foo 1 0 tai Then you enter the directory and look for files like README or INSTALL that explain what you need to do Almost always this amounts to typing the following commands cel too 1 0 configure make make check su make install o o o o oe The configure command invokes a shell script that is distributed with the package that configures the package for you automatically First it probes your system through a set of tests that allow it to determine things it needs to know and then it uses this knowledge to generate automatically a Makefile from a template stored in a file called Makefile in When you invoke make with no argument it executes the default target of the generated Makefile That target will compile your source code but will not install it If your software comes with self tests then you can compile and run them by typing make check To install your software you need to explicitly
142. ing to the Ruby test tool for MatCalc shows all classes of leaks 32139 My PID 32139 parent PID 29514 Prog and args are 32139 Ruby test 37139 Command Line 32139 Ruby test 321 9 9 15 Geenit wralicla Ele 532139 Y oO tool memcheck mS LS gt n leak check yes 321 59 show reachable yes 32139 log file u0 grad sancheg Out valgrind log 32139 32139 ERROR SUMMARY 0 errors from 0 contexts suppressed 4 from 1 32139 malloc free in use at exit 694 548 bytes in 8 123 blocks 32139 malloc free 8 450 allocs 327 frees 704 697 bytes allocated 32139 searching for pointers to 8 123 not freed blocks 32139 checked 1 412 776 bytes 32139 32139 8 bytes in 1 blocks are definitely lost in loss record 1 of 8 32139 at 0x4A06019 operator new unsigned long vg replace malloc c 167 HR by 0x403693 ruby test experiment runner Ruby test cc 150 32139 by 0x403D23 main Ruby test cc 210 32139 32139 8 bytes in 1 blocks are still reachable in loss record 2 of 8 32139 at 0x4A06019 operator new unsigned long vg replace malloc c 167 32139 Jo RRA alo ne en Gonen ame sos muay helper assi 32139 by 0x403B71 ruby test ruby call method Ruby test cc 94 32139 by 0x403CFC main Ruby test cc 206 32139 32139 32 bytes in 1 blocks are possibly lost in loss record 3 of 8 32 1 39 at 0x4A05809 malloc vg
143. irtlab Project Evolution 63 MatCalc v 1 1 GUI also allows the user further control of the simulation with respect to the original GUI version by providing edit boxes for setting the time step and test specimen dimensions and a control for selecting the FEM algorithm variant for the simulation Fig 11 shows MatCalc s v 1 1 GUI after a simulation run B Material Calculator t File Edit View Help SIMULATION SETUP SIMULATION RESULTS General parameters Rur Experiment UniaxialX m Data table Yield Function OC smith material E2 Time StressX StressY StressZ StressXY StressXZ Stressy Algorithm Radial return map t StressU StressU StressU StressU StressU Stress Time step 1000 02 t 1 000E 02 2 857E 01 2 098E 07 2 098E 07 2 080E 09 2 080E 09 4422 2 000E 02 45 575E401 42 111E 07 amp 2 111E 07 44 337E 10 4 337E 10 1 78 3 000E 02 48161E401 42122E07 2 122E 07 49 069E 11 49 069E 11 7 53 4 000E 02 1 062E 02 42 133E 07 2 133E 07 41 901E11 41 901E11 4315 5 000E 02 41 296E402 2 144E 07 2 144E 07 43997512 3 997E 12 4125 v Time span 1 000E 00 t Specimen dimensions 1 000E 00 L 1 000E 00 L 1 000E 00 L Graph Specific parameters stress 2 957E 01 lt 4 436E 02 lt 5 545EMoP PStFeS8UT oo strains 1 000E 03 lt 2 876E 02 lt 3 9 445E 02 L L Constant Name Constant Value ST w Experiment disp
144. is a suite of programming tools produced by the GNU project These tools are designed to assist in making various source code packages portable to many Unix like systems 6 2 1 1 Autoconf Automake and Libtool http en wikipedia org wiki GNU build system The GNU Build System is comprised mainly of the packages Autoconf Automake and Libtool Autoconf produces a configuration shell script named configure which probes the installer platform for portability related information which is required to customize makefiles configuration header files and other application specific files Then it proceeds to generate customized versions of these files from generic templates This way the user will not need to customize these files manually e Automake produces makefile templates Makefile in to be used by Autoconf from a very high level specification stored in a file called Makefile am Automake produces makefiles that conform to the GNU makefile standards taking away the extraordinary effort required to produce them by hand Automake requires Autoconf in order to be used properly Libtool makes it possible to compile position independent code and build shared libraries in a portable manner It does not require either Autoconf or Automake and can be used independently Automake however supports libtool and interoperates with it in a seamless manner 6 2 1 2 The configure shell script GJO3 p 1 The
145. is kind of tool Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution A more severe portability problem that actually caused the configure script to abort on Solaris and OpenSolaris platforms was that of the isinf and isnan functions in Virtlab s MC test module Since not all platforms use the same conventions these functions had to be redefined by inserting in MC test cc the following code suggested in the Autoconf tool manual section 5 5 1 Portability of C Functions os Del EGYETLEN o vacio eS 2009 05 13 ifndef isnan define isnan x sizeof x sizeof long double isnan_ld x sizeof x sizeof double isnan_d x 2 akeen E OSN Steti abiyle al a temem i float R NE natespibheer se fl JE Steric aladas aye denan Cl doble SEA a Sie Jr Seige allas shine tenem Mel ewe Goole d weenie x HS 27 endif ifndef isinf define isinf x sizeof x sizeof long double isinf ld x sizeof x sizeof double isinf d x 3 alsalioue Se xy Steric allas aligns teigi i float xI return ionam Ge x9 3 Szeme yilina hene deim b Couls xe db ases Iena dex x9 E DT Sucia aladas aloe ealimie lol Ikon ekotioikz 3 E debida alejacia 6 gt 29 2 endif Although seemingly simple at first sight a closer look at the above code suggests there might be quite subtle underpinnings to the C compiling standards being exploited th
146. iting configure ac file and rerunning the Autotools chain or supplying the RUBY CFLAGS and RUBY LIBS variables on the configure script command line invocation to override the aforementioned locations with those suitable for the particular platform in which the software was being built While passing arguments to the configure script might be acceptable in some cases it is in general tedious so the use of macros that perform the specific dependency check is the preferred option The GNU build system does provide facilities for cases where the developer might need to add a specific check to the build system 5 3 1 2 2 MatCalc v 1 1 During the work on MatCalc during the period May 2009 March 2010 a macro for Autoconf that queries the system for an installed Ruby package and extracts the necessary information therein was found and was therefore included in the configure ac file Check for ruby AM CHECK RUBY 1 8 G S 2009 07 03 As with any locally supplied macro the above macro call requires adding the line ACLOCAL AMFLAGS I m4t to Makefile am file so that the GNU build system is informed of the existence of a locally supplied macro in the software package s m4 folder that 1s a macro that is to be provided with the software package but is not part of the set of standard macros distributed with Autoconf The aforementioned check for Ruby still required additional configuration lines to be ad
147. ix of adding a destroy function that explicitly calls the destructor should fix this leak So the code inside the experiment runner would be modified to look like MzwUEEdotaserevsi cu datos Soy ez Sat Ml MINIM Varua ce valis musy sCelleies rene ele EUME ce valis by scaler sereas city Varun noriesc ible call mathocl smesso Melek 3 Ceteasst valus che valie cu wee dataset ruby destroy dataset value Note There is potentially another class of leaks related to ruby object The issue is simple but it requires a good understanding of a C objects life cycle constructors destructors copy constructors and assignment operators and an understanding of the steps involved allocating memory for an object instance running the object s constructor using the object running the object s destructor freeing the allocated memory for the object s instance C placement new operator should also be understood Gonzalo Sanchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix 9 14 Compilation Assembly and Linking Overview Note The complete contents of this section are adapted from http www tenouk com ModuleW html COMPILERS ASSEMBLERS and LINKERS Normally the C s program building process involves four stages and utilizes different tools such as a preprocessor compiler assembler and linker At the end there should be a single executable file Below are the stages that happen in
148. lacement rate x 1 000E 01 s Yield Function ElasticE 3 000E 04 ElasticNu 3 000E 01 eta 3 000E 03 Fig 11 MatCalc v 1 1 GUI after RUN Among further usability improvements in this version of the GUI it can be noted that e The complete simulation setup data is visible against the simulation results e The data table uses scientific format for displaying the numerical information shows the corresponding physical units for each data column has an easier to read layout by the shading of every other row and can be scrolled independently of the graph panel e The graph panel textual information updated as explored with the pointing device shows the physical value and units as opposed to mere pixel coordinates within the corresponding axis limits which enables a direct comparison with the data table above However the graph panel is still the best candidate for improvement in MatCalc s GUI section 5 3 2 3 lists a number of improvements envisioned for this panel 35 These features were already available in the underlying Virtlab library yet not exploited in the original GUI School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution Although not visible in the screenshot pop up hints were added to each of the widgets in the GUI that provide the user with additional usage information for each control when he she hovers each control with the pointing device Also not
149. le after generating the configure script with aclocal autoheader automake and autoconf the execution of the script yielded the following output on an OpenSolaris platform School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution hecking for GTK yes hecking for GLADE yes hecking usr lib ruby 1 8 i486 linux ruby h usability no hecking usr lib ruby 1 8 i486 linux ruby h presence no hecking for usr lib ruby 1 8 i486 linux ruby h no hecking usr lib ruby 1 8 universal darwin8 0 ruby h usability no hecking usr lib ruby 1 8 universal darwin8 0 ruby h presence no hecking for usr lib ruby 1 8 universal darwin8 0 ruby h no hecking usr lib ruby 1 8 powerpc darwin8 0 ruby h usability no hecking usr lib ruby 1 8 powerpc darwin8 0 ruby h presence no hecking for usr lib ruby 1 8 powerpc darwin8 0 ruby h no configure error libruby 1 8 is needed to compile Ko ME COE E OMEN GO M COE Om On It can be seen in the last lines of the output produced by configure that the script aborts upon being unable to find a working installation of Ruby in the system The messages give evidence that the search is being done in specific locations these correspond to the hardcoded paths in the configure ac file the pertinent extract of which is shown above before the configure script output Therefore building the software package required either ed
150. licent clneeJs c e Shared libraries Building shared libraries becomes as easy as building static libraries GJO3 p 2 The typical steps a developer has to perform to prepare a software package using the GNU Build System are the following 1 Prepare the files configure ac and Makefile am with appropriate instructions for the autoconf and automake tools 2 Execute the following tools aclocal I m4 autoheader automake add missing gnu foreign autoconf Alternatively the utility autoreconf repeatedly runs autoconf autoheader aclocal automake and other tools to update the GNU build system in the specified directories and their subdirectories Gonzalo Sanchez Virtlab 1 1 M Eng Report Apr 2010 6 Software Tools 113 The above steps will produce the configure shell script as intended for the end user Therefore as the end user would do the steps reguired to build the software package from the configure script are typically the following configure make If the software package contains tests these can be compiled and run with the following command make check Installing the software once it has been compiled and eventually tested requires the following commands su make install To check at build time any specific options the software package might support the configure shell script can be queried with the following command configure help
151. mall steps with individual checks for one feature Hereafter we will call these steps probes How results of probes are represented differs from one tool to another but most of them have a caching mechanism in place so that you don t need to run a probe each time you need the result of that probe Probes can have various granularities can be independent or can be dependent on the result of other probes Roughly speaking the available set of probes is the way a configuration tool represents its knowledge about the platform to which it needs to adapt The result of the entire set of probes defines de facto a model for a given Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 6 Software Tools platform This hurts on the plane of operating systems with more or less support from those systems maintainers Given the diversity of platforms to cover configuration tools in general take on a tremendous job This unavoidably generates frustration in different places and at different levels Try to be positive and not judge a configuration tool only by its failures in some cases http freshmeat net articles make alternatives The boldface type used here is for highlighting passages of the quote but is not present in the original text School of Computational Engineering and Science McMaster University 6 Software Tools 6 2 1 The GNU Build System The GNU build system also known as the Autotools
152. me agreed module naming convention that enables the dynamic linker to find the newest installed module such as some version specification Furthermore the distribution of the libraries is in binary form no source including dynamically linked libraries DLLs and when you change your program you only have to recompile the file that was changed 12 The d11 extension and DLL acronym refer to the Microsoft Windows naming convention of shared objects School of Computational Engineering and Science McMaster University 202 9 Appendix 3 In combination with virtual memory dynamic linking permits two or more processes to share read only executable modules such as standard C libraries Using this technigue only one copy of a module needs be resident in memory at any time and multiple processes each can executes this shared code read only This results in a considerable memory saving although demands an efficient swapping policy RUNTIME LINKER AND SHARED LIBRARY LOADING The runtime linker is invoked when a program that was linked against a shared object is started or when a program requests that a shared object be dynamically loaded So the resolution of the symbols can be done at one of the following times 1 Load time dynamic linking the application program is read from the disk disk file into memory and unresolved references are located The load time loader finds all necessary external symbols and alters all refer
153. mpassed within the CESZ713 2010 course at CES Department McMaster University The Message Passing Interface for Parallel Applications that will target the parallelization of the search algorithm by application of the Message Passing Interface MPI constructs for building parallel applications San10 The parallelization of the search algorithm is expected to improve the following Performance By the mere evaluation of the cost function in parallel for each trial centre tested by the algorithm a significant time saving is expected if there are enough cores or nodes in the system for each possible coordinate shift Also provided enough computing power is available in the system several step sizes for each coordinate shift can be tried in parallel with the former parallelization scheme Furthermore for when the tool is able to address several real world material tests all of the work in each case could be executed in parallel with appropriate communication of the minimization search between all processes Convergence Parallel execution of the tool for different initial guesses can be used to check if the convergence is towards the same local minimum or different local minimums The challenge in this case is the termination criteria for the overall search in the case of quicker convergence of one path with respect to the rest compounded with the possibility of hitting different local minima A complementary approach to improvi
154. n calls ruby object m vector construct which then calls Data Make Struct Data Make Struct allocates ruby xmalloc enough memory for an instance of the native class and then zeros the memory So in this case it allocates the memory for a C m vector instance and zeros that Inside m vector we have two int and a scalar On a 32 bit machine this memory allocation should be 8 bytes ruby object m vector construct retums this new chunk of memory back to m vector rubyt create The method m vector ruby createlookslike this m vector ruby h 55 00054 create a ruby object from a c m vector 00055 RUBY METHOD create const m vector amp vector 00056 1 00057 VALUE object 00058 m veckors msn censi celos 00059 asuiciado Wasi y 00060 return object 00061 When 00058 has finished executing instance points to valid memory that has been filled with zeros In 00059 the assignment operator for the vector class executes The assignment operator will allocate memory to store the values of the vector and copy the values from the vector variable At this point two leaks have been produced Data Make Struct takes free a function pointer to the function free but in the code a NULL pointer is passed ruby helper h 00168 object Data Make Struct ruby class 1d T 0 0 1nternal Hence all the memory allocated inside Data_Make Struct is never freed The destructors on the objects constructed insid
155. nal conference on software engineering ICSE 2008 21 Oliveira Suely Stewart David E Writing scientific software a guide to good style New York NY USA Cambridge University Press 2006 Gonzalo Sanchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution 5 2 2 Software Qualities The software qualities referred to in this document are a collection of measures that together define the excellence or worth of a software product or process SY09 s 2 Q1 Reliability The probability that a software product will meet its stated requirements under a given usage profile As an example an scientific computing application is reliable if the true error is rarely larger than the user requested bound on the error Q2 Accuracy A measure of the absolute or relative error of an approximate solution computed by the software compared to the true solution Q3 Performance A measure of how large a problem can be handled by a software product and how quickly an answer can be found Performance is related to how efficiently the internal resources of the computer are used Q4 Understandability The degree to which a programmer finds a software package easy to understand Q5 Maintainability The effort required to locate and fix errors and to add features to an operational software package Q6 Verifiability The effort necessary to verify the properties of a software package Q7 Reusabilit
156. nce in the quote it is not part of the original text Gonzalo Sanchez Virtlab 1 1 M Eng Report Apr 2010 6 Software Tools Subversion is a version control system of the centralized type requiring a server for the repository It is the revision control system with which Virtlab library was originally managed From the developer s perspective the initial step to start working with a codebase under version control in a centralized version control system like Subversion is the following e Copy the contents of the repository located in the file server into a working folder the developer s local hard disk drive After acquiring the initial working copy the developer s subsequent workflow is basically a repetition of the following steps e Update the working copy with the latest state of the repository Make changes to the code in the working folder Update the repository to incorporate those changes The centralized type of version control system manages the possible overlapping operations of several developers on the repository and keeps track of each change to every file in the repository timestamped and including the identity of the author of the changes The use of a version control system to manage ail files pertaining to a software package 1s perhaps the first tool that a developer should use for addressing the maintenance of both code and documentation School of Computational Engineering and
157. nd maintainability qualities of the software package an additional file INSTALL2 with installation hints that covers this specific compiling linking issues was generated and added to Virtlab software package Section 9 5 in the Appendix lists the complete contents of the file where compile time and run time linking issues are discussed After effecting all of the described changes the building procedure for MatCalc was finally rendered fully automated gonzalo sancheg configure nec nec nec nec nec nec nec nec nec nec nec nec nec nec OCOD Om Om OMG Om DN ON OE Om OM CN 6 king build system type i386 pc solaris2 11 king host system type i386 pc solaris2 11 king target system type i386 pc solaris2 11 king for a BSD compatible install usr bin ginstall c king whether build environment is sane yes king for a thread safe mkdir p usr gnu bin mkdir p king for gawk gawk king whether make sets MAKE yes iin rte CCG 55 Cee king for C compiler default output file name a out king whether the C compiler works yes king whether we are cross compiling no king for suffix of executables kou for SUECIA ot object 2189 9 School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution config status creating Makefile config sta
158. nd virtual test and return the material model parameter values fitted as per the real world experimental data This should allow the users to fit their material models for use within MatCalc to real materials after which the accuracy reliability and ultimately the verifiability of Virtlab could be checked An example of material model implemented by the current MatCalc version is given by the following expression where c denotes the material stress denotes the material strain and A and y are the material model parameters gc 22 n Eq 7 Example material model The desired model fitting module would seek to adjust the material model parameters A and 7 for the example given by Eq 7 by comparing the simulation results produced with approximate values initial guesses for those parameters with the data produced by a real world material test For that purpose an appropriate cost function of the material model parameters has to be provided so that minimizing this objective function returns an optimal set of values for the parameters A naive objective function can be the traditional least squares fit which for the material model example given by Eq 7 would be min f p loo 7Y p A n p j 1 Eg 8 Naive dol a function for the material model of Eq 7 To avoid that the optimization method adjusts the parameters 4 and y taking into account particularities of either the simulation run or real materi
159. ndix School of Computational Engineering and Science McMaster University 9 Appendix dFdKappa diff CGF Kappa dKappadEpsilonVPT diff CGKappaF EpsilonVPXX diff CGKappaF EpsilonVPYY diff CGKappaF EpsilonVP2Z diff CGKappaF EpsilonVPXY diff CGKappaF EpsilonVPYZ diff CGKappaF EpsilonVPXZ gt CGDe De CGHe VectorMatrixMultiply dFdSigmaT De dQdSigma CGHe simplify CGHe CGHp dFdKappa dKappadEpsilonVPT dQdSigma CGHp simplify CGHp CGLambda CGGamma CGPhiF CGLambda simplify CGLambda CGLambdaP diff CGLambda F CGLambdaP simplify CGLambdaP CGCl 1 0 1 CGLambdaP dt CGHe CGHp CGC1 simplify CGCl CGDeltaEpsilonVP dt CGLambda dQdSigmaT CGDeltaEpsilonVP simplify CGDeltaEpsilonvVP CGDeltaEpsilonVPNL dt Lambda dOdSigmaT CGDeltaEpsilonVPNL simplify CGDeltaEpsilonVPNL CGDeltaSigmaVP dt CGC1 CGLambda De dQdSigma CGDeltaSigmaVP simplify CGDeltaSigmaVP CGDeltaSigmaVPNL dt CGC1 Lambda De dQdSigma CGDeltaSigmaVPNL simplify CGDeltaSigmaVPNL CoDvpSublerm dt COCI CGLambdaP dOdSigmaT dFdSigma CGDvpSubTerm simplify CGDvpSubTerm maple gets stuck here with complex equations CGDvp De MatrixMatrixMultiply De CGDvpSubTerm De CGDvp simplify CGDvp maple gets stuck here with complex eq
160. ng the performance would be to study the possibility of progressively augmenting the step size once a pattern has been found as is the case shown in Fig 29 p 88 and Fig 30 p 89 after eta has reached an almost stable value around 3E 3 and ElasticE is about 10E 3 Care should be taken though to avoid possible oscillations in the resulting algorithm step size control that could lead to non convergence For the two parameter case a four core machine could potentially perform all computations in parallel MPI code can work on SMP machines as well as clusters or combinations thereof Gonzalo Sanchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution 5 3 7 Documentation Industrial documentation suffers from problems so serious that programmers rely almost exclusively on the code To remedy this problems the documents must be designed as carefully as the code they support The same set of documents must be used for design implementation and maintenance Our design methodology is based on the central role of documentation It is in some ways more important than the code Discard the code and keep the documents and you can recreate the code quickly and capably Discard the documents and keep the code and the resulting system will be hard to control and expensive to maintain HS99 p 16 To address the maintainability understandability and reusability qualities of Virtlab li
161. now displays the data table produced by the simulated test and the lower part of the left panel shows a graph with the plot of stress values as a function of strain the user can select the dimension X Y or Z in which to plot the stress vs strain values from the data table with the combobox provided beneath the graph panel Several usability hindrances can be noted e The time step was not a user configurable option and is fixed at 1 60 s e The graph panel textual information labelled Position which is updated as explored with the pointing device just refers to the pixel range and pointing device pixel coordinates of the graph panel but has no reference to the underlying plot data i e the data table e The left and right panels are not resizable to the user s convenience so that the data table is awkward to visualize even on wide screens e The data table does not present the information in scientific format e The material test and model constant s values have been occluded by the data table after the simulation run Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution The console ouput stdout stream generated by the program is shown in Fig 9 m Bl sanchegOmills Projects virtlab svn 0 1 matcalc src d E File Edit View Terminal Tabs Help 0 85 count 5 error 2 Didnd t Converge in 5 ps final error 24959e 05 0 866667 count 5 error 31334e 05
162. nt to sudden strain changes viscous materials and which deformation is permanent after the change in strain School of Computational Engineering and Science McMaster University 32 4 Virtlab Project Overview Fig 5 Yield function F the hardening effect and the plastic potential O in stress space McC07 Figure 2 3 p 22 4 3 4 Stress strain relationship constitutive equation The relationship between the the current stress field Fig 3 and the deformation strain history Fig 4 of the body is given by the constitutive equation which is specific to the material Under the hypothesis of isothermal process in an isotropic material a generalization of Hooke s law implies that the stress rate do dt and the strain rate de dt can be related by the elastic constitutive matrix D E v in which the coefficients depend only on the material properties the elastic modulus and v Poisson s ratio McC07 p 21 El E e o De D Eq 4 Constitutive equation in rate form stress c and strain e related by the constitutive matrix D E v B Usually and incorrectly referred as Young s modulus It should be attributed to Euler 14 The expression that defines the matrix D can be seen e g in McCO7 p 20 For the purposes of this report it suffices to know that the matrix is a constant coefficients matrix Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010
163. ntents of the documents 2 2 Terminology Expression Description software package The complete software s file collection codebase documentation build and test scripts associated data files etc software codebase The software s codebase files plus the build and test scripts and associated data files essentially the software package contents less the documentation set software product The application itself as seen from an user s perspective accuracy A measure of the absolute or relative error of an approximate solution computed by the software compared to the true solution maintainability The effort required for a developer to locate and fix errors and to add features to an operational software package performance A measure of how large a problem can be handled by a software product and how quickly an answer can be found Performance is related to how efficiently the internal resources of the computer are used portability The effort required for a developer to transfer the software package from one operating environment to another reliability The probability that a software product will meet its stated requirements under a given usage profile As an example an scientific computing application is reliable 1f the true error is rarely larger than the user requested bound on the error reusability The extent to which a program module of a software package can
164. o facilitate browsing The documentation set includes complete source code files listing index of data structures class hierarchy and data fields and folder directory hierarchy and indexes of all functions structures unions enumerations variables type definitions and definitions Graphics are provided for all class inheritance diagrams dependency graphs and function call caller graphs Note To the date of writing of this document VL REP of the remaining documents listed above and in Table 1 only the VL SCD documentation set exists Therefore an extensive appendix has been added to this report in which the currently existing documentation files is listed for reference and preservation purposes The information in this report s appendix will require appropriate inclusion into the VL UM and VL TM documents when the latter are developed From an end user s perspective the software package currently requires the Ruby language run time environment Mat95 and if automatic generation of the material model s code is desired the Maple computer algebra system Map80 From a developers standpoint the software package additionally requires GNU Autotools suite VETTO0O For the software package maintenance Doxygen source code documentation generator vHe97 plus optional dependencies is suggested although not required Details of these dependencies are provided in the VL TM and VL UM documents please refer to Table 1 S
165. oal is often to solve for the changes of deformation and stress within a given body as depicted in Cartesian x y z space representation in Fig 1 7o solve for the histories of deformation and stress it is necessary to satisfy the governing partial differential equation for equilibrium subject to initial conditions and boundary conditions The initial conditions could involve setting initial stress or strain fields while the boundary conditions could involve specifying the surface traction T or the prescribed displacements u The equilibrium equation alone does not provide enough information equations to solve for all of the unknowns so the constitutive equation is added The constitutive equation postulates a dependence of the stress on the history of deformation which allows for a solution to the overall problem CSMAKOT p 24 T N Fig 1 Boundary valued problem with prescribed displacements u and an applied surface traction T CSMAK07 Figure 4 p 24 The boldface type applied here if for highlighting sections of particular relevance in the quote it is not part of the original text Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 4 Virtlab Project Overview 29 4 3 2 Stress Stress is a measure of the force per unit area for each direction at a point within the body SMCO9 p 24 Fig 2 Resultant force Af on a small element AS of the surface S enclosing
166. om being a quality document It is also worth noting that ironically against the basic purpose of a version control system the Subversion repository for VirtLab has been divided by hand into 4 folders which contain the repository state up to some milestones in the development process The rationale for the hand made aforementioned division is that those four major stages in the School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution development of MatCalc MatGen would stand out immediately and clearly avoiding the need to execute SVN commands to surf the SVN logs and checkout different revisions Even though this could have easily been accomplished by a proper use of the SVN resources tags branches comments those resources were not properly exploited from the beginning and the task of rewinding the revisions to fix them was not worth undertaking on the face of other prioritary documentation and coding issues 5 3 7 5 Other support text files Some issues pertaining to Virtlab internals originally documented in specific documentation text files were leveraged by adding information from the main document existent as of May 2009 McC07 These files are about e The way to use Virtlab modules as a library for material simulation How to add a material test to MatCalc How to add a material model to MatCalc Generating material models with MatGen Sections
167. ommand line switches Tt was not hooked to the existing GUI and hence only available for a developer whom used the codebase as a library B Leaving the du message function as a stub and requesting the compiler to inline functions should achieve this School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution e The values of the configuration parameters set in the input file are overridden by either setting the corresponding environment variables or command line switches to other valid values e The values of the configuration parameters set by the environment variables are overridden by setting the corresponding command line switches to any other valid values Therefore the input files could operate as a user templates for the application The environment variables can be used as session defaults for the application which would override any corresponding input files settings The command line switches would allow for ultimate tweaks to the configuration at invocation time for example the user might use a single input file eventually overriding the test specimen dimensions therein via appropriate environment variables and then run the simulation several times just changing the time step in each simulation with an appropriate command line switch without the need of editing the input file nor environment variable for just that simple change This scheme
168. on 4 3 5 Body environment relationship equilibrium equation esee eene 33 4 3 6 Continuum mechanics problem statement essent nennen entente 33 4 3 7 Virtlab s computational approach to continuum mechanics problem see 34 5 VIRTLAB PROJECT EVOLUTION ccceeccceeseeseeeeeeeeeeeseeeeeeeaaeeseeeeeeesaesceneeeeeaseeseeeeeeseeeeeeneeneas 37 5b SyriOpSiS ette ct ep ee reete e a e ee a p Re p a a e eate 5 1 1 Initial State 2007 09 Virtlab v 0 1 5 12 Final State 2010 03 Virtlab Vol 1 aie ie eda deett a edes 39 5 2 Statement sy LARREA AAA TA TA TA TA TA ERE TER AR A AH ER HG UH A AES ead 40 5 2 FL Rationales st oec eM A LN DM MD ee cde 40 52 2 SoftWare QUES RR 41 EPA RS SO ID BD OPI ID DIO e OO Ed 42 5 3 Report of Changes and Additions eese nennen enne nnet ethernet srest 43 5 3 1 Building process School of Computational Engineering and Science McMaster University 5 33 11 Portability ISSUES ii eem He e Rede eg 44 5 312 AOS e juss rea e E KEN sells NONE ARAON AE ELV S T A ues pcasssenapsasese S 48 BITs Se 48 5 3 1 2 2 M tC alc v 1 15 etie inem ibd Dates 50 Re BUE SRM 53 5 3 12 4 MatGen ve 1 T in eb an ERE PRU e RO elated dd al ida nee gle aaa a PESE 55 5 321 3 Future SWOEe o5 etta EET QUERIES RUE TN Oe NE Tete tee Mte ted e RR RN
169. on to use the codebase as a library in lieu of using the already developed MatCalc CLI frontend as a tool was that of simplicity and performance using MatCalc s CLI frontend would have implied that all the parameter updates including those to update the trial centres and basepoints performed file read write and parse operations whereas parameter updating withing a data structure in memory is straightforward The underlying organization of the library in fact encouraged and greatly facilitated the latter approach 5 3 6 4 Tool preliminary performance and results Note to the date of writing of the present report the parameter fitting tool has been tested only superficially since its usage unveiled a subtle but severe memory leak problem in the underlying library which therefore had to be solved in the first place see p 128 in section 6 4 for a description of the issue and section 9 13 p 194 for the corresponding diagnose and fix For the initial testing of the tool s operation a test case was forged in Octave Based on a closed form solution for a specific material model behaviour the resulting data was contaminated by random noise with the intention to emulate real world experimental data Fig 26 Viscoelastic model and simulated test data dat signa eps 2Xetakdedtk exp t lambda StressU sigma 0 0 002 0 004 0 006 0 008 0 01 eps L Fig 26 Viscoelastic material experimental
170. opied from the HTML Doxygen documentation for MatCalc lists the files that comprise MatCalc alongside the brief comments for each of the documented files File List Here is a list of all files with brief descriptions brick element cc code 003 brick element h code 003 Header file for brick element cc cli cc code 001 CLI frontend for MatCalc FEM engine cli h code 001 Header file for cli cc 002 Current simulation parameters data structure module CODE REQUIRES CONVERTING struct INTO class configset cc code configset h code 003 Header file for configset cc datachunk ruby cc code 003 datachunk ruby h code 003 Header file for datachunk ruby cc Contains code dataset cc code 002 Current simulation data class module dataset h code 003 Header file for dataset cc Contains code dataset ruby cc code 003 dataset ruby h code 003 Header file for dataset ruby cc Contains code debug utils cc code 004 debug utils h code 003 Header file for debug utils cc DEmatrix cc code 003 DEmatrix h code 003 Header file for DEmatrix cc 003 Elastic integrator algorithm only useful for elastic materials use Return E ended map algorithm valid for all materials elastic integrato
171. opriately included undergo development e Sections 9 1 9 2 9 3 and 9 4 contain the copy of the ChangeLog and TODO files for MatCalc and MatGen respectively These are copied as is and therefore have not been revised neither for informal offending language nor spelling mistakes and the like issues They are intended as an example of the effort difficulty involved in maintaining the software package as it evolved Additionally to these records an effort to maintain the Subversion log file was effected but the duplication of tasks will probably almost inevitably imply the existence of both sins of omissions and commissions between the ChangeLog files and corresponding Subversion log entries The latter are not listed herein Section 9 5 lists the complete contents of the file INSTALL2 which provides information on the specific issues of compile time and run time linking e Section 9 6 lists the contents of the file matcalc driver txt which provides a succinct example of how to use Virtlab s codebase as a library for simulation e Section 9 7 lists the contents of the file add experiment txt which explains how to define a virtual material test for use in MatCalc e Section 9 8 lists the contents of the file add material txt which details the procedure for adding a material model class to MatCalc Section 9 9 lists the contents of the file generate material txt which details the procedure for generating a
172. orithm see 89 JISBEM test help mesSsage o er m PD o o em e DE E re ees ayn EO E e ero d EOD GO ERE 98 32 Conte ure schpL SaHple sese ee e ce rabos rl EE nn E Cue 107 33 Makefil example 25 RE e ee e e ete eel ae t stetur 109 34 Key GNU build system tools and files from a developer and a user perspectiVe oooonnocincnnccnonnconanonananonanonancnnonns 114 35 Doxygern graph legend ee ret tet eh i reet ii d e I ER CFTE ERE a aves 118 36 input cc call and caller graphs generated by DoXygen eceeceeeseessceseeeseceseeeeeeeeeaeceseeeaeceseceaeseeeceeeereeeeneeeeees 119 37 Brief detailed comments and include dependency graph for matcalc cc generated by Doxygen 120 38 mateale ce code listing generated by Doxygen neo eee eee nte eterne 121 39 Virtlab v 0 1 library memory leak flooding 97 9 of the computer s MeMOTY oooooocccoconocanononononononcnonnnnanononns 128 40 Compile link and execute stages for running program a process sssssssseeeeeeeeeneeneee nnne 198 4T Ih relocationrecotd tette tte E RR S Re tetas 199 42 The object files nkitig ptocess i ni Cp PEPPER POE REO RP deh abe i EORR Ps 200 Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 1 Acknowledgements 11 ACKNOWLEDGEMENTS To John McCutchan for his excellent work irrefutable proof of which is that an inexperienced programmer like me could actually do som
173. ors it does not rely on the standard 1ibc library that can vary between implementations and therefore provides its own Glib library which replaces a number of standard calls Gtk has C bindings that enable calling the Gtk functions from a C program but its C interface might be used from within C programs by restricting the program to the C subset of C or by adopting a few conventions The user interface layout is actually defined in one Extensible Markup Language XML file generated by the Glade Interface Designer a GUI builder for Gtk Gla98 This allows to modify the layout of the interface independently of the underlying GUI code as long as the cross referenced widgets remain the same 5 3 2 1 MatCalc v 0 1 GUI The original GUI for MatCalc v 0 1 is shown in Fig 7 A FI Material Calculator on mills cas mcmaster ca R z File Edit View Help General Constant Name Constant Value Experiment UniaxialX w Experiment displacement x 0 0 s Yield Function ElasticE 0 0 ElasticNu 0 0 Kyield 0 0 Fig 7 MatCalc v 0 1 GUI after RESET The GUI s left panel allows the user to select the virtual material test Experiment combobox to apply to a selected material model Yield Function combobox during a specified time Time edit box On the right panel the particular constants for the selected material test and model are unfolded and the user is allowed to edit the values prior to
174. ovided as initial values for the step r 1 Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution 83 A sample search path produced by the Hooke and Jeeves algorithm is depicted in Fig 23 the table in Fig 24 gives detailed indications of the actions taken at each step and why In the graph legend Success indicates the cost function evaluation at the point returns a lower value than the current minimum Failure otherwise amp e Starting point 0 Success x Failure e a Extrapolation W Final point 4 17 x 18 i 22 9 X qox Q9 X Q ay 09 Bda 20 x 16 Fig 23 Sample search by Hooke and Jeeves pattern move algorithm The table in Fig 24 describes in detail the complete process Numbering Heration Direction Variable Comparison Step Remarks index index values point lengths k i gi v2 Sp 052 0 0 9 2 2 starting point 1 1 2 9 0 success 2 0 D 2 11 1 failure 3 0 2 2 T 1 success 4 l 0 4 5 2 2 extrapolation 5 1 1 6 5 0 43 success success 6 1 2 6 3 5 failnre 7 1 2 6 7 5 failure 8 2 0 l0 3 5 2 2 extrapolation SUCCESS 9 2 12 3 8 failure 10 2 8 3 8 failure 11 2 2 0 1 8 failure 12 2 2 10 5 8 failure 13 3 0 l4 1 2 2 extrapolation 14 3 i 16 1 13 failure 15 3 1 1
175. own SP updates identified 387 6 2 Sill HY ZG eaea gene Win lt ivolwim SIP Mockeres csm riada 399 E c cd 7925 tt tc 10 544 tt lookups requiring 10 978 probes NEL tt tc 10 544 fast cache updates 5 flushes 17925 transtab new AOA UE cies ez ET BOT E OE O U ses 17925 transtab dumped 9 gt 98 ma ZSZ sz cGbraustab discarded DI 012959 cw 22 17925 scheduler 3 961 401 jumps bb entries 17925 scheduler 39 17 156 major minor sched events ex 1925283 sanity 40 cheap 2 expensive checks 119252 exectx 30 011 lists 292 contexts avg 0 per list 11925 exectx 10 926 searches 86 644 full compares 7 930 per 1000 17925 gt exectx 0 cmp2 6 cmp4 0 cmpAll Amid the copious information produced the flag v was specified upon invocation which causes system libraries information to be included in the log as well as statistics pertaining to Valgrind s binary instrumentation Valgrind s report indicates the program has performed a clean memory operation freeing all allocated memory upon exit and thus producing no memory leaks School of Computational Engineering and Science McMaster University 6 Software Tools Memory that has not been freed by the system upon program termination is marked as still reachable like in the following case corresponding to the 1ists tool for MatCalc see section 5 3 8 1 p 95 32057 32057 32057 32057 32057 32057 3
176. pletion of the second stage of Virtlab Project School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution 5 2 Statement The work undertook as Virtlab Project s second stage on May 2009 was philosophically driven by the concept of software qualities applied to a scientific software package These qualities are founded in the rationale presented in the following section 5 2 1 and described in the next section 5 2 2 The project goals are derived thereafter in section 5 2 3 5 2 1 Rationale The rationale beneath the quest for software quality is clearly stated in SY09 s 1 The field of scientific computing SC has developed an impressive variety of algorithms and libraries that have greatly influenced and improved the work of scientists and engineers SC software has for instance successfully been used to increase the productivity of manufacturing processes to improve the effectiveness of health care treatments and to raise the level of safety obtained by new building and vehicle designs However instances have occurred where the confidence placed in SC software has been misplaced For instance Oliveira and Stewart 21 summarize three examples of SC software failures i the 1991 failure of a Patriot missile to hit an incoming Scud missile ii the 1996 explosion of the Ariane 5 rocket and iii the 1991 collapse of the Sleipner A oil rig The disturbing possibility of
177. port Apr 2010 3 Introduction 3 4 Related Documentation Overview The related documents listed in Table 1 provide the following information not included in the present report VL UM Virtlab User Manual The User s Manual is targeted to the end user of the software package it provides instructions to build the software from the source code describes how to perform the included tests in the software codebase and describes how to use the software once compiled and installed on the user s computing platform VL TM Virtlab Technical Manual The Technical Manual is targeted at developers and maintainers of the software package as well as to those users who wish to evaluate its engineering scientific foundations it provides information on the internal workings of the software such as its hierarchical and modular composition modules interaction and interactions with the software package dependencies as well as information of the software engineering tools techniques applied in the development test and maintenance of the software package VL SCDI Virtlab Source Code Documentation The codebase documentation generated by Doxygen vHe97 from the software s source code files is an organized collection of HTML hyper text markup language files The generated documentation uses syntax highlighting and or colour coding for enhanced readability and all objects therein are cross referenced through hyper text links t
178. r 2010 3 Introduction 21 3 2 Purpose of the Report This document constitutes the author s M Eng Report to be submitted to the School of Computational Engineering and Science McMaster University Hamilton Ontario Canada in partial fulfilment of the requirements for the degree of Master of Engineering project option It is therefore intended for the examination committee and in this context its purposes are the following Describe the Virtlab Project origin motivations and goals Report the modifications and additions effected during the period May 2009 March 2010 to the Virtlab software package developed and maintained by McCutchan until September 2007 McC07 based on previous work of Smith and Gao 2005 and Gao 2004 Describe the rationale behind the modifications and additions to the software package during the period May 2009 March 2010 Evaluate the impact of the modifications and additions to the software package during the period May 2009 March 2010 and draw conclusions Suggest future work for improving and enhancing the software package Suggest future research lines that could use the software as a working example The underlying purpose of the present Report is to provide an example that demonstrates the value of Software Engineering methods and technologies for Scientific Computing School of Computational Engineering and Science McMaster University 3 Introduction
179. r h code 003 Header file for elastic integrator cc element h code 003 Header file for lt unknown gt HEADER REQUIRES REVISION experiment list cc code 004 experiment list h code 003 Header file for experiment list cc experiment runner cc code 004 experiment runner h code 003 Header file for experiment runner cc fem gq3 cc code 003 fem gq3 h code 003 Header file for fem gq3 cc graph widget marshallers c code graph widget marshallers h code graph widget cc code 004 School of Computational Engineering and Science McMaster University 9 Appendix graph widget h code 003 Header file for graph widget cc gui cc code 001 Gtk Glade GUI frontend for MatCalc FEM engine gui h code 003 Header file for gui cc input cc code 002 MatCalc setup and data text file input module input h code 003 Header file for input cc integrator cc code 003 integrator h code 003 Header file for integrator cc m matrix cc code 003 m matrix h code 003 Header file for m matrix cc m scalar cc code 003 m scalar h code 003 Header file for m scalar cc m vector cc code 003 m vector h code 003 Header file for m vector cc m vector ruby cc code 003 m vector ruby h code 003 Header file for m vector ruby cc contains code matcalc cc code
180. re DROP n RO E DEOR meres 92 5232723 INS PALL file onere NN 93 2 95 EN SNA Ne eedabaee eed en ee 93 5 3 7 5 Othersupport text files eerte e eot one RR tetto RU Hee 94 5 3 7 6 Ellute NOI i nee dino eh diet 94 5 3 8 Vartlab tests and tools 2 5 22 ao eee e eo te ND D Oed cp d 95 5 3 8 1 listSdo0lz sss se ee ciate elses esl A eh RUNDEN RA URN DRE AO 95 5 3 8 2 rdset itt 10015 5e mtt anta un tn ttu ata nive teint uti entier 96 5 3 8 3 configset test utility noi eee id DR HER ree Oi 97 5337834 LEMA AO e e PR RM UR GARE ta 98 2 3 8 5 Future VOE ob poene eR Eee beam dae eio 99 6 SOFTWARE TOOBES inierunt di 101 od eno cile 102 6 2 Build Systems 6 2 1 The GNU Build System 6 2 1 1 Autoconf Automake atid Pabtool eoi eene e e en venie esee 106 6 2 1 2 The configure shell script 106 6 2 1 3 Makefiles 108 6 2 1 4 Goals 110 6 2 1 5 User s perspective DI 6 2 1 6 Developer s E Aaa 112 OIDO EEEE E ES 115 ARAN A EM 123 Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 6 5 System tracing tools 2 eite teret rna eere ete r s ede eek ra debeo dea dede da e coset ode tek son eode da e t se ode ehe 130 7 CONCLUSIONS amp FUTURE WORK RESEARCH cccccccccccccnccnncnnnnnnnnnnnnnanonncnnnnnnnnnnnnnnnnncnnnnnns 135 FL Conchisions 7 iii SiG ii aay nae Deo TO TO DOR RAE haha 136 E
181. re package Regression testing is any type of software testing that seeks to uncover software errors by partially retesting a modified program The intent of regression testing is to provide a general assurance that no additional errors were introduced in the process of fixing other problems Regression testing is commonly used to efficiently test the system by systematically selecting the appropriate minimum suite of tests needed to adequately cover the affected change Common methods of regression testing include rerunning previously run tests and checking whether previously fixed faults have re emerged One of the main reasons for regression testing is that it s often extremely difficult for a programmer to figure out how a change in one part of the software will echo in other parts of the software 1 http en wikipedia org wiki Regression testing 55 And to the fact that not enough time during the period May 2009 March 2010 was allocated to review the code due to other priorities for the work during the said period http sourceforge net apps mediawiki cppunit index php title Main Page 1 Savenkov Roman 2008 How to Become a Software Tester Roman Savenkov Consulting p 386 ISBN 978 0 615 23372 7 School of Computational Engineering and Science McMaster University 100 5 Virtlab Project Evolution Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 6 Software Tools 101 6 SOFTWARE
182. relying on incorrect SC software is further highlighted by the errors found when comparing nine large commercial packages for seismic data processing 14 15 All of the packages were initially based on the same mathematical algorithms but in experiments they produced different results with an average absolute difference of 1 per 4000 lines of code 15 The above examples illustrate that problems exist with the software quality of correctness even though correctness is generally considered to be the most important quality in SC 19 If this most important quality is not being achieved then it is reasonable to believe that other software qualities such as understandability maintainability and reusability are also suffering SY09 s 1 20 These concepts are succinctly described in Table 2 Terminology and in section 5 2 2 p 41 Software Qualities 21 The boldface type applied here if for highlighting sections of particular relevance in the quote it is not part of the original text a 14 Hatton Les The chimera of software quality Computer 2007 40 8 15 Hatton Les Roberts Andy How accurate is scientific software IEEE Trans Software Eng 1994 20 10 785 97 19 Kelly Diane F Sanders Rebecca Assessing the quality of scientific software In Proceedings of the first international workshop on software engineering for computational science and engineering SECSE 2008 Leipzig Germany In conjunction with the 30th internatio
183. replace malloc c 149 32139 by 0x4C7B156 ruby xmalloc gc c 144 32139 y Meter 19 local serio Kou exec ye Sw 32139 LOA 0989 SERIO yyy poros Varsa SSS 32139 by 0x4CA886F yycompile parse y 2692 32139 by 0x4CBE46C load file ruby c 974 321 39 oy 2807 09 GOV EMP Svo Sm Ue SET MN IDEM S Eds De 32139 by 0x403CD5 main Ruby test cc 202 several lines suppressed here 32139 400 040 bytes in 1 blocks are still reachable in loss record 8 of 8 32139 at 0x4A05809 malloc vg replace malloc c 149 32139 by 0x4C798FD add heap gc c 383 32139 by 0x4C6E915 ruby init eval c 1388 34 1 39 by 0x403BF5 ruby basic test Ruby test cc 40 32139 by 0x403CD5 main Ruby test cc 202 32139 32139 LEAK SUMMARY 32139 definitely lost 392 bytes in 3 blocks 32139 joxeXeeale bs Jioxees 1552 OYES SO ES 32139 still reachable 694 124 bytes in 8 119 blocks 32139 suppressed 0 bytes in 0 blocks The combined results of the two latter examples would indicate that the leak is probably produced in the application code rather than around system libraries as expected School of Computational Engineering and Science McMaster University 6 Software Tools As commented in section 5 3 6 4 p 85 the development of the Material Model Parameters Fitting Tool for MatCalc unveiled a severe memory leak underlying the core library modules which at the time of
184. rk It has to be noted that the purpose and output of various of the original tests within the codebase are not immediately understandable due to the lack of documentation The Doxygen documentation for these tests acknowledges the knowledge state for the test tool to the moment of writing of the present report The brief comment for each of the files can be checked to the end of the table posted in section 9 12 starting at p 191 Naturally among the future work with respect to the tools and tests for Virtlab software package is that of correctly comprehending and documenting the existent tests These tests as any other tests that might be created should be encompassed under adeguate unit testing schemes to better address the verifiability and reliability qualities of the software package Currently Virtlab library has only two modules Math test and MC test under a unit testing framework CppUnit unit testing is a software verification and validation method in which a programmer tests if individual units of source code are fit for use A unit is the smallest testable part of an application In procedural programming a unit may be an individual function or procedure Ideally each test case is independent from the others http en wikipedia org wiki Unit testing Additionally a proper regression testing suite should be created to the same purpose of systematically addressing the verifiability and reliability qualities of the softwa
185. run time linking issues are described for the different platforms Section 9 5 in the Appendix lists the complete contents of the file 5 3 7 4 Subversion commit log Virtlab codebase is managed under the Subversion SVN version control system Col00 An overview of version control systems is provided in section 6 1 p 102 As other contemporary version control tools Subversion forces each update of the repository to be accompanied by a corresponding commit message The developer or developers are supposed to use this message instance to describe the changes effected to the files being updated in the codebase repository Thus the log file that is generated can act as a ChangeLog file for the project under version control The clear advantage of this log over a usual ChangeLog file is that the developer is forced to write a message whenever he or she pretends to alter the software s codebase in the repository his or her name is associated automatically with the change and the tool already writes into the message file the list of files that have been modified locally with respect to those in the software s repository which helps the developer to remember what were the actual files that changed he she did since the last commit operation Given that during the period from May 2009 to March 2010 there was only one developer working on the software codebase and that specific ChangeLog files were maintained the Subversion logs are far fr
186. running the simulation Run button on the left side panel 30 The same Gtk toolkit is used for MatGen 3 Please refer to http library gnome org devel gtk tutorial stable and http library gnome org devel gtk stable 32 These constants vary according to the selected material test and model School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution Fig 8 shows MatCal s v 0 1 GUI frontend after a simulation run amp 3 FI Material Calculator on mills cas mcmaster ca t File Edit View Help General Stress Z 0 016667 0 467949 0 016026 0 016026 0 033333 0 884598 0 000050 0 00005 0 050000 1 278094 0 000045 0 00004 0 066667 1 641311 0 000041 0 000041 0 083333 1 976580 0 000038 0 00003 0 100000 2 286049 0 000034 0 000032 0 116667 2 571704 0 000031 0 000031 0 133333 2 835377 0 000028 0 00002 0 150000 3 078759 0 000026 0 00002 0 166667 3 303411 0 000023 0 00002 0 183333 3 510773 0 000021 0 000021 0 200000 3 702175 0 000019 0 00001 0 216667 3 878846 0 000017 0 000013 0 233333 4 041918 0 000015 0 00001 0 250000 4 192438 0 000014 0 000012 0 266667 4 331372 0 000012 0 000013 0 283333 4 459610 0 000011 0 000011 0 300000 4 577975 0 000010 0 000010 Experiment UniaxialX Yield Function smith Time 0316667 4687227 0 000009 N 00000 E 2 Fig 8 MatCalc v 0 1 GUI after RUN The right panel
187. s Coh oho CH CH CH CHR CHR Chb Che CH CHR CHR CHR Che CHb He He e Data table heading not displ Read simulation parameters Read simulation data e_x ice cNu eta ayed UniaxialX OC smith material E2 Radial return map 1 000e 02 000e4 00 000e4 00 000e4 00 000e4 00 000e 01 000e404 000e 01 000e 03 99 12 lines 99 lines Fig 15 MatcCalc v 1 1 file input parsing progress shown in stdout The console output of the software product was improved for easier readability Fig 16 B H gonzaloGsancheg Projects virtlab svn 1 1 matcalc src File Edit View Time Time Time Time Time Time Time Time Time Time Time Time IM NE NE NE NM NON o 9 01 converged in 39 01 converged in 9 01 converged in Time 49 01 converged in Time 49 01 converged in Time 39 01 converged in Time 49 01 converged in Time 9 01 converged in Time 9 01 converged in MatCalc simulation ended Opening export home gonzalo Desktop output dat Writing simulation parameters Writing simulation data Saved 99 records Terminal Tabs Help converged in converged in converged in converged in converged in converged in converged in 1 steps converged in 4 steps 2 steps 1 4 2 2 2 1 4 converged in 2 steps 2 2 1 4 2 2 2 H 4 steps steps steps steps steps steps steps steps steps s
188. s Virtlab Project and its software product Virtlab Software Library now constitute a non trivial example case of Software Engineering principles and technologies application for the improvement of Scientific Computing software The Virtlab Project and software Library are described in greater detail in chapter 4 p 25 and their evolution is reported in chapter 5 p 37 Elastic materials deform when loaded and return to their original state when the load is removed Plastic materials yield after a loading threshold is reached and will thereafter remain deformed even when the load is removed the ductile kind will withstand significant deformation whereas brittle ones will tend to fracture after yielding Viscous materials are those which will oppose resistance depending on the deformation rate to which they are subject to typical behaviour in fluids Viscoelastic viscoplastic and elasto viscoplastic materials present combinations of the aforementioned characteristic behaviours 3 In load controlled tests a known load force field is applied over time to the test specimen and the resulting specimens deformation strain state is measured In displacement controlled tests the test specimen is subject to a known sequence of deformations over time and the resulting specimen s internal loading condition stress state is measured Gonzalo S nchez Virtlab 1 1 M Eng Report Ap
189. s for which you don t have the source code Valgrind will save you hours of debugging time With Valgrind tools you can automatically detect many memory management and threading bugs This gives you confidence that your programs are free of many common bugs some of which would take hours to find manually or never be found at all You can find and eliminate bugs before they become a problem Valgrind can help you speed up your programs With Valgrind tools you can also perform very detailed profiling to help find bottlenecks in your programs http valgrind org info about html Valgrind s utility comes with a price since it implements a software CPU underneath the binary code being analyzed the programs run significantly slower than when run by the hardware CPU 7 The boldface type applied here if for highlighting sections of particular relevance in the quote it is not part of the original text School of Computational Engineering and Science McMaster University 6 Software Tools When should you use Valgrind All the time For small programs with short run times when developing you can always run the program under a Valgrind tool usually Memcheck knowing that memory bugs will be found immediately In automatic testing By using Valgrind tools in your automatic unit integration system or regression test you can be confident no code will be unchecked After big changes To ensure new bugs haven t been intro
190. s operation test D test cc code test CLI executable for testing the relative error between a simulation based on a material model and a closed form solution computation DOC REQUIRES REVISION Gonzalo Sanchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix test FEM test cc code test CLI tool for testing MatCalc s FEM algorithm Run FEM test h CODE REQUIRES REVISION test Glade test cc code test CLI executable for checking Glade availability 1t is assumed that will trigger system errors in case Gtk Glade are unavailable DOC REQUIRES REVISION test Graph test cc code test CLI executable for testing MatCalc s GUI graph display test K test cc code test CLI executable for testing the behaviour of matrix K under constraints displacements DOC REQUIRES REVISION test MatCalc drv cc code test CLI executable that performs three not well documented tests CODE REQUIRES REVISION test Math test cc code test CLI executable to test Matrix and Vector matematical operations 19 tests test MC test cc code test CLI executable to test the material class class 9 tests CODE REQUIRES REFACTORING test Ruby test cc code test CLI executable that checks Ruby interaction with the experiment runner class and ruby experiment scripts tools dset d
191. s that need to be filled in LINKING The linker actually enables separate compilation As shown in Fig 42 an executable can be made up of a number of source files which can be compiled and assembled into their object files respectively independently Adapted from http www tenouk com ModuleW html 18 Bear in mind that if you use the IDE type compilers these processes quite transparent School of Computational Engineering and Science McMaster University 9 Appendix The following Figure shows the steps involved in the process of building the C program starting from the compilation until the loading of the executable image into the memory for program running Source code file hello c hello cpp Preprocessed code file hello i Assembly code file hello s Executable code hello hello exe Stored in secondary storage such as hard disk hdd as an executable image when rumung execute the program a process Load Run time objects modules libraries defened linking nnn Process Address Space Primary memory e g RAM Fig 40 Compile link and execute stages for running program a process Figure w 1 http www tenouk com ModuleW html Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix The following figure shows the linker resolving references between object files including system libraries Ch j
192. s the array of scalars elements datachunk e base size sizeof scalar 26 bytes constructor doesn t allocate any memory e destructor doesn t free any memory dataset e base size sizeof std vector sizeof std map add constant causes memory usage to grow add datachunk causes memory usage to grow e destructor frees all memory allocated through add constant add datachunk 9 13 3 2 C Ruby ruby object m vector e construct allocates base size ofm vector memory and zeros it C construct also allocates a handle inside Ruby small and collected by ruby GC Ruby e create then makes a copy ofthem vector passed into create C ruby object datachunk e construct allocates base size of datachunk memory and zeros it C construct also allocates a handle inside Ruby small and collected by ruby GC Ruby e create then makes a copy of the datachunk passed into create C ruby object dataset construct allocates base size of dataset memory and zeros it C e construct also allocates a handle inside Ruby small and collected by ruby GC Ruby e create then makes a copy of the dataset passed into create C School of Computational Engineering and Science McMaster University 9 Appendix The problem is that the C destructors for the dataset and m vector classes are never run when they are wrapped inside a ruby object C class 9 13
193. se utilities were developed just to provide simple graphical user interfaces which resulted neither altogether user friendly nor flexible enough to enable the potential end users to tap the full capabilities of the underlying library as could be done by embedding its modules in other applications Additionally the scripts for building the original codebase into this two executables were not streamlined for a regular user despite the fact that these configuration scripts were generated by the GNU Autotools toolset VETT00 the main dependencies for MatGen and MatCalc Maple and Ruby respectively had their locations hardcoded into the build scripts and even then just addressed MacOS and Linux platforms which were the developing platforms of choice Finally the only documentation for the codebase as of September 2007 were the embedded comments in the source code files and the overall documentation for the software package in existence was that provided in the M Sc thesis corresponding to the original developer s work on the library McC07 As of September 2007 Virtlab Software Library reached version 0 1 This is the final state of the software library at completion of the first stage of Virtlab Project and thus the initial state for the second stage of Virtlab Project 18 These concepts are succinctly described in Table 2 Terminology and in section 5 2 2 p 41 Software Qualities P Refer to section 6 2 1 p 106 for
194. sical storage layout for data so that if it is changed the change is restricted to a small subset of the total program For example if a three dimensional point x y z is represented in a program with three floating point scalar variables and later the representation is changed to a single array variable of size three a module designed with information hiding in mind would protect the remainder of the program from such a change http en wikipedia org wiki Information hiding The modifications and additions introduced in the GUI frontend to MatCalc and the development of the CLI frontend were effected with the aforementioned separation of concerns and information hiding concepts in mind and were feasible because the underlying library had also been built upon the same principles 5 3 5 1 File Input and Output modules The file input and file output tasks were assigned to specific modules which now hide the complexity of populating or querying the original data structure defined in the library the transference of information between this and the input output files and the file format and 2 E W Dijkstra A Discipline of Programming Prentice Hall 1976 The boldface type is used here to confer the emphasis given in the original text which used italicized typeface Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution parsing tasks The original codebase included
195. source respectively There are a number of other internal macros Commands start with TAB not spaces helloworld helloworld o ee OMS NES helloworld o helloworld c eg v SE S lt PHONY clean clean rm f helloworld helloworld o http en wikipedia org wiki Makefile Example_makefile Part of a complex Makefile actually the one generated by the configure script shown in Fig 32 p 107 is shown in Fig 33 p 109 Gonzalo Sanchez Virtlab 1 1 M Eng Report Apr 2010 6 Software Tools 109 H Makefile in generated by automake 1 10 from Makefile am 2 8 Makefile Generated from Makefile in by configure Copyright CC 1994 1995 1996 1997 1998 1999 2000 2001 2002 5 2003 2004 2005 2006 Free Software Foundation Inc gt H This Makefile in is free software the Free Software Foundation 7 gives unlimited permission to copy and or distribute it S with or without modifications as long as this notice is preserved j 8 This program is distributed in the hope that it will be useful 8 but WITHOUT ANY WARRANTY to the extent permitted by law without gt even the implied warranty of MERCHANTABILITY or FITNESS FOR A 3 PARTICULAR PURPOSE 7 pkgdatadir datadir matcalc 2 pkglibdir Clibdir2 matcalc 35 pkgincludedir Cincludedir matcalc 20 am cd CDPATH tzSH VERSION 3 PATH SEPARATOR 88 cd install sh DATA install sh c m 644 22 install sh
196. stallbsd from OSF since it installs stuff as root by default for ac prog in ginstall scoinst install do for ac exec ext in ac executable extensions do if test f as dir ac prog ac exec ext amp amp as test x as dir ac prog if test ac prog install amp amp grep dspmsg as dir ac prog ac exec ext dev null 2281 then H AIX install It has an incompatible calling convention elif test ac prog install amp amp 3 i 3 0 1 8 8 3 o8 3 5 w CD CD LO CO CO CO CO CO CO CO CO LO CO CO D CO CD 9 9 D CO LO CD CO CO CO CO Fig 32 configure script sample School of Computational Engineering and Science McMaster University 6 Software Tools 6 2 1 3 Makefiles A Makefile is a file that contains build descriptions building instructions or rules that enable building a software package with the build tool make That is it specifies how to derive the target program from each of its dependencies Makefiles are parsed by the make tool which then appropriately calls the compiler assembler and static linking tools to actually compile assemble and link the target program from each of the dependencies Note An overview of the compilation assembly and linking static and dynamic process is presented in section 9 14 p 197 A Makefile consists of lines of text which define a file or set of files or a rule name as depending on
197. stomize the software It has to be adapted to new build platforms to new runtime platforms to sitewide conventions etc The builds are far less frequent Avoidance is not really a requirement for example The difference in requirements has had an influence on the evolutions of build tools some being used mostly from within build systems and some being used mostly stand alone The key advance in build systems is the fact that they put some executable code in the sourcecode distribution of the software to be built We name the executable part in the source distribution the configuration tool This changes the nature of the sourcecode distribution now it is more like an installer package Installer is a term stolen from binary distributions For software distributed in binary form it is a long time established practice that the package has to execute on the system that receives the software distribution Because you are now supposed to execute some program delivered with the sources before you start the build the source distribution has a chance to adapt itself to the current build machine This is what makes build systems so helpful with sourcecode portability The configuration tool may change build descriptions or sourcecode or both Sometimes the configuration tool has evolved into a complex interactive tool see the several tools available to configure Linux kernel compilation The configuration tool inspects the build platform in s
198. t De dQdSigma CGRMJ3 dPhidF dFdSigma CGRMJ4 dPhidF CGHp dt 1 0 CGGamma CGRMJ lt lt TC CRMA bl LSCORMOELDA ECR LL IL GRAM LA A EGRMOEDIESSQq CGRMJ1 1 6 CGRMJ2 1 gt CGRMIL 2 4 PoDORMGE 2 2 CGRMIL 2 32 CGRMIL 2 4 ESEMIL 2 51 CGRMdI1 24 61 CGRMI2 2135 CGRMIL 2 42 CE SMILES 2 LoGBRMJIEDS 2 OGRMOLIG S4 LoGGEMOLIS 5 CGRMJLDIS 6 CORMIZ 3 2 lt CGRMJ1 4 1 CGRMJ1 4 2 CGRMJ1 4 3 CGRMJ1 4 4 CGRMJ1 4 5 CGRMJ1 4 6 CGRMJ2 4 gt Gonzalo Sanchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix S School of Computational Engineering and Science McMaster University 9 Appendix 9 10 test matcalc sh Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix School of Computational Engineering and Science McMaster University 9 Appendix Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix School of Computational Engineering and Science McMaster University 9 Appendix 9 11 test EvalMapleStatement cc Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix School of Computational Engineering and Science McMaster University 9 Appendix Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix 191 9 12 MatCalc 1 1 file list Doxygen The following table c
199. t it will be appropriately captured and categorized when the source file is parsed School of Computational Engineering and Science McMaster University 6 Software Tools base path where the generated documentation will be put OUTPUT DIRECTORY so 0 4 Call Doxygen to generate the documentation based on the settings in the configuration file doxygen config file Doxygen features include http www stack nl dimitri doxygen features html Support for C C Java Corba and Microsoft Java Python IDL C Objective C and to some extent D and PHP sources Supports documentation of files namespaces packages classes structs unions templates variables functions typedefs enums and defines Automatically generates class and collaboration diagrams in HTML as clickable image maps and ETEX as Encapsulated PostScript images Uses the dot tool of the Graphviz tool kit to generate include dependency graphs collaboration diagrams call graphs directory structure graphs and graphical class hierarchy graphs Flexible comment placement Allows you to put documentation in the header file before the declaration of an entity source file before the definition of an entity or in a separate file Generates a list of all members of a class including any inherited members along with their protection level Outputs documentation in on line format HTML and UNIX man page and off line format ETgX
200. t most of the original codebase was undocumented The table in section 9 12 p 191 copied from that generated by Doxygen lists the files that comprise MatCalc alongside the brief comments for each of the documented files where the said warnings can be observed To further facilitate the documentation maintenance two very simple shell scripts not documented in this report have been created to automate the corresponding documentation update and are distributed with the software package Doxygen by itself can generate plain HTML documentation but to produce certain graphical output such as the graphs shown in Fig 25 Fig 35 Fig 36 and Fig 37 it requires other tools that are not usually part of a typical Linux or OpenSolaris distribution nor are by default part of MacOS or Solaris environments It was therefore decided that a tar Unix tape archive file containing the generated documentation for each of MatCalc and MatGen is to be included with Virtlab software package as a convenience for a developer who might not have the complete set of tools to generate the full fledged Doxygen documentation the first time he or she accesses the codebase 5 3 7 2 ChangeLog and TODO files Not altogether following the GNU coding standards but taking the ideas therein an attempt to maintain proper ChangeLog and TODO files was effected The ChangeLog files are intended as a log of all changes done to the codebase reported chronolo
201. t run time MatCalc s 3D FEM Finite Element Method simulation engine can then apply load or displacement controlled virtual material tests to the included material classes to simulate the material s stress strain and deformation history under the specified virtual test conditions The virtual material tests are classes described in the Ruby programming language Mat95 in plain text files MatCalc launches the Ruby interpreter to parse the files at run time so virtual material tests can be added or modified anytime without the need to rebuild the software to make them available Both Virtlab main components MatGen and MatCalc provide GUI Graphical User Interface and CLI Command Line Interface frontend choices that enable the users to access the underlying library s functionality in convenient ways either for interactive use or batch processing The design of Virtlab as a software library also enables developers to embed the core library modules in other software packages Elastic materials deform when loaded and return to their original state when the load is removed Plastic materials yield after a loading threshold is reached and will thereafter remain deformed even when the load is removed the ductile kind will withstand significant deformation whereas brittle ones will tend to fracture after yielding Viscous materials develop stress depending on the deformation rate to which they are subject to
202. teps steps steps steps steps final final final final final final final final final final final final final final final final final final oe be ee eee ow 294E 15 245E 06 O34E 07 462E 15 Fig 16 MatcCalc v 1 1 information in stdout stream formatted to fit in 80 columns 36 This can be easily exploited to generate logs by simple redirection of the output to a file eventually processing filtering the stream by interposing a pipe of commands that accept reading from stdin and writing to stdout e g grep awk sed sort etc Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution 67 j 5 3 2 3 Future work During the GUI refactoring from v 0 1 to v 1 1 several ideas were considered for further enhancing the usability of the software product in relation to its GUI frontend The main issue to improve is to eliminate the relative path reference to the XML definition file for the GUI which prevents the software to be called from any directory except from that where the XML file is found as data matcalc glade This should be dealt with by means of the Autoconf framework see section 5 3 1 Besides the aforementioned issue the GUI object that offers the greatest potential for improvement is the graphical output display Improve its performance rendering in slow machines is actually painful or at least add an option to
203. the viscoplastic constitutive equation follows the approach presented by Stolle 1991 and mathematical manipulation Smith 2001 McC07 s 2 3 pp 23 24 The input to MatGen is a description of the five variabilities of Perzyna s viscoplastic strain tensor model Eq 3 that is part of the potentially complex constitutive equation Eq 4 the fluidity parameter y the yield function F the hardening parameter c the function Quos uo EOS xo the viscoplastic potential Q and eventually some additional material specific constants required by the aforementioned parameters At MatGen s core a client to the Maple computer algebra system calls Maple s symbolic computation engine to calculate the mathematical expressions in Eq 6 as well as other expressions required by the FEM algorithm in MatCalc and calls Maple s code generation engine to actually generate the code for the computed expressions MatGen then appropriately inlines the generated code in a C class which defines the specific material model for the behaviour specified by the user in terms of y o F x and O Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 4 Virtlab Project Overview The diagram in Fig 6 shows the main components of Virtlab its main dependencies the main user inputs and how these are related
204. the original development up to September 2007 had gone unnoticed The reason for the problem not being noticed in the first place resides in the combination of two facts the first is that Virtlab library development was mainly performed using ad hoc command line executables for different but fixed problems which were run just once the second fact is that a single run of the FEM engine does not generate any directly observable leak only when the engine is run repeatedly and without actually quitting the application is the leak actually produced and only then can it be directly observed as a progressive memory shortage as reported by system tools like the top command In the aforementioned context the use of the GUI frontend which allows repeated simulations without actually exiting the program will effectively produce the leak yet the total leak caused by a few iterations can still go unnoticed in modern computers fitted with significant amounts of RAM memory as compared to the memory grabbed in each iteration However the hundreds of iterations required by the parameter fitting tool can actually bring any machine down to its knees as shown in Fig 39 where the free swap space of the server mills mcmaster ca was left exactly in OKB after the offending tool took over 97 9 of the system s memory r sancheg mills ssh bash ttyp3 80x24 Fig 39 Virtlab v 0 1 library memory leak flooding
205. the second stage of Virtlab Project is that of May 2009 which essentially is the state of the software package as of September 2007 The final state is defined at March 2010 However it must be noted that there is ongoing work scheduled until the end of April 2010 that is expected to improve the documentation of the FEM algorithm at the core of MatCalc and the performance and documentation of the material model s parameters fitting tool This is therefore classified under the future work section section 7 2 p 139 of this report 5 1 1 Initial State 2007 09 Virtlab v 0 1 Virtlab software library was developed by John McCutchan for his M Sc Thesis under the supervision of Dr Spencer Smith at McMaster University McC07 As stated in section 4 2 the Virtual Material Laboratory software library was foremostly intended as proof of concept software where the underlying purpose was that of applying software engineering techniques such as commonality analysis program families development and model manipulation to improve the qualities of a scientific computing software package Accuracy Maintainability Performance Portability Reliability Reusability Understandability Verifiability At this stage the project s main objective was developing library modules that a developer could easily embed in larger applications So despite the executables MatGen and MatCalc were created with the end user in mind the frontends to the
206. the use of functions already present in the library to manage stdout and stderr streams all console output is now performed through functions du message and du error defined in the debug utils module This enables to change the behaviour of the console output in a single module in the library instead of having to deal with sprintf functions throughout the whole codebase for example to eliminate all informational messages altogether if performance requirements dictate the need 5 3 5 4 configset module A configset module was introduced with the purpose of handling the run time configuration of MatCalc This module is in charge of parsing the command line options and provides access functions to create and delete a simple structure in which it keeps information such as the input and output filenames selected material test and model names selected integration algorithm and the values for the time step and span test specimen dimensions etc In the future this module could support command line switches for all the possible options and eventually query environment variables in which the user might specify default values for the structure elements This would enable the following three level priority configuration scheme The application provides built in defaults for each of the configuration parameters on which to fall back if any of them is not properly set either in the input file or by the environment variables or by the c
207. tus creating src Makefile config status creating matcalc config h config status executing depfiles commands Note how the configure script is checking the following dependencies of MatCalc checking for GTK yes checking for GLADE yes checking for CPPUNIT yes checking for ruby usr bin ruby checking for Ruby version gt 1 8 yes In case of failing to find an installed dependency the build will abort with a corresponding error message as it was shown for the case when Ruby could not be found If the dependency that configure is unable to locate is installed then similarly to the aforementioned commented problem with Ruby either a suitable check for the dependency has to be added to configure ac and the complete Autotools chain rerun as a developer would do or an appropriate flag should be given in the configure script command line invocation as shown for MatGen v 1 1 in section 5 3 1 2 4 p 55 This requires the user to be knowledgeable of the software installed in his her platform If the dependency that configure is unable to locate is not installed then the user has to install it first The dependency itself might be distributed as source code and in that case perhaps using the GNU Build System for compilation Then the user would require running the dependencies configure script to build the dependency first and then rerun MatCalc s configure script 5 3 1 2 3 MatGen v 0 1
208. ty 9 Appendix Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix 9 6 matcalc driver txt School of Computational Engineering and Science McMaster University 9 Appendix Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix 9 7 add experiment txt School of Computational Engineering and Science McMaster University 170 9 Appendix Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix 9 8 add material txt School of Computational Engineering and Science McMaster University 9 Appendix Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix School of Computational Engineering and Science McMaster University 9 Appendix Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix School of Computational Engineering and Science McMaster University 9 Appendix Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix 9 9 generate material txt School of Computational Engineering and Science McMaster University 9 Appendix Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appendix School of Computational Engineering and Science McMaster University 9 Appendix Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 9 Appe
209. ty and portability enhancement for the product specially if adequately combined with the Autoconf building stages to enable the user the choice of GUI type Gtk or Java Applet Gonzalo S nchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution EJ 5 3 3 MatCalc s CLI As part of the sought improvement in the usability and portability qualities a CLI frontend was developed for MatCalc to enable batch operations MatCalc s CLI provides a simple yet informative usage message if invoked with the n switch Fig 17 m Bl gonzalo sancheg Projects virtlab svn 1 1 matcalc src e X File Edit View Terminal Tabs Help Fig 17 MatCalc v 1 1 CLI usage message A typical invocation of MatCalc CLI frontend for a batch run would therefore be user node path to matcalc matcalc i path to infile dat o path to outfile dat As can be inferred from the sample command line above or from inspection of the command line syntax in Fig 17 MatCalc s CLI does not provide a switch for every parameter or option present in the GUI frontend and unlike the GUI frontend requires an input file The development of the CLI frontend relied heavily on the previous implementation of proper file based input output functionality in the library 4 Material test material model integration algorithm time step and span test specimen dimensions material test and model constants
210. uations Return Map J and F dPhidrk re diff OGPhiE TEJE ddQddSigma lt lt diff diff CGQ SigmaXX SigmaXX diff diff CGQ SigmaXX SigmaYY diff diff CGQ SigmaXX SigmaZZ diff diff CGQ SigmaXX SigmaXY diff diff CGQ SigmaXX SigmaYZ diff diff CGQ SigmaXX SigmaXZ gt lt diff diff CGO SigmaYY SigmaXX diff diff CGO SigmaYY SigmaYY A AGO Sites AS GM diff diff CGO SigmaYY SigmaXY diff diff CGO SigmaYY SigmaYZ chica ebro CES Salome SAME da 225 lt diff diff CGO SigmaZZ SigmaXX diff diff CGO SigmaZZ SigmaYY diff diff CGO SigmaZZ SigmaZZ diff diff CGO SigmaZZ SigmaXY diff diff CGO SigmaZZ SigmaYZ diff diff CGO SigmaZZ SigmaXZ gt lt diff diff CGO SigmaXY SigmaXX diff diff CGO SigmaXY SigmaYY diff diff CGO SigmaXY SigmaZZ diff diff CGO SigmaXY SigmaXY diff diff CGO SigmaXY SigmaYZ diff diff CGO SigmaXY SigmaXZ gt lt diff diff CGO SigmaYZ SigmaXX diff diff CGO SigmaYZ SigmaYY diff diff CGO SigmaYZ SigmaZZ diff diff CGO SigmaYZ SigmaXY diff diff CGO SigmaYZ SigmaYZ diff diff CGO SigmaYZ SigmaXZ gt lt diff diff CGO SigmaXZ SigmaXX diff diff CGO SigmaXZ SigmaYY diff diff CGO SigmaXZ SigmaZZ diff diff CGO SigmaXZ SigmaXY diff diff CGO SigmaXZ SigmaYZ diff diff CGO SigmaXZ SigmaXZ gt gt CGRMJ CGRMJ1 IdentityMatrix 6 6 dt Lambda MatrixMatrixMultiply De ddQddSigma CGRMJ2 d
211. would provide similar flexibility to the CLI frontend as the GUI frontend currently has for experimenting Gonzalo Sanchez Virtlab 1 1 M Eng Report Apr 2010 5 Virtlab Project Evolution 5 3 5 5 Virtlab v 1 1 restructure overview The separation of concerns thus introduced basically with the file input and output modules and the configuration module compounded with the underlying separation of concerns and information hiding policies already implemented in the codebase allowed the quick development of a material model parameters fitting tool described in section 5 3 6 This tool provides a clear example of the advantages in terms of reusability maintainability and understandability and indirectly in terms of reliability and verifiability gained by a proper modularization and application of information hiding techniques Fig 22 in p 80 provides an overview of the current relationship between some of the the aforementioned modules in the library in terms of the files that implement them This figure does not depict the complete set of files that comprise MatCalc most notably the complex interaction between C and Ruby is not even hierarchically presented but focuses on those files that were involved added to provide the separation of concerns reported in this section Note The pseudo code snippets that can be seen within each file icon in Fig 22 p 80 actually represent the key aspects o
212. y The extent to which a program module of a software package can be used in other applications Q8 Portability The effort required to transfer the software package from one operating environment to another To the above qualities an additional Usability quality can be added that addresses the overall easiness with which an end user of the software package can install it and make full use of it School of Computational Engineering and Science McMaster University 5 Virtlab Project Evolution 5 2 3 Goals With the mindset described in section 5 2 1 the Virtlab Project goals for the period May 2009 March 2010 Virtlab Project s second stage were set as follows Improve the usability of the software product automate the build process as much as possible improve the GUI frontend to MatCalc so that the full potential of the underlying library can be tapped provide a CLI frontend to MatCalc to enable batch simulations Improve the portability and consequently the reusability qualities of the software product extend it to Solaris OpenSolaris platforms which would render the software portable across almost all major Unix implementations used for scientific computing Improve the software package understandability and maintainability qualities generate appropriate documentation sets oriented at users on the one hand and to developers maintainers on the other hand Improve the software product s accuracy
213. y a simple and automatic procedure The second goal is achieved by the automatic generation of Makefiles and other shell scripts that are typically used in the building process which facilitates the developer s tasks Fig 34 p 114 succinctly shows the key GNU build system tools and files from a developer and a user perspective Despite the use of the GNU Build System in the Virtlab software package the configuration instructions in the original versions of the configure ac files for MatCalc and MatGen were not streamlined for a regular user the main dependencies Maple and Ruby respectively had their locations hardcoded therein specifically for the original developer s platforms configuration Additionally the portability of Virtlab was limited to MacOS and Linux platforms which were the development platforms of choice Also neither make dist nor make install Makefile targets worked as expected 5 3 1 1 Portability issues Various portability issues have been successfully addressed by the use of the GNU Build System tools on Virtlab software library These enabled to extend the platform options to Solaris and OpenSolaris For a start the use of autoscan tool on Virtlab library suggested the addition of several checks in the configure ac file Among the suggested macros to include were e AC FUNC_STRTOD e AC TYPE SIZE T AC C INLINE AC TYPE SIGNAL e AC CHECK _FUNCS pow

Download Pdf Manuals

image

Related Search

Related Contents

120625 Revision_Final_Edit.cdr  KB 125 - Ploberger  „DVR-6018“ ÜBERWACHUNGSRECORDER  Contents  取扱説明書 - pb ピービー  ネスターマーティンカタログ  Contact Detach – Unomedical a/s / Convatec  ` Mäÿië Clÿ`System®  

Copyright © All rights reserved.
Failed to retrieve file