SundanceNedelec.cpp
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 #include "SundanceNedelec.hpp"
00032 #include "SundanceADReal.hpp"
00033 #include "PlayaExceptions.hpp"
00034 #include "SundanceSpatialDerivSpecifier.hpp"
00035 #include "SundancePoint.hpp"
00036 #include "SundanceObjectWithVerbosity.hpp"
00037 #include "SundanceOut.hpp"
00038 
00039 using namespace Sundance;
00040 using namespace Sundance;
00041 using namespace Sundance;
00042 using namespace Teuchos;
00043 
00044 
00045 Nedelec::Nedelec(int spatialDim)
00046   : HCurlVectorBasis(spatialDim)
00047 {}
00048 
00049 bool Nedelec::supportsCellTypePair(
00050   const CellType& maximalCellType,
00051   const CellType& cellType
00052   ) const
00053 {
00054   switch(maximalCellType)
00055   {
00056     case TriangleCell:
00057       switch(cellType)
00058       {
00059         case TriangleCell:
00060         case LineCell:
00061         case PointCell:
00062           return true;
00063         default:
00064           return false;
00065       }
00066     case TetCell:
00067       // tets not yet implemented
00068       return false;
00069       switch(cellType)
00070       {
00071         case TetCell:
00072         case TriangleCell:
00073         case LineCell:
00074         case PointCell:
00075           return true;
00076         default:
00077           return false;
00078       }
00079     default:
00080       return false;
00081   }
00082 }
00083 
00084 void Nedelec::print(std::ostream& os) const 
00085 {
00086   os << "Nedelec()";
00087 }
00088 
00089 int Nedelec::nReferenceDOFsWithoutFacets(
00090   const CellType& maximalCellType,
00091   const CellType& cellType
00092   ) const
00093 {
00094   TEUCHOS_TEST_FOR_EXCEPT(maximalCellType != TriangleCell);
00095   switch(cellType)
00096     {
00097     case PointCell:
00098       return 0;
00099     case LineCell:
00100       return 1;
00101     case TriangleCell:
00102       return 0;
00103     default:
00104       TEUCHOS_TEST_FOR_EXCEPTION(true, std::runtime_error, "Cell type "
00105                          << cellType << " not implemented in Nedelec basis");
00106       return -1; // -Wall
00107     }
00108 }
00109 
00110 void Nedelec::getReferenceDOFs(
00111   const CellType& maximalCellType,
00112   const CellType& cellType,
00113   Array<Array<Array<int> > >& dofs) const 
00114 {
00115   switch(cellType)
00116     {
00117     case PointCell:
00118       dofs.resize(1);
00119       dofs[0] = tuple(Array<int>());
00120       return;
00121     case LineCell:
00122       dofs.resize(2);
00123       dofs[0] = tuple(Array<int>());
00124       dofs[1] = tuple<Array<int> >(tuple(0));
00125       return;
00126     case TriangleCell:
00127       dofs.resize(3);
00128       dofs[0] = tuple(Array<int>());
00129       dofs[1] = tuple<Array<int> >(tuple(0), tuple(1), tuple(2));
00130       dofs[2] = tuple(Array<int>());
00131       return;
00132     case TetCell:
00133       dofs.resize(4);
00134       dofs[0] = tuple(Array<int>());
00135       dofs[1] = tuple<Array<int> >(tuple(0), tuple(1), tuple(2), tuple(3));
00136       dofs[2] = tuple(Array<int>());
00137       dofs[3] = tuple(Array<int>());
00138       return;
00139     default:
00140       TEUCHOS_TEST_FOR_EXCEPTION(true, std::runtime_error, "Cell type "
00141                          << cellType << " not implemented in Nedelec basis");
00142     }
00143 }
00144 
00145 
00146 
00147 void Nedelec::refEval(
00148   const CellType& cellType,
00149   const Array<Point>& pts,
00150   const SpatialDerivSpecifier& deriv,
00151   Array<Array<Array<double> > >& result,
00152   int verbosity) const
00153 {
00154   TEUCHOS_TEST_FOR_EXCEPTION(true, std::runtime_error, "evaluation of Nedelec elements not yet supported");
00155 }
00156 
00157 

Site Contact