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( &closedBasis_ ,
false );
70 bases[0][1] = rcp( &openBasis_ ,
false );
71 bases[1][0] = rcp( &openBasis_ ,
false );
72 bases[1][1] = rcp( &closedBasis_ ,
false );
73 this->setBases( bases );
77 template<
class Scalar,
class ArrayScalar>
79 closedBasis_( order , pointType==POINTTYPE_SPECTRAL?POINTTYPE_SPECTRAL:POINTTYPE_EQUISPACED ),
80 openBasis_( order-1 , pointType==POINTTYPE_SPECTRAL?POINTTYPE_SPECTRAL_OPEN:POINTTYPE_EQUISPACED ),
81 closedPts_( order+1 , 1 ),
85 this ->
basisCardinality_ = 2 * closedBasis_.getCardinality() * openBasis_.getCardinality();
86 this ->
basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Quadrilateral<4> >() );
91 PointTools::getLattice<Scalar,FieldContainer<Scalar> >( closedPts_ ,
92 shards::CellTopology(shards::getCellTopologyData<shards::Line<2> >()) ,
95 pointType==POINTTYPE_SPECTRAL?POINTTYPE_WARPBLEND:POINTTYPE_EQUISPACED );
97 if (pointType == POINTTYPE_SPECTRAL)
99 PointTools::getGaussPoints<Scalar,FieldContainer<Scalar> >( openPts_ ,
104 PointTools::getLattice<Scalar,FieldContainer<Scalar> >( openPts_ ,
105 shards::CellTopology(shards::getCellTopologyData<shards::Line<2> >()) ,
108 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( &closedBasis_ ,
false );
115 bases[0][1] = rcp( &openBasis_ ,
false );
116 bases[1][0] = rcp( &openBasis_ ,
false );
117 bases[1][1] = rcp( &closedBasis_ ,
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<openBasis_.getCardinality();j++) {
161 const int odim = openDofTags[j][0];
162 const int oent = openDofTags[j][1];
163 for (
int i=0;i<closedBasis_.getCardinality();i++) {
164 const int cdim = closedDofTags[i][0];
165 const int cent = closedDofTags[i][1];
169 tags[4*tagcur] = dofdim;
170 tags[4*tagcur+1] = dofent;
171 tags[4*tagcur+2] = current_dof_per_entity[dofdim][dofent];
172 current_dof_per_entity[dofdim][dofent]++;
173 tags[4*tagcur+3] = total_dof_per_entity[dofdim][dofent];
179 for (
int j=0;j<closedBasis_.getCardinality();j++) {
180 const int cdim = closedDofTags[j][0];
181 const int cent = closedDofTags[j][1];
182 for (
int i=0;i<openBasis_.getCardinality();i++) {
183 const int odim = openDofTags[i][0];
184 const int oent = openDofTags[i][1];
188 tags[4*tagcur] = dofdim;
189 tags[4*tagcur+1] = dofent;
190 tags[4*tagcur+2] = current_dof_per_entity[dofdim][dofent];
191 current_dof_per_entity[dofdim][dofent]++;
192 tags[4*tagcur+3] = total_dof_per_entity[dofdim][dofent];
205 Intrepid::setOrdinalTagData(
this -> tagToOrdinal_,
206 this -> ordinalToTag_,
208 this -> basisCardinality_,
216 template<
class Scalar,
class ArrayScalar>
218 const ArrayScalar & inputPoints,
219 const EOperator operatorType)
const {
222 #ifdef HAVE_INTREPID_DEBUG
223 Intrepid::getValues_HDIV_Args<Scalar, ArrayScalar>(outputValues,
226 this -> getBaseCellTopology(),
227 this -> getCardinality() );
231 int dim0 = inputPoints.dimension(0);
237 for (
int i=0;i<dim0;i++) {
238 xPoints(i,0) = inputPoints(i,0);
239 yPoints(i,0) = inputPoints(i,1);
242 switch (operatorType) {
250 closedBasis_.getValues( closedBasisValsXPts , xPoints , OPERATOR_VALUE );
251 closedBasis_.getValues( closedBasisValsYPts , yPoints , OPERATOR_VALUE );
252 openBasis_.getValues( openBasisValsXPts , xPoints , OPERATOR_VALUE );
253 openBasis_.getValues( openBasisValsYPts , yPoints , OPERATOR_VALUE );
257 for (
int j=0;j<openBasis_.getCardinality();j++) {
258 for (
int i=0;i<closedBasis_.getCardinality();i++) {
259 for (
int l=0;l<dim0;l++) {
260 outputValues(bfcur,l,0) = closedBasisValsXPts(i,l) * openBasisValsYPts(j,l);
261 outputValues(bfcur,l,1) = 0.0;
268 for (
int j=0;j<closedBasis_.getCardinality();j++) {
269 for (
int i=0;i<openBasis_.getCardinality();i++) {
270 for (
int l=0;l<dim0;l++) {
271 outputValues(bfcur,l,0) = 0.0;
272 outputValues(bfcur,l,1) = openBasisValsXPts(i,l) * closedBasisValsYPts(j,l);
286 closedBasis_.getValues( closedBasisDerivsXPts , xPoints , OPERATOR_D1 );
287 closedBasis_.getValues( closedBasisDerivsYPts , yPoints , OPERATOR_D1 );
288 openBasis_.getValues( openBasisValsXPts , xPoints , OPERATOR_VALUE );
289 openBasis_.getValues( openBasisValsYPts , yPoints , OPERATOR_VALUE );
294 for (
int j=0;j<openBasis_.getCardinality();j++) {
295 for (
int i=0;i<closedBasis_.getCardinality();i++) {
296 for (
int l=0;l<dim0;l++) {
297 outputValues(bfcur,l) = closedBasisDerivsXPts(i,l,0) * openBasisValsYPts(j,l);
304 for (
int j=0;j<closedBasis_.getCardinality();j++) {
305 for (
int i=0;i<openBasis_.getCardinality();i++) {
306 for (
int l=0;l<dim0;l++) {
307 outputValues(bfcur,l) = openBasisValsXPts(i,l) * closedBasisDerivsYPts(j,l,0);
315 TEUCHOS_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_CURL), std::invalid_argument,
316 ">>> ERROR (Basis_HDIV_QUAD_In_FEM): CURL is invalid operator for HDIV Basis Functions");
320 TEUCHOS_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_GRAD), std::invalid_argument,
321 ">>> ERROR (Basis_HDIV_QUAD_In_FEM): GRAD is invalid operator for HDIV Basis Functions");
334 TEUCHOS_TEST_FOR_EXCEPTION( ( (operatorType == OPERATOR_D1) ||
335 (operatorType == OPERATOR_D2) ||
336 (operatorType == OPERATOR_D3) ||
337 (operatorType == OPERATOR_D4) ||
338 (operatorType == OPERATOR_D5) ||
339 (operatorType == OPERATOR_D6) ||
340 (operatorType == OPERATOR_D7) ||
341 (operatorType == OPERATOR_D8) ||
342 (operatorType == OPERATOR_D9) ||
343 (operatorType == OPERATOR_D10) ),
344 std::invalid_argument,
345 ">>> ERROR (Basis_HDIV_QUAD_In_FEM): Invalid operator type");
349 TEUCHOS_TEST_FOR_EXCEPTION( ( (operatorType != OPERATOR_VALUE) &&
350 (operatorType != OPERATOR_GRAD) &&
351 (operatorType != OPERATOR_CURL) &&
352 (operatorType != OPERATOR_DIV) &&
353 (operatorType != OPERATOR_D1) &&
354 (operatorType != OPERATOR_D2) &&
355 (operatorType != OPERATOR_D3) &&
356 (operatorType != OPERATOR_D4) &&
357 (operatorType != OPERATOR_D5) &&
358 (operatorType != OPERATOR_D6) &&
359 (operatorType != OPERATOR_D7) &&
360 (operatorType != OPERATOR_D8) &&
361 (operatorType != OPERATOR_D9) &&
362 (operatorType != OPERATOR_D10) ),
363 std::invalid_argument,
364 ">>> ERROR (Basis_HDIV_QUAD_In_FEM): Invalid operator type");
370 template<
class Scalar,
class ArrayScalar>
372 const ArrayScalar & inputPoints,
373 const ArrayScalar & cellVertices,
374 const EOperator operatorType)
const {
375 TEUCHOS_TEST_FOR_EXCEPTION( (
true), std::logic_error,
376 ">>> ERROR (Basis_HDIV_QUAD_In_FEM): FEM Basis calling an FVD member function");
379 template<
class Scalar,
class ArrayScalar>
385 for (
int j=0;j<openPts_.dimension(0);j++)
387 for (
int i=0;i<closedPts_.dimension(0);i++)
389 DofCoords(cur,0) = closedPts_(i,0);
390 DofCoords(cur,1) = openPts_(j,0);
396 for (
int j=0;j<closedPts_.dimension(0);j++)
398 for (
int i=0;i<openPts_.dimension(0);i++)
400 DofCoords(cur,0) = openPts_(i,0);
401 DofCoords(cur,1) = closedPts_(j,0);
412 #if defined(Intrepid_SHOW_DEPRECATED_WARNINGS)
414 #warning "The Intrepid package is deprecated"
virtual void getDofCoords(ArrayScalar &DofCoords) const
Returns spatial locations (coordinates) of degrees of freedom on a reference cell; defined for interp...
void getValues(ArrayScalar &outputValues, const ArrayScalar &inputPoints, const EOperator operatorType) const
Evaluation of a FEM basis on a reference Quadrilateral cell.
EBasis basisType_
Type of the basis.
void initializeTags()
Initializes tagToOrdinal_ and ordinalToTag_ lookup arrays.
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
Basis_HDIV_QUAD_In_FEM(int order, const ArrayScalar &ptsClosed, const ArrayScalar &ptsOpen)
Constructor.
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...
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. ...