51 template<
class Scalar,
class ArrayScalar>
53 const ArrayScalar & ptsClosed ,
54 const ArrayScalar & ptsOpen):
55 closedBasis_( order , ptsClosed ),
56 openBasis_( order-1 , ptsOpen ) ,
57 closedPts_( ptsClosed ),
61 this ->
basisCardinality_ = 2 * closedBasis_.getCardinality() * openBasis_.getCardinality();
62 this ->
basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Quadrilateral<4> >() );
67 Array<Array<RCP<Basis<Scalar,ArrayScalar > > > > bases(2);
68 bases[0].resize(2); bases[1].resize(2);
69 bases[0][0] = rcp( &openBasis_ ,
false );
70 bases[0][1] = rcp( &closedBasis_ ,
false );
71 bases[1][0] = rcp( &closedBasis_ ,
false );
72 bases[1][1] = rcp( &openBasis_ ,
false );
73 this->setBases( bases );
78 template<
class Scalar,
class ArrayScalar>
80 closedBasis_( order , pointType==POINTTYPE_SPECTRAL?POINTTYPE_SPECTRAL:POINTTYPE_EQUISPACED ),
81 openBasis_( order-1 , pointType==POINTTYPE_SPECTRAL?POINTTYPE_SPECTRAL_OPEN:POINTTYPE_EQUISPACED ) ,
82 closedPts_( order+1 , 1 ),
86 this ->
basisCardinality_ = 2 * closedBasis_.getCardinality() * openBasis_.getCardinality();
87 this ->
basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Quadrilateral<4> >() );
92 PointTools::getLattice<Scalar,FieldContainer<Scalar> >( closedPts_ ,
93 shards::CellTopology(shards::getCellTopologyData<shards::Line<2> >()) ,
96 pointType==POINTTYPE_SPECTRAL?POINTTYPE_WARPBLEND:POINTTYPE_EQUISPACED );
98 if (pointType == POINTTYPE_SPECTRAL)
100 PointTools::getGaussPoints<Scalar,FieldContainer<Scalar> >( openPts_ ,
105 PointTools::getLattice<Scalar,FieldContainer<Scalar> >( openPts_ ,
106 shards::CellTopology(shards::getCellTopologyData<shards::Line<2> >()) ,
109 POINTTYPE_EQUISPACED );
112 Array<Array<RCP<Basis<Scalar,ArrayScalar > > > > bases(2);
113 bases[0].resize(2); bases[1].resize(2);
114 bases[0][0] = rcp( &openBasis_ ,
false );
115 bases[0][1] = rcp( &closedBasis_ ,
false );
116 bases[1][0] = rcp( &closedBasis_ ,
false );
117 bases[1][1] = rcp( &openBasis_ ,
false );
118 this->setBases( bases );
122 template<
class Scalar,
class ArrayScalar>
131 std::vector<int> tags( tagSize * this->getCardinality() );
133 const std::vector<std::vector<int> >& closedDofTags = closedBasis_.getAllDofTags();
134 const std::vector<std::vector<int> >& openDofTags = openBasis_.getAllDofTags();
136 std::map<int,std::map<int,int> > total_dof_per_entity;
137 std::map<int,std::map<int,int> > current_dof_per_entity;
139 for (
int i=0;i<4;i++) {
140 total_dof_per_entity[0][i] = 0;
141 current_dof_per_entity[0][i] = 0;
143 for (
int i=0;i<4;i++) {
144 total_dof_per_entity[1][i] = 0;
145 current_dof_per_entity[1][i] = 0;
147 total_dof_per_entity[2][0] = 0;
148 current_dof_per_entity[2][0] = 0;
151 for (
int i=0;i<4;i++) {
152 total_dof_per_entity[1][i] = openBasis_.getCardinality();
155 total_dof_per_entity[2][0] = this->getCardinality() - 4 * openBasis_.getCardinality();
160 for (
int j=0;j<closedBasis_.getCardinality();j++)
162 const int cdim = closedDofTags[j][0];
163 const int cent = closedDofTags[j][1];
164 for (
int i=0;i<openBasis_.getCardinality();i++)
166 const int odim = openDofTags[i][0];
167 const int oent = openDofTags[i][1];
171 tags[4*tagcur] = dofdim;
172 tags[4*tagcur+1] = dofent;
173 tags[4*tagcur+2] = current_dof_per_entity[dofdim][dofent];
174 current_dof_per_entity[dofdim][dofent]++;
175 tags[4*tagcur+3] = total_dof_per_entity[dofdim][dofent];
182 for (
int j=0;j<openBasis_.getCardinality();j++)
184 const int odim = openDofTags[j][0];
185 const int oent = openDofTags[j][1];
186 for (
int i=0;i<closedBasis_.getCardinality();i++)
188 const int cdim = closedDofTags[i][0];
189 const int cent = closedDofTags[i][1];
193 tags[4*tagcur] = dofdim;
194 tags[4*tagcur+1] = dofent;
195 tags[4*tagcur+2] = current_dof_per_entity[dofdim][dofent];
196 current_dof_per_entity[dofdim][dofent]++;
197 tags[4*tagcur+3] = total_dof_per_entity[dofdim][dofent];
203 Intrepid::setOrdinalTagData(
this -> tagToOrdinal_,
204 this -> ordinalToTag_,
206 this -> basisCardinality_,
214 template<
class Scalar,
class ArrayScalar>
216 const ArrayScalar & inputPoints,
217 const EOperator operatorType)
const {
220 #ifdef HAVE_INTREPID_DEBUG
221 Intrepid::getValues_HCURL_Args<Scalar, ArrayScalar>(outputValues,
224 this -> getBaseCellTopology(),
225 this -> getCardinality() );
229 int dim0 = inputPoints.dimension(0);
235 for (
int i=0;i<dim0;i++) {
236 xPoints(i,0) = inputPoints(i,0);
237 yPoints(i,0) = inputPoints(i,1);
240 switch (operatorType) {
248 closedBasis_.getValues( closedBasisValsXPts , xPoints , OPERATOR_VALUE );
249 closedBasis_.getValues( closedBasisValsYPts , yPoints , OPERATOR_VALUE );
250 openBasis_.getValues( openBasisValsXPts , xPoints , OPERATOR_VALUE );
251 openBasis_.getValues( openBasisValsYPts , yPoints , OPERATOR_VALUE );
255 for (
int j=0;j<closedBasis_.getCardinality();j++)
257 for (
int i=0;i<openBasis_.getCardinality();i++)
259 for (
int l=0;l<dim0;l++)
261 outputValues(bfcur,l,0) = closedBasisValsYPts(j,l) * openBasisValsXPts(i,l);
262 outputValues(bfcur,l,1) = 0.0;
269 for (
int j=0;j<openBasis_.getCardinality();j++)
271 for (
int i=0;i<closedBasis_.getCardinality();i++)
273 for (
int l=0;l<dim0;l++)
275 outputValues(bfcur,l,0) = 0.0;
276 outputValues(bfcur,l,1) = openBasisValsYPts(j,l) * closedBasisValsXPts(i,l);
290 closedBasis_.getValues( closedBasisDerivsXPts , xPoints , OPERATOR_D1 );
291 closedBasis_.getValues( closedBasisDerivsYPts , yPoints , OPERATOR_D1 );
292 openBasis_.getValues( openBasisValsXPts , xPoints , OPERATOR_VALUE );
293 openBasis_.getValues( openBasisValsYPts , yPoints , OPERATOR_VALUE );
298 for (
int j=0;j<closedBasis_.getCardinality();j++)
300 for (
int i=0;i<openBasis_.getCardinality();i++)
302 for (
int l=0;l<dim0;l++) {
303 outputValues(bfcur,l) = -closedBasisDerivsYPts(j,l,0) * openBasisValsXPts(i,l);
310 for (
int j=0;j<openBasis_.getCardinality();j++)
312 for (
int i=0;i<closedBasis_.getCardinality();i++)
314 for (
int l=0;l<dim0;l++)
316 outputValues(bfcur,l) = closedBasisDerivsXPts(i,l,0) * openBasisValsYPts(j,l);
324 TEUCHOS_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_DIV), std::invalid_argument,
325 ">>> ERROR (Basis_HCURL_QUAD_In_FEM): DIV is invalid operator for HCURL Basis Functions");
329 TEUCHOS_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_GRAD), std::invalid_argument,
330 ">>> ERROR (Basis_HCURL_QUAD_In_FEM): GRAD is invalid operator for HCURL Basis Functions");
343 TEUCHOS_TEST_FOR_EXCEPTION( ( (operatorType == OPERATOR_D1) ||
344 (operatorType == OPERATOR_D2) ||
345 (operatorType == OPERATOR_D3) ||
346 (operatorType == OPERATOR_D4) ||
347 (operatorType == OPERATOR_D5) ||
348 (operatorType == OPERATOR_D6) ||
349 (operatorType == OPERATOR_D7) ||
350 (operatorType == OPERATOR_D8) ||
351 (operatorType == OPERATOR_D9) ||
352 (operatorType == OPERATOR_D10) ),
353 std::invalid_argument,
354 ">>> ERROR (Basis_HCURL_QUAD_In_FEM): Invalid operator type");
358 TEUCHOS_TEST_FOR_EXCEPTION( ( (operatorType != OPERATOR_VALUE) &&
359 (operatorType != OPERATOR_GRAD) &&
360 (operatorType != OPERATOR_CURL) &&
361 (operatorType != OPERATOR_CURL) &&
362 (operatorType != OPERATOR_D1) &&
363 (operatorType != OPERATOR_D2) &&
364 (operatorType != OPERATOR_D3) &&
365 (operatorType != OPERATOR_D4) &&
366 (operatorType != OPERATOR_D5) &&
367 (operatorType != OPERATOR_D6) &&
368 (operatorType != OPERATOR_D7) &&
369 (operatorType != OPERATOR_D8) &&
370 (operatorType != OPERATOR_D9) &&
371 (operatorType != OPERATOR_D10) ),
372 std::invalid_argument,
373 ">>> ERROR (Basis_HCURL_QUAD_In_FEM): Invalid operator type");
379 template<
class Scalar,
class ArrayScalar>
381 const ArrayScalar & inputPoints,
382 const ArrayScalar & cellVertices,
383 const EOperator operatorType)
const {
384 TEUCHOS_TEST_FOR_EXCEPTION( (
true), std::logic_error,
385 ">>> ERROR (Basis_HCURL_QUAD_In_FEM): FEM Basis calling an FVD member function");
388 template<
class Scalar,
class ArrayScalar>
394 for (
int j=0;j<closedPts_.dimension(0);j++)
396 for (
int i=0;i<openPts_.dimension(0);i++)
398 DofCoords(cur,0) = openPts_(i,0);
399 DofCoords(cur,1) = closedPts_(j,0);
405 for (
int j=0;j<openPts_.dimension(0);j++)
407 for (
int i=0;i<closedPts_.dimension(0);i++)
409 DofCoords(cur,0) = closedPts_(i,0);
410 DofCoords(cur,1) = openPts_(j,0);
422 #if defined(Intrepid_SHOW_DEPRECATED_WARNINGS)
424 #warning "The Intrepid package is deprecated"
EBasis basisType_
Type of the basis.
static void lineProduct2d(const int dim0, const int entity0, const int dim1, const int entity1, int &resultdim, int &resultentity)
bool basisTagsAreSet_
"true" if tagToOrdinal_ and ordinalToTag_ have been initialized
virtual void getDofCoords(ArrayScalar &DofCoords) const
Returns spatial locations (coordinates) of degrees of freedom on a reference cell; defined for interp...
ECoordinates basisCoordinates_
The coordinate system for which the basis is defined.
void getValues(ArrayScalar &outputValues, const ArrayScalar &inputPoints, const EOperator operatorType) const
Evaluation of a FEM basis on a reference Quadrilateral cell.
shards::CellTopology basisCellTopology_
Base topology of the cells for which the basis is defined. See the Shards package http://trilinos...
void initializeTags()
Initializes tagToOrdinal_ and ordinalToTag_ lookup arrays.
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. ...
Basis_HCURL_QUAD_In_FEM(int order, const ArrayScalar &ptsClosed, const ArrayScalar &ptsOpen)
Constructor.