Workspace 6.21.5
|
Defines a node in (x,y,z) space with an ID. The node also has state info. More...
#include <Mesh/DataStructures/node.h>
Public Types | |
enum | { inflowBoundary = flag3 , modified1 = flag4 , modified2 = flag5 , merge = flag6 , surface = flag7 , processed = flag8 } |
Public Types inherited from NumberedObject | |
enum | { flag0 , flag1 , flag2 , flag3 , flag4 , flag5 , flag6 , flag7 , flag8 , flag9 , flag10 , flag11 , flag12 , flag13 , flag14 , flag15 } |
Public Member Functions | |
Node (long IDnum, const Vector3d &v) | |
Node (long IDnum, double X, double Y, double Z) | |
~Node () | |
void | addToPosition (const Vector3d &v) |
void | AddToPosition (const Vector3d &v) |
Vector3d | calcNormal () const |
void | checkAttached () |
void | clearAttachments () |
Attachments * | getAttachments () |
Attachments * | GetAttachments () |
Attachments * | getAttachments () const |
Attachments * | GetAttachments () const |
Node * | getClosestAttachedNode () const |
const Vector3d & | getPosition () const |
const Vector3d & | GetPosition () const |
bool | hasAttachments () const |
bool | HasAttachments () const |
void | rebuildAttachedNodesFromElements () |
void | setPosition (const Vector3d &v) |
void | SetPosition (const Vector3d &v) |
void | setPositionX (double x) |
void | SetPositionX (double x) |
void | setPositionY (double y) |
void | SetPositionY (double y) |
void | setPositionZ (double z) |
void | SetPositionZ (double z) |
void | sortAttachedShellElements () |
Public Member Functions inherited from NumberedObject | |
NumberedObject (long ID) | |
Create an object with the specified ID and all flags except isValid not set. | |
void | clearFlag (unsigned flag) |
Clear flag. Do not use this to manipulate the isValid flag, since list managers are responsible for that. | |
void | copyFlags (const NumberedObject &t) |
long | getID () const |
long | getIndex () const |
bool | isFlagSet (unsigned flag) const |
bool | isValid () const |
void | setFlag (unsigned flag, bool b=true) |
Set flag to b. Do not use this to manipulate the isValid flag, since list managers are responsible for that. | |
void | setID (long ID) |
void | setIndex (long i) |
void | SetID (long ID) |
long | GetID () const |
void | SetIndex (long i) |
long | GetIndex () const |
bool | IsFlagSet (unsigned flag) const |
void | ClearFlag (unsigned flag) |
void | SetFlag (unsigned flag) |
void | setFlagTo (unsigned flag, bool b=true) |
void | SetFlagTo (unsigned flag, bool b=true) |
bool | IsValid () const |
Public Member Functions inherited from State | |
State (unsigned stateSize, unsigned integerDataSize) | |
~State () | |
void | addToIntegerData (int index, long val) |
void | addToState (int index, const Vector3d &v) |
void | addToState (int index, double val) |
void | copyIntegerData (int index, const State &s) |
void | copyState (int index, const State &s) |
void | copyStateVector (int index, const State &s) |
long | getIntegerData (int index) const |
double | getState (int index) const |
Vector3d | getStateVector (int index) const |
void | setIntegerData (int index, long val) |
void | setState (int index, const Vector3d &v) |
void | setState (int index, double val) |
void | CopyIntegerData (int index, const State &s) |
void | AddToIntegerData (int index, long val) |
void | SetIntegerData (int index, long val) |
long | GetIntegerData (int index) const |
void | CopyStateVector (int index, const State &s) |
void | CopyState (int index, const State &s) |
void | AddToState (int index, const Vector3d &v) |
void | AddToState (int index, double val) |
double | GetState (int index) const |
Vector3d | GetStateVector (int index) const |
void | SetState (int index, double val) |
void | SetState (int index, const Vector3d &v) |
Additional Inherited Members | |
Related Functions inherited from NumberedObject | |
int | bitMask (unsigned pos) |
A Node should only be created by a NodeList object. Similarly, the nature of the node's state or integer data should only be changed by a NodeList object, although the state or integer data itself can be modified by other things.
Node | ( | long | IDnum, |
double | X, | ||
double | Y, | ||
double | Z | ||
) |
IDnum | ID number of the new node. You should avoid duplicating node ID numbers within a model. Same ID numbers in different models is okay though. |
X | X co-ordinate. |
Y | Y co-ordinate. |
Z | Z co-ordinate. |
This constructor creates a node with no state arrays defined. Calling any function related to node state the constructed object will lead to undefined results. You should only use this constructor if all you need is position and ID information or if you want to create a temporary element and need some equally temporary nodes for it.
IDnum | ID number of the new node. You should avoid duplicating node ID numbers within a model. Same ID numbers in different models is okay though. |
v | (X,Y,Z) co-ordinates. |
This constructor creates a node with no state arrays defined. Calling any function related to node state the constructed object will lead to undefined results. You should only use this constructor if all you need is position and ID information or if you want to create a temporary element and need some equally temporary nodes for it.
~Node | ( | ) |
|
inline |
v | The vector to add to the current location of the node. |
|
inline |
Vector3d calcNormal | ( | ) | const |
The node normal is calculated as an angle-weighted average of the attached shell elements' normals. The angle weighting is achieved by multiplying each normal by the vertex angle formed at this node. When the node normal vector is scaled to unit length, the angle-weighting has already been conveniently incorporated.
ThinWedgeError | Shell elements attached to the node have directly opposing normal vectors. This can only arise when the geometry is effectively an infinitely thin wedge (ie zero wedge angle). |
void checkAttached | ( | ) |
This function checks the attached shell elements and nodes of this node to determine if the geometry is physically meaningful. If there is more than one free edge at this node, then an error is flagged. This would indicate geometry that could not be physically built (multiple spikes coming together at a point). It will also detect if two or more surfaces are coming together at this node. This is evidenced by more than two shell elements sharing a node pair.
This function also calls sortAttachedShellElements() as the last thing it does. This does most of the error checking as a by-product of sorting the attached shell element list into the correct order.
DuplicateElementError | Two or more shell elements use the same nodes, of which this node is one. The element normal directions are not necessarily in the same direction. |
SurfaceIntersectError | At least one edge attached to the node is shared by more than two shell elements. |
InconsistentSurfaceNormalsError | Shell elements attached to the node do not have consistent normal vectors (ie neighbouring shells have positive normal vectors on opposite sides). |
MultipleFreeEdgesError | There can be at most two free edges attached to any given node. If there are more, the surface has a point connection between different surfaces, and this is typically not meaningful. Such geometry can usually be modified by either breaking off one of the surfaces from this node, or by adding an extra shell element(s) to fill in the gap and reduce the number of free edges. |
void clearAttachments | ( | ) |
Deletes the existing attachments object, regardless of whether it is empty or not.
Attachments * getAttachments | ( | ) |
|
inline |
Attachments * getAttachments | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
Node * getClosestAttachedNode | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
void rebuildAttachedNodesFromElements | ( | ) |
Calling this function rebuilds the attached nodes list using the attached elements list. This allows the caller to set the attached elements list to what they want, then call this function to easily get an attached nodes list to match. It also allows the attached node list to be updated whenever an attached element is removed. Because elements can share nodes, removing an element doesn't necessarily mean all its nodes will be removed from attached node lists. The only way to reliably update the attached node list is to rebuild it from scratch by re-attaching all attached elements' nodes.
|
inline |
v | The new location of the node. |
|
inline |
|
inline |
x | The new X co-ordinate of the node. |
|
inline |
|
inline |
y | The new Y co-ordinate of the node. |
|
inline |
|
inline |
z | The new Z co-ordinate of the node. |
|
inline |
void sortAttachedShellElements | ( | ) |
When the function exits, the elements in the attached shell element list will be ordered clockwise when looking along the direction of the node normal. If there is a free edge at this node, then the first and last elements in the list are on the edge and therefore do not share a node pair.
This function is typically called many times, particularly by cleanup routines. Although its name suggests that its primary purpose is to sort the attached element list, the process by which this is done conveniently uncovers most geometry errors. It is for this by-product that many calls to sortAttachedElements() are made. Bad performance of this function will typically hurt overall application performance quite strongly.
DuplicateElementError | Two or more shell elements use the same nodes, of which this node is one. The element normal directions are not necessarily in the same direction. |
SurfaceIntersectError | At least one edge attached to the node is shared by more than two shell elements. |
InconsistentSurfaceNormalsError | Shell elements attached to the node do not have consistent normal vectors (ie neighbouring shells have positive normal vectors on opposite sides). |
MultipleFreeEdgesError | There can be at most two free edges attached to any given node. If there are more, the surface has a point connection between different surfaces, and this is typically not meaningful. Such geometry can usually be modified by either breaking off one of the surfaces from this node, or by adding an extra shell element(s) to fill in the gap and reduce the number of free edges. |