SundanceNodalDOFMapHN.hpp
Go to the documentation of this file.
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 #ifndef SUNDANCE_NODALDOFMAPHN_H
00043 #define SUNDANCE_NODALDOFMAPHN_H
00044 
00045 #include "SundanceDefs.hpp"
00046 #include "SundanceSpatiallyHomogeneousDOFMapBase.hpp"
00047 #include "SundanceCellSet.hpp"
00048 #include "SundanceCellFilter.hpp"
00049 #include "SundanceBasisFamily.hpp"
00050 #include "SundanceObjectWithVerbosity.hpp"
00051 #include "SundanceHNDoFMapBaseHomogeneous.hpp"
00052 #include "SundanceMatrixStore.hpp"
00053 
00054 namespace Sundance
00055 {
00056 using namespace Teuchos;
00057 
00058 /** 
00059  * 
00060  */
00061 class NodalDOFMapHN : public HNDoFMapBaseHomogeneous
00062 {
00063 public:
00064   /** */
00065   NodalDOFMapHN(const Mesh& mesh, int nFuncs,
00066     const CellFilter& maxCellFilter, 
00067     int setupVerb);
00068 
00069       
00070   /** */
00071   virtual ~NodalDOFMapHN(){;}
00072 
00073   /** */
00074   RCP<const MapStructure> 
00075   getDOFsForCellBatch(int cellDim,
00076     const Array<int>& cellLID,
00077     const Set<int>& requestedFuncSet,
00078     Array<Array<int> >& dofs,
00079     Array<int>& nNodes,
00080     int verb) const ;
00081 
00082 
00083   /**
00084    * @param cellLID [in] the maxCell LID input
00085    * @param funcID [in] the function ID
00086    * @param trafoMatrixSize [in/out]
00087    * @param doTransform [out]
00088    * @param transfMatrix [out] (we assume that the array is already pre-sized )*/
00089   void getTrafoMatrixForCell(
00090       int cellLID,
00091       int funcID,
00092       int& trafoMatrixSize,
00093       bool& doTransform,
00094       Array<double>& transfMatrix ) const;
00095 
00096   /** Function to apply transformation for facets
00097    * @param cellDim , the facet dimension
00098    * @param cellLID , facet LID
00099    * @param facetIndex , facet index in the maxCofacet
00100    * @param funcID  [in] the function ID
00101    * @param trafoMatrixSize [in/out]
00102    * @param doTransform [out]
00103    * @param transfMatrix [out] (we assume that the array is already pre-sized )*/
00104   void getTrafoMatrixForFacet(
00105       int cellDim,
00106       int cellLID,
00107       int facetIndex,
00108       int funcID,
00109       int& trafoMatrixSize,
00110       bool& doTransform,
00111       Array<double>& transfMatrix ) const;
00112 
00113 
00114   /** See subclass for docu */
00115   void getDOFsForHNCell(
00116     int cellDim,
00117     int cellLID,
00118         int funcID,
00119         Array<int>& dofs ,
00120         Array<double>& coefs ) const;
00121 
00122   /** */
00123   RCP<const MapStructure> mapStruct() const 
00124     {return structure_;}
00125 
00126   /** */
00127   int nFuncs() const {return nFuncs_;}
00128 
00129 protected:
00130 
00131   void init();
00132 
00133   void computeOffsets(int localCount)  ;
00134 
00135   void shareRemoteDOFs(const Array<Array<int> >& remoteNodes);
00136 
00137   /** This is a temporary function which later could be out source to the Basis */
00138   void getPointLIDsForHN( int pointLID ,
00139        int facetIndex ,
00140        int maxCellIndex ,
00141        Array<int>& glbLIDs ,
00142        Array<double>& coefsArray,
00143        Array<int>& nodeIndex );
00144 
00145   CellFilter maxCellFilter_;
00146 
00147   int dim_;
00148 
00149   int nFuncs_;
00150 
00151   int nElems_;
00152 
00153   int nNodes_;
00154 
00155   int nNodesPerElem_;
00156 
00157   int nFacets_;
00158 
00159   Array<int> elemDofs_;
00160 
00161   Array<int> nodeDofs_;
00162 
00163   RCP<const MapStructure> structure_;
00164 
00165   /** Is true if the cell has hanging node */
00166   Array<bool> hasCellHanging_;
00167 
00168   /** Is true if the node is hanging*/
00169   Array<bool> nodeIsHanging_;
00170 
00171   /** maps one Cell index to the point LIDs, where are global DoFs which  */
00172   Sundance::Map< int , Array<int> > cellsWithHangingDoF_globalDoFs_;
00173 
00174   /** maps one Cell index to the point LIDs, where are global DoFs which  */
00175   Sundance::Map< int , Array<int> > cells_To_NodeLIDs_;
00176 
00177   /** Maps the local (hanging) node (Point) LID to the global DoFs index */
00178   Sundance::Map< int , Array<int> >  hangingNodeLID_to_NodesLIDs_;
00179 
00180   /** Maps the local (hanging) node (Point) DoF to the global DoFs */
00181   Sundance::Map< int , Array<double> > hangindNodeLID_to_Coefs_;
00182 
00183   /** Maps the local (hanging) node (Point) DoF to the matrix index*/
00184   Sundance::Map< int , int > maxCellLIDwithHN_to_TrafoMatrix_;
00185 
00186   /** The object to store all the transformation matrixes */
00187   MatrixStore                          matrixStore_;
00188 
00189   /** */
00190   Array<int> facetLID_;
00191 
00192 };
00193 
00194 }
00195 
00196 
00197 #endif

Site Contact