v_sim.NodeArray¶
- Subclasses:
 
Methods¶
- Inherited:
 - Structs:
 
Virtual Methods¶
- Inherited:
 
Properties¶
Name  | 
Type  | 
Flags  | 
Short Description  | 
|---|---|---|---|
r  | 
all elements  | 
||
r  | 
total number of nodes  | 
||
r  | 
total number of original nodes  | 
Signals¶
- Inherited:
 
Name  | 
Short Description  | 
|---|---|
Gets emitted when the maskable characteristic of one element changes.  | 
|
Gets emitted when the visibility characteristic of one element changes.  | 
|
Gets emitted when the number of nodes has changed, decreasing.  | 
|
Gets emitted when the number of nodes has changed, increasing.  | 
|
Gets emitted when one or more nodes have moved, because of translations or because the user has moved them manually.  | 
Fields¶
- Inherited:
 
Name  | 
Type  | 
Access  | 
Description  | 
|---|---|---|---|
parent_instance  | 
r  | 
Class Details¶
- class v_sim.NodeArray(**kwargs)¶
 - Bases:
 - Abstract:
 No
- Structure:
 
Opaque structure representing array of nodes object.
- allocate(elements, nNodes)¶
 - Parameters:
 elements ([
v_sim.Element]) – the size of nNodes.nNodes ([
int]) – an array giving the number of nodes per element.
Reallocate the internal arrays to match elements and nNodes.
- allocateByNames(nNodesPerElement, elementNames)¶
 - Parameters:
 nNodesPerElement ([
int]) – number ofv_sim.Nodeperv_sim.Element;elementNames ([
str]) – names of elements;
This method allocates the storing part of the given
v_sim.NodeArraystructure and store all thev_sim.Nodes.
- allocateNodesForElement(eleId, nNodes)¶
 - Parameters:
 eleId (
int) – an internalv_sim.Elementid ;nNodes (
int) – a positive number of nodes.
This routine is used to allocate space for nNodes of a
v_sim.Element. Thisv_sim.Elementis identified by its internal id, seev_sim.NodeArray.getElementId(). If thisv_sim.Elementhas already enough space in this self, nothing is done, otherwise space is reallocated.New in version 3.7.
- compareElements(data2)¶
 - Parameters:
 data2 (
v_sim.NodeArray) – an otherv_sim.Dataobject.- Returns:
 Trueif the two objects contains exactly the samev_sim.Elementobjects (not one more or one less or one different),Falseotherwise.- Return type:
 
This method is used to compare the composition of the given two
v_sim.Dataobjects. The test is only done onv_sim.Elementlists.
- completeAdding()¶
 After new nodes have been added, call this routine to ensure that proper signals are emitted. See
v_sim.NodeArray.startAdding() to start a bunch addition of new nodes.New in version 3.8.
- completeMoving()¶
 After new nodes have been moved, call this routine to ensure that proper signals are emitted. See
v_sim.NodeArray.startMoving() to start a bunch movements of new nodes.New in version 3.8.
- containsElement(element)¶
 - Parameters:
 element (
v_sim.Element) – av_sim.Elementobject.- Returns:
 True, if self contains element.- Return type:
 
Tests if element is contained in self. element may be part of self but without nodes.
New in version 3.8.
- copyNode(node)¶
 - Parameters:
 node (
v_sim.Node) – a node of the givenv_sim.NodeArray.- Returns:
 the location of a newly used node.
- Return type:
 
Return the location of an unstored node that is the deep copy of the given node. The returned node is then added in the list of used nodes.
- freeNodes()¶
 Deallocate all nodes of the object and related properties but keep the object alive.
- freeProperty(key)¶
 - Parameters:
 key (
str) – the name of the property to be removed.
This method free the given property and all associated data.
- getElement(node)¶
 - Parameters:
 node (
v_sim.Node) – av_sim.Nodeof this array.- Returns:
 a
v_sim.Element, owned by V_Sim.- Return type:
 
This routine gets the
v_sim.Elementthe node belongs to.New in version 3.7.
- getElementId(element)¶
 - Parameters:
 element (
v_sim.Element) – av_sim.Elementobject.- Returns:
 a positive number or -1 if not found.
- Return type:
 
This routines returns the internal id used to represent element, or -1 if not found.
New in version 3.7.
- getFromId(number)¶
 - Parameters:
 number (
int) – an integer.- Returns:
 the found
v_sim.NodeorNoneif none corresponds to number.- Return type:
 
