52 template<
class Scalar,
class ArrayScalar>
54 const EPointType pointType ):
56 coeffs_( (n+1)*(n+2) , n*(n+2) )
58 const int N = n*(n+2);
61 this ->
basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Triangle<3> >() );
66 const int littleN = n*(n+1);
67 const int bigN = (n+1)*(n+2);
68 const int scalarSmallestN = (n-1)*n / 2;
69 const int scalarLittleN = littleN/2;
70 const int scalarBigN = bigN/2;
76 Teuchos::SerialDenseMatrix<int,Scalar> V1(bigN, N);
87 for (
int i=0;i<scalarLittleN;i++) {
89 V1(scalarBigN+i,scalarLittleN+i) = 1.0;
101 Phis_.getValues( phisAtCubPoints , cubPoints , OPERATOR_VALUE );
104 for (
int i=0;i<n;i++) {
105 for (
int j=0;j<scalarBigN;j++) {
106 V1(j,littleN+i) = 0.0;
109 cubWeights(k) * cubPoints(k,1)
110 * phisAtCubPoints(scalarSmallestN+i,k)
111 * phisAtCubPoints(j,k);
114 for (
int j=0;j<scalarBigN;j++) {
115 V1(j+scalarBigN,littleN+i) = 0.0;
117 V1(j+scalarBigN,littleN+i) +=
118 cubWeights(k) * cubPoints(k,0)
119 * phisAtCubPoints(scalarSmallestN+i,k)
120 * phisAtCubPoints(j,k);
129 Teuchos::SerialDenseMatrix<int,Scalar> V2(N , bigN);
134 if (pointType == POINTTYPE_WARPBLEND) {
139 else if (pointType == POINTTYPE_EQUISPACED ) {
140 shards::CellTopology linetop(shards::getCellTopologyData<shards::Line<2> >() );
142 PointTools::getLattice<Scalar,FieldContainer<Scalar> >( linePts ,
145 POINTTYPE_EQUISPACED );
153 for (
int i=0;i<3;i++) {
158 for (
int j=0;j<2;j++) {
168 Phis_.getValues( phisAtEdgePoints , edgePts , OPERATOR_VALUE );
171 for (
int j=0;j<n;j++) {
173 for (
int k=0;k<scalarBigN;k++) {
174 V2(n*i+j,k) = edgeTan(0) * phisAtEdgePoints(k,j);
175 V2(n*i+j,k+scalarBigN) = edgeTan(1) * phisAtEdgePoints(k,j);
187 if (numInternalPoints > 0) {
189 PointTools::getLattice<Scalar,FieldContainer<Scalar> >( internalPoints ,
196 Phis_.getValues( phisAtInternalPoints , internalPoints , OPERATOR_VALUE );
199 for (
int i=0;i<numInternalPoints;i++) {
200 for (
int j=0;j<scalarBigN;j++) {
202 V2(3*n+i,j) = phisAtInternalPoints(j,i);
204 V2(3*n+numInternalPoints+i,scalarBigN+j) = phisAtInternalPoints(j,i);
212 Teuchos::SerialDenseMatrix<int,Scalar> Vsdm( N , N );
215 Vsdm.multiply( Teuchos::NO_TRANS , Teuchos::NO_TRANS , 1.0 , V2 , V1 , 0.0 );
221 Teuchos::SerialDenseSolver<int,Scalar> solver;
222 solver.setMatrix( rcp( &Vsdm ,
false ) );
225 Teuchos::SerialDenseMatrix<int,Scalar> Csdm( bigN , N );
226 Csdm.multiply( Teuchos::NO_TRANS , Teuchos::NO_TRANS , 1.0 , V1 , Vsdm , 0.0 );
230 for (
int i=0;i<bigN;i++) {
231 for (
int j=0;j<N;j++) {
237 template<
class Scalar,
class ArrayScalar>
248 int *tags =
new int[ tagSize * this->getCardinality() ];
250 const int degree = this->getDegree();
253 for (
int ed=0;ed<3;ed++) {
254 for (
int i=0;i<degree;i++) {
255 tag_cur[0] = 1; tag_cur[1] = ed; tag_cur[2] = i; tag_cur[3] = degree;
263 const int numFaceDof = (degree-1)*degree;
265 for (
int i=3*degree;i<degree*(degree+2);i++) {
266 tag_cur[0] = 2; tag_cur[1] = 0; tag_cur[2] = faceDofCur; tag_cur[3] = numFaceDof;
272 Intrepid::setOrdinalTagData(
this -> tagToOrdinal_,
273 this -> ordinalToTag_,
275 this -> basisCardinality_,
287 template<
class Scalar,
class ArrayScalar>
289 const ArrayScalar & inputPoints,
290 const EOperator operatorType)
const {
293 #ifdef HAVE_INTREPID_DEBUG
294 Intrepid::getValues_HCURL_Args<Scalar, ArrayScalar>(outputValues,
297 this -> getBaseCellTopology(),
298 this -> getCardinality() );
300 const int numPts = inputPoints.dimension(0);
301 const int deg =
this -> getDegree();
302 const int scalarBigN = (deg+1)*(deg+2)/2;
305 switch (operatorType) {
309 Phis_.getValues( phisCur , inputPoints , OPERATOR_VALUE );
311 for (
int i=0;i<outputValues.dimension(0);i++) {
312 for (
int j=0;j<outputValues.dimension(1);j++) {
313 outputValues(i,j,0) = 0.0;
314 outputValues(i,j,1) = 0.0;
315 for (
int k=0;k<scalarBigN;k++) {
316 outputValues(i,j,0) += coeffs_(k,i) * phisCur(k,j);
317 outputValues(i,j,1) += coeffs_(k+scalarBigN,i) * phisCur(k,j);
326 Phis_.getValues( phisCur , inputPoints , OPERATOR_GRAD );
327 for (
int i=0;i<outputValues.dimension(0);i++) {
328 for (
int j=0;j<outputValues.dimension(1);j++) {
330 outputValues(i,j) = 0.0;
331 for (
int k=0;k<scalarBigN;k++) {
332 outputValues(i,j) -= coeffs_(k,i) * phisCur(k,j,1);
335 for (
int k=0;k<scalarBigN;k++) {
336 outputValues(i,j) += coeffs_(k+scalarBigN,i) * phisCur(k,j,0);
343 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::invalid_argument,
344 ">>> ERROR (Basis_HCURL_TRI_In_FEM): Operator type not implemented");
348 catch (std::invalid_argument &exception){
349 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::invalid_argument,
350 ">>> ERROR (Basis_HCURL_TRI_In_FEM): Operator type not implemented");
357 template<
class Scalar,
class ArrayScalar>
359 const ArrayScalar & inputPoints,
360 const ArrayScalar & cellVertices,
361 const EOperator operatorType)
const {
362 TEUCHOS_TEST_FOR_EXCEPTION( (
true), std::logic_error,
363 ">>> ERROR (Basis_HCURL_TRI_In_FEM): FEM Basis calling an FVD member function");
Basis_HGRAD_TRI_Cn_FEM_ORTH< Scalar, FieldContainer< Scalar > > Phis_
Orthogonal basis of ofder n, in terms of which the H(curl) basis functions are expressed.
virtual void getCubature(ArrayPoint &cubPoints, ArrayWeight &cubWeights) const
Returns cubature points and weights (return arrays must be pre-sized/pre-allocated).
Defines Gauss integration rules on a line.
EBasis basisType_
Type of the basis.
Basis_HCURL_TRI_In_FEM(const int n, const EPointType pointType)
Constructor.
bool basisTagsAreSet_
"true" if tagToOrdinal_ and ordinalToTag_ have been initialized
virtual int getNumPoints() const
Returns the number of cubature points.
ECoordinates basisCoordinates_
The coordinate system for which the basis is defined.
shards::CellTopology basisCellTopology_
Base topology of the cells for which the basis is defined. See the Shards package http://trilinos...
FieldContainer< Scalar > coeffs_
Array holding the expansion coefficients of the nodal basis in terms of Phis_.
Defines direct integration rules on a triangle.
virtual const shards::CellTopology getBaseCellTopology() const
Returns the base cell topology for which the basis is defined. See Shards documentation http://trilin...
void getValues(ArrayScalar &outputValues, const ArrayScalar &inputPoints, const EOperator operatorType) const
Evaluation of a FEM basis on a reference Triangle cell.
int basisDegree_
Degree of the largest complete polynomial space that can be represented by the basis.
int basisCardinality_
Cardinality of the basis, i.e., the number of basis functions/degrees-of-freedom. ...
virtual void initializeTags()
Initializes tagToOrdinal_ and ordinalToTag_ lookup arrays.