next up previous contents index
Next: VI.3 Extraction and manipulation Up: VI. FeResPost Examples with Previous: VI.1 COM examples with   Contents   Index

Subsections


VI.2 CLA analyses in excel

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:

The example is meant to be the presentation of a small application devoted to classical laminate analysis. This application is highly customizable provided the user is ready to adapt it to its needs by modifying the spreadsheets and the associated VBA programming.


VI.2.1 Preparing the application

Before using the excel workbook, the FeResPost COM component must be referenced. This is done as follows:

Once this has been done, you may save the excel workbook so that the references to FeResPost library shall be ``remembered'' the next time you open the workbook.

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"


VI.2.2 Workbook events

Two events are defined in the workbook:


VI.2.3 Spreadsheets

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.

VI.2.3.1 Spreadsheet ``HiddenData''

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.

VI.2.3.2 Spreadsheet ``NeutralLines''

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.

VI.2.3.3 Spreadsheet ``ClaDbIds''

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:

The integer and string id correspond to the CLA idfier of the entity. The excel ID is a String representation of this idfier that allows to refer to the entities in the other spreadsheets. The spreadsheet defines several buttons: Several macros are defined in the spreadsheet. Most of these macros perform the different operations done by the buttons. You can access to the macros by the VBA editor. At the beginning of VBA program lines, several variables are defined:
            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"
frpApp is the variable that contains a reference to the FeResPost COM server. db contains 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.

The 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

VI.2.3.4 Spreadsheet ``DbUnitsEdit''

The spreadsheet allows to manipulate the units in which The CLA database and its entities are expressed:

Remember that the difference between the ``SetUnits*'' and ``ChangeUnits*'' methods is that the second group of methods perform units conversions between old and new units. The ``SetUnits*'' methods modifies the units associated to entities without modifying the values of the different quantities.

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.

VI.2.3.5 Spreadsheet ``MatEdit''

This spreadsheet is used to edit materials defined in the current dataBase. New materials can also be added. The spreadsheet contains two buttons:

The material IDs and properties are defined by filling the different cells where appropriate.

VI.2.3.6 Spreadsheet ``LamEdit''

This spreadsheet is used to edit laminates defined in the current dataBase. New laminates can also be added. The spreadsheet contains three buttons:

The laminate IDs and properties are defined by filling the different cells where appropriate.

VI.2.3.7 Spreadsheet ``LoadEdit''

This spreadsheet is used to edit loads defined in the current dataBase. New loads can also be added. The spreadsheet contains two buttons:

The load IDs and properties are defined by filling the different cells where appropriate.

VI.2.3.8 Spreadsheet ``MatProperties''

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.

VI.2.3.9 Spreadsheet ``LamProperties''

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.

VI.2.3.10 Spreadsheet ``LamText''

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).

VI.2.3.11 Spreadsheet ``LamLoadResponse_A''

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:

The spreadsheet makes use of several functions defined in ``calcLamLoadResponse'' VBA module. These methods calculate laminate global stress/strain state, ply stresses and strains, and failure indices, reserve factors or equivalent stresses.

VI.2.3.12 Spreadsheet ``LamLoadResponse_B''

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.

VI.2.3.13 Spreadsheet ``LamMinRfCalcArray''

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.

VI.2.3.14 Spreadsheet ``LamMinRfCalcScal''

This is the scalar version of the spreadsheet above. It is generally less efficient.

VI.2.3.15 Spreadsheet ``LamMaxFiCalcArray''

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.

VI.2.3.16 Spreadsheet ``LamMaxFiCalcScal''

This is the scalar version of the spreadsheet above. It is generally less efficient.


VI.2.4 VBA modules

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.

VI.2.4.1 ``calcMatProperties'' module

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''.

VI.2.4.2 ``calcLamProperties'' module

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''.

VI.2.4.3 ``calcLamLoadResponse'' module

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:


next up previous contents index
Next: VI.3 Extraction and manipulation Up: VI. FeResPost Examples with Previous: VI.1 COM examples with   Contents   Index
FeResPost 2017-05-28