Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Download and unpack redAnTS if you haven't done so already. Bring up PostProcessMenuFiles/CalcStrainStress.min 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.

function sigepsstruct=CalcStrainStress(fighandle)
handles=guidata(fighandle);

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 (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 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

x= handles.mesh.xcoords

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.

...

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 line. A red circle should appear as shown below.

...

Type the following at the command line to see what the nodal x-coordinates are:

x= handles.mesh.xcoords

Note that the strain and stress fields, eps and sig, respectively, don't yet exist. When you update the structure sigepsstruct in CalcStrainStress.m, these fields will be added to the handles structure by the function that calls CalcStrainStress.m.

...