Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef SUNDANCERIVARAFACE_H
00044 #define SUNDANCERIVARAFACE_H
00045
00046 #include "SundanceDefs.hpp"
00047 #include "SundanceRivaraTreeNode.hpp"
00048 #include "SundanceRivaraNode.hpp"
00049 #include "SundanceSet.hpp"
00050 #include "Teuchos_Array.hpp"
00051 #include "Teuchos_RefCountPtr.hpp"
00052
00053 using namespace Teuchos;
00054 namespace Sundance
00055 {
00056 namespace Rivara
00057 {
00058 class Element;
00059 class RivaraMesh;
00060
00061 using Sundance::Set;
00062 using Sundance::makeSet;
00063 using Teuchos::Array;
00064 using Teuchos::RefCountPtr;
00065
00066
00067 class FaceNodes
00068 {
00069 public:
00070
00071 FaceNodes(
00072 const RCP<Node>& a,
00073 const RCP<Node>& b,
00074 const RCP<Node>& c)
00075 : nodeLIDSet_(rcp(new Set<int>(makeSet(a->localIndex(), b->localIndex(), c->localIndex()))))
00076 {}
00077
00078
00079
00080 bool operator<(const FaceNodes& other) const
00081 {
00082 return (*nodeLIDSet_) < (*(other.nodeLIDSet_));
00083 }
00084
00085
00086 const Set<int>& nodes() const {return *nodeLIDSet_;}
00087
00088 private:
00089 RCP<Set<int> > nodeLIDSet_;
00090 };
00091
00092
00093
00094
00095
00096 class Face
00097 {
00098 public:
00099
00100
00101
00102 Face(
00103 const RCP<Node>& a,
00104 const RCP<Node>& b,
00105 const RCP<Node>& c
00106 )
00107 : label_(-1),
00108 globalIndex_(-1),
00109 nodes_(a,b,c),
00110 ownerProc_(std::max(std::max(a->ownerProc(), b->ownerProc()), c->ownerProc()))
00111 {}
00112
00113
00114 const FaceNodes& nodes() const {return nodes_;}
00115
00116
00117 int ownerProc() const {return ownerProc_;}
00118
00119
00120
00121
00122 int globalIndex() const {return globalIndex_;}
00123
00124
00125
00126
00127 void setGlobalIndex(int globalIndex) {globalIndex_ = globalIndex;}
00128
00129
00130
00131
00132 void setLabel(int label) {label_=label;}
00133
00134
00135
00136
00137 int label() const {return label_;}
00138 private:
00139
00140 int label_;
00141 int globalIndex_;
00142 FaceNodes nodes_;
00143 int ownerProc_;
00144 };
00145 }
00146 }
00147
00148 #endif