00001 /* @HEADER@ */ 00002 // ************************************************************************ 00003 // 00004 // Sundance 00005 // Copyright 2011 Sandia Corporation 00006 // 00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00008 // the U.S. Government retains certain rights in this software. 00009 // 00010 // Redistribution and use in source and binary forms, with or without 00011 // modification, are permitted provided that the following conditions are 00012 // met: 00013 // 00014 // 1. Redistributions of source code must retain the above copyright 00015 // notice, this list of conditions and the following disclaimer. 00016 // 00017 // 2. Redistributions in binary form must reproduce the above copyright 00018 // notice, this list of conditions and the following disclaimer in the 00019 // documentation and/or other materials provided with the distribution. 00020 // 00021 // 3. Neither the name of the Corporation nor the names of the 00022 // contributors may be used to endorse or promote products derived from 00023 // this software without specific prior written permission. 00024 // 00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY 00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE 00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00036 // 00037 // Questions? Contact Kevin Long (kevin.long@ttu.edu) 00038 // 00039 00040 /* @HEADER@ */ 00041 00042 00043 /* 00044 * SundanceHNMapBase.hpp 00045 * 00046 * Created on: Mar 18, 2010 00047 * Author: benk 00048 */ 00049 00050 #ifndef SUNDANCEHNMAPBASE_HPP_ 00051 #define SUNDANCEHNMAPBASE_HPP_ 00052 00053 #include "SundanceDefs.hpp" 00054 #include "SundanceMesh.hpp" 00055 00056 namespace Sundance 00057 { 00058 using namespace Teuchos; 00059 00060 /** 00061 * The abstract class which extends the functionalities of the DOF map <br> 00062 * The only additional functionality is that we have a restriction on the DOFs 00063 * , with the pre-fill transformations these constraints can be build in into the matrix 00064 * 00065 */ 00066 class HNDoFMapBase 00067 { 00068 public: 00069 00070 /** Empty Ctor */ 00071 HNDoFMapBase(const Mesh& mesh, int nFuncs, int setupVerb) : mesh_(mesh){;} 00072 00073 virtual ~HNDoFMapBase() {;} 00074 00075 /** 00076 * @param cellLID [in] the maxCell LID input 00077 * @param funcID [in] the function ID 00078 * @param trafoMatrixSize [in/out] 00079 * @param doTransform [out] 00080 * @param transfMatrix [out] (we assume that the array is already pre-sized )*/ 00081 virtual void getTrafoMatrixForCell( 00082 int cellLID, 00083 int funcID, 00084 int& trafoMatrixSize, 00085 bool& doTransform, 00086 Array<double>& transfMatrix ) const=0; 00087 00088 /** Function to apply transformation for facets 00089 * @param cellDim , the facet dimension 00090 * @param cellLID , facet LID 00091 * @param facetIndex , facet index in the maxCofacet 00092 * @param funcID [in] the function ID 00093 * @param trafoMatrixSize [in/out] 00094 * @param doTransform [out] 00095 * @param transfMatrix [out] (we assume that the array is already pre-sized )*/ 00096 virtual void getTrafoMatrixForFacet( 00097 int cellDim, 00098 int cellLID, 00099 int facetIndex, 00100 int funcID, 00101 int& trafoMatrixSize, 00102 bool& doTransform, 00103 Array<double>& transfMatrix ) const = 0; 00104 00105 00106 00107 /** Function used for plotting for hanging node DOFMaps 00108 * Returns for one hanging node (element) the global DoFs which contribute to that hanging local DoF 00109 * @param cellDim [in] the dimension 00110 * @param cellLID [in] the LID of the cell 00111 * @param funcID [in] the function ID, (to wchich the DOFs belong) 00112 * @param dofs [out] the global DoF s 00113 * @param coefs [out] the coefficient of each global DoF */ 00114 virtual void getDOFsForHNCell( 00115 int cellDim, 00116 int cellLID, 00117 int funcID, 00118 Array<int>& dofs , 00119 Array<double>& coefs ) const=0; 00120 00121 /** Returns the dimension where the DoF map is defined 00122 * For HN we do transformation only for the maxCell type */ 00123 int getSpacialMeshDim() const { return mesh_.spatialDim();} 00124 00125 protected: 00126 00127 private: 00128 00129 const Mesh mesh_; 00130 00131 }; 00132 00133 } 00134 00135 00136 #endif /* SUNDANCEHNMAPBASE_HPP_ */