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 );
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];
206 this -> ordinalToTag_,
208 this -> basisCardinality_,
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);
234 FieldContainer<Scalar> xPoints(dim0,1);
235 FieldContainer<Scalar> yPoints(dim0,1);
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) {
245 FieldContainer<Scalar> closedBasisValsXPts( closedBasis_.getCardinality() , dim0 );
246 FieldContainer<Scalar> closedBasisValsYPts( closedBasis_.getCardinality() , dim0 );
247 FieldContainer<Scalar> openBasisValsXPts( openBasis_.getCardinality() , dim0 );
248 FieldContainer<Scalar> openBasisValsYPts( openBasis_.getCardinality() , dim0 );
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);
281 FieldContainer<Scalar> closedBasisDerivsXPts( closedBasis_.getCardinality() , dim0 , 1 );
282 FieldContainer<Scalar> closedBasisDerivsYPts( closedBasis_.getCardinality() , dim0 , 1 );
283 FieldContainer<Scalar> openBasisValsXPts( openBasis_.getCardinality() , dim0 );
284 FieldContainer<Scalar> openBasisValsYPts( openBasis_.getCardinality() , dim0 );
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");