1 #ifndef INTREPID_HGRAD_TRI_C1_FEMDEF_HPP 
    2 #define INTREPID_HGRAD_TRI_C1_FEMDEF_HPP 
   54 template<
class Scalar, 
class ArrayScalar>
 
   57     this -> basisCardinality_  = 3;
 
   58     this -> basisDegree_       = 1;    
 
   59     this -> basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Triangle<3> >() );
 
   60     this -> basisType_         = BASIS_FEM_DEFAULT;
 
   61     this -> basisCoordinates_  = COORDINATES_CARTESIAN;
 
   62     this -> basisTagsAreSet_   = 
false;
 
   67 template<
class Scalar, 
class ArrayScalar>
 
   77   int tags[]  = { 0, 0, 0, 1,
 
   82   Intrepid::setOrdinalTagData(
this -> tagToOrdinal_,
 
   83                               this -> ordinalToTag_,
 
   85                               this -> basisCardinality_,
 
   94 template<
class Scalar, 
class ArrayScalar> 
 
   96                                                             const ArrayScalar &  inputPoints,
 
   97                                                             const EOperator      operatorType)
 const {
 
  100 #ifdef HAVE_INTREPID_DEBUG 
  101   Intrepid::getValues_HGRAD_Args<Scalar, ArrayScalar>(outputValues,
 
  104                                                       this -> getBaseCellTopology(),
 
  105                                                       this -> getCardinality() );
 
  109   int dim0 = inputPoints.dimension(0);  
 
  115   switch (operatorType) {
 
  118       for (
int i0 = 0; i0 < dim0; i0++) {
 
  119         x = inputPoints(i0, 0);
 
  120         y = inputPoints(i0, 1);
 
  123         outputValues(0, i0) = 1.0 - x - y;
 
  124         outputValues(1, i0) = x;
 
  125         outputValues(2, i0) = y;
 
  131       for (
int i0 = 0; i0 < dim0; i0++) {
 
  134         outputValues(0, i0, 0) = -1.0;
 
  135         outputValues(0, i0, 1) = -1.0;
 
  137         outputValues(1, i0, 0) =  1.0;
 
  138         outputValues(1, i0, 1) =  0.0;
 
  140         outputValues(2, i0, 0) =  0.0;
 
  141         outputValues(2, i0, 1) =  1.0;
 
  146       for (
int i0 = 0; i0 < dim0; i0++) {
 
  147         outputValues(0, i0, 0) = -1.0;
 
  148         outputValues(0, i0, 1) =  1.0;
 
  150         outputValues(1, i0, 0) =  0.0;
 
  151         outputValues(1, i0, 1) = -1.0;
 
  153         outputValues(2, i0, 0) =  1.0;
 
  154         outputValues(2, i0, 1) =  0.0;
 
  159       TEUCHOS_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_DIV), std::invalid_argument,
 
  160                           ">>> ERROR (Basis_HGRAD_TRI_C1_FEM): DIV is invalid operator for rank-0 (scalar) fields in 2D.");
 
  174         int DkCardinality = Intrepid::getDkCardinality(operatorType, 
 
  175                                                        this -> basisCellTopology_.getDimension() );
 
  176         for(
int dofOrd = 0; dofOrd < 
this -> basisCardinality_; dofOrd++) {
 
  177           for (
int i0 = 0; i0 < dim0; i0++) {
 
  178             for(
int dkOrd = 0; dkOrd < DkCardinality; dkOrd++){
 
  179               outputValues(dofOrd, i0, dkOrd) = 0.0;
 
  187       TEUCHOS_TEST_FOR_EXCEPTION( !( Intrepid::isValidOperator(operatorType) ), std::invalid_argument,
 
  188                           ">>> ERROR (Basis_HGRAD_TRI_C1_FEM): Invalid operator type");
 
  194 template<
class Scalar, 
class ArrayScalar>
 
  196                                                             const ArrayScalar &    inputPoints,
 
  197                                                             const ArrayScalar &    cellVertices,
 
  198                                                             const EOperator        operatorType)
 const {
 
  199   TEUCHOS_TEST_FOR_EXCEPTION( (
true), std::logic_error,
 
  200                       ">>> ERROR (Basis_HGRAD_TRI_C1_FEM): FEM Basis calling an FVD member function");
 
  203 template<
class Scalar, 
class ArrayScalar>
 
  205 #ifdef HAVE_INTREPID_DEBUG 
  207   TEUCHOS_TEST_FOR_EXCEPTION( !(DofCoords.rank() == 2), std::invalid_argument,
 
  208                       ">>> ERROR: (Intrepid::Basis_HGRAD_TRI_C1_FEM::getDofCoords) rank = 2 required for DofCoords array");
 
  210   TEUCHOS_TEST_FOR_EXCEPTION( !( DofCoords.dimension(0) == 
this -> basisCardinality_ ), std::invalid_argument,
 
  211                       ">>> ERROR: (Intrepid::Basis_HGRAD_TRI_C1_FEM::getDofCoords) mismatch in number of DoF and 0th dimension of DofCoords array");
 
  213   TEUCHOS_TEST_FOR_EXCEPTION( !( DofCoords.dimension(1) == (int)(
this -> basisCellTopology_.getDimension()) ), std::invalid_argument,
 
  214                       ">>> ERROR: (Intrepid::Basis_HGRAD_TRI_C1_FEM::getDofCoords) incorrect reference cell (1st) dimension in DofCoords array");
 
  217   DofCoords(0,0) =  0.0;   DofCoords(0,1) =  0.0;
 
  218   DofCoords(1,0) =  1.0;   DofCoords(1,1) =  0.0;
 
  219   DofCoords(2,0) =  0.0;   DofCoords(2,1) =  1.0;
 
void getDofCoords(ArrayScalar &DofCoords) const 
Returns spatial locations (coordinates) of degrees of freedom on a reference Quadrilateral. 
void getValues(ArrayScalar &outputValues, const ArrayScalar &inputPoints, const EOperator operatorType) const 
Evaluation of a FEM basis on a reference Triangle cell. 
Basis_HGRAD_TRI_C1_FEM()
Constructor. 
void initializeTags()
Initializes tagToOrdinal_ and ordinalToTag_ lookup arrays.