01l. How to control number of decimal places used in AutoPIPE's library SRC files?


Applies To
Product(s):AutoPIPE
Version(s):ALL;
Area: Library
Date Logged
& Current Version
Aug. 2022
12.08.01.010

Problem:

How to control number of decimal places used in AutoPIPE's library SRC files?

Solution:

 +++Warning+++ 

This is not an easy process and needs to be perform by a very meticulous person that can follow these instructions very carefully.

In this example, let us concentrate on changing the modulus value (3rd column) from using 2 numbers after the decimal to using 4 numbers after the decimal.  

SRC file to be updated =  B313-18.src

Library location = see WIKI here, folder containing "Library files"

1. Copy default SRC file from original location to a new folder on the desk top.

2. Rename file from B313-18.src to Test.scr (highly suggest to never use the same name as a default material library)

3. Open Test.SRC using any text editor (ex. Notepad++, Ultra EDIT, MS Word)

4. Detail on the SRC file, Material Table format

Line 9 definition

1 = 12 = Length of the Material name Field on line 244(ex. CS)

2 = 1 = Number of decimal places in item #1 if a real value. However #1 is not a real value and thus will be ignored. 

3 = C = Value can be I (integer), R (real number), C (character), or X (special character). pertaining to line 244.

4 = (A1,A12) = Fortran format A1 is starting character, where A12 is the next field length or 12 characters (If Integer than use I, if real value than use F, if character value than use A), pertaining to line 244.  

5 = 01 = any data related to this material, 1 character values, see image below, pertaining to line 245.

6 = 04 = any data related to this material, 4 integer values, see image below, pertaining to line 245.

7 = 02 = any data related to this material, 2 real values, see image below, pertaining to line 245.

Line 10 definition

Information here is a description of what is defined by line 9. 

In this case it is tells that this is a Material Table ID

Line 11 definition

Similar in nature as line #9 above, it describes the information on line 248 - *MECH and the table from lines 247 - 320

1 = 4 = Length of the Mechanical name on line 246 (ex. *MECH)

2 = 1 = Number of decimal places in item #1 if a real value. However #1 is not a real value and thus will be ignored. 

3 = X = Value can be I (integer), R (real number), C (character), or X (special character). pertaining to line 246.

4 = (A1,A04) = Fortran format A1 is starting character, where A04 is the next field length or 4 characters (If Integer than use I, if real value than use F, if character value than use A), pertaining to line 246.  

5 = 00 = any data related to this material, 0 character values, therefore pertains to no lines.

6 = 00 = any data related to this material, 0 integer values, therefore pertains to no lines.

7 = 222 = any data related to this material, 222 real values, pertaining to lines 20 - 241. Note that the table defines 220 lines, but only 74 of them are actually used in the Matl table, pertaining to lines 247 - 320.

Line 12 definition

Information here is a description of what is defined by line 11. 

In this case it is tells that this is the mechanical data.

Line 13 to 19 definition

Information here describes the format used to define the items on lines 244 and 245 of the material information. 

Line 20 definition

1 = 20 = The line number in the file. This information is not typical viewed in most word editing software, however as seen here can be very useful when making modifications to any file in AutoPIPE. Therefore highly suggest to use applications like Notepad++, Ultra-edit, etc.  

2 = 25 = Locate the Units file defined on the General Model options dialog, open the *.UNT file (ex. AutoPIPE.UNT), in the fourth column locate item #25. These are the units for this field. 

3 = 09 = Length of the field, on line 247, columns 1 to 9

4 = 03 = Number of decimal places for value on line 247

5 = 02 = Format for Tools> Library command, Lines to skip-UPDATE,  image below 

6 = 00 = Format for Tools> Library command, Lines to skip-SCAN, image below

7 = 16 = Format for Tools> Library command, Spaces to skip, image below

8 = 9.1 = Format for Tools> Library command, Write format, width of column and number of decimal places, image below

9 = Temp: = Format for Tools> Library command, Label, name of data in table column

Line 21 and 22 definition

Similar format as defined on line 20 of the file above.

Note

Line 21, column #3 = 08, this represents columns 10-17

Line 22, column #3 = 07, this represents columns 18-24 

Line 242 definition

After the last data entry for the table find additional lines that instruct the application on how to read the lines of data in the table

Read format for Major data record on line 245

1X = 1st column is a single space

A20 = Charter field that is 20 columns wide

4 (I2, 1X) = 4 groups of integer value that are 2 columns wide with 1 blank space between each integer group

F5.1 = Real value that is 5 columns wide, in that 5 spaces, there is room for 1 value after decimal.

2X = 2 columns wide of empty data

F7.4 = Real value that is 7 columns wide, in that 7 spaces, there is room for 4 values after decimal.

Line 243 definition

After the last data entry for the table find additional lines that instruct the application on how to read the lines of data in the table

Read format for Minor data records from lines 247 - 320


1X = 1st column is a single space

