00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
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
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;
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