Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Node Class Reference

This class encapsulate a node over a window manifold. More...

#include <Manifold_2.h>

Collaboration diagram for Node:

Public Types

enum  FlagType { e_unset_flag = -1 }
 

Public Member Functions

 Node ()
 Default constructor. More...
 
 Node (const Pane_manifold_2 *pm, int vid, Access_Mode mode)
 Construct a Node object from a pane manifold and its node ID. More...
 
Halfedge halfedge () const
 Get an incident halfedge originated from the node. More...
 
const Pane_manifold_2pane_manifold () const
 Obtain the pane manifold that owns the edge. More...
 
const COM::Pane * pane () const
 Obtain the owner Pane_manifold_2 of the node. More...
 
int id () const
 Obtain the node ID within its Pane_manifold_2. More...
 
const Point_3< Real > & point () const
 Obtain the coordinates of a node. More...
 
const void * addr (const COM::Attribute *attr) const
 Obtain the address of an attribute associated with the node. More...
 
const COM::Attribute * attr (const COM::Attribute *a) const
 Obtain the attribute on the parent pane of the node. More...
 
bool is_border () const
 Is the node on the physical boundary? More...
 
bool is_isolated () const
 Is the node isolated? More...
 
bool is_primary () const
 Is the node a primary? More...
 
Node get_primary () const
 Get the primary copy of the node. More...
 
bool coincide (const Node &n) const
 Check whether the current node coincide with the given node. More...
 
bool operator== (const Node &n) const
 Are two nodes the same? More...
 
bool operator!= (const Node &n) const
 Are two nodes different? More...
 
bool operator< (const Node &n) const
 Does the current node has a smaller ID then the given node? More...
 
 Node ()
 
 Node (MVec pos)
 
 Node (MVec pos, int flag)
 
 ~Node ()
 
void setID (int theID)
 
int getID ()
 
void setPosition (MVec pos)
 
MVec getPosition ()
 
void addFace (Face *face)
 
void removeFace (Face *face)
 
int getNumFaces ()
 retrieves the number of faces currently associated with this node. More...
 
FacegetFace (int Index)
 Retrieves a pointer to the face referenced by the supplied index that is associated with this node, i.e., if there are 3 faces associated with this node (use getNumFaces), then index should run from 0 to 2. More...
 
Face ** getAllFaces ()
 Retrieves a pointer to the internal array of faces associated with this node. More...
 
void addElement (Element *elem)
 
void removeElement (Element *elem)
 
int getNumElements ()
 retrieves the number of elements currently associated with this node. More...
 
ElementgetElement (int Index)
 Retrieves a pointer to the element referenced by the supplied index that is associated with this node, i.e., if there are 3 elements associated with this node (use getNumElements), then index should run from 0 to 2. More...
 
Element ** getAllElements ()
 Retrieves a pointer to the internal array of elements associated with this node. More...
 
FacesharedFace (Node *n2, Node *n3, Node *n4=0)
 
NodegetNext ()
 
void addNextLink (Node *link)
 
boolean separate (Mesh *mesh, FaceList *list, int new_material)
 
int getFlag () const
 
void setFlag (int flag)
 

Protected Attributes

const Pane_manifold_2_pm
 
int _vID
 
Access_Mode _mode
 

Private Member Functions

ElementListgetSeparateElements (FaceList *list)
 

Private Attributes

MVec d_position
 
int d_ID
 
int d_flag
 
Noded_nextNode
 
Face ** d_faces
 
int d_faceArraySize
 
int d_numFaces
 
Element ** d_elements
 
int d_elementArraySize
 
int d_numElements
 

Friends

istream & operator>> (istream &stream, Node &n)
 
ostream & operator<< (ostream &stream, Node &n)
 

Detailed Description

This class encapsulate a node over a window manifold.

Definition at line 370 of file Manifold_2.h.

Member Enumeration Documentation

enum FlagType
Enumerator
e_unset_flag 

Definition at line 15 of file Node.hpp.

15  {
16  e_unset_flag = -1
17  };

Constructor & Destructor Documentation

Node ( )
inline

Default constructor.

Definition at line 373 of file Manifold_2.h.

Referenced by separate().

373 : _pm(NULL), _vID(0), _mode( ACROSS_PANE) {}
Access_Mode _mode
Definition: Manifold_2.h:442
int _vID
Definition: Manifold_2.h:441
const Pane_manifold_2 * _pm
Definition: Manifold_2.h:440

Here is the caller graph for this function:

Node ( const Pane_manifold_2 pm,
int  vid,
Access_Mode  mode 
)
inline

Construct a Node object from a pane manifold and its node ID.

Definition at line 376 of file Manifold_2.h.

377  : _pm( pm), _vID( vid), _mode( mode) {}
Access_Mode _mode
Definition: Manifold_2.h:442
int _vID
Definition: Manifold_2.h:441
const Pane_manifold_2 * _pm
Definition: Manifold_2.h:440
Node ( )
Node ( MVec  pos)

Definition at line 23 of file Node.cpp.

23  :
24 d_position( pos ),
25 d_ID(-1),
27 d_nextNode (this),
29 d_numFaces(0),
32 {}
int d_flag
Definition: Node.hpp:102
Node * d_nextNode
Definition: Node.hpp:104
int d_numFaces
Definition: Node.hpp:108
int d_numElements
Definition: Node.hpp:112
MVec d_position
Definition: Node.hpp:99
int d_elementArraySize
Definition: Node.hpp:111
int d_ID
Definition: Node.hpp:100
int d_faceArraySize
Definition: Node.hpp:107
Node ( MVec  pos,
int  flag 
)

Definition at line 34 of file Node.cpp.

34  :
35 d_position( pos ),
36 d_ID(-1),
37 d_flag(flag),
38 d_nextNode (this),
40 d_numFaces(0),
43 {}
int d_flag
Definition: Node.hpp:102
Node * d_nextNode
Definition: Node.hpp:104
int d_numFaces
Definition: Node.hpp:108
int d_numElements
Definition: Node.hpp:112
MVec d_position
Definition: Node.hpp:99
int d_elementArraySize
Definition: Node.hpp:111
int d_ID
Definition: Node.hpp:100
int d_faceArraySize
Definition: Node.hpp:107
~Node ( )

Definition at line 45 of file Node.cpp.

References d_elementArraySize, d_elements, d_faceArraySize, and d_faces.

45  {
46 
47  if( d_faceArraySize > 0 ){
48  delete [] d_faces;
49  }
50  if( d_elementArraySize > 0 ){
51  delete [] d_elements;
52  }
53 }
Element ** d_elements
Definition: Node.hpp:110
int d_elementArraySize
Definition: Node.hpp:111
Face ** d_faces
Definition: Node.hpp:106
int d_faceArraySize
Definition: Node.hpp:107

Member Function Documentation

void addElement ( Element elem)

Definition at line 86 of file Node.cpp.

References d_elementArraySize, d_elements, and d_numElements.

Referenced by operator>>(), TCoElement::replaceFaceNode(), QCoElement::replaceFaceNode(), Element::replaceNode(), and Element::setFromNodes().

86  {
87 
89  d_elementArraySize = (int)( d_elementArraySize * 1.25 + 3);
90  Element **new_arr = new Element*[d_elementArraySize];
91  if( d_numElements > 0 ){
92  memcpy(new_arr, d_elements, d_numElements * sizeof(Element*) );
93  delete [] d_elements;
94  }
95  d_elements = new_arr;
96  }
97  d_elements[d_numElements] = elem;
98  d_numElements++;
99 }
Element ** d_elements
Definition: Node.hpp:110
int d_numElements
Definition: Node.hpp:112
int d_elementArraySize
Definition: Node.hpp:111

Here is the caller graph for this function:

void addFace ( Face face)

Definition at line 55 of file Node.cpp.

References d_faceArraySize, d_faces, d_numFaces, and face.

Referenced by QuadFace::QuadFace(), Face::replaceNode(), and TriFace::TriFace().

55  {
56 
57  if( d_faceArraySize == d_numFaces ){
58  d_faceArraySize = (int)( d_faceArraySize * 1.25 + 3);
59  Face **new_arr = new Face*[d_faceArraySize];
60  if( d_numFaces > 0 ){
61  memcpy(new_arr, d_faces, d_numFaces * sizeof(Face*) );
62  delete [] d_faces;
63  }
64  d_faces = new_arr;
65  }
67  d_numFaces++;
68 }
int d_numFaces
Definition: Node.hpp:108
Face ** d_faces
Definition: Node.hpp:106
static T_VertexSet * face
Definition: vinci_lass.c:79
int d_faceArraySize
Definition: Node.hpp:107
The Face class is an abstract base class that supplies implemented general methods, as well as a vew virtual interface methods to child classes.
Definition: Face.hpp:19

Here is the caller graph for this function:

void addNextLink ( Node link)

Definition at line 139 of file Node.cpp.

References d_nextNode.

Referenced by QCoElement::setFromMyNodes(), and TCoElement::setFromMyNodes().

139  {
140 
141  Node* prev = this;
142 
143  while( prev->d_nextNode != this ){
144  prev = prev->d_nextNode;
145  }
146  // now prev->next is this one
147  prev->d_nextNode = link;
148  prev = link;
149  while( prev->d_nextNode != link ){
150  prev = prev->d_nextNode;
151  }
152  // now prev->next is link
153  prev->d_nextNode = this;
154 
155  prev = this;
156  while( prev->d_nextNode != this ){
157  prev = prev->d_nextNode;
158  }
159 }
Node * d_nextNode
Definition: Node.hpp:104
This class encapsulate a node over a window manifold.
Definition: Manifold_2.h:370

Here is the caller graph for this function:

const void * addr ( const COM::Attribute *  attr) const

Obtain the address of an attribute associated with the node.

Note: This function can be slow O(log(#panes)) if the attribute is not on the current pane.

Definition at line 1191 of file Manifold_2.C.

References _pm, _vID, attr(), COM_assertion_msg, COM_get_sizeof(), and Simple_manifold_2::pane().

Referenced by Halfedge::edge_average(), Halfedge::face_average(), get_deformed_normal(), rflu_modhashtable::rflu_hashedge(), rflu_modhashtable::rflu_hashface(), rflu_modhashtable::rflu_hashfuncprimary(), rflu_modhashtable::rflu_hashfuncsecondary(), rflu_modhashtable::rflu_hashvertex(), rflu_modhashtable::rflu_hashvertexfancy(), and rflu_modhashtable::rflu_unhashbface().

1191  {
1192  COM_assertion_msg( a, "Unexpected NULL pointer");
1193  COM_assertion_msg( a->is_nodal(), "Expect a nodal attribute");
1194 
1195  const COM::Attribute *attr;
1196 
1197  const COM::Pane *pn = _pm->pane();
1198  int pid = pn->id();
1199  if ( a->pane()->id() == pid)
1200  attr = a;
1201  else {
1202  if ( a->window() != pn->window()) {
1203  pn = &a->window()->pane( pid);
1204  COM_assertion_msg( pn, "Pane does not exist");
1205  }
1206  attr=pn->attribute( a->id());
1207  COM_assertion_msg( attr, "Attribute does not exist");
1208  }
1209 
1210  return ((const char*)attr->pointer()) +
1211  COM_get_sizeof( attr->data_type(), attr->stride()*(_vID-1));
1212 }
#define COM_assertion_msg(EX, msg)
const COM::Pane * pane() const
Obtain a const pointer to the pane.
int _vID
Definition: Manifold_2.h:441
const COM::Attribute * attr(const COM::Attribute *a) const
Obtain the attribute on the parent pane of the node.
Definition: Manifold_2.h:404
const Pane_manifold_2 * _pm
Definition: Manifold_2.h:440
int COM_get_sizeof(const COM_Type type, int c)
Definition: roccom_c++.h:560

Here is the call graph for this function:

Here is the caller graph for this function:

const COM::Attribute* attr ( const COM::Attribute *  a) const
inline

Obtain the attribute on the parent pane of the node.

It takes O(log(#panes)) time.

Definition at line 404 of file Manifold_2.h.

References _pm, COM_assertion_msg, and Simple_manifold_2::pane().

Referenced by addr(), rocstar_rocfrac::associate_pointer(), modrocstar::associate_pointer(), and m_rocburn_interface_data::associate_pointer().

404  {
405  COM_assertion_msg( a, "Unexpected NULL pointer");
406  return a->window()->pane( _pm->pane()->id()).attribute(a->id());
407  }
#define COM_assertion_msg(EX, msg)
const COM::Pane * pane() const
Obtain a const pointer to the pane.
const Pane_manifold_2 * _pm
Definition: Manifold_2.h:440

Here is the call graph for this function:

Here is the caller graph for this function:

bool coincide ( const Node n) const
inline

Check whether the current node coincide with the given node.

Definition at line 422 of file Manifold_2.h.

References _mode, _pm, _vID, and Pane_manifold_2::get_primary().

423  { return _pm->get_primary( _vID, _mode) == n._pm->get_primary( n._vID, n._mode); }
Access_Mode _mode
Definition: Manifold_2.h:442
int _vID
Definition: Manifold_2.h:441
const Pane_manifold_2 * _pm
Definition: Manifold_2.h:440
Node get_primary(int vID, Access_Mode mode) const
Obtains a Node object corresponding to the primary copy of the given node.
Definition: Manifold_2.h:629

Here is the call graph for this function:

Node get_primary ( ) const
inline

Get the primary copy of the node.

Definition at line 419 of file Manifold_2.h.

References _mode, _pm, _vID, and Pane_manifold_2::get_primary().

Referenced by Window_manifold_2::assign_global_nodeIDs().

419 { return _pm->get_primary( _vID, _mode); }
Access_Mode _mode
Definition: Manifold_2.h:442
int _vID
Definition: Manifold_2.h:441
const Pane_manifold_2 * _pm
Definition: Manifold_2.h:440
Node get_primary(int vID, Access_Mode mode) const
Obtains a Node object corresponding to the primary copy of the given node.
Definition: Manifold_2.h:629

Here is the call graph for this function:

Here is the caller graph for this function:

Element ** getAllElements ( )
inline

Retrieves a pointer to the internal array of elements associated with this node.

Use getNumElements to find out how many are in the array.

Definition at line 147 of file Node.hpp.

References d_elements.

148 { return d_elements; }
Element ** d_elements
Definition: Node.hpp:110
Face ** getAllFaces ( )
inline

Retrieves a pointer to the internal array of faces associated with this node.

Use getNumFaces to find out how many are in the array.

Definition at line 135 of file Node.hpp.

References d_faces.

136 { return d_faces; }
Face ** d_faces
Definition: Node.hpp:106
Element * getElement ( int  Index)
inline

Retrieves a pointer to the element referenced by the supplied index that is associated with this node, i.e., if there are 3 elements associated with this node (use getNumElements), then index should run from 0 to 2.

Definition at line 143 of file Node.hpp.

References d_elements.

144 { return d_elements[Index]; }
Element ** d_elements
Definition: Node.hpp:110
Face * getFace ( int  Index)
inline

Retrieves a pointer to the face referenced by the supplied index that is associated with this node, i.e., if there are 3 faces associated with this node (use getNumFaces), then index should run from 0 to 2.

Definition at line 131 of file Node.hpp.

References d_faces.

132 { return d_faces[Index]; }
Face ** d_faces
Definition: Node.hpp:106
int getFlag ( ) const
inline

Definition at line 150 of file Node.hpp.

References d_flag.

Referenced by operator<<().

151 {return d_flag; }
int d_flag
Definition: Node.hpp:102

Here is the caller graph for this function:

int getID ( )
inline

Definition at line 119 of file Node.hpp.

References d_ID.

Referenced by operator<<().

120 { return d_ID; }
int d_ID
Definition: Node.hpp:100

Here is the caller graph for this function:

Node* getNext ( )
int getNumElements ( )
inline

retrieves the number of elements currently associated with this node.

Definition at line 140 of file Node.hpp.

References d_numElements.

141 { return d_numElements; }
int d_numElements
Definition: Node.hpp:112
int getNumFaces ( )
inline

retrieves the number of faces currently associated with this node.

Definition at line 128 of file Node.hpp.

References d_numFaces.

129 { return d_numFaces; }
int d_numFaces
Definition: Node.hpp:108
MVec getPosition ( )
inline

Definition at line 125 of file Node.hpp.

References d_position.

Referenced by TetElement::getMinEdgeLength().

126 { return d_position; }
MVec d_position
Definition: Node.hpp:99

Here is the caller graph for this function:

ElementList * getSeparateElements ( FaceList list)
private

Definition at line 192 of file Node.cpp.

References d_elements, d_faces, d_numElements, d_numFaces, FALSE, FaceList::get(), ElementList::get(), Face::getElement1(), Face::getElement2(), i, FaceList::insert_first(), ElementList::insert_first(), Element::isCohesive(), j, FaceList::move_to(), ElementList::move_to(), FaceList::next(), ElementList::next(), FaceList::remove(), ElementList::reset(), FaceList::size(), ElementList::size(), and TRUE.

Referenced by separate().

192  {
193 
194  // Collect ONLY regular faces - not in cohesive,
195  // not boundary, not in the "list" ("list" is a facelist of
196  // the faces involving the node that is trying to be separated).
197 
198  //"list" is used as a separator list of faces. We need to build a list of
199  //faces that CAN be traversed. That list will be node_faces.
200 
201  FaceList node_faces;
202  int i;
203  for( i = 0; i < d_numFaces; i++ ){
204  //step through all the faces in the d_faces array for this node.
205  Face *face = d_faces[i];
206  //see if each face is on the "list" of separable faces sent in.
207  if( list->move_to( face )){
208  continue; //if it is, then go to the next face.
209  }
210 
211  //if this face is an exterior face, or if either element that it
212  //is associated with is cohesive, then don't add it to the facelist.
213  if( !face->getElement2() || face->getElement1()->isCohesive() ||
214  face->getElement2()->isCohesive() ){
215  continue;
216  }
217  node_faces.insert_first( face );
218  }
219 
220  //count the number of non-cohesive ("real") elements attached to this node.
221  int count_real=0;
222  for( i = 0; i < d_numElements; i++ ){
223  if( !d_elements[i]->isCohesive() ){
224  count_real++;
225  }
226  }
227 
228  // Try to find ONE non-cohesive element. Note the "break" in the "if"
229  // below if one is found!
230  ElementList *shared_elements = new ElementList;
231  for( i = 0; i < d_numElements; i++ ){
232  if( !d_elements[i]->isCohesive() ){
233  shared_elements->insert_first(d_elements[i]);
234  break;
235  }
236  }
237 
238  //We should always find at least one non-cohesive element (says Alla).
239  if( shared_elements->size() != 1 ){
240  // thoretically this should not happen (pure cohesive node)
241  delete shared_elements;
242  return 0; //get out of town if node is pure cohesive - can't separate.
243  }
244 
245  // Since we found one non-cohesive element, now try to add more
246  boolean changed = TRUE;
247  while( changed ) {
248  changed = FALSE;
249  //number of faces with non-cohesive or non-exterior elements on both sides.
250  int size = node_faces.size();
251  int i;
252  //loop over all the candidate faces for this node.
253  for( i = 0; i < size; i++ ) {
254  //retrieve the list of faces for this node.
255  Face* face = node_faces.get();
256  boolean found=FALSE;
257  // check if face belongs to any shared element
258  shared_elements->reset();
259  int nums = shared_elements->size();
260  int j;
261  //for each element in the shared_elements list...
262  for( j = 0; j < nums; j++ ) {
263  Element* sh_el = shared_elements->get();
264  Element* oelem(0);
265  //check and see if the current face involves one of the elements on the list.
266  //If so, get the other element that is on the other side of the face (put
267  //in oelem).
268  if( face->getElement1() == sh_el ){
269  oelem = face->getElement2();
270  }
271  else if( face->getElement2() == sh_el ){
272  oelem = face->getElement1();
273  }
274  //if find the second element ...
275  if( oelem ){
276  found = TRUE;
277  //if it's not already on the shared elements list, then put it on the list.
278  if( !shared_elements->move_to( oelem ) ){
279  shared_elements->insert_first( oelem );
280  }
281  break; //exit j loop (element loop)
282  }
283 
284  //get ready to check the next element.
285  shared_elements->next();
286 
287  } //for (j=0...
288 
289  if( found ){
290  //remove the current face from the facelist
291  node_faces.remove();
292  //get ready to look at the new facelist (sans the current face)
293  changed = TRUE;
294  //exit the i loop and go back to the while (start over with new list of faces)
295  break;
296  }
297 
298  //one of the faces must be part of elements that are already on the list, so go on!
299  node_faces.next();
300 
301  } //for (i=0 ...
302  } //while(changed)
303 
304  // count_real is the number of non-cohesive elements attached to this node.
305  // have separation surface
306  //if the actual number of elements is greater than the number you found, then there must
307  //be a separation plane. If it is the same, then you went all the way around and found no
308  //boundary.
309  if( count_real > shared_elements->size() ){
310  return shared_elements;
311  }
312  delete shared_elements;
313  return 0;
314 }
#define FALSE
Definition: vinci.h:133
Definition: face.h:90
Element * get()
Definition: ElementList.hpp:87
Element ** d_elements
Definition: Node.hpp:110
Element * getElement2()
Get the pointer to the second element that this face is associated with.
Definition: Face.hpp:197
int d_numFaces
Definition: Node.hpp:108
int d_numElements
Definition: Node.hpp:112
void reset()
Definition: ElementList.hpp:76
int size()
Definition: FaceList.hpp:95
void next()
Definition: FaceList.hpp:80
blockLoc i
Definition: read.cpp:79
#define TRUE
Definition: vinci.h:134
Face * remove()
Definition: FaceList.cpp:76
Face ** d_faces
Definition: Node.hpp:106
void insert_first(Element *val)
Definition: ElementList.hpp:69
boolean isCohesive() const
Definition: Element.hpp:112
j indices j
Definition: Indexing.h:6
boolean move_to(Face *val)
Definition: FaceList.cpp:102
Face * get()
Definition: FaceList.hpp:87
boolean move_to(Element *val)
The Face class is an abstract base class that supplies implemented general methods, as well as a vew virtual interface methods to child classes.
Definition: Face.hpp:19
Element * getElement1()
Get the pointer to the first element that this face is associated with.
Definition: Face.hpp:191
void insert_first(Face *val)
Definition: FaceList.hpp:69

Here is the call graph for this function:

Here is the caller graph for this function:

Halfedge halfedge ( ) const
inline

Get an incident halfedge originated from the node.

If the node is on the physical boundary, the halfedge must be a physical border edge.

Definition at line 670 of file Manifold_2.h.

References _mode, _pm, _vID, Pane_manifold_2::get_counterpart(), Simple_manifold_2::get_incident_edge(), Simple_manifold_2::get_incident_real_edge(), Halfedge::pane_manifold(), REAL_PANE, and WHOLE_PANE.

Referenced by Window_manifold_2::determine_primaries(), and is_border().

671 {
672  Edge_ID eID;
673 
674  switch ( _mode) {
675  case REAL_PANE:
676  eID = _pm->get_incident_real_edge( _vID); break;
677  case WHOLE_PANE:
678  eID = _pm->get_incident_edge( _vID); break;
679  default: {
681  // the current node (vertex) is in general the origin of the edge or
682  // the edge center, unless the node is isolated.
683 
684  if ( eID.is_border()) {
685  Halfedge h=_pm->get_counterpart( eID);
686  if ( h.pane_manifold()) return h;
687  }
688  }
689  }
690 
691  return Halfedge(_pm, eID, _mode);
692 }
Access_Mode _mode
Definition: Manifold_2.h:442
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
const Halfedge & get_counterpart(Edge_ID eID) const
Get the counterpart of an edge in the ACROSS_PANE mode, i.e.
Definition: Manifold_2.h:581
This class encapsulate a halfedge over a window manifold.
Definition: Manifold_2.h:446
Edge_ID get_incident_real_edge(int vID) const
Get the ID of an incident real edge within the pane of a given node.
int _vID
Definition: Manifold_2.h:441
const Pane_manifold_2 * _pm
Definition: Manifold_2.h:440
const Pane_manifold_2 * pane_manifold() const
Obtain the pane manifold that owns the edge.
Definition: Manifold_2.h:540
Edge_ID get_incident_edge(int vID) const
Get the ID of an incident edge within the pane of a given node that originated from the node...

Here is the call graph for this function:

Here is the caller graph for this function:

int id ( ) const
inline

Obtain the node ID within its Pane_manifold_2.

Definition at line 391 of file Manifold_2.h.

References _vID.

Referenced by Window_manifold_2::assign_global_nodeIDs().

391 { return _vID; }
int _vID
Definition: Manifold_2.h:441

Here is the caller graph for this function:

bool is_border ( ) const
inline

Is the node on the physical boundary?

Definition at line 668 of file Manifold_2.h.

References halfedge(), and Halfedge::is_border().

668 { return halfedge().is_border(); }
bool is_border() const
Is the edge a border edge?
Definition: Manifold_2.h:476
Halfedge halfedge() const
Get an incident halfedge originated from the node.
Definition: Manifold_2.h:670

Here is the call graph for this function:

bool is_isolated ( ) const
inline

Is the node isolated?

Definition at line 413 of file Manifold_2.h.

References _pm, _vID, and Simple_manifold_2::is_isolated_node().

Referenced by Window_manifold_2::determine_primaries().

413 { return _pm->is_isolated_node( _vID); }
int _vID
Definition: Manifold_2.h:441
const Pane_manifold_2 * _pm
Definition: Manifold_2.h:440
bool is_isolated_node(int vID) const
Is the node isolated (i.e. not incident on any element)?

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_primary ( ) const
inline

Is the node a primary?

Definition at line 416 of file Manifold_2.h.

References _mode, _pm, _vID, and Pane_manifold_2::is_primary().

416 { return _pm->is_primary( _vID, _mode); }
Access_Mode _mode
Definition: Manifold_2.h:442
bool is_primary(int vID, Access_Mode mode) const
Determines whether a given node is a primary copy.
Definition: Manifold_2.h:642
int _vID
Definition: Manifold_2.h:441
const Pane_manifold_2 * _pm
Definition: Manifold_2.h:440

Here is the call graph for this function:

bool operator!= ( const Node n) const
inline

Are two nodes different?

Definition at line 430 of file Manifold_2.h.

References _pm, and _vID.

431  { return _pm != n._pm || _vID != n._vID; }
int _vID
Definition: Manifold_2.h:441
const Pane_manifold_2 * _pm
Definition: Manifold_2.h:440
bool operator< ( const Node n) const
inline

Does the current node has a smaller ID then the given node?

Definition at line 434 of file Manifold_2.h.

References _pm, _vID, and Simple_manifold_2::pane().

434  {
435  return _pm->pane()->id() < n._pm->pane()->id() ||
436  _pm == n._pm && _vID < n._vID;
437  }
const COM::Pane * pane() const
Obtain a const pointer to the pane.
int _vID
Definition: Manifold_2.h:441
const Pane_manifold_2 * _pm
Definition: Manifold_2.h:440

Here is the call graph for this function:

bool operator== ( const Node n) const
inline

Are two nodes the same?

Definition at line 426 of file Manifold_2.h.

References _pm, and _vID.

427  { return _pm == n._pm && _vID == n._vID; }
int _vID
Definition: Manifold_2.h:441
const Pane_manifold_2 * _pm
Definition: Manifold_2.h:440
const COM::Pane* pane ( ) const
inline

Obtain the owner Pane_manifold_2 of the node.

Definition at line 387 of file Manifold_2.h.

References _pm, and Simple_manifold_2::pane().

Referenced by Window_manifold_2::assign_global_nodeIDs().

388  { if ( _pm) return _pm->pane(); else return NULL; }
const COM::Pane * pane() const
Obtain a const pointer to the pane.
const Pane_manifold_2 * _pm
Definition: Manifold_2.h:440

Here is the call graph for this function:

Here is the caller graph for this function:

const Pane_manifold_2* pane_manifold ( ) const
inline

Obtain the pane manifold that owns the edge.

Definition at line 384 of file Manifold_2.h.

References _pm.

384 { return _pm; }
const Pane_manifold_2 * _pm
Definition: Manifold_2.h:440
const Point_3<Real>& point ( ) const
inline

Obtain the coordinates of a node.

Definition at line 394 of file Manifold_2.h.

References _pm, _vID, and Simple_manifold_2::pane().

Referenced by get_deformed_normal(), and Halfedge::tangent().

395  { return (const Point_3<Real>&)_pm->pane()->coordinates()[ 3*_vID-3]; }
const COM::Pane * pane() const
Obtain a const pointer to the pane.
int _vID
Definition: Manifold_2.h:441
const Pane_manifold_2 * _pm
Definition: Manifold_2.h:440

Here is the call graph for this function:

Here is the caller graph for this function:

void removeElement ( Element elem)

Definition at line 102 of file Node.cpp.

References d_elements, d_numElements, and i.

Referenced by QCoElement::replaceFaceNode(), TCoElement::replaceFaceNode(), Element::replaceNode(), HexElement::~HexElement(), QCoElement::~QCoElement(), TCoElement::~TCoElement(), and TetElement::~TetElement().

102  {
103 
104  int i;
105  int dif = 0;
106  for( i = 0; i < d_numElements; i++ ){
107  if( (dif == 0) && (d_elements[i] == element) ){
108  dif++;
109  continue;
110  }
111  if( dif > 0 ){
112  d_elements[i - dif] = d_elements[i];
113  }
114  }
115  d_numElements -= dif;
116 }
Element ** d_elements
Definition: Node.hpp:110
int d_numElements
Definition: Node.hpp:112
blockLoc i
Definition: read.cpp:79

Here is the caller graph for this function:

void removeFace ( Face face)

Definition at line 70 of file Node.cpp.

References d_faces, d_numFaces, and i.

Referenced by Face::replaceNode(), QuadFace::~QuadFace(), and TriFace::~TriFace().

70  {
71 
72  int i;
73  int dif = 0;
74  for( i = 0; i < d_numFaces; i++ ){
75  if( (dif == 0) && (d_faces[i] == face) ){
76  dif++;
77  continue;
78  }
79  if( dif > 0 ){
80  d_faces[i - dif] = d_faces[i];
81  }
82  }
83  d_numFaces -= dif;
84 }
int d_numFaces
Definition: Node.hpp:108
blockLoc i
Definition: read.cpp:79
Face ** d_faces
Definition: Node.hpp:106

Here is the caller graph for this function:

boolean separate ( Mesh mesh,
FaceList list,
int  new_material 
)

Definition at line 162 of file Node.cpp.

References Mesh::addNode(), d_flag, d_position, FALSE, getSeparateElements(), Node(), Mesh::replaceNode(), separate(), and TRUE.

Referenced by Mesh::addCohesive(), and separate().

162  {
163 
164  //Use the facelist to get a list of involved elements, and see if they can
165  //be separated or not. This method should be called getSeparableElements. It
166  //returns an element list with the involved elements if separable, empty if not
167  //separable.
168  ElementList* sep_elements = getSeparateElements( list );
169 
170  if( !sep_elements ){ //not a separable node.
171  return FALSE;
172  }
173 
174  //Its separable - make a new node at the same position, and add it to the mesh.
175  //Note that it should have the same nodeflag as the initial node.
176  Node *new_node = new Node(d_position, d_flag);
177  mesh->addNode( new_node );
178 
179  //now we have to go back to the mesh class... kind of wierd design.
180  mesh->replaceNode(this, new_node, sep_elements, new_material );
181 
182  delete sep_elements;
183 
184  // now can call separate again for this & for new_node
185  // recursion to separate further
186 
187  new_node->separate( mesh, list, new_material );
188  separate( mesh, list, new_material);
189  return TRUE;
190 }
#define FALSE
Definition: vinci.h:133
boolean separate(Mesh *mesh, FaceList *list, int new_material)
Definition: Node.cpp:162
int d_flag
Definition: Node.hpp:102
This class encapsulate a node over a window manifold.
Definition: Manifold_2.h:370
Node()
Default constructor.
Definition: Manifold_2.h:373
void addNode(Node *node)
The following add/remove/get methods are utility methods to add, remove, or return instances of nodes...
Definition: Mesh.cpp:60
MVec d_position
Definition: Node.hpp:99
void replaceNode(Node *node, Node *new_node, ElementList *sep_elements, int new_material)
Definition: Mesh.cpp:245
#define TRUE
Definition: vinci.h:134
ElementList * getSeparateElements(FaceList *list)
Definition: Node.cpp:192

Here is the call graph for this function:

Here is the caller graph for this function:

void setFlag ( int  flag)
inline

Definition at line 153 of file Node.hpp.

References d_flag.

Referenced by operator>>().

154 { d_flag = flag; }
int d_flag
Definition: Node.hpp:102

Here is the caller graph for this function:

void setID ( int  theID)
inline

Definition at line 116 of file Node.hpp.

References d_ID.

Referenced by Mesh::addNode(), and Mesh::removeNode().

117 { d_ID = theID; }
int d_ID
Definition: Node.hpp:100

Here is the caller graph for this function:

void setPosition ( MVec  pos)
inline

Definition at line 122 of file Node.hpp.

References d_position.

123 { d_position = pos; }
MVec d_position
Definition: Node.hpp:99
Face * sharedFace ( Node n2,
Node n3,
Node n4 = 0 
)

Definition at line 118 of file Node.cpp.

References d_faces, d_numFaces, Face::getNodes(), Face::getNumNodes(), i, and k.

Referenced by HexElement::setFaceFromNodes(), TetElement::setFaceFromNodes(), TCoElement::setFaceFromNodes(), and QCoElement::setFaceFromNodes().

118  {
119 
120  int i;
121  for( i = 0; i < d_numFaces; i++ ){
122  Node** fnodes = d_faces[i]->getNodes();
123  int numn = d_faces[i]->getNumNodes();
124  int count=0;
125  int k;
126  for( k = 0; k < numn; k++ ){
127  if( fnodes[k] == n2 || fnodes[k] == n3 || fnodes[k] == n4){
128  count++;
129  }
130  }
131  if( ( n4 == 0 && count == 2) || count == 3 ){
132  return d_faces[i];
133  }
134  }
135  return 0;
136 }
This class encapsulate a node over a window manifold.
Definition: Manifold_2.h:370
j indices k indices k
Definition: Indexing.h:6
int d_numFaces
Definition: Node.hpp:108
blockLoc i
Definition: read.cpp:79
Face ** d_faces
Definition: Node.hpp:106
Node ** getNodes()
Returns the array of nodes.
Definition: Face.hpp:185
virtual int getNumNodes() const =0
Retrieves the number of nodes that make up the face.

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

ostream& operator<< ( ostream &  stream,
Node n 
)
friend

Definition at line 156 of file Node.hpp.

156  {
157  stream << n.d_ID << '\t' << n.d_position << endl;
158  return stream;
159 }
MVec d_position
Definition: Node.hpp:99
int d_ID
Definition: Node.hpp:100
istream& operator>> ( istream &  stream,
Node n 
)
friend

Definition at line 161 of file Node.hpp.

161  {
162  stream >> n.d_ID >> n.d_position;
163  return stream;
164 }
MVec d_position
Definition: Node.hpp:99
int d_ID
Definition: Node.hpp:100

Member Data Documentation

Access_Mode _mode
protected

Definition at line 442 of file Manifold_2.h.

Referenced by coincide(), get_primary(), halfedge(), and is_primary().

int _vID
protected
int d_elementArraySize
private

Definition at line 111 of file Node.hpp.

Referenced by addElement(), and ~Node().

Element* * d_elements
private
int d_faceArraySize
private

Definition at line 107 of file Node.hpp.

Referenced by addFace(), and ~Node().

Face* * d_faces
private

Definition at line 106 of file Node.hpp.

Referenced by addFace(), getAllFaces(), getFace(), getSeparateElements(), removeFace(), sharedFace(), and ~Node().

int d_flag
private

Definition at line 102 of file Node.hpp.

Referenced by getFlag(), separate(), and setFlag().

int d_ID
private

Definition at line 100 of file Node.hpp.

Referenced by getID(), operator<<(), operator>>(), and setID().

Node* d_nextNode
private

Definition at line 104 of file Node.hpp.

Referenced by addNextLink().

int d_numElements
private

Definition at line 112 of file Node.hpp.

Referenced by addElement(), getNumElements(), getSeparateElements(), and removeElement().

int d_numFaces
private

Definition at line 108 of file Node.hpp.

Referenced by addFace(), getNumFaces(), getSeparateElements(), removeFace(), and sharedFace().

MVec d_position
private

Definition at line 99 of file Node.hpp.

Referenced by getPosition(), operator<<(), operator>>(), separate(), and setPosition().


The documentation for this class was generated from the following files: