DVexplode_materials


Synopsis

create an array of fields from a single field based on material properties of cell
sets


module DVexplode_materials {
Mesh+Iparam &in {
nnodes+req;
xform+nonotify;
};
int+Iparam property;
int+Oparam nfld;
Cells+write+nonotify out_sets[nfld] {
*cell_set[];
ncell_sets => array_size(cell_set);
};
group out_mrgs[nfld] {
int+nres arr_ind => index_of(out_mrgs);
Mesh+Node_Data+Cell_Data+nres &out_flds =>
merge(out_sets[arr_ind],in);
};
mlink+nonotify+OPort2 out => out_mrgs.out_flds;

method+notify_val+notify_inst upd_explode_mat<status=1> =
"DVexplode_mat";
};

Description

Each cell set in a field has an associated properties array. You may use this array to
store anything related to the cell set, but it is commonly used to store material
properties of the cells in the cell set.

DVexplode_materials splits up the field into an array of fields based on the values of a particular element of the properties array. The same array index is used to look up the value in the properties array of each cell set. Each cell set with a distinct value of that property goes into a separate output field. The actual values are not significant, only whether they are equal or not. Note that this module compares floating-point numbers for equality; you are responsible for ensuring that the values in the material property array are bit-for-bit equal or not, as desired.

Input Ports

in

Mesh. This mesh is split apart into multiple meshes on the output, according to the selected property value of each cell set.

property

int. Which element of the property value array to use.

Output Ports

nfld

Number of meshes in the output array.

out

Mesh[]. An array of meshes, with other data merged from the input field.

Example

explode_materials

File

v/dv.v

See also

Not applicable.