SundanceHomogeneousDOFMap.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_HOMOGENEOUSDOFMAP_H
00032 #define SUNDANCE_HOMOGENEOUSDOFMAP_H
00033 
00034 
00035 #include "SundanceDefs.hpp"
00036 #include "SundanceMesh.hpp"
00037 #include "SundanceBasisFamily.hpp"
00038 #include "SundanceCellSet.hpp"
00039 #include "SundanceCellFilter.hpp"
00040 #include "SundanceDOFMapBase.hpp"
00041 
00042 
00043 namespace Sundance
00044 {
00045 using namespace Teuchos;
00046 
00047 /** 
00048  * A HomogeneousDOFMap is a DOF map for the special (and common)
00049  * case in which every function has the same basis and is defined
00050  * on every cell in the mesh. 
00051  */
00052 class HomogeneousDOFMap : public DOFMapBase
00053 {
00054 public:
00055   /** */
00056   HomogeneousDOFMap(const Mesh& mesh, 
00057     const BasisFamily& basis,
00058     int numFuncs);
00059                         
00060   /** */
00061   HomogeneousDOFMap(const Mesh& mesh, 
00062     const BasisFamily& basis,
00063     const Array<CellFilter>& subregions,
00064     int numFuncs);
00065 
00066   /** */
00067   virtual ~HomogeneousDOFMap(){;}
00068 
00069 
00070      
00071 
00072       
00073 
00074   /** */
00075   virtual void getDOFsForCellBatch(int cellDim, const Array<int>& cellLID,
00076     Array<int>& dofs,  
00077     Array<Array<int> >& funcIDs,
00078     Array<int>& nNodes) const ;
00079 
00080 
00081   /** */
00082   virtual void print(std::ostream& os) const ;
00083 
00084 private:
00085 
00086   /** */
00087   void allocate(const Mesh& mesh, 
00088     const BasisFamily& basis,
00089     int numFuncs);
00090       
00091   /** */
00092   void buildMaximalDofTable() const ;
00093 
00094   /** */
00095   bool hasBeenAssigned(int cellDim, int cellLID) const 
00096     {return dofs_[cellDim][cellLID][0] != uninitializedVal();}
00097 
00098   /** */
00099   void initMap();
00100 
00101   /** */
00102   void setDOFs(int cellDim, int cellLID, 
00103     int& nextDOF, bool isRemote=false);
00104 
00105   /** */
00106   void shareDOFs(int cellDim,
00107     const Array<Array<int> >& outgoingCellRequests);
00108 
00109   /** */
00110   void computeOffsets(int dim, int localCount);
00111 
00112   /** */
00113   const Array<int>& funcIDList() const {return funcIDOnCellSet(0);}
00114 
00115   static int uninitializedVal() {return -1;}
00116 
00117   int dim_;
00118 
00119   Array<Array<Array<int> > > dofs_;
00120 
00121   mutable Array<int> maximalDofs_;
00122 
00123   mutable bool haveMaximalDofs_;
00124 
00125   Array<Array<Array<Array<int> > > > localNodePtrs_;
00126 
00127   Array<int> nNodesPerCell_;
00128 
00129   Array<int> totalNNodesPerCell_;
00130 
00131   Array<Array<int> > numFacets_;
00132 
00133   Array<Array<int> > originalFacetOrientation_;
00134 
00135   bool basisIsContinuous_;
00136 
00137       
00138 };
00139 }
00140 
00141 
00142                   
00143 
00144 
00145 #endif

Site Contact