×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Read data file a time for Hetval subroutine

Read data file a time for Hetval subroutine

Read data file a time for Hetval subroutine

(OP)
I am not good in Abaquas. I am writing the subroutine Hetval, in this subroutine I read data file from my PC. Because I need data to give to Abaqus program. Result is good but it take me a long time because the program must read many times with same data. I want to read the data a time, then assign it to array and use array instead of read file . But I dont know what to do. Can You help me? Please, describe clearly for me.
Thank a lot.

My subroutine:

SUBROUTINE HETVAL(CMNAME, TEMP, TIME, DTIME, STATEV, FLUX,
    1 PREDEF, DPRED)
.....
OPEN (UNIT =10, FILE ="...", STATUS="OLD", ACCESS="SEQUENTIAL", IOSTAT=OpenStatus)    
...
READ (UNIT =10,FMT = 100, IOSTAT = InputStatus)...
...
close (10)
...
RETURN
END

RE: Read data file a time for Hetval subroutine

Variant 1:

Put an ARRAY in a COMMON block, let's call it HIVALUES.

Then use UEXTERNALDB subroutine (see documentation for usage details) which is called at the beginning of the analysis (must check if LOP=0) to read the data from the external file and initiate the HIVALUES.

Declare HIVALUES in HETVAL , now you have the values without reading the external file each time HETVAL is called.

Variant 2:

Put a Boolean flag (TRUE/FALSE) in a COMMON block and set it to FALSE, let's call it FILE_READ=.FALSE.

In HETVAL declare FILE_READ and code something like this:

if FILE_READ=.FALSE. then
           1. read the file
           2. set FILE_READ=.TRUE.

Thus the file will be read only once!

Best.

RE: Read data file a time for Hetval subroutine

(OP)
I finished the new program based on your reply. Analysis time is short and algorithm You gave is good. Thank Xerf very much.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources