00001 /* @HEADER@ */ 00002 // ************************************************************************ 00003 // 00004 // Sundance 00005 // Copyright (2005) Sandia Corporation 00006 // 00007 // Copyright (year first published) Sandia Corporation. Under the terms 00008 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government 00009 // retains certain rights in this software. 00010 // 00011 // This library is free software; you can redistribute it and/or modify 00012 // it under the terms of the GNU Lesser General Public License as 00013 // published by the Free Software Foundation; either version 2.1 of the 00014 // License, or (at your option) any later version. 00015 // 00016 // This library is distributed in the hope that it will be useful, but 00017 // WITHOUT ANY WARRANTY; without even the implied warranty of 00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 // Lesser General Public License for more details. 00020 // 00021 // You should have received a copy of the GNU Lesser General Public 00022 // License along with this library; if not, write to the Free Software 00023 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00024 // USA 00025 // Questions? Contact Kevin Long (krlong@sandia.gov), 00026 // Sandia National Laboratories, Livermore, California, USA 00027 // 00028 // ************************************************************************ 00029 /* @HEADER@ */ 00030 00031 #ifndef SUNDANCE_UNIFORM_REFINEMENT_PAIR_H 00032 #define SUNDANCE_UNIFORM_REFINEMENT_PAIR_H 00033 00034 #include "SundanceDefs.hpp" 00035 #include "SundanceMeshType.hpp" 00036 #include "SundanceMesh.hpp" 00037 #include "SundanceArrayOfTuples.hpp" 00038 00039 namespace Sundance 00040 { 00041 /** 00042 * 00043 */ 00044 class UniformRefinementPair 00045 { 00046 public: 00047 /** */ 00048 UniformRefinementPair(); 00049 /** */ 00050 UniformRefinementPair(const MeshType& meshType, 00051 const Mesh& coarse); 00052 00053 /** */ 00054 const Mesh& fine() const {return fine_;} 00055 00056 /** */ 00057 const Mesh& coarse() const {return coarse_;} 00058 00059 /** */ 00060 const Array<int>& oldToNewVertMap() const {return oldToNewVertMap_;} 00061 00062 /** */ 00063 const Array<int>& newVertToOldLIDMap() const {return newVertToOldLIDMap_;} 00064 00065 /** */ 00066 const Array<int>& newVertIsOnEdge() const {return newVertIsOnEdge_;} 00067 00068 /** */ 00069 const Array<int>& oldEdgeToNewVertMap() const {return oldEdgeToNewVertMap_;} 00070 00071 /** */ 00072 const ArrayOfTuples<int>& oldToNewElemMap() const 00073 {return oldToNewElemMap_;} 00074 00075 /** */ 00076 const Array<int>& newToOldElemMap() const 00077 {return newToOldElemMap_;} 00078 00079 /** */ 00080 const Array<Array<int> >& oldEdgeChildren() const 00081 {return oldEdgeChildren_;} 00082 00083 /** */ 00084 const Array<Array<int> >& oldEdgeParallels() const 00085 {return oldEdgeParallels_;} 00086 /** */ 00087 const Array<int>& newEdgeParents() const 00088 {return newEdgeParents_;} 00089 00090 /** */ 00091 const Array<int>& newEdgeParallels() const 00092 {return newEdgeParallels_;} 00093 00094 00095 /** */ 00096 const ArrayOfTuples<int>& interiorEdgesOfCoarseElems() const 00097 {return interiorEdges_;} 00098 00099 00100 /** Run a consistency check on the pair of meshes. Returns the number 00101 * of errors detected. */ 00102 int check() const ; 00103 00104 protected: 00105 void refineTriMesh(); 00106 00107 int lookupEdge(const Mesh& mesh, int v1, int v2) const ; 00108 00109 private: 00110 MeshType meshType_; 00111 Mesh coarse_; 00112 Mesh fine_; 00113 00114 Array<int> oldToNewVertMap_; 00115 Array<int> newVertIsOnEdge_; 00116 Array<int> newVertToOldLIDMap_; 00117 Array<int> oldEdgeToNewVertMap_; 00118 00119 ArrayOfTuples<int> oldToNewElemMap_; 00120 Array<int> newToOldElemMap_; 00121 00122 Array<Array<int> > oldEdgeChildren_; 00123 Array<Array<int> > oldEdgeParallels_; 00124 Array<int> newEdgeParents_; 00125 Array<int> newEdgeParallels_; 00126 00127 ArrayOfTuples<int> interiorEdges_; 00128 }; 00129 00130 } 00131 00132 00133 #endif