Importing and Exporting Materials
You can import and export materials to and from your COMSOL Multiphysics models. The Materials toolbar include Import Materials and Export Materials buttons. You can also right-click one of the following nodes in the Model Builder and choose Import Materials, Import Materials From, or Export Materials:
The Materials node under Global Definitions.
The Materials node under Definitions in a component.
The selected node determines where the imported materials will go or what materials to export into a new XML-file.
To import materials first select one of these nodes, then click the Import Materials button or choose it from a context menu. An Import Materials dialog appears that displays the content of the selected file. Select the materials to import and then click OK to import them to the model. You can also choose Import Materials From, which opens the Select Model fullscreen window for choosing a materials file from a database.
Some types of materials can only be imported to either Global Definitions or Definitions. Importing such a materials to the wrong branch is not allowed, so they are therefore ignored in the import. A message will appear when this happens.
To export materials, click the Export Materials button or choose it from a context menu. In the Export Materials dialog box that appears, choose the file location and enter a name for the XML-file to export materials to. Click OK when you are done to export the materials in the chosen file.
Material Import and Export Formats
COMSOL can import materials from the following formats:
There are no special extension for the supported XML-file formats, and they expect the .xml extension. The COMSOL Multiphysics software detects the actual format automatically by looking at the first part of the file.
For materials export, COMSOL Multiphysics only supports explicit export to the Model XML-file format. You can export materials on the MPH-file format by just saving a model, which can contain materials only.
For more information about the XML-file format, see Materials in The COMSOL File Formats chapter in the COMSOL Multiphysics Programming Reference Manual.