In the examples of section VI.1.4, one shows how the FeResPost COM component can be used to automate CLA calculations with different programming languages. However, the small programs done with these examples are not significantly different than the programs presented in Chapter IV.5.
One presents here an example in which the COM component is used in excel and allows to perform operations where the capabilities of excel and FeResPost are used together to produce a small application devoted to CLA calculations. The example is presented in excel spreadsheet ``COMEX/EX06/LaminateAnalysis.xls''.
The presentation of the example is organized as follows:
Before using the excel workbook, the FeResPost COM component must be referenced. This is done as follows:
If a FeResPost COM server is already referenced in the workbook when you open it the first time. (As it probably will be the case with the workbook you download from FeResPost web site.) You must first un-select the old reference to FeResPost server, before selecting the new one. You will have to perform this operation each time you install a new version of FeResPost COM server on your computer.
When you change the version of FeResPost, you must also modify the variable ``appName'' in the VBA code associated to ``ClaDbIds'' spreadsheet of the workbook. The corresponding line looks like:
Const appName As String = "FeResPost_4_0_0.Application"
Two events are defined in the workbook:
One presents below the different spreadsheets defined in the workbook. Most of these spreadsheets also contain associated VBA functions and variables. Generally, these are used for the spreadsheet buttons automation.
This spreadsheet is hidden. But you can make it ``Visible'' with the VBA editor. The spreadsheet contains the definition of several list that are used by the automation buttons of the other spreadsheets in the workbook. No VBA functions or variables are associated to ``HiddenData'' spreadsheet.
This spreadsheet is hidden. But you can make it ``Visible'' with the VBA editor. The spreadsheet contains the neutral lines corresponding to a ClaDb object in NDF format. (See the presentation of ``ClaDbIds'' spreadsheet for more information.) No VBA functions or variables are associated to ``NeutralLines'' spreadsheet.
This is the spreadsheet that manages the access to the COM server and the ClaDb composite database used for calculations. This is the first spreadsheet in which you have to go to start the application.
The spreadsheet contains several buttons, and information on the entities available in the current dataBase appear in the cells: lists of materials, laminates and loads. Each entity in the current dataBase is characterized by:
Dim frpApp As Variant Dim db As Variant Dim maxEntitiesNbr As Long Const maxPliesNbr As Long = 100 Const appName As String = "FeResPost_3_4_0.Application" Const logFileName As String = "FeResPost_LaminateAnalysis.log"
frpAppis the variable that contains a reference to the FeResPost COM server.
dbcontains the ClaDb composite dataBase in which all composite entities are stored. Only one ClaDb dataBase can be opened in the workbook. The variable ``appName'' is a constant that corresponds to the name of the server. You will have to change this variable when you change the version of FeResPost.
logFileName variable is used to redirect FeResPost
output messages. This is necessary, as with excel, FeResPost
is not run in console mode. Practically, the redirection is
programmed as follows in ``getApplication'' method:
fullLogName = ActiveWorkbook.Path + "\" + logFileName frpApp.openMsgOutputFile fullLogName, "w+" frpApp.writeAboutInformation
The spreadsheet allows to manipulate the units in which The CLA database and its entities are expressed:
Presently, the workbook does not allow to modify the system of units of CLA entities individually. This could be done by the addition of a few buttons in the corresponding ``MatEdit'', ``LamEdit'' and ``LoadEdit'' worksheets. We think however that it is a bad idea to try to define CLA entities with different units in a same database. Actually, the number of buttons defined in ``DbUnitsEdit'' spreadsheet is probably already too large.
This spreadsheet is used to edit materials defined in the current dataBase. New materials can also be added. The spreadsheet contains two buttons:
This spreadsheet is used to edit laminates defined in the current dataBase. New laminates can also be added. The spreadsheet contains three buttons:
This spreadsheet is used to edit loads defined in the current dataBase. New loads can also be added. The spreadsheet contains two buttons:
This spreadsheet calculates material properties for a material defined in the current composite dataBase. The two buttons allow to select an existing material and the orientation wrt which material properties are calculated.
The spreadsheet makes use of several functions defined in ``calcMatProperties'' VBA module.
This spreadsheet calculates laminate properties for a laminate defined in the current composite dataBase. The two buttons allow to select an existing laminate and the orientation wrt which laminate properties are calculated.
The spreadsheet makes use of several functions defined in ``calcLamProperties'' VBA module.
This spreadsheet allows to visualize the definition of laminates in a format suitable to inclusion in text documents. The spreadsheet makes use of ``getLamDescr'' function defined in ``calcLamProperties'' VBA module. This function has two arguments: the name of the laminate, and a list of acronyms that allow to replace material names in laminate description by a shorter name (typically a single letter).
This spreadsheet calculates laminate load response for a laminate defined in the current composite dataBase, and a loading also defined in the current dataBase. The buttons allow to select:
This spreadsheet performs the same calculations as ``LamLoadResponse_A'' except that the loading is not extracted from the current composite dataBase. Instead the loading is defined in the spreadsheet by filling the appropriate cells. (No ClaLoad object defined in the composite database is used.) For all the quantities that appear in the spreadsheet, units are those of the laminate object.
This spreadsheet is used to calculate laminate minimum reserve factors for a selection of load cases and criteria. This is the ``matricial'' version of the calculation where a whole set of load responses are calculated by a single call to one function. This version is generally very efficient when a large number of load cases must be processed. The unit system for components of loading and results is the same as for the laminate.
This is the scalar version of the spreadsheet above. It is generally less efficient.
This spreadsheet performs the same operation as ``LamMinRfCalcArray'' except that maximum values on the laminate are returned instead of minimum values. This makes the spreadsheet more adapted to the calculation of maximum failure indices or equivalent stresses. The unit system for components of loading and results is the same as for the laminate.
This is the scalar version of the spreadsheet above. It is generally less efficient.
Three VBA modules are defined. The modules define functions that can be used to obtain material properties, laminate properties, or laminate load response. These modules define functions that return results that are generally presented as 1D or 2D arrays, and can be used directly in excel spreadsheets with the appropriate arguments passed as selections of cells. The user should look at the VBA code to understand the different functions.
TIP: to enter a formula that returns a matricial function into an excel spreadsheet, select the target cell, enter the name of the function with the appropriate arguments and press ``MAJ+ENTER'' simultaneously.
These functions return different types of material properties like CMEs, CTEs, stiffness and compliance matrices... Examples of use of these functions are given in spreadsheet ``MatProperties''.
These functions return different types of laminate properties like CMEs, CTEs, stiffness and compliance matrices... Examples of use of these functions are given in spreadsheets ``LamProperties'' and ``LamText''.
The functions calculate laminate load responses. Examples of use of the functions are given in spreadsheets ``LamLoadResponse_A'', ``LamLoadResponse_B'', ``LamMinRfCalcArray'', ``LamMinRfCalcScal'', ``LamMaxFiCalcArray'' and ``LamMaxFiCalcScal''.
Note that for several of the functions, the load can be specified different ways depending on the size of the range that defines the loading: