SundanceRivaraNode.hpp
Go to the documentation of this file.
00001 #ifndef SUNDANCERIVARANODE_H
00002 #define SUNDANCERIVARANODE_H
00003 
00004 #include "SundanceDefs.hpp"
00005 #include "SundancePoint.hpp"
00006 #include "Teuchos_RefCountPtr.hpp"
00007 #include "Teuchos_Array.hpp"
00008 
00009 
00010 namespace Sundance
00011 {
00012 namespace Rivara
00013 {
00014 class Element;
00015 class Edge;
00016 using Sundance::Point;
00017 using Teuchos::Array;
00018 
00019 /**
00020  * Class Node is a vertex in a simplicial mesh.
00021  */
00022 class Node
00023 {
00024 public:
00025   Node(int gid, const Point& x, int ownerProc, int label=-1);
00026 
00027   /**
00028    * Return the spatial position of this node
00029    */
00030   const Point& pt() const ;
00031 
00032   /**
00033    * Return the local index of this node
00034    */
00035   int localIndex() const {return localIndex_;}
00036 
00037 
00038   /**
00039    * Return the global index of this node
00040    */
00041   int globalIndex() const {return globalIndex_;}
00042 
00043   /**
00044    * Set the local index of this node
00045    */
00046   void setLocalIndex(int localIndex) {localIndex_ = localIndex;}
00047 
00048   /**
00049    * Add an element to the list of elements containing this node.
00050    */
00051   void addConnectingElement(Element* elem);
00052 
00053   /**
00054    * Add an edge to the list of edges containing this node
00055    */
00056   void addConnectingEdge(Edge* edge);
00057 
00058   /**
00059    * Return the rank of the proc that owns this node
00060    */
00061   int ownerProc() const {return ownerProc_;}
00062 
00063 
00064   /**
00065    * Return the label of this node
00066    */
00067   int label() const {return label_;}
00068 
00069 
00070 private:
00071   int label_;
00072   int localIndex_;
00073   int globalIndex_;
00074   Point x_;
00075 
00076   Array<Element*> elements_;
00077   Array<Edge*> edges_;
00078 
00079   int ownerProc_;
00080 };
00081 }
00082 }
00083 
00084 
00085 
00086 #endif

Site Contact