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

Site Contact