1 #ifndef INTREPID_HGRAD_LINE_CN_FEM_JACOBIDEF_HPP
2 #define INTREPID_HGRAD_LINE_CN_FEM_JACOBIDEF_HPP
54 template<
class Scalar,
class ArrayScalar>
56 this -> basisCardinality_ = order+1;
57 this -> basisDegree_ = order;
58 this -> jacobiAlpha_ = alpha;
59 this -> jacobiBeta_ = beta;
60 this -> basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Line<> >() );
61 this -> basisType_ = BASIS_FEM_HIERARCHICAL;
62 this -> basisCoordinates_ = COORDINATES_CARTESIAN;
63 this -> basisTagsAreSet_ =
false;
68 template<
class Scalar,
class ArrayScalar>
70 const ArrayScalar & inputPoints,
71 const EOperator operatorType)
const {
74 #ifdef HAVE_INTREPID_DEBUG
75 Intrepid::getValues_HGRAD_Args<Scalar, ArrayScalar>(outputValues,
78 this -> getBaseCellTopology(),
79 this -> getCardinality() );
83 int numPoints = inputPoints.dimension(0);
85 Teuchos::Array<Scalar> tmpPoints(numPoints);
86 Teuchos::Array<Scalar> jacobiPolyAtPoints(numPoints);
89 for (
int i=0; i<numPoints; i++) {
90 tmpPoints[i] = inputPoints(i, 0);
94 switch (operatorType) {
95 case OPERATOR_VALUE: {
96 for (
int ord = 0; ord <
this -> basisCardinality_; ord++) {
97 IntrepidPolylib::jacobfd(numPoints, &tmpPoints[0], &jacobiPolyAtPoints[0], (Scalar*)0, ord, jacobiAlpha_, jacobiBeta_);
98 for (
int pt = 0; pt < numPoints; pt++) {
100 outputValues(ord, pt) = jacobiPolyAtPoints[pt];
108 for (
int ord = 0; ord <
this -> basisCardinality_; ord++) {
110 for (
int pt = 0; pt < numPoints; pt++) {
112 outputValues(ord, pt, 0) = jacobiPolyAtPoints[pt];
127 int d_order = getOperatorOrder( operatorType );
131 if (d_order > this->getDegree()) {
132 stop_order = this->getDegree();
135 stop_order = d_order;
137 for (
int p_order=0;p_order<stop_order;p_order++) {
138 for (
int pt=0;pt<numPoints;pt++) {
139 outputValues(p_order,pt,0) = 0.0;
143 for (
int p_order=d_order;p_order<=this->getDegree();p_order++) {
145 Scalar scalefactor = 1.0;
146 for (
int d=1;d<=d_order;d++) {
147 scalefactor *= 0.5 * ( p_order + jacobiAlpha_ + jacobiBeta_ + d );
152 &jacobiPolyAtPoints[0],
153 (Scalar*)0, p_order-d_order,
154 jacobiAlpha_ + d_order,
155 jacobiBeta_ + d_order);
156 for (
int pt = 0; pt < numPoints; pt++) {
158 outputValues(p_order, pt,0) = scalefactor *jacobiPolyAtPoints[pt];
167 TEUCHOS_TEST_FOR_EXCEPTION( !( Intrepid::isValidOperator(operatorType) ), std::invalid_argument,
168 ">>> ERROR (Basis_HGRAD_LINE_Cn_FEM_JACOBI): Invalid operator type.");
171 TEUCHOS_TEST_FOR_EXCEPTION( !( Intrepid::isValidOperator(operatorType) ), std::invalid_argument,
172 ">>> ERROR (Basis_HGRAD_LINE_Cn_FEM_JACOBI): Invalid operator type.");
176 catch (std::invalid_argument &exception){
177 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::invalid_argument,
178 ">>> ERROR (Basis_HGRAD_LINE_Cn_FEM_JACOBI): Operator failed");
184 template<
class Scalar,
class ArrayScalar>
186 const ArrayScalar & inputPoints,
187 const ArrayScalar & cellVertices,
188 const EOperator operatorType)
const {
189 TEUCHOS_TEST_FOR_EXCEPTION( (
true), std::logic_error,
190 ">>> ERROR (Basis_HGRAD_LINE_Cn_FEM_JACOBI): FEM Basis calling an FVD member function");
195 template<
class Scalar,
class ArrayScalar>
197 this -> basisCardinality_ = n+1;
198 this -> basisDegree_ = n;
199 this -> jacobiAlpha_ = alpha;
200 this -> jacobiBeta_ = beta;
201 this -> initializeTags();
206 template<
class Scalar,
class ArrayScalar>
218 for (
int i=0; i < this->basisCardinality_; i++) {
222 tags(i, 3) = this->basisCardinality_;
226 Intrepid::setOrdinalTagData(
this -> tagToOrdinal_,
227 this -> ordinalToTag_,
229 this -> basisCardinality_,
void initializeTags()
Initializes tagToOrdinal_ and ordinalToTag_ lookup arrays.
void getValues(ArrayScalar &outputValues, const ArrayScalar &inputPoints, const EOperator operatorType) const
Evaluation of a FEM basis on a reference Line cell.
static void jacobd(const int np, const Scalar *z, Scalar *polyd, const int n, const Scalar alpha, const Scalar beta)
Calculate the derivative of Jacobi polynomials.
Implementation of a templated lexicographical container for a multi-indexed scalar quantity...
static void jacobfd(const int np, const Scalar *z, Scalar *poly_in, Scalar *polyd, const int n, const Scalar alpha, const Scalar beta)
Routine to calculate Jacobi polynomials, , and their first derivative, .
void setBasisParameters(int n, Scalar alpha=0, Scalar beta=0)
Sets private data basisDegree_, basisCardinality_, jacobiAlpha_, and jacobiBeta_, to n...
Basis_HGRAD_LINE_Cn_FEM_JACOBI(int order, Scalar alpha=0, Scalar beta=0)
Constructor.