1#ifndef INTREPID_HGRAD_LINE_CN_FEM_JACOBIDEF_HPP
2#define INTREPID_HGRAD_LINE_CN_FEM_JACOBIDEF_HPP
54template<
class Scalar,
class ArrayScalar>
58 this -> jacobiAlpha_ = alpha;
59 this -> jacobiBeta_ = beta;
60 this ->
basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Line<> >() );
68template<
class Scalar,
class ArrayScalar>
70 const ArrayScalar & inputPoints,
71 const EOperator operatorType)
const {
74#ifdef HAVE_INTREPID_DEBUG
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: {
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];
110 for (
int pt = 0; pt < numPoints; pt++) {
112 outputValues(ord, pt, 0) = jacobiPolyAtPoints[pt];
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");
184template<
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");
195template<
class Scalar,
class ArrayScalar>
199 this -> jacobiAlpha_ = alpha;
200 this -> jacobiBeta_ = beta;
206template<
class Scalar,
class ArrayScalar>
222 tags(i, 3) = this->basisCardinality_;
239#if defined(Intrepid_SHOW_DEPRECATED_WARNINGS)
241#warning "The Intrepid package is deprecated"
void getValues_HGRAD_Args(ArrayScalar &outputValues, const ArrayScalar &inputPoints, const EOperator operatorType, const shards::CellTopology &cellTopo, const int basisCard)
Runtime check of the arguments for the getValues method in an HGRAD-conforming FEM basis....
void setOrdinalTagData(std::vector< std::vector< std::vector< int > > > &tagToOrdinal, std::vector< std::vector< int > > &ordinalToTag, const int *tags, const int basisCard, const int tagSize, const int posScDim, const int posScOrd, const int posDfOrd)
Fills ordinalToTag_ and tagToOrdinal_ by basis-specific tag data.
int getOperatorOrder(const EOperator operatorType)
Returns order of an operator.
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.
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.
virtual int getDegree() const
Returns the degree of the basis.
bool basisTagsAreSet_
"true" if tagToOrdinal_ and ordinalToTag_ have been initialized
virtual const shards::CellTopology getBaseCellTopology() const
Returns the base cell topology for which the basis is defined. See Shards documentation http://trilin...
std::vector< std::vector< std::vector< int > > > tagToOrdinal_
DoF tag to ordinal lookup table.
int basisCardinality_
Cardinality of the basis, i.e., the number of basis functions/degrees-of-freedom.
ECoordinates basisCoordinates_
The coordinate system for which the basis is defined.
EBasis basisType_
Type of the basis.
int basisDegree_
Degree of the largest complete polynomial space that can be represented by the basis.
std::vector< std::vector< int > > ordinalToTag_
DoF ordinal to tag lookup table.
shards::CellTopology basisCellTopology_
Base topology of the cells for which the basis is defined. See the Shards package http://trilinos....
virtual int getCardinality() const
Returns cardinality of the basis.
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, .
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.