This methods retrieves the
v_sim.Nodeidentified by the integer number. The number must be strictly positive. No error is raised if no node corresponds to the given number.
- getNElements(physical)¶
 - 
The parameter self stores several
v_sim.Nodeofv_sim.Element. This routine is used to get the number ofv_sim.Elementthat are used by this self. Depending on physical value, the number ofv_sim.Elementrepresenting physical element or not is retrieved. The actual returned number ofv_sim.Elementtake into account only elements with a positive number of nodes.New in version 3.7.
 
- getNNodes()¶
 - Returns:
 a positive number.
- Return type:
 
This routines returns the number of
v_sim.Nodestored in self.New in version 3.7.
- getNOriginalNodes()¶
 - Returns:
 a positive number.
- Return type:
 
This routines returns the number of original
v_sim.Nodestored in self.New in version 3.7.
- getNewNode(element)¶
 - Parameters:
 element (
v_sim.Element) – av_sim.Elementobject.- Returns:
 the location of a newly used node.
- Return type:
 
Return the location of an unstored node for the given
v_sim.Element. The returned node is then added in the list of used nodes.New in version 3.8.
- getNewNodeForId(iEle)¶
 - Parameters:
 iEle (
int) – the id used in self to index av_sim.Element.- Returns:
 the location of a newly used node.
- Return type:
 
Return the location of an unstored node for the given
v_sim.Element. The returned node is then added in the list of used nodes.
- getOriginal(nodeId)¶
 - Parameters:
 nodeId (
int) – a node id.- Returns:
 the original node index or -1 if nodeId is original.
- Return type:
 
Test if the given nodeId is an original or a replica for the periodisation.
- getProperty(key)¶
 - Parameters:
 key (
str) – a string.- Returns:
 - Return type:
 
This method is used to retrieve the node property associated to the given key.
- iterNext(iter)¶
 - Parameters:
 iter (
v_sim.NodeArrayIter) – av_sim.NodeArrayIterobject.
Modify node and element internal pointers to the next node, or
Noneif none remains.
- iterNextArray(iter)¶
 - Parameters:
 iter (
v_sim.NodeArrayIter) – av_sim.NodeArrayIterobject.
Modify node and element internal pointers to the next node from the starting array, or
Noneif none remains.New in version 3.8.
- iterNextElement(iter, allowEmpty)¶
 - Parameters:
 iter (
v_sim.NodeArrayIter) – av_sim.NodeArrayIterobject ;allowEmpty (
bool) – a boolean.
Modify element internal pointer to the next element and set node to the first one, or
Noneif none remains. If allowEmpty isTrue, this iterator may return an element with no nodes, otherwise, it skips elements with no nodes.
- iterNextList(iter)¶
 - Parameters:
 iter (
v_sim.NodeArrayIter) – av_sim.NodeArrayIterobject.
Modify node and element internal pointers to the next node from the starting list, or
Noneif none remains.New in version 3.7.
- iterNextNode(iter)¶
 - Parameters:
 iter (
v_sim.NodeArrayIter) – av_sim.NodeArrayIterobject.
Modify node internal pointer to the next node, or
Noneif none remains. Contrary tov_sim.NodeArray.iterNext() it does not go to the next element if one exists.
- iterNextNodeNumber(iter)¶
 - Parameters:
 iter (
v_sim.NodeArrayIter) – av_sim.NodeArrayIterobject.
Modify node internal pointer to the next node, increasing the id of the current node. The element internal pointer is also updated accordingly. If no more nodes exist after the given one, node and element internal pointers are set to
None.
- iterNextNodeOriginal(iter)¶
 - Parameters:
 iter (
v_sim.NodeArrayIter) – av_sim.NodeArrayIterobject.
Modify node internal pointer to the next original node, or
Noneif none remains. Contrary tov_sim.NodeArray.iterNext() it does not go to the next element if one exists.New in version 3.6.
- iterNextVisible(iter)¶
 - Parameters:
 iter (
v_sim.NodeArrayIter) – av_sim.NodeArrayIterobject.
Go to the next rendered node (changing element if required).
- iterRestartNode(iter)¶
 - Parameters:
 iter (
v_sim.NodeArrayIter) – av_sim.NodeArrayIterobject.
The element internal pointer must be associated. Then, it returns the node pointer to the first node for this element.
- iterStart(iter)¶
 - Parameters:
 iter (
v_sim.NodeArrayIter) – av_sim.NodeArrayIterobject.
Initialise the node and element internal pointers for a run over the nodes.
- iterStartArray(arr)¶
 - Parameters:
 arr ([
int]) – an array of node ids to iterate on.- Returns:
 an alocated iterator.
