2.5. Using Material Library Files

Although you can define material properties separately for each finite element analysis, you can also store a material property set in an archival material library file, then retrieve the set and reuse it in multiple analyses. (Each material property set has its own library file.) The material library files also enable several users to share commonly used material property data.

The material library feature offers you other advantages:

  • Because the archived contents of material library files are reusable, you can use them to define other, similar material property sets quickly and with fewer errors. For example, suppose that you have defined material properties for one grade of steel and want to create a material property set for another grade of steel that is slightly different. You can write the existing steel material property set to a material library file, read it back in under a different material number, and then make the minor changes needed to define properties for the second type of steel.

  • The /MPLIB command defines a material library read and write path. Doing so enables you to protect your material data resources in a read-only archive, while giving users the ability to write their material data locally without switching paths.

  • You can give your material library files meaningful names that reflect the characteristics of the data they contain. For example, the name of a material library file describing properties of a steel casting might be STEELCST.SI_MPL. (See Creating (Writing) a Material Library File for an explanation of file naming conventions.)

  • You can design your own directory hierarchy for material library files. This enables you to classify and catalog the files by material type (plastic, aluminum, etc.), by units, or by any category you choose.

The next few sections describe how to create and read material library files. For additional information, see the descriptions of the /MPLIB, MPREAD, and MPWRITE commands in the Command Reference.

2.5.1. Format of Material Library Files

Material library files are command files. The file format supports both linear and nonlinear properties. You can reuse material library files because the commands in them are written so that, once you read a material property set into the database, you can associate that set with any material number you wish.

2.5.2. Specifying a Default Read/Write Path for Material Library Files

The material library is located at <drive:>\Program Files\Ansys Inc\v242\ANSYS\matlib.

Before creating any material library files, issue the /MPLIB command to define a default read path and write path for those files:

/MPLIB,R-W_opt,PATH

In place of R-W_opt, specify READ (to set the read path), WRITE (to set the write path), or STAT to see what read and write paths currently are in use. In place of PATH, specify the path to be used for material library files.

2.5.3. Creating (Writing) a Material Library File

To create an archival material library file, perform these steps:

  1. To tell the program what system of units you are using, issue the /UNITS command. For example, to specify the international system of units, you would issue the command /UNITS,SI. You cannot access the /UNITS command directly from the GUI.

  2. Define a material property using the MP command (Main Menu> Preprocessor> Material Props> Isotropic). To do so, you must specify a material number and at least one material property value (for example, magnetic permeability or MURX).

  3. From the PREP7 preprocessor, issue the MPWRITE command (Main Menu> Preprocessor> Material Props> Material Library> Export Library) and specify the file name (Fname argument) for the material library file:

    MPWRITE,Fname,,,LIB,MAT

Issuing MPWRITE writes the material data specified by material number MAT into the named file in the current working directory. (If you previously specified a material library write path by issuing the /MPLIB command (Main Menu> Preprocessor> Material Props> Material Library> Library Path), the program writes the file to that location instead.)

Naming conventions for a material library file are as follows:

  • The name of the file is the name you specify on the MPWRITE command. If you do not specify a file name, the default name is JOBNAME.

  • The extension of a material library file name follows the pattern .xxx_MPL, where xxx identifies the system of units for this material property sets. For example, if the system of units is the CGS system, the file extension is .CGS_MPL. The default extension, used if you do not specify a units system before creating the material library file, is .USER_MPL. (This indicates a user-defined system of units.)

2.5.4. Reading a Material Library File

To read a material library file into the database:

  1. Issue the /UNITS command to specify the desired system of units.


    Note:  The default system of units is SI. The GUI lists only material library files with the currently active units.


  2. Specify a new material reference number or an existing number that you want to overwrite (MAT).


    Caution:  Overwriting an existing material in the database deletes all data associated with it.


  3. Read the material library file into the database (MPREAD).

The LIB argument on MPREAD supports a file search hierarchy. The program searches for the named material library file first in the current working directory, then in your home directory, then in the read path directory specified by the /MPLIB command, and finally in the program directory /ansys242/matlib. If you omit the LIB argument, the programs searches only in the current working directory.