Please enable JavaScript to view this site.

Knowledge Base

Navigation: Scripting Language > Material database

getmaterial

We've made some changes. Use 'Ctrl-F5' to clear your browser cache.
Scroll Prev Top Next More

Returns properties of a material in the material database.

 

Supported Product: FDTD, MODE

 

Syntax

Description

?getmaterial( "materialname");

Displays the property names of the specified material that can be modified.

out = getmaterial( "materialname", "propertyname");

Returns the property named "propertyname" of the material with the name "materialname". The returned variable is either a matrix or a string, depending on the property in the query.

 

Examples

These commands add a new Conductive material, set the name to "aluminum", anisotropy to "Diagonal", and set the permittivity as well as conductivity properties for the material. The command getmaterial() is then used to find the permittivity of the material.

 

A=[4;5;6];

B=[1;2;3];

mymaterial = addmaterial("Conductive");

setmaterial(mymaterial,"name","Aluminum");

setmaterial("Aluminum", "Anisotropy", 1); # enable diagonal anisotropy

setmaterial("Aluminum","Permittivity", A);

setmaterial("Aluminum","Conductivity", B);

?getmaterial("Aluminum","Permittivity");

result: 

4 5 6 

 

This example shows how to access raw data from a Sampled data material.

 

Note: Sampled data matrix format

The sampled data matrix has 2 or 4 columns, for isotropic or anisotropic materials

- The first column is the frequency vector, in Hz.

- The next column(s) are the complex valued permittivity.

If you want refractive index data (rather than permittivity), remember that permittivity is simply the square of the refractive index.

 

matName = "Ag (Silver) - CRC";

?getmaterial(matName);

maxCoeff = getmaterial(matName,"max coefficient");

sampledData = getmaterial(matName,"sampled data");

 

# convert sampledData matrix to refractive index

f1  = pinch(sampledData,2,1); # first column

eps = pinch(sampledData,2,2);  # second column

nk1 = sqrt(eps);

 

# use getindex command for comparison

f2 = linspace(100e12,1000e12,100);

nk2 = getindex(matName,f2);

 

plotxy(c/f1*1e6,real(nk1),

    c/f1*1e6,imag(nk1),

    c/f2*1e6,real(nk2),

    c/f2*1e6,imag(nk2),

    "wavelength (um)","refractive index");

legend("n - getmaterial",

    "k - getmaterial",

    "n - getindex",

    "k - getindex"); 

 

See Also

Material database, addmaterial, setmaterial, getindex, getfdtdindex

Copyright Lumerical Inc. | Privacy | Site Map