The Group object is useful for archiving entity sets if there are a small number of sets and the sets are therefore dense. Internally a Group object allocates a slot for each entity, such as the total number of nodes or elements, in the model. The total memory required for set storage will be proportional to the number of groups and this memory could be large for a large number of groups.
The IdTran object is useful for archiving entity sets if there are a large number of sets and the sets are therefore sparse. Internall an IdTran object allocates a slot for each entity in the set. If the sets are disjoint, the total memory required for set storage will be generally bounded by the total number of entities in the model.
Users of a Group object may set or query for active entities. The Group module also supports Boolean operations so that entity subsets may be combined, intersected, copied, etc. Normally the active entities in a Group object are set by a function in another module such as vis_ConnectFaceGroup in the Connect module. The functions associated with a Group object are the following.
*vis_GroupBegin - create an instance of a Group object vis_GroupEnd - destroy an instance of a Group object vis_GroupError - return Group object error flag vis_GroupCopy - copy a Group
vis_GroupNode - query for active node vis_GroupElem - query for active element vis_GroupElemEnt - query for active element edge or face vis_GroupAll - set all entities active Clear - set all entities inactive Complement - reverse entity activities vis_GroupBoolean - perform Boolean operations vis_GroupCount - count active entities vis_GroupDef - define parent and child entities Inq - inquire parent and child entities vis_GroupIdTran - convert IdTran object vis_GroupInitIndex - initialize NextIndex function NextIndex - get next active entity index vis_GroupSetIndex - set entity as active or inactive GetIndex - get entity activity by index vis_GroupSetIndices - set entities as active or inactive vis_GroupNumEntFlag - get number of entity flags by index vis_GroupSetEntFlag - set entity flag by index and number GetEntFlag - get entity flag by index and number vis_GroupSetName - set name string GetName - get name string vis_GroupSetType - set type GetType - get type vis_GroupSetSpec - set specific type GetSpec - get specific type
The actual data structures used to hold active entity flags are private to the Group object. The user accesses active entities in a Group using a suite of functions. These functions fall into three basic categories, (1) query for the activity flags of a particular entity by index, (2) query for the activity flag of a particular entity by index and edge or face number, (3) query for the index of the "next" active entity.
The activity flags which are returned for basic element and node entities, using vis_GroupGetIndex for example, are returned as the low order bit in an integer data type (Vint). For non polygonal or polyhedral finite element shapes the flags for element faces are returned encoded as the low order 6 bits in an integer. Each bit set indicates that the associated element face (numbered 1 to 6 in a hexahedron for example) is active. The flags for element edges are returned encoded as the low order 12 bits in an integer. Each bit set indicates that the associated element edge (numbered 1 to 12 in a hexahedron for example) is active. For polygonal and polyhedral shapes (VIS_SHAPEPOLYGON and VIS_SHAPEPOLYHED) the integer activity index only encodes the activity flags for the first 32 edges or faces. The function vis_GroupGetEntFlag has been designed to query any activity flag individually by index and edge or face number.
The functions vis_GroupNode, vis_GroupElem, and vis_GroupElemEnt are designed to test for activity flag(s) and return the flag as the return value of the function.
Boolean and other operations on Group objects may be performed using vis_GroupAll, vis_GroupClear, vis_GroupCopy, vis_GroupBoolean and vis_GroupComplement. The vis_GroupIdTran function may be used to convert an ordered list of identifiers in an IdTran object into a set of active entity flags in a Group object.
As a convenience, a name string may be associated with the Group object using vis_GroupSetName. The functions vis_GroupSetType, vis_GroupGetType and vis_GroupSetSpec, vis_GroupGetSpec may be used to set useful integer data which describe the general and specific types of the group. These integers are usually set to the values associated with the element associations VIS_FEATYPE and VIS_FEASPEC respectively.
*vis_GroupBegin - create an instance of a Group object
vis_Group *vis_GroupBegin ()
None
Destroy an instance of a Group object using
void vis_GroupEnd (vis_Group *group)
Return the current value of a Group object error flag using
Vint vis_GroupError (vis_Group *group)
Make a copy of a Group object. The private data from the fromgroup object is copied to the group object. Any previous private data in group is lost.
void vis_GroupCopy (vis_Group *group, vis_Group *fromgroup)
vis_GroupNode - query for active node
Vint vis_GroupNode (vis_Group *group, Vint index)
index Index of entity
vis_GroupElem - query for active element
Vint vis_GroupElem (vis_Group *group, Vint index)
index Index of entity
vis_GroupElemEnt - query for active element edge or face
Vint vis_GroupElemEnt (vis_Group *group, Vint index, Vint no)
index Index of entity no Element edge or face number
vis_GroupAll,vis_GroupClear,vis_GroupComplement - unary group operations
void vis_GroupAll (vis_Group *group) void vis_GroupClear (vis_Group *group) void vis_GroupComplement (vis_Group *group)
group Pointer to Group object.
None
vis_GroupBoolean - perform binary Boolean group operations
void vis_GroupBoolean (vis_Group *group, Vint oper, vis_Group *groupsrc)
group Pointer to Group object. oper Boolean operation to perform =GROUP_DELETE Delete groupsrc from group. =GROUP_INSERT Insert groupsrc in group. =GROUP_MASK Mask groupsrc from group. =GROUP_SET Copy groupsrc to group. groupsrc Pointer to source Group object.
None
vis_GroupCount - count active entities in a group
void vis_GroupCount (const vis_Group *group, Vint *nparent, Vint *nchild)
group Pointer to Group object.
nparent Number of currently active parent entities nchild Number of currently active child entities
vis_GroupDef - define parent and child entities
void vis_GroupDef (vis_Group *group, Vint nument, Vint parenttype, Vint childtype)
group Pointer to Group object. nument Number of parent entities parenttype Type of parent entity =SYS_ELEM Element type =SYS_NODE Node type childtype Type of child entity. =SYS_NONE No child entity =SYS_FACE Face type =SYS_EDGE Edge type
None
Inquire of defined nument, parenttype and childtype as output arguments. The value of nument is the maximum index referenced by vis_GroupDef or vis_GroupSetIndex.
void vis_GroupInq (const vis_Group *group, Vint *nument, Vint *parenttype, Vint *childtype)
vis_GroupIdTran - convert an IdTran object to a Group object
void vis_GroupIdTran (vis_Group *group, vis_IdTran *idtran)
group Pointer to Group object. idtran Pointer to IdTran object.
None
vis_GroupInitIndex,vis_GroupNextIndex - initialize and get next active entity
void vis_GroupInitIndex (vis_Group *group) void vis_GroupNextIndex (vis_Group *group, Vint *index, Vint *flags)
group Pointer to Group object.
index Index of entity flags Activity flag(s) of entity.
vis_GroupSetIndex - set entity as active or inactive
void vis_GroupSetIndex (vis_Group *group, Vint index, Vint flags)
group Pointer to Group object. index Index of entity to set activity flags Activity flag(s) of entity.
None
Get flags as an output argument.
void vis_GroupGetIndex (const vis_Group *group, Vint index, Vint *flags)
vis_GroupSetIndices - set entities as active or inactive
void vis_GroupSetIndices (vis_Group *group, Vint nix, Vint indices[], Vint flags)
group Pointer to Group object. nix Number of indices indices Indices of entities to set activity flags Activity flag(s) of entities.
None
vis_GroupNumEntFlag - get number of entity flags by index
void vis_GroupNumEntFlag (vis_Group *group, Vint index, Vint *numno, Vint *maxno);
group Pointer to Group object. index Index of entity to set activity flag
numno Number of set element edges or faces. maxno Maximum element edge or face set.
vis_GroupSetEntFlag - set entity flag by index and number
void vis_GroupSetEntFlag (vis_Group *group, Vint index, Vint no, Vint flag)
group Pointer to Group object. index Index of entity to set activity flag no Element edge or face number flag Activity flag of entity.
None
Get flag as an output argument.
void vis_GroupGetEntFlag (const vis_Group *group, Vint index, Vint no, Vint *flag)
vis_GroupSetName - set name string
void vis_GroupSetName (vis_Group *group, Vchar *name)
group Pointer to Group object. name Name string
None
Get name as an output argument.
void vis_GroupGetName (const vis_Group *group, Vchar name[])
vis_GroupSetType - set type
void vis_GroupSetType (vis_Group *group, Vint type)
group Pointer to Group object. type Integer general type
None
Get type as an output argument.
void vis_GroupGetType (const vis_Group *group, Vint *type)
vis_GroupSetSpec - set specific type
void vis_GroupSetSpec (vis_Group *group, Vint spec)
group Pointer to Group object. spec Integer specific type
None
Get spec as an output argument.
void vis_GroupGetSpec (const vis_Group *group, Vint *spec)
The IdTran module can also be used to store sets of nodes and elements, including element entities such as element faces and edges. Functions are provided to store and query for set names, integer identifier, etc. The functions associated with a IdTran object are the following.
*vis_IdTranBegin - create an instance of a IdTran object vis_IdTranEnd - destroy an instance of a IdTran object vis_IdTranError - return IdTran object error flag vis_IdTranCopy - copy a IdTran
vis_IdTranClear - clear all identifiers for all entities vis_IdTranCount - count number of defined identifiers vis_IdTranDef - define initial number of entities Inq - inquire of number of entities vis_IdTranDelete - delete all set objects vis_IdTranEquId - set equivalent id vis_IdTranEquSweep - sweep equivalent ids vis_IdTranEquReNumber - renumber equivalent ids vis_IdTranGroup - convert Group object vis_IdTranIndex - get entity index given identifier vis_IdTranIndices - get entity indices given identifiers vis_IdTranAllIndex - get all entity indices given identifier vis_IdTranNumIndex - get number of entity indices given identifier vis_IdTranMatch - check for matching IdTran objects vis_IdTranAddId - add entity identifier vis_IdTranAddThruByIds - add list of entity identifiers vis_IdTranSetEnt - set entity face or edge number GetEnt - get entity face or edge number GetEnts - get entity face or edge numbers vis_IdTranSetEntType - set entity number type GetEntType - get entity number type vis_IdTranSetId - set entity identifier GetId - get entity identifier given index GetIds - get entity identifiers given indices vis_IdTranSetName - set name string GetName - get name string vis_IdTranSetSpec - set finite element specific type GetSpec - get finite element specific type vis_IdTranSetType - set finite element type GetType - get finite element type vis_IdTranSetUProp - set UProp object GetUProp - get UProp object vis_IdTranUnique - generate unique identifiers
Next the index-identifier mapping must be defined. Use a call to vis_IdTranSetId for each entity identifier. The order in which the indices are defined is immaterial. Identifiers may be mapped to indices either one at a time or in a set using vis_IdTranIndex and vis_IdTranIndices respectively. Use vis_IdTranGetId and vis_IdTranGetIds to map indices to identifiers. The index-identifier mapping may be changed at any time using vis_IdTranSetId, however before the reverse mapping may be queried using vis_IdTranIndex and vis_IdTranIndices, the IdTran object must analyze the index-identifier mapping which is a potentially computationally expensive operation. If there are entities with duplicate identifiers then the functions vis_IdTranNumIndex and vis_IdTranAllIndex may be used to get a list of entities which share a given identifier.
The IdTran object may be used to store and query node and element and element face and edge sets. Each element face or edge is characterized by the element identifier and face or edge number. In the case of element face and edge sets, use the function vis_IdTranSetEnt to set the face or edge number associated with an element. The element identifier must have been previously defined for an index using vis_IdTranSetId. Note that if several element faces or edges are to be set for a single element, an index with the element identifier must be specified first for each face or edge.
As an option, the IdTran object can be used to store and query auxiliary set information. Use vis_IdTranSetEntType and vis_IdTranGetEntType to store the entity type (node or element) and subtype (none, face, edge). The functions vis_IdTranSetType and vis_IdTranSetSpec are designed to store the element type, VIS_FEATYPE and element specific, VIS_FEASPEC associations which may characterize the set. Use vis_IdTranGetType and vis_IdTranGetSpec to query this information. This auxiliary information has no effect on the operation of the IdTran object, it is only for the user to store and query.
The IdTran object may also be used to manage identifier equivalencing using the functions IdTranClear, IdTranEquId, IdTranEquSweep and IdTranEquReNumber. The IdTran object should be initially cleared (all identifiers set to zero) using IdTranClear. Identifier equivalences are then entered pair by pair using IdTranEquId. After the last equivalenced pair are entered, sweep the equivalences using IdTranEquSweep. This function will ensure that all equivalenced identifiers point to the lowest common equivalenced index. The lowest common equivalenced identifiers and all other index identifiers will be zero. Use IdTranEquReNumber to renumber all the identifiers starting from one.
The vis_IdTranGroup function may be used to convert the set of active entity flags in a Group object to an ordered list of identifiers in an IdTran object.
As a convenience, a name string may be associated with the IdTran object using vis_IdTranSetName.
*vis_IdTranBegin - create an instance of an IdTran object
vis_IdTran *vis_IdTranBegin ()
None
Destroy an instance of a IdTran object using
void vis_IdTranEnd (vis_IdTran *connect)
Return the current value of a IdTran object error flag using
Vint vis_IdTranError (vis_IdTran *connect)
Make a copy of a IdTran object. The private data from the fromidtran object is copied to the IdTran object. Any previous private data in idtran is lost.
void vis_IdTranCopy (vis_IdTran *idtran, vis_IdTran *fromidtran)
vis_IdTranClear - clear identifiers to zero for all entities
void vis_IdTranClear (vis_IdTran *idtran)
idtran Pointer to IdTran object.
None
vis_IdTranCount - count the number of defined identifiers
void vis_IdTranCount (vis_IdTran *idtran, Vint type, Vint *num)
idtran Pointer to IdTran object. type Type of count to return =IDTRAN_MAXINDEX Maximum index set =IDTRAN_NUMINDICES Number of non-zero identifiers =IDTRAN_NUMUNIQUE Number of unique identifiers
num Number of indices
vis_IdTranDef - define number of entities
void vis_IdTranDef (vis_IdTran *idtran, Vint nument)
idtran Pointer to IdTran object. nument Number of entities
None
Inquire of defined nument or the maximum index for which an identifier has been defined using vis_IdTranSetId, as an output argument using
void vis_IdTranInq (const vis_IdTran *idtran, Vint *nument)
vis_IdTranDelete - delete all set objects
void vis_IdTranDelete (vis_IdTran *idtran)
idtran Pointer to IdTran object.
None
vis_IdTranEquId - set equivalent id
void vis_IdTranEquId (vis_IdTran *idtran, Vint index, Vint id)
idtran Pointer to IdTran object. index Index of entity to set identifier id Entity identifier
None
vis_IdTranEquSweep - sweep equivalent ids
void vis_IdTranEquSweep (vis_IdTran *idtran)
idtran Pointer to IdTran object.
None
vis_IdTranEquReNumber - renumber equivalent ids
void vis_IdTranEquReNumber (vis_IdTran *idtran, Vint *num)
idtran Pointer to IdTran object.
num Number of unique ids None
vis_IdTranGroup - convert a Group object to an IdTran object
void vis_IdTranGroup (vis_IdTran *idtran, vis_Group *group)
idtran Pointer to IdTran object. group Pointer to Group object.
None
vis_IdTranIndex,vis_IdTranIndices - get entity index or indices
void vis_IdTranIndex (vis_IdTran *idtran, Vint id, Vint *index) void vis_IdTranIndices (vis_IdTran *idtran, Vint nids, Vint ids[], Vint indices[])
idtran Pointer to IdTran object. nids Number of entity id translations to perform id Entity id for which to return entity index ids Array of entity ids for which to return entity indices
index Entity index indices Array of entity indices
vis_IdTranNumIndex - get number of entity indices given identifier
void vis_IdTranNumIndex (vis_IdTran *idtran, Vint id, Vint *num)
idtran Pointer to IdTran object. id Entity id for which to return number of entity indices
num Number of entity indices
vis_IdTranAllIndex - get all entity indices given identifier
void vis_IdTranNumIndex (vis_IdTran *idtran, Vint id, Vint *num) Vint indices[])
idtran Pointer to IdTran object. id Entity id for which to return number of entity indices
num Number of entity indices indices Array of entity indices
vis_IdTranMatch - check for matching IdTran objects
void vis_IdTranMatch (vis_IdTran *idtran, vis_IdTran *idtranm, Vint *flag)
idtran Pointer to IdTran object. idtranm Pointer to IdTran object.
flag Matching flag =SYS_OFF Not matching =SYS_ON Matching
vis_IdTranAddId - add entity identifier
void vis_IdTranAddId (vis_IdTran *idtran, Vint id)
idtran Pointer to IdTran object. id Entity identifier
None
vis_IdTranAddThruByIds - add list of entity identifiers
void vis_IdTranAddThruByIds (vis_IdTran *idtran, Vint num, Vint listids[])
idtran Pointer to IdTran object. num Number of entries in listids. listids Entity list
None
5,7,IDTRAN_THRU,11,20,25,IDTRAN_THRU,29,IDTRAN_BY,2,3generates the following series of identifiers.
5,7,8,9,10,11,20,25,27,29,3
vis_IdTranSetEnt - set entity face or edge number
void vis_IdTranSetEnt (vis_IdTran *idtran, Vint index, Vint no)
idtran Pointer to IdTran object. index Index of entity to set identifier no Element face or edge number
None
Get a single no associated with an index as an output argument.
void vis_IdTranGetEnt (const vis_IdTran *idtran, Vint index, Vint *no)
Get a set of nos associated with a set of indices where nindices is the number of indices.
void vis_IdTranGetEnts (const vis_IdTran *idtran, Vint nindices, Vint indices[], Vint nos[])
vis_IdTranSetEntType - set entity number type
void vis_IdTranSetEntType (vis_IdTran *idtran, Vint parenttype, Vint childtype)
idtran Pointer to IdTran object. parenttype Type of parent entity =SYS_ELEM Element type =SYS_NODE Node type childtype Type of child entity. =SYS_NONE No child entity =SYS_FACE Face type =SYS_EDGE Edge type
None
Inquire parenttype and childtype as output arguments.
void vis_IdTranGetEntType (vis_IdTran *idtran, Vint *parenttype, Vint *childtype)
vis_IdTranSetSpec - set finite element specific type
void vis_IdTranSetSpec (vis_IdTran *idtran, Vint spec)
idtran Pointer to IdTran object. spec Finite element specific type
None
Inquire spec as an output argument.
void vis_IdTranGetSpec (vis_IdTran *idtran, Vint *spec)
vis_IdTranSetType - set finite element type
void vis_IdTranSetType (vis_IdTran *idtran, Vint type)
idtran Pointer to IdTran object. type Finite element type
None
Inquire type as an output argument.
void vis_IdTranGetType (vis_IdTran *idtran, Vint *type)
vis_IdTranSetId - set entity index and associated identifier
void vis_IdTranSetId (vis_IdTran *idtran, Vint index, Vint id)
idtran Pointer to IdTran object. index Index of entity to set identifier id Entity identifier
None
Get a single id associated with an index as an output argument.
void vis_IdTranGetId (const vis_IdTran *idtran, Vint index, Vint *id)
Get a set of ids associated with a set of indices where nindices is the number of indices. The array arguments indices and ids may be safely used as the same array.
void vis_IdTranGetIds (const vis_IdTran *idtran, Vint nindices, Vint indices[], Vint ids[])
Note that there is no error checking for the validity of the index or indices input to the vis_IdTranGetId and vis_IdTranGetIds functions.
vis_IdTranSetName - set name string
void vis_IdTranSetName (vis_IdTran *idtran, Vchar *name)
idtran Pointer to IdTran object. name Name string
None
Get name as an output argument.
void vis_IdTranGetName (const vis_IdTran *idtran, Vchar name[])
vis_IdTranSetUProp - set UProp object
void vis_IdTranSetUProp (vis_IdTran *idtran, vis_UProp *uprop)
idtran Pointer to IdTran object. uprop Pointer to UProp object.
None
Inquire uprop as an output argument.
void vis_IdTranGetUProp (vis_IdTran *idtran, vis_UProp **uprop)
vis_IdTranUnique - generate unique identifiers
void vis_IdTranUnique (vis_IdTran *idtran, vis_IdTran *fromidtran)
idtran Pointer to IdTran object. fromidtran Pointer to IdTran object.
None