F6.0 = Real value that is 6 columns wide, in that 6 spaces, there is room for 0 values after decimal.

1X = 1 column wide of empty data

F6.3 = Real value that is 6 columns wide, in that 6 spaces, there is room for 3 values after decimal.

3X = 1 columns wide of empty data

F6.2 = Real value that is 6 columns wide, in that 6 spaces, there is room for 2 values after decimal.

Notes: 

1. Most of the table definitions lines 9 to 241 are mostly used when enabling the Library (Tools > Tools > Library) command to display, scan, print library data. 

2. Major and Minor data records line, ex. 242 and 243 are used by the program to read the library data table for each material.

3. the program will ignore values that are not correctly formatted or are outside of the field width.

Example:

a. In minor data above. if value was -2.601, the 0.001 would be ignored because it is outside of the field width

b. In minor data above. if value was -2.601, with the enter value in the field with, the 0.001 would be read because the field is defined for 6 columns wide to include 3 decimal values.

5. Find and replace as indicated below

Find - "15 07 02 00 01 04 7.3       Mod:"

Replace - "15 07 03 00 01 04 7.3       Mod:"

Note: should replace 74 times

6. Modify Minor data records line at the end of the table, ex. line #243. 

Find - (1X,F6.0,1X,F6.3,3X,F6.2)

Replace - (1X,F6.0,1X,F6.3,3X,F7.3)

7. Update Each material Id and each respective row with modulus values according to the new format. maintain the decimal location, 7 columns wide, and with 3 values after the decimal.  

8. Compile the library into a LIB file, place the library in the folder with all the other libraries, restart AutoPIPE, select the library from the material drop down listing, and test all the values returned are correct. 

Again,.  +++Warning+++

Remember, being a custom library, Bentley cannot be held responsible for the inaccuracy of the new library content. It is your responsibility to verify the following information:

a. Verification of data in the SRC file
b. Verification of data in the Press / Temp. dialog
c. Verification of relevant data in the Pipe Properties or any dialog referenced by the updated library

Additional questions and answer: 

Question 1: In order to increase the modulus value to 3 numbers after the decimal, in the original file there is no 24th column for lines 247 to 320 as there is no space after 23rd column .There is “Enter” for Next line. Should we create 24th column by giving space bar or 0, then “Enter” for next line? 

Answer: 

If not explicitly explained, once a filed is defined, the number can exist anywhere within its bounds and the program only reads what has been defined. 

Example: given that the field has 9 character defined with 2 number after decimals and ...

Line 20 reads, 25 09 03 01 00 16 9.1     Temp:

Line 243 reads, (1X,F6.2,1X,F6.3,3X,F7.3)

Is it correct to assume that all of the following numbers are correctly entered and the whole number on each line will be read by the program?

If you answered Yes, you are wrong.

If answered No, your are somewhat correct. But let us look at the details. 

As mentioned,  the number can exist anywhere within its bounds and the program only reads what has been defined. 

Table was defined by lines 20 and 243 as indicated above. 

From line 20 the field is defined as 9 characters wide for the Library print/scan command. Therefore any number within the bounds of columns 1-9 will be printed / scan. Any value exceeding this length will be truncated back to 9 characters in the first 9 columns.

However line 243 informs us that the program will read,  the 1st column as a blank character, and the next 6 columns with 2 number after decimal. Or column 1 is not read / blank, and only read columns 2-7. The decimal can be in any of these 6 column and only 2 numbers after the decimal will be read while the other values will be truncated. 

So what value does the program read from each row:

Row 2 = 432.1 (why, anything beyond column 7 is truncated)

Row 3 = 432.1 (why, anything beyond column 7 is truncated)

Row 4 = 432 (why, anything beyond column 7 is truncated)

Row 5 = 432 (why, anything beyond column 7 is truncated)

Row 6 = 432.12 (why, anything beyond column 7 is truncated)

Row 7 = 32.12 (column 1 is not read / blank, value is in the defined 6 columns and only 2 number after decimal are read)

Back to the original question, Should we create 24th column to make room for a 3rd number after the decimal ?

Most important, take a moment to layout the line as defined to clearly understand the defined fields and what is read by the program

Lines 20 = 25 09 03 01 00 16 9.1 Temp:
Lines 21 = 24 08 03 00 00 02 8.3 Exp:
Lines 22 = 15 07 03 00 01 04 7.3 Mod:

Line 243 = (1X,F6.0,1X,F6.3,3X,F7.3)

There are 2 correct answer here.

 

1. As indicated above, one could move the entire value over 1 column and enter another number with out changing the row length

or 

2. Insert a 3rd value after the decimal before the row return. 

Question 2: Is the position of the decimal point fixed for Temp(7th), Exp(12th) and Modulus(21) in the line 247 to 320?

Answer: 

No. refer to Question / Answer #1 above. 

The decimal value can occur at any time with in the defined field. 

See Also

Libraries - AutoPIPE

Bentley AutoPIPE