CreateDiscMaterial

function CreateDiscMaterial(filename, data, mat_db, mesh)

Full definition:

function CreateDiscMaterial(filename, data, mat_db, mesh)

Create the discrete material hdf5 file (version 2) usable by AddDiscMaterial

Note: This function currently requires Matlab. Octave is missing the necessary hdf5 write functions.

arguments:

  • filename: hdf5 file to create (must not exist)

  • data: voxel based index data, index as used in mat_db-1

  • mat_db: material database

  • mesh: used voxel mesh. Note size is size(data)+[1 1 1]

example:

mat_db.epsR    = [1     3      4];    %relative permittivity
mat_db.kappa   = [0     0.2    0.4];  %electric conductivity (S/m)
mat_db.density = [0     1000   1010]; %material density (kg/m³)
mat_db.Name    = {'Background','mat2','mat3'};

data = [0 1 0; 2 1 2; 0 1 0];   % 3x3x3 data
mesh.x = [0    0.1 0.2 0.3];    % 4 mesh lines in x-dir (3 cells)
mesh.y = [-0.1 0   0.1 0.2];    % 4 mesh lines in y-dir (3 cells)
mesh.z = [0    0.4 0.8 1.2];    % 4 mesh lines in z-dir (3 cells)

CreateDiscMaterial('test_mat.h5', data, mat_db, mesh);

See also AddDiscMaterial


author: Thorsten Liebig (2013)