4.2.2.3. Outline of readFil.m

In this section the way the function readFil.m works is outlined.

Contents

Summary

Detailed outline

Templates

Reference

Summary

In summary, the following steps are taken to read the data from a results file:

[1] Find the category of the record key provided by the user.

[2] Convert the contents of the fil file into an one-row string

[3] Find the positions in the above string where the record key occurs.

[4] Delete the positions where the record key does not occur at the second position of a record.

[5] For each of the remaining positions, scan the data items in each position and arrange them in an output matrix.

Detailed outline

Here the steps summarized in the previous section are explained in detail.

[1] The categories of the various record keys are shown at 4.2.2.2. Categories of results. If the record key belongs to categories 1,2 or 3 the analogous function is called to retrieve the output. If the record key does not belong to categories 1,2 or 3 but is valid, then the analogous RecXXX.m function is called to retrieve the output (XXX is the record key). If the record key neither belongs to any category nor a suitable RecXXX function exists for extracting the results, an empty matrix is output.

[2] The conversion to one-row string is vital to retrieve the data items that are split by two successive 80-character logical records.

[3] To find the occurences of a record key an appropriate string has to be formed first. The one-row string is searched for this string.

[4] The string which is searched for in step [3] does not always occur in the second position of a record. For example the string 'I 41900' may not denote a record key, but may be part of the element node definitions of a record. Such positions of occurence are meaningless and therefore deleted.

[5] Each position is scanned depending on its category or record key, as presented in step [1], and the output is assigned to one row of a floating point or cell array. Proceed to the next position and do the same, etc till the end.

Templates

An exemplary Matlab script which reads the results of an Abaqus/Standard analysis written in a fil file is as follows:

% S is the directory path of the results file. It is assumed that it is
% placed in the folder C:\Abaqus_Temp\
S='C:\Abaqus_Temp';
fileID = fopen('AbaqusInputFile.inp','wt');
% Write Abaqus options in the file
fprintf(fileID,' *HEADING\n');
fprintf(fileID,' ...<options in Abaqus input file>...\n');
fprintf(fileID,' *STEP\n');
fprintf(fileID,' ...<options for analysis in Abaqus/Standard>...\n');
fprintf(fileID,' *FILE FORMAT,ASCII\n');
% specify at least one of the following:
fprintf(fileID,' *EL FILE\n');
fprintf(fileID,'  ...<Element output variable IDs>...\n');
% or:
fprintf(fileID,' *NODE FILE\n');
fprintf(fileID,'  ...<Node output variable IDs>...\n');
% end the step definition
fprintf(fileID,' *END STEP\n');
fclose(fileID);
% Run the input file with Abaqus
!abaqus job=AbaqusInputFile
% Give Abaqus enough time to create the lck file
pause(2)
% While the lck file exists then halt Matlab execution
while exist('AbaqusInputFile.lck','file')==2
    pause(0.1)
end
% Obtain results contained in AbaqusInputFile.fil
recordKey=myRecordKey;
out=readFil('AbaqusInputFile.fil',recordKey,S)
 

An exemplary Matlab script which reads the results of an Abaqus/Explicit analysis written in a fil file is as follows:

% S is the directory path of the results file. It is assumed that it is
% placed in the folder C:\Abaqus_Temp\
S='C:\Abaqus_Temp';
% AbaqusInputFile.inp is the name of the Abaqus input file
fileID = fopen('AbaqusInputFile.inp','wt');
% Write Abaqus options in the file
fprintf(fileID,' *HEADING\n');
fprintf(fileID,' ...<options in Abaqus input file>...\n');
fprintf(fileID,' *STEP\n');
fprintf(fileID,' ...<options for analysis in Abaqus/Explicit>...\n');
fprintf(fileID,' *FILE OUTPUT\n');
% specify at least one of the following:
fprintf(fileID,' *EL FILE\n');
fprintf(fileID,'  ...<Element output variable IDs>...\n');
% or:
fprintf(fileID,' *NODE FILE\n');
fprintf(fileID,'  ...<Node output variable IDs>...\n');
% end the step definition
fprintf(fileID,' *END STEP\n');
fclose(fileID);
% Run the input file with Abaqus
!abaqus job=AbaqusInputFile
% Give Abaqus enough time to create the lck file
pause(2)
% While the lck file exists then halt Matlab execution
while exist('AbaqusInputFile.lck','file')==2
    pause(0.1)
end
% Convert fil file to fin (ASCII format)
!abaqus ascfil job=AbaqusInputFile
% Give Abaqus enough time for the file conversion
pause(2)
% Obtain results contained in AbaqusInputFile.fin
recordKey=myRecordKey;
out=readFil('AbaqusInputFile.fin',recordKey,S);
 

Reference

For more details about the functions involved in this section see:

catRecKey.m

fil2Str.m

readFilCat1.m

readFilCat2.m

readFilCat3.m

Rec1900.m

Rec1901.m

Rec1902.m

Rec1911.m

Rec1921.m

Rec1940.m

Rec1980.m

Rec1991.m

Rec2000.m

_________________________________________________________________________
Abaqus2Matlab - www.abaqus2matlab.com
Copyright (c) 2017 by George Papazafeiropoulos

If using this application for research or industrial purposes, please cite:
G. Papazafeiropoulos, M. Muniz-Calvente, E. Martinez-Paneda.
Abaqus2Matlab: a suitable tool for finite element post-processing.
Advances in Engineering Software. Vol 105. March 2017. Pages 9-16. (2017)
DOI:10.1016/j.advengsoft.2017.01.006



Created with an evaluation copy of HelpSmith.
To remove this notice, you should purchase the full version of the product.

We support Ukraine and condemn war. Push Russian government to act against war. Be brave, vocal and show your support to Ukraine. Follow the latest news HERE