Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Include Page
MATLAB Google Analytics
MATLAB Google Analytics
Include Page
Structures and Handles - Panel
Structures and Handles - Panel
Panel

Overview
Step 1: Creating a structure for one element
Step 2: Creating a structure for two elements
Step 3: Structure of handles

...

Structure of Handles

Preparation

Before going through this step, make sure you have gone go through the first four five steps of the

newwindow
Introductory _redAnTS _ Tutorial #1Introductory _
redAnTS _ Tutorial #1
https://confluence.cornell.edu/display/SIMULATION/redAnTS+TUTORIAL+1+Problem+Specification
and calculate the nodal displacements. If you have saved the mesh and input data from the tutorial previously, launch redAnTS, read in the mesh and input data and solve to obtain the nodal displacements. Leave the redAnTS GUI running.

Introduction

MATLAB assigns a handle to every graphics object it creates. One can use this handle to change the object's properties. redAnTS creates a structure, called the "handles structure", that contains all the handles of the objects in its graphical user interface (GUI). It then augments this "handles structure" by adding fields corresponding to the mesh, material properties, nodal displacements, element strains, etc. In other words, the handles structure is the container that is used to store this FEA data. The handles structure is illustrated in the figure below.

...

In the above figure, the fields guihandle1 and guihandle2 are handles for "objects" in the redAnTS GUI. The field mesh_data contains the mesh information (the x and y coordinates of the nodes etc.) and is, in turn, a structure. The field prop_data contains the material properties (E, nu) and is also a structure. Yada yada yada.

Handles structure in redAnTS

Download and unpack redAnTS if you haven't done so alreadyWithin your redAnTS folder, there is a folder called PostProcessMenuFiles and within that folder, a file called CalcStrainStress.m. Bring up PostProcessMenuFiles/CalcStrainStress.m in the MATLAB editor. This function is used to calculate the element strain and stress values from the nodal displacements. This is one of the functions that you need to modify to add post-processing capabilities to your version of redAnTS. Let's take a closer look at the following two statements in this function.

...

The variable fighandle is the handle to the main redAnTS window and is passed into this function. The second statement passes this handle on to the guidata command to create a variable called handles. This variable handles is our exalted handles structure associated with the main redAnTSwindow GUI (bow to it a few times in respect). Its fields contain all data required to calculate the element strain and stress as discussed below.

The data fields of interest in the handles structure are listed in the redAnTS main help. To see this, type Help help redAnTS at the MATLAB command line. Below is a snapshot from the help.

Thus, the handles structure has a field called mesh that is also a structure. The mesh field in turn contains the xcoords and other fields. The statement

...

will give you a row vector containing the x-coordinates of all the nodes. You can visualize the handles structure as per the figure below.

Investigate the handles structure using the debugger

You can set use the debugger to investigate further what the fields of the handles structure look like. In the MATLAB editor, add a breakpoint in CalcStrainStress.m at the statement handles=guidata(fighandle). You can add a breakpoint by clicking to the left of the linestatement. A red circle should appear as shown below.

Calculate σxxas per the first item in Step 5 of the tutorialNow we need to drive redAnTS into CalcStrainStress.m function so that it will stop execution at the breakpoint that we just set. CalcStrainStress.m is invoked when we calculate the stress components in the redAnTS GUI. To calculate the stress components, go to the redAnTS GUI and click on Strain, Stress under Post-Process. Program execution should stop at the above statement. Check the Workspace. Then, step through this statement using the step icon.

...

After you are done investigating the handles structure in the debugger, exit the debug mode by clicking on the Exit debug mode icon in the editor.

You should now have enough background to provide post-processing capabilities in redAnTS by modifying the following functions:

CalcStrainStress.m
CalcPrincipals.m
CalcEffectiveStress.m

Happy computing!
See and rate the complete Learning Module
Go to Comments

Go to all MATLAB Learning Modules