1#ifndef INTREPID_HGRAD_LINE_CN_FEMDEF_HPP
2#define INTREPID_HGRAD_LINE_CN_FEMDEF_HPP
53 template<
class Scalar,
class ArrayScalar>
55 const ArrayScalar &pts ):
64 this ->
basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Line<2> >() );
71 for (
int i=0;i<n;i++) {
72 TEUCHOS_TEST_FOR_EXCEPTION( pts(i,0) >= pts(i+1,0) ,
74 "Intrepid::Basis_HGRAD_LINE_Cn_FEM Illegal points given to constructor" );
84 for (
int i=1;i<n;i++) {
100 Teuchos::SerialDenseMatrix<int,Scalar> Vsdm(N,N);
101 for (
int i=0;i<N;i++) {
102 for (
int j=0;j<N;j++) {
108 Teuchos::SerialDenseSolver<int,Scalar> solver;
109 solver.setMatrix( rcp( &Vsdm ,
false ) );
113 for (
int i=0;i<N;i++) {
114 for (
int j=0;j<N;j++) {
115 Vinv_(i,j) = Vsdm(j,i);
121 template<
class Scalar,
class ArrayScalar>
123 const EPointType &pointType ):
132 this ->
basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Line<2> >() );
138 case POINTTYPE_EQUISPACED:
141 case POINTTYPE_SPECTRAL:
144 case POINTTYPE_SPECTRAL_OPEN:
148 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::invalid_argument ,
"Basis_HGRAD_LINE_Cn_FEM:: invalid point type" );
158 Teuchos::SerialDenseMatrix<int,Scalar> Vsdm(N,N);
159 for (
int i=0;i<N;i++) {
160 for (
int j=0;j<N;j++) {
166 Teuchos::SerialDenseSolver<int,Scalar> solver;
167 solver.setMatrix( rcp( &Vsdm ,
false ) );
171 for (
int i=0;i<N;i++) {
172 for (
int j=0;j<N;j++) {
173 Vinv_(i,j) = Vsdm(j,i);
179 template<
class Scalar,
class ArrayScalar>
214 for (
int i=1;i<n;i++) {
217 tags[4*i+2] = -edge_dof + i;
218 tags[4*i+3] = internal_dof;
248 template<
class Scalar,
class ArrayScalar>
250 const ArrayScalar & inputPoints,
251 const EOperator operatorType)
const {
254#ifdef HAVE_INTREPID_DEBUG
261 const int numPts = inputPoints.dimension(0);
265 switch (operatorType) {
269 Phis_.getValues( phisCur , inputPoints , operatorType );
270 for (
int i=0;i<outputValues.dimension(0);i++) {
271 for (
int j=0;j<outputValues.dimension(1);j++) {
272 outputValues(i,j) = 0.0;
274 outputValues(i,j) += this->
Vinv_(k,i) * phisCur(k,j);
296 Phis_.getValues( phisCur , inputPoints , operatorType );
298 for (
int i=0;i<outputValues.dimension(0);i++) {
299 for (
int j=0;j<outputValues.dimension(1);j++) {
300 for (
int k=0;k<outputValues.dimension(2);k++) {
301 outputValues(i,j,k) = 0.0;
303 outputValues(i,j,k) += this->
Vinv_(l,i) * phisCur(l,j,k);
311 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::invalid_argument,
312 ">>> ERROR (Basis_HGRAD_LINE_Cn_FEM): Operator type not implemented" );
316 catch (std::invalid_argument &exception){
317 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::invalid_argument,
318 ">>> ERROR (Basis_HGRAD_LINE_Cn_FEM): Operator failed");
325 template<
class Scalar,
class ArrayScalar>
327 const ArrayScalar & inputPoints,
328 const ArrayScalar & cellVertices,
329 const EOperator operatorType)
const {
330 TEUCHOS_TEST_FOR_EXCEPTION( (
true), std::logic_error,
331 ">>> ERROR (Basis_HGRAD_LINE_Cn_FEM): FEM Basis calling an FVD member function");
335 template<
class Scalar,
class ArrayScalar>
351#if defined(Intrepid_SHOW_DEPRECATED_WARNINGS)
353#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....
static const double INTREPID_TOL
General purpose tolerance in, e.g., internal Newton's method to invert ref to phys maps.
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 getDkCardinality(const EOperator operatorType, const int spaceDim)
Returns cardinality of Dk, i.e., the number of all derivatives of order k.
void initializeTags()
Initializes tagToOrdinal_ and ordinalToTag_ lookup arrays.
Basis_HGRAD_LINE_Cn_FEM(int order, const ArrayScalar &pts)
Constructor.
FieldContainer< Scalar > latticePts_
Holds the points defining the Lagrange basis.
FieldContainer< Scalar > Vinv_
inverse of Generalized Vandermonde matrix, whose columns store the expansion coefficients of the noda...
void getValues(ArrayScalar &outputValues, const ArrayScalar &inputPoints, const EOperator operatorType) const
Evaluation of a FEM basis on a reference Line cell.
FieldContainer< Scalar > V_
Generalized Vandermonde matrix V_{ij} = phis_i(x_j).
virtual void getDofCoords(ArrayScalar &DofCoords) const
implements the dofcoords interface
Basis_HGRAD_LINE_Cn_FEM_JACOBI< Scalar, FieldContainer< Scalar > > Phis_
orthogonal basis
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....