imat_result_danoe/partition


Purpose

Partition Data At Nodes On Elements results.

Syntax

d=partition(d,ct)

d=d.partition(ct)

[d,v]=partition(d,ct)

[~,v]=partition(d,ct,'veconly')



Description

PARTITION partitions results using the input partitioning data CT. When CT is a numeric or logical vector, PARTITION will partition the results to the indices specified in CT. This is the same as subscripting the object.

When CT is an imat_ctrace, the result will be partitioned using the nodes and directions (component locations) in CT. If not all of the entities in the coordinate trace were found, PARTITION will issue a warning.

When CT is an imat_group, the result will be partitioned to the nodes and elements specified in the group. If not all of the entities in the group were found, PARTITION will issue a warning.

When CT is a cell array containing numeric MxN matrix, PARTITION attempts to match the first N rows in this matrix to the first N rows in the component matrix. To match all of the entries in a column, use INF for that column. For example,

CT = {[1 inf 33]}

specifies that PARTITION should match all components with element 1, all nodes, and component 33. CT can contain rows both with and without INF. PARTITION will not issue a warning if not all of the entries were found.

The optional input string 'veconly' tells PARTITION to generate the output vector V only, and not create the partitioned result.

V is a logical vector of the same length as the number of rows in the component matrix containing true for rows that were kept when partitioning.

Examples

>> d = d.partition([1 2 7]);

>> d = d.partition(imat_ctrace('1x'));

>> [d,v] = d.partition({[1 inf 33; 2 2 22]});

>> [~,v] = d.partition([1 2 7],'veconly');