mat_create
Create a manual material with explicit property values and units, without needing a library. Assign it to chosen domains, named selections, or all domains in a COMSOL model.
Instructions
Create a manual material with explicit properties (no library needed).
Args:
name: material display name, e.g. "My alloy" (becomes the label).
properties: Basic-group properties (def group), values are COMSOL
expressions with units, e.g.
{"thermalconductivity": "400[W/(mK)]",
"density": "8960[kg/m^3]", "heatcapacity": "385[J/(kgK)]"}.
Anisotropic tensors can be given as lists of 9 values.
groups: extra property groups, e.g. {"Enu": {"E": "200[GPa]",
"nu": "0.3"}}; group tags use COMSOL's built-in types
("Enu" = Young's modulus and Poisson's ratio, "linzRes",
"idealGas", ...).
material_type: "Common" (default, works for all physics) | "Solid" |
"Fluid" | "PorousMedia" | "Multiphase" | "Switch" | "External" |
"LayeredMaterial" | ...
component: component tag (default "comp1"); "" or "global" = global.
selection: domain numbers to assign the material to.
named: named selection tag to assign instead of selection.
all_domains: true = assign all domains.
tag: material tag (default auto mat1, ...).
label: custom label (default: name).
model: model name/tag (None = current model).
Example:
mat_create(name="Steel custom", properties={"density": "7850[kg/m^3]",
"thermalconductivity": "44.5[W/(mK)]", "heatcapacity": "475[J/(kgK)]"},
selection=[1])
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>"
},
"name": "mat_create"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | ||
| name | Yes | ||
| label | No | ||
| model | No | ||
| named | No | ||
| groups | No | ||
| component | No | comp1 | |
| selection | No | ||
| properties | No | ||
| all_domains | No | ||
| material_type | No | Common |