- Return type:
 iter:
v_sim.NodeArrayIter
Set values to a
v_sim.NodeArrayIterobject to iterate over nodes of the given array.New in version 3.8.
- iterStartList(lst)¶
 - Parameters:
 lst ([
int]) – a list of node ids to iterate on.- Returns:
 an alocated iterator.
- Return type:
 iter:
v_sim.NodeArrayIter
Set values to a
v_sim.NodeArrayIterobject to iterate over nodes of the given list.New in version 3.7.
- iterStartNumber(iter)¶
 - Parameters:
 iter (
v_sim.NodeArrayIter) – av_sim.NodeArrayIterobject.
Initialise the node and element internal pointers for a run following the node oder.
- iterStartVisible(iter)¶
 - Parameters:
 iter (
v_sim.NodeArrayIter) – av_sim.NodeArrayIterobject.
Initialise the node and element internal pointers for a run over the visible nodes (see
v_sim.NodeArray.iterNextVisible).
- iterWhere(where, *data)¶
 - Parameters:
 where (
v_sim.NodeArrayIterFunc) – the function to evaluate on each node.
- Returns:
 an alocated iterator.
- Return type:
 iter:
v_sim.NodeArrayIter
Starts iter to iterate on nodes of self, when the condition defined by where evaluates to
True. iter is then to be used withv_sim.NodeArray.iterNextArray().New in version 3.8.
- iter_new()¶
 - Returns:
 an alocated iterator.
- Return type:
 iter:
v_sim.NodeArrayIter
Set values to a
v_sim.NodeArrayIterobject to iterate over nodes. Its contain is initialised with the array size (number of elements, number of nodes per element…).
- join(frag, at)¶
 - Parameters:
 frag (
v_sim.NodeArray) – anotherv_sim.NodeArrayobject.at ([
float]) – a position in cartesian coordinates.
- Returns:
 the ids of the added nodes in self.
- Return type:
 [
int]
Add all nodes from frag to self and position them centred at at.
New in version 3.8.
- moveNode(id, at)¶
 - 
Move the node id at the posityion at given in cartesian coordinates. If several nodes should be moved, consider using
v_sim.NodeArray.moveNodes() or encapsulate the calls withinv_sim.NodeArray.startMoving() andv_sim.NodeArray.completeMoving().New in version 3.8.
 
- moveNodes(ids, xyz)¶
 - Parameters:
 ids ([
int]) – a set ofv_sim.Nodeids.xyz ([
float]) – a set of cartesian displacements.
Apply translations on all nodes defined by ids. Displacements are read from xyz which is an array containing as many float triplets as nodes in ids.
New in version 3.8.
- property_newFloatArray(key, len)¶
 - Parameters:
 - Returns:
 the newly created
v_sim.NodePropertyobject or the existing one.- Return type:
 
This method creates and allocates a new area to store nodes associated data that can be retrieve with the key. These data are constant float arrays of length len.
If the property already exists, it is returned.
New in version 3.8.
- property_newInteger(key)¶
 - Parameters:
 key (
str) – a string.- Returns:
 the newly created
v_sim.NodePropertyobject.- Return type:
 
This method creates and allocates a new area to store nodes associated integer values. This is the same than
v_sim.NodeArray.property_newPointer() but for static integers instead of pointers as data.
- property_newPointer(key, freeFunc, newAndCopyFunc, *user_data)¶
 - Parameters:
 - Returns:
 the newly created
v_sim.NodePropertyobject or the existing one.- Return type:
 
This method creates and allocates a new area to store nodes associated data that can be retrieve with the key. These data are pointers on allocated memory locations. When the property is removed with the #visu_node_freePropertry (or the associated
v_sim.NodeArrayis free) the area is free and freeFunc is called for each token (orGLib.free() if freeFunc isNone).The method newAndCopyFunc is used when the number of nodes is increased, if the const
objectof theGLib.CopyFuncis notNone, then we require a copy, if it isNone, then the routine must create a new token with default values.If the property already exists, it is returned.
- removeAllDuplicateNodes()¶
 - 
Remove all nodes that are not original in the box.
 
- removeNodes(nodeNumbers)¶
 - Parameters:
 nodeNumbers ([
int]) – an array of integers (negative terminated).
Remove the given
v_sim.Nodefrom the self. The properties are also updated.
- removeNodesOfElement(element)¶
 - Parameters:
 element (
v_sim.Element) – av_sim.Elementobject.
Remove all the
v_sim.Nodefrom the element element. The properties are also updated.New in version 3.7.
- rotateNodes(ids, axis, center, angle)¶
 - Parameters:
 ids ([
int]) – a set ofv_sim.Nodeids.axis ([
float]) – an axis orientation.center ([
float]) – point coordinates.angle (
float) – an angle in degrees.
Apply the rotation defined by angle along axis passing by center to all nodes referenced in ids.
New in version 3.8.
- setElement(node, element)¶
 - Parameters:
 node (
v_sim.Node) – av_sim.Nodepointer.element (
v_sim.Element) – av_sim.Elementobject.
- Returns:
 the new location of the
v_sim.Node.- Return type:
 
Change the nature of the
v_sim.Elementof node to be element.New in version 3.8.
- setNodeVisibility(id, status)¶
 - Parameters:
 - Returns:
 Trueif visibility of node id is indeed changed.- Return type:
 
Change the visibility of node id in self. If id is out of bound, nothing is done and no error raised. If visibility is indeed changed, then
v_sim.NodeArray::VisibilityChangedsignal is emitted.New in version 3.8.
- setOriginal(nodeId)¶
 - 
Make nodeId an original node.
 
- shiftNode(id, delta)¶
 - 
Move the node id of the quantity delta given in cartesian coordinates. If several nodes should be shifted, consider using
v_sim.NodeArray.shiftNodes() or encapsulate the calls withinv_sim.NodeArray.startMoving() andv_sim.NodeArray.completeMoving().New in version 3.8.
 
- shiftNodes(ids, delta)¶
 - Parameters:
 ids ([
int]) – a set ofv_sim.Nodeids.delta ([
float]) – a shift in cartesian coordinates.
Apply delta on the coordinates of every nodes in ids.
New in version 3.8.
- startAdding()¶
 Begin to accumulate the node ids that are added to the structure. When addition is finished, call
v_sim.NodeArray.completeAdding() to ensure completion and emit signals.New in version 3.8.
- startMoving()¶
 Begin to accumulate the node ids that are moved in the structure. When moving is finished, call
v_sim.NodeArray.completeMoving() to ensure completion and emit signals.New in version 3.8.
Signal Details¶
- v_sim.NodeArray.signals.ElementMaskableChanged(node_array, ele)¶
 - Signal Name:
 ElementMaskableChanged- Flags:
 - Parameters:
 node_array (
v_sim.NodeArray) – The object which received the signalele (
v_sim.Element) – thev_sim.Elementthat has its visibility changed
Gets emitted when the maskable characteristic of one element changes.
New in version 3.8.
- v_sim.NodeArray.signals.ElementVisibilityChanged(node_array, ele)¶
 - Signal Name:
 ElementVisibilityChanged- Flags:
 - Parameters:
 node_array (
v_sim.NodeArray) – The object which received the signalele (
v_sim.Element) – thev_sim.Elementthat has its visibility changed
Gets emitted when the visibility characteristic of one element changes.
New in version 3.8.
- v_sim.NodeArray.signals.PopulationDecrease(node_array, ids)¶
 - Signal Name:
 PopulationDecrease- Flags:
 - Parameters:
 node_array (
v_sim.NodeArray) – The object which received the signalids ([
int]) – an array ofv_sim.Nodeids.
Gets emitted when the number of nodes has changed, decreasing. ids contains all removed ids. When emitted, nodes have already been removed, so no external routines should keep pointers on these nodes.
New in version 3.4.
- v_sim.NodeArray.signals.PopulationIncrease(node_array, ids)¶
 - Signal Name:
 PopulationIncrease- Flags:
 - Parameters:
 node_array (
v_sim.NodeArray) – The object which received the signalids ([
int]) – an array ofv_sim.Nodeids.
Gets emitted when the number of nodes has changed, increasing. ids contains all new ids.
New in version 3.4.
- v_sim.NodeArray.signals.position_changed(node_array, ids)¶
 - Signal Name:
 position-changed- Flags:
 - Parameters:
 node_array (
v_sim.NodeArray) – The object which received the signal
Gets emitted when one or more nodes have moved, because of translations or because the user has moved them manually.
New in version 3.2.
Property Details¶
- v_sim.NodeArray.props.elements¶
 - Name:
 elements- Type:
 - Default Value:
 - Flags:
 
all elements
- v_sim.NodeArray.props.n_nodes¶
 - 
total number of nodes