Difference between revisions of "Material Command Block"

From OSUPDOCS
Jump to navigation Jump to search
 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
To use a material in calculations, you first must define it in the input commands. The method for defining materials depends on the type of input commands file you are writing.
To use an [[Material Models|MPM material]], an [[FEA Material Models|FEA material]], or a [[Traction Laws|traction law]] in calculations, you first must define it in the input commands. The method for defining materials and traction laws depends on the type of input commands file you are writing.
__TOC__
== Scripted Input Commands ==


__FORCETOC__
When using [[NairnFEAMPM]] or [[NairnFEAMPMViz]], a material or traction law is created with the scripting command block:


=== Scripted Input Commands ===
  Material (id),(name),(type)
 
When using [[NairnFEAMPM]] or [[NairnFEAMPMViz]], a material is created with the command block:
 
  Material ID,name,type
     Property value
     Property value
     Property2 value
     Property2 value
Line 16: Line 14:
where
where


* <code>ID</code> is the material ID (any string or number) that is used to reference this material in other commands.
* <tt>(id)</tt> is the material ID (any string or number) that is used to reference this material in other commands.
* <code>name</code> is a name that will appear in output files to describe the material
* <tt>(name)</tt> is a name that will appear in output files to describe the material
* <code>type</code> is the type of material, which can be set by using material type name or material type ID from the available [[#toc|material models]] (see material tables on this page for each material's name and ID)
* <tt>(type)</tt> is the type of material, which can be set by using material type name or material type ID from the available [[#toc|material models]] (see material tables on this page for each material's name and type number)


Each material property is specified on a line with a property name and its value. Refer to each [[Material Models|MPM]] or [[Material Models|FEA]] material type to see the available properties and which ones are required properties. The property names are case sensitive (although [[NairnFEAMPM]] can usually handle any case).
Each material property is specified on a line with a property name and its value. Refer to each [[Material Models|MPM material]][[FEA Material Models|FEA material]], or [[Traction Laws|traction law]] type to see the available properties and which ones are required properties. The property names are case sensitive (although [[NairnFEAMPM]] can usually handle any case).


=== XML Input Commands ===
== XML Input Commands ==


A material definition in a <code>XML</code> input file has the form:
A material or traction law definition in a <tt>XML</tt> input file has the form:


  &lt;Material Type='1' Name='Polymer'&gt;
  &lt;Material Type='(num)' Name='(name)'&gt;
     &lt;Property&gt;value&lt;/Property&gt;
     &lt;Property&gt;value&lt;/Property&gt;
     &lt;Property2&gt;value&lt;/Property2&gt;     
     &lt;Property2&gt;value&lt;/Property2&gt;     
Line 35: Line 33:
where
where


* <code>Type</code> is the material type and must be entered by material type ID corresponding to that [[#toc|material models]] (see material tables on this page for each material's ID).
* <tt>(num)</tt> is the material type and must be entered by material number corresponding to that [[Material Models|MPM]] or [[Material Models|FEA]] material type (see material tables for each material's type number).
* <code>Name</code> is any user-defined description of the material.
* <tt>(name)</tt> is any user-defined description of the material.


Each material property is specified in a single <code>XML</code> element matching the property name and the content of the element as the value. Refer to each [[#toc|material type]] to see the available properties and which ones are required properties.
Each material property is specified in a single <tt>XML</tt> element matching the property name and the content of the element as the value. Refer to each [[Material Models|MPM material]],  [[FEA Material Models|FEA material]], or [[Traction Laws|traction law]] type to see the available properties and which ones are required properties.


Note that in <code>XML</code> files a material does not have an ID that is used in scripting files to refer to that material in other commands. Instead, other <code>XML</code> commands refer to defined materials by number or name as follows:
==== Referencing Materials in XML Files ====
Note that in <tt>XML</tt> files a material does not have an ID that is used in scripting files to refer to that material in other commands. Instead, other <tt>XML</tt> commands refer to defined materials by name or number as follows:


;By Name
: In this method, you use <tt>matname='Mat_Name'</tt> attributes where <tt>'Mat_Name'</tt> matches the <tt>Name</tt> attribute of any defined material in the file. You can use these names even before the materials are defined, but an error will occur if you reference materials that are never defined. When referring to materials by name, you must be certain that all material <tt>Name</tt> attributes have unique strings.
; By Numbers
; By Numbers
: In this method, you use <code>mat='#'</code> attributes to refer to materials where # is the material number. The materials are defined by numbers in the order they appear in the output file with the first material being number 1. You have to be careful to use the correct number. If you add new materials to a file, it is best to add them to the end of the materials list, otherwise previous commands that referenced materials after an inserted material, will point to the wrong material.
: In this method, you use <tt>mat='#'</tt> attributes to refer to materials where # is the material number. The materials are defined by numbers in the order they appear in the output file with the first material being number 1. You have to be careful to use the correct number. If you add new materials to a file, it is best to add them to the end of the materials list, otherwise previous commands that referenced materials after an inserted material, will point to the wrong material.
;By Name
: In this method, you use <code>matname='Mat_Name'</code> attributes where <code>'Mat_Name'</code> matches the <code>Name</code> attribute of any defined material in the file. You can use these names even before the materials are defined, but an error will occur if you reference materials that are never defined. When referring to materials by name, you must be certain that all material <code>Name</code> attributes have unique strings.


When referring to materials by name, the defined materials will appear in the output file in the ordered referenced rather than in the order defined in the input file. For this reason, you should not refer to some materials by name and others by number in the same file. The eventual ordering will likely mean the numbers will refer to the wrong material. The naming method is preferred in hand-edited <code>XML</code> files. If you use both <code>mat</code> and <code>matname</code> attributes in a single element, the <code>matname</code> attribute will be used and the <code>mat</code> will be ignored.
When referring to materials by name, the defined materials will appear in the output file in the ordered referenced rather than in the order defined in the input file. For this reason, you should not refer to some materials by name and others by number in the same file. The eventual ordering will likely mean the numbers will refer to the wrong material. The naming method is preferred in hand-edited <tt>XML</tt> files. If you use both <tt>matname</tt> and <tt>mat</tt> attributes in a single element, the <tt>matname</tt> attribute will be used and the <tt>mat</tt> one will be ignored. A few options that refer to materials (''e.g.'', some material properties and custom task settings) can only use material number. When using such settings, it is probably better to reference all materials by number rather then by name.

Latest revision as of 18:43, 1 January 2021

To use an MPM material, an FEA material, or a traction law in calculations, you first must define it in the input commands. The method for defining materials and traction laws depends on the type of input commands file you are writing.

Scripted Input Commands

When using NairnFEAMPM or NairnFEAMPMViz, a material or traction law is created with the scripting command block:

Material (id),(name),(type)
   Property value
   Property2 value
      .
      .
Done

where

  • (id) is the material ID (any string or number) that is used to reference this material in other commands.
  • (name) is a name that will appear in output files to describe the material
  • (type) is the type of material, which can be set by using material type name or material type ID from the available material models (see material tables on this page for each material's name and type number)

Each material property is specified on a line with a property name and its value. Refer to each MPM material, FEA material, or traction law type to see the available properties and which ones are required properties. The property names are case sensitive (although NairnFEAMPM can usually handle any case).

XML Input Commands

A material or traction law definition in a XML input file has the form:

<Material Type='(num)' Name='(name)'>
   <Property>value</Property>
   <Property2>value</Property2>     
      .
      .
</Material>

where

  • (num) is the material type and must be entered by material number corresponding to that MPM or FEA material type (see material tables for each material's type number).
  • (name) is any user-defined description of the material.

Each material property is specified in a single XML element matching the property name and the content of the element as the value. Refer to each MPM material, FEA material, or traction law type to see the available properties and which ones are required properties.

Referencing Materials in XML Files

Note that in XML files a material does not have an ID that is used in scripting files to refer to that material in other commands. Instead, other XML commands refer to defined materials by name or number as follows:

By Name
In this method, you use matname='Mat_Name' attributes where 'Mat_Name' matches the Name attribute of any defined material in the file. You can use these names even before the materials are defined, but an error will occur if you reference materials that are never defined. When referring to materials by name, you must be certain that all material Name attributes have unique strings.
By Numbers
In this method, you use mat='#' attributes to refer to materials where # is the material number. The materials are defined by numbers in the order they appear in the output file with the first material being number 1. You have to be careful to use the correct number. If you add new materials to a file, it is best to add them to the end of the materials list, otherwise previous commands that referenced materials after an inserted material, will point to the wrong material.

When referring to materials by name, the defined materials will appear in the output file in the ordered referenced rather than in the order defined in the input file. For this reason, you should not refer to some materials by name and others by number in the same file. The eventual ordering will likely mean the numbers will refer to the wrong material. The naming method is preferred in hand-edited XML files. If you use both matname and mat attributes in a single element, the matname attribute will be used and the mat one will be ignored. A few options that refer to materials (e.g., some material properties and custom task settings) can only use material number. When using such settings, it is probably better to reference all materials by number rather then by name.