Intrepid2
Intrepid2_CellToolsDefValidateArguments.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Intrepid2 Package
4 //
5 // Copyright 2007 NTESS and the Intrepid2 contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 
16 #ifndef __INTREPID2_CELLTOOLS_DEF_VALIDATE_ARGUMENTS_HPP__
17 #define __INTREPID2_CELLTOOLS_DEF_VALIDATE_ARGUMENTS_HPP__
18 
19 // disable clang warnings
20 #if defined (__clang__) && !defined (__INTEL_COMPILER)
21 #pragma clang system_header
22 #endif
23 
24 namespace Intrepid2 {
25 
26  //============================================================================================//
27  // //
28  // Validation of input/output arguments for CellTools methods //
29  // //
30  //============================================================================================//
31 
32  template<typename jacobianViewType,
33  typename PointViewType,
34  typename worksetCellViewType>
35  void
36  CellTools_setJacobianArgs( const jacobianViewType jacobian,
37  const PointViewType points,
38  const worksetCellViewType worksetCell,
39  const shards::CellTopology cellTopo,
40  const int startCell, const int endCell) {
41  // Validate worksetCell array
42  INTREPID2_TEST_FOR_EXCEPTION( worksetCell.rank() != 3, std::invalid_argument,
43  ">>> ERROR (Intrepid2::CellTools::setJacobian): rank = 3 required for worksetCell array." );
44  //TODO: check this. not working for composite tet
45  //INTREPID2_TEST_FOR_EXCEPTION( worksetCell.extent(1) != cellTopo.getSubcellCount(0), std::invalid_argument,
46  // ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 1 (number of cell nodes) of worksetCell array does not match cell topology." );
47 
48  INTREPID2_TEST_FOR_EXCEPTION( worksetCell.extent(2) != cellTopo.getDimension(), std::invalid_argument,
49  ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 2 (spatial dimension) of worksetCell array does not match cell dimension." );
50 
51  // Validate points array: can be rank-2 (P,D) or rank-3 (C,P,D)
52  // If rank-2: admissible jacobians: rank-3 (P,D,D) or rank-4 (C,P,D,D); admissible whichCell: -1 (default) or cell ordinal.
53  const auto pointRank = points.rank();
54  INTREPID2_TEST_FOR_EXCEPTION( pointRank != 2 &&
55  pointRank != 3, std::invalid_argument,
56  ">>> ERROR (Intrepid2::CellTools::setJacobian): points must have rank 2 or 3." );
57 
58  const int endCellResolved = (endCell == -1) ? worksetCell.extent_int(0) : endCell;
59  const int numCells = endCellResolved - startCell;
60 
61  INTREPID2_TEST_FOR_EXCEPTION(startCell < 0, std::invalid_argument, "Invalid startCell");
62  INTREPID2_TEST_FOR_EXCEPTION(startCell >= worksetCell.extent_int(0), std::invalid_argument, "startCell is out of bounds in workset.");
63  INTREPID2_TEST_FOR_EXCEPTION(endCellResolved > worksetCell.extent_int(0), std::invalid_argument, "resolved endCell is out of bounds in workset.");
64 
65  switch (pointRank) {
66  case 2: {
67  INTREPID2_TEST_FOR_EXCEPTION( points.extent(1) != cellTopo.getDimension(), std::invalid_argument,
68  ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 1 (spatial dimension) of points array does not match cell dimension." );
69 
70  INTREPID2_TEST_FOR_EXCEPTION( jacobian.rank() != 4, std::invalid_argument,
71  ">>> ERROR (Intrepid2::CellTools::setJacobian): rank = 4 required for jacobian array." );
72 
73  INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent_int(0) != numCells, std::invalid_argument,
74  ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 0 (number of cells) of jacobian array must equal number of cells requested from in the workset." );
75 
76  INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(1) != points.extent(0), std::invalid_argument,
77  ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 1 (number of points) of jacobian array must equal dim 0 of points array." );
78 
79  INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(2) != points.extent(1), std::invalid_argument,
80  ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 2 (spatial dimension) of jacobian array must equal dim 1 of points array." );
81 
82  INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(2) != jacobian.extent(3), std::invalid_argument,
83  ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 2 = dim 3 (same spatial dimensions) required for jacobian array." );
84 
85  INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(3) < 1 || jacobian.extent(3) > 3, std::invalid_argument,
86  ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 2 and dim 3 (spatial dimensions) must be between 1 and 3." );
87  break;
88  }
89  case 3: {
90  INTREPID2_TEST_FOR_EXCEPTION( points.extent_int(0) != numCells, std::invalid_argument,
91  ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 0 (number of cells) of points array must equal number of cells requested from in the workset.");
92 
93  INTREPID2_TEST_FOR_EXCEPTION( points.extent(2) != cellTopo.getDimension(), std::invalid_argument,
94  ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 2 (spatial dimension) of points array does not match cell dimension");
95 
96  // rank-4 (C,P,D,D) jacobian required for rank-3 (C,P,D) input points
97  INTREPID2_TEST_FOR_EXCEPTION( jacobian.rank() != 4, std::invalid_argument,
98  ">>> ERROR (Intrepid2::CellTools::setJacobian): rank = 4 required for jacobian array." );
99 
100  INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(0) != points.extent(0), std::invalid_argument,
101  ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 0 (number of cells) of jacobian array must equal dim 0 of points array");
102 
103  INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(1) != points.extent(1), std::invalid_argument,
104  ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 1 (number of points) of jacobian array must equal dim 1 of points array");
105 
106  INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(2) != points.extent(2), std::invalid_argument,
107  ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 2 (spatial dimension) of jacobian array must equal dim 2 of points array");
108 
109  INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(2) != jacobian.extent(3), std::invalid_argument,
110  ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 2 = dim 3 (same spatial dimensions) required for jacobian array. ");
111 
112  INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(3) < 1 || jacobian.extent(3) > 3, std::invalid_argument,
113  ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 2 and dim 3 (spatial dimensions) must be between 1 and 3." );
114  break;
115  }
116  }
117  }
118 
119  template<typename jacobianInvViewType,
120  typename jacobianViewType>
121  void
122  CellTools_setJacobianInvArgs( const jacobianInvViewType jacobianInv,
123  const jacobianViewType jacobian ) {
124  // Validate input jacobian array: admissible ranks & dimensions are:
125  // - rank-4 with dimensions (C,P,D,D), or rank-3 with dimensions (P,D,D).
126  const ordinal_type jacoRank = jacobian.rank();
127  INTREPID2_TEST_FOR_EXCEPTION( jacoRank != 4 &&
128  jacoRank != 3, std::invalid_argument,
129  ">>> ERROR (Intrepid2::CellTools::setJacobianInv): rank = 4 or 3 required for jacobian array." );
130 
131  // Verify correctness of spatial dimensions - they are the last two dimensions of the array: rank-2 and rank-1
132  INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(jacoRank - 1) != jacobian.extent(jacoRank - 2), std::invalid_argument,
133  ">>> ERROR (Intrepid2::CellTools::setJacobianInv): dim(rank-2) = dim(rank-2) (same spatial dimensions) required for jacobian array." );
134 
135  INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(jacoRank - 1) < 1 ||
136  jacobian.extent(jacoRank - 1) > 3, std::invalid_argument,
137  ">>> ERROR (Intrepid2::CellTools::setJacobianInv): dim(rank-1) and dim(rank-2) (spatial dimensions) must be between 1 and 3." );
138 
139  // Validate output jacobianInv array: must have the same rank and dimensions as the input array.
140  const ordinal_type jacoInvRank = jacobianInv.rank();
141  INTREPID2_TEST_FOR_EXCEPTION( jacoInvRank != jacoRank, std::invalid_argument,
142  ">>> ERROR (Intrepid2::CellTools::setJacobianInv): jacobian rank does not match to jacobianInv." );
143 
144  for (ordinal_type i=0;i<jacoRank;++i) {
145  INTREPID2_TEST_FOR_EXCEPTION( jacobianInv.extent(i) != jacobian.extent(i), std::invalid_argument,
146  ">>> ERROR (Intrepid2::CellTools::setJacobianInv): jacobian dimension (i) does not match to jacobianInv dimension (i)." );
147  }
148  }
149 
150 
151  template<typename jacobianDetViewType,
152  typename jacobianViewType>
153  void
154  CellTools_setJacobianDetArgs( const jacobianDetViewType jacobianDet,
155  const jacobianViewType jacobian ) {
156  // Validate input jacobian array: admissible ranks & dimensions are:
157  // - rank-4 with dimensions (C,P,D,D), or rank-3 with dimensions (P,D,D).
158  const ordinal_type jacoRank = jacobian.rank();
159  INTREPID2_TEST_FOR_EXCEPTION( jacoRank != 4 &&
160  jacoRank != 3, std::invalid_argument,
161  ">>> ERROR (Intrepid2::CellTools::setJacobianInv): rank = 4 or 3 required for jacobian array." );
162 
163  // Verify correctness of spatial dimensions - they are the last two dimensions of the array: rank-2 and rank-1
164  INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(jacoRank - 1) != jacobian.extent(jacoRank - 2), std::invalid_argument,
165  ">>> ERROR (Intrepid2::CellTools::setJacobianInv): dim(rank-2) = dim(rank-2) (same spatial dimensions) required for jacobian array." );
166 
167  INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(jacoRank - 1) < 1 ||
168  jacobian.extent(jacoRank - 1) > 3, std::invalid_argument,
169  ">>> ERROR (Intrepid2::CellTools::setJacobianInv): dim(rank-1) and dim(rank-2) (spatial dimensions) must be between 1 and 3." );
170 
171  // Validate output jacobianDet array
172  const ordinal_type jacoDetRank = jacobianDet.rank();
173  // must be rank-2 with dimensions (C,P) if jacobian was rank-4
174  // must be rank-1 with dimension (P) if jacobian was rank-3
175  INTREPID2_TEST_FOR_EXCEPTION( jacoDetRank != (jacoRank-2), std::invalid_argument,
176  ">>> ERROR (Intrepid2::CellTools::setJacobianDetArgs): rank = 2 required for jacobianDet if jacobian is rank-4." );
177 
178  for (ordinal_type i=0;i<jacoDetRank;++i) {
179  INTREPID2_TEST_FOR_EXCEPTION( jacobianDet.extent(i) != jacobian.extent(i), std::invalid_argument,
180  ">>> ERROR (Intrepid2::CellTools::setJacobianDetArgs): jacobianDet dimension (i) does not match to jacobian dimension (i)." );
181  }
182  }
183 
184 
185 
186  template<typename physPointViewType,
187  typename refPointViewType,
188  typename worksetCellViewType>
189  void
190  CellTools_mapToPhysicalFrameArgs( const physPointViewType physPoints,
191  const refPointViewType refPoints,
192  const worksetCellViewType worksetCell,
193  const shards::CellTopology cellTopo ) {
194  // Validate worksetCell array
195  INTREPID2_TEST_FOR_EXCEPTION( (worksetCell.rank() != 3) || (physPoints.rank() != 3), std::invalid_argument,
196  ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): rank = 3 required for worksetCell and physPoints arrays." );
197 
198  //TODO: check this, not working for tria6
199  //INTREPID2_TEST_FOR_EXCEPTION( worksetCell.extent(1) != cellTopo.getSubcellCount(0), std::invalid_argument,
200  // ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): dim 1 (number of cell nodes) of worksetCell array does not match cell topology." );
201 
202  //we allow cells immersed in a higher-dimensional space (e.g. 2d cell in a 3d space)
203  INTREPID2_TEST_FOR_EXCEPTION( worksetCell.extent(2) < cellTopo.getDimension(), std::invalid_argument,
204  ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): dim 2 (spatial dimension) of worksetCell array is smaller than the cell dimension." );
205 
206  INTREPID2_TEST_FOR_EXCEPTION( physPoints.extent(2) != worksetCell.extent(2), std::invalid_argument,
207  ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): physPoints and worksetCell should have the same spatial dimension." );
208 
209 
210  // Validate refPoints array: can be rank-2 (P,D) or rank-3 (C,P,D) array
211  const ordinal_type refPointRank = refPoints.rank();
212  const ordinal_type physPointRank = physPoints.rank();
213 
214  INTREPID2_TEST_FOR_EXCEPTION( refPointRank != 2 &&
215  refPointRank != 3, std::invalid_argument,
216  ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): refPoints requires rank 2 or 3." );
217 
218  switch (refPointRank) {
219  case 2: {
220  // If rank-2: admissible output array is (P,D) or (C,P,D)
221  INTREPID2_TEST_FOR_EXCEPTION( refPoints.extent(1) != cellTopo.getDimension(), std::invalid_argument,
222  ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): dim 1 (spatial dimension) of refPoints array does not match cell dimension." );
223 
224  INTREPID2_TEST_FOR_EXCEPTION( physPoints.rank() != 3, std::invalid_argument,
225  ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): rank = 3 required for physPoints array for the default whichCell value." );
226 
227  INTREPID2_TEST_FOR_EXCEPTION( physPoints.extent(0) != worksetCell.extent(0), std::invalid_argument,
228  ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): dim 0 (number of cells) of physPoints array must equal dim 0 of worksetCell array." );
229 
230  INTREPID2_TEST_FOR_EXCEPTION( physPoints.extent(1) != refPoints.extent(0), std::invalid_argument,
231  ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): dim 1 (number of points) of physPoints array must equal dim 0 of refPoints array." );
232 
233 
234  break;
235  }
236  case 3: {
237  // refPoints is (C,P,D): requires physPoints to be (C,P,D) and whichCell=-1 (because all cell mappings are applied)
238  // validate refPoints dimensions and rank
239  INTREPID2_TEST_FOR_EXCEPTION( refPoints.extent(0) != worksetCell.extent(0), std::invalid_argument,
240  ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): dim 0 (number of cells) of refPoints and worksetCell arraya are required to match." );
241 
242  INTREPID2_TEST_FOR_EXCEPTION( refPoints.extent(2) != cellTopo.getDimension(), std::invalid_argument,
243  ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): dim 2 (spatial dimension) of refPoints array does not match cell dimension." );
244 
245  // physPoints must match rank and dimensions of refPoints
246  INTREPID2_TEST_FOR_EXCEPTION( refPointRank != physPointRank, std::invalid_argument,
247  " >>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): refPoints rank does not match to physPoints rank." );
248 
249  for (ordinal_type i=0;i<refPointRank-1;++i) {
250  INTREPID2_TEST_FOR_EXCEPTION( refPoints.extent(i) != physPoints.extent(i), std::invalid_argument,
251  " >>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): refPoints dimension(i) does not match to physPoints dimension(i)." );
252  }
253  break;
254  }
255  }
256  }
257 
258  template<typename refPointViewType,
259  typename physPointViewType,
260  typename worksetCellViewType>
261  void
262  CellTools_mapToReferenceFrameArgs( const refPointViewType refPoints,
263  const physPointViewType physPoints,
264  const worksetCellViewType worksetCell,
265  const shards::CellTopology cellTopo ) {
266  // Validate worksetCell array
267  const ordinal_type worksetCellRank = worksetCell.rank();
268  INTREPID2_TEST_FOR_EXCEPTION( worksetCellRank != 3, std::invalid_argument,
269  ">>> ERROR (Intrepid2::CellTools::mapToReferenceFrame): rank = 3 required for worksetCell array" );
270  // TODO: check this.
271  // INTREPID2_TEST_FOR_EXCEPTION( worksetCell.extent(1) != cellTopo.getSubcellCount(0), std::invalid_argument,
272  // ">>> ERROR (Intrepid2::CellTools::mapToReferenceFrame): dim 1 (number of cell nodes) of worksetCell array does not match cell topology" );
273 
274  INTREPID2_TEST_FOR_EXCEPTION( worksetCell.extent(2) != cellTopo.getDimension(), std::invalid_argument,
275  ">>> ERROR (Intrepid2::CellTools::mapToReferenceFrame): dim 2 (spatial dimension) of worksetCell array does not match cell dimension" );
276 
277  // Admissible ranks and dimensions of refPoints and physPoints depend on whichCell value:
278  // default is to map multiple sets of points to multiple sets of points. (C,P,D) arrays required
279 
280  const ordinal_type physPointRank = physPoints.rank();
281  const ordinal_type refPointRank = refPoints.rank();
282 
283  INTREPID2_TEST_FOR_EXCEPTION( refPointRank != 2 &&
284  refPointRank != 3, std::invalid_argument,
285  ">>> ERROR (Intrepid2::CellTools::mapToReferenceFrame): refPoint must have rank 2 or 3." );
286 
287  INTREPID2_TEST_FOR_EXCEPTION( physPointRank != refPointRank, std::invalid_argument,
288  ">>> ERROR (Intrepid2::CellTools::mapToReferenceFrame): physPoints rank does not match refPoints rank." );
289  for (ordinal_type i=0;i<refPointRank;++i) {
290  INTREPID2_TEST_FOR_EXCEPTION( refPoints.extent(i) != physPoints.extent(i), std::invalid_argument,
291  ">>> ERROR (Intrepid2::CellTools::mapToReferenceFrame): physPoints dimension (i) does not match refPoints dimension (i)." );
292  }
293  }
294 
295  template<typename refPointViewType,
296  typename initGuessViewType,
297  typename physPointViewType,
298  typename worksetCellViewType>
299  void CellTools_mapToReferenceFrameInitGuessArgs( const refPointViewType refPoints,
300  const initGuessViewType initGuess,
301  const physPointViewType physPoints,
302  const worksetCellViewType worksetCell,
303  const shards::CellTopology cellTopo ) {
304  // Call the method that validates arguments with the default initial guess selection
305  CellTools_mapToReferenceFrameArgs(refPoints, physPoints, worksetCell, cellTopo);
306 
307  // Then check initGuess: its rank and dimensions must match those of physPoints.
308  INTREPID2_TEST_FOR_EXCEPTION( initGuess.rank() != physPoints.rank(), std::invalid_argument,
309  ">>> ERROR (Intrepid2::CellTools::mapToReferenceFrame): InitGuess must have the same rank as physPoints");
310 
311  const ordinal_type r = initGuess.rank();
312  for (ordinal_type i=0;i<r;++i) {
313  INTREPID2_TEST_FOR_EXCEPTION( initGuess.extent(i) != physPoints.extent(i), std::invalid_argument,
314  ">>> ERROR (Intrepid2::CellTools::mapToReferenceFrame): InitGuess dimension (i) does not match ot physPoints dimension(i).");
315  }
316  }
317 
318 
319 } // end of intrepid2
320 
321 #endif
322 
323 
324 
325 
326 
327 // template<class Scalar>
328 // template<class ArrayIncl, class ArrayPoint, class ArrayCell>
329 // void CellTools<Scalar>::checkPointwiseInclusion(ArrayIncl & inCell,
330 // const ArrayPoint & physPoints,
331 // const ArrayCell & worksetCell,
332 // const ordinal_type & whichCell,
333 // const shards::CellTopology & cell)
334 // {
335 // // Validate worksetCell array
336 // INTREPID2_TEST_FOR_EXCEPTION( (getrank(worksetCell) != 3), std::invalid_argument,
337 // ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): rank = 3 required for worksetCell array" );
338 
339 // INTREPID2_TEST_FOR_EXCEPTION( (static_cast<index_type>(worksetCell.extent(1)) != (index_type)cell.getSubcellCount(0) ), std::invalid_argument,
340 // ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): dim 1 (number of cell nodes) of worksetCell array does not match cell topology" );
341 
342 // INTREPID2_TEST_FOR_EXCEPTION( (static_cast<index_type>(worksetCell.extent(2)) != (index_type)cell.getDimension() ), std::invalid_argument,
343 // ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): dim 2 (spatial dimension) of worksetCell array does not match cell dimension" );
344 
345 
346 // // Validate whichCell It can be either -1 (default value) or a valid cell ordinal.
347 // INTREPID2_TEST_FOR_EXCEPTION( !( ( (0 <= whichCell ) && (whichCell < worksetCell.extent(0) ) ) || (whichCell == -1) ), std::invalid_argument,
348 // ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): whichCell = -1 or a valid cell ordinal is required." );
349 
350 // // Validate points array: can be rank-2 (P,D) or rank-3 (C,P,D)
351 // // If rank-2: admissible inCell is rank-1 (P); admissible whichCell is valid cell ordinal but not -1.
352 // if(getrank(physPoints) == 2) {
353 
354 // INTREPID2_TEST_FOR_EXCEPTION( (whichCell == -1), std::invalid_argument,
355 // ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): whichCell = a valid cell ordinal is required with rank-2 input array." );
356 
357 // INTREPID2_TEST_FOR_EXCEPTION( (static_cast<index_type>(physPoints.extent(1)) != (index_type)cell.getDimension() ), std::invalid_argument,
358 // ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): dim 1 (spatial dimension) of physPoints array does not match cell dimension" );
359 
360 // // Validate inCell
361 // INTREPID2_TEST_FOR_EXCEPTION( (getrank(inCell) != 1), std::invalid_argument,
362 // ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): rank = 1 required for inCell array" );
363 
364 // INTREPID2_TEST_FOR_EXCEPTION( (static_cast<index_type>(inCell.extent(0)) != static_cast<index_type>(physPoints.extent(0))), std::invalid_argument,
365 // ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): dim 0 (number of points) of inCell array must equal dim 0 of physPoints array" );
366 // }
367 // // If rank-3: admissible inCell is rank-2 (C,P); admissible whichCell = -1.
368 // else if (getrank(physPoints) == 3){
369 
370 // INTREPID2_TEST_FOR_EXCEPTION( !(whichCell == -1), std::invalid_argument,
371 // ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): whichCell = -1 is required with rank-3 input array." );
372 
373 // INTREPID2_TEST_FOR_EXCEPTION( (static_cast<index_type>(physPoints.extent(0)) != static_cast<index_type>(worksetCell.extent(0)) ), std::invalid_argument,
374 // ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): dim 0 (number of cells) of physPoints array must equal dim 0 of worksetCell array " );
375 
376 // INTREPID2_TEST_FOR_EXCEPTION( (static_cast<index_type>(physPoints.extent(2)) != (index_type)cell.getDimension() ), std::invalid_argument,
377 // ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): dim 2 (spatial dimension) of physPoints array does not match cell dimension" );
378 
379 // // Validate inCell
380 // INTREPID2_TEST_FOR_EXCEPTION( (getrank(inCell) != 2), std::invalid_argument,
381 // ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): rank = 2 required for inCell array" );
382 
383 // INTREPID2_TEST_FOR_EXCEPTION( (static_cast<index_type>(inCell.extent(0)) != static_cast<index_type>(physPoints.extent(0))), std::invalid_argument,
384 // ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): dim 0 (number of cells) of inCell array must equal dim 0 of physPoints array" );
385 
386 // INTREPID2_TEST_FOR_EXCEPTION( (static_cast<index_type>(inCell.extent(1)) != static_cast<index_type>(physPoints.extent(1))), std::invalid_argument,
387 // ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): dim 1 (number of points) of inCell array must equal dim 1 of physPoints array" );
388 // }
389 // else {
390 // INTREPID2_TEST_FOR_EXCEPTION( !( (getrank(physPoints) == 2) && (getrank(physPoints) ==3) ), std::invalid_argument,
391 // ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): rank = 2 or 3 required for points array" );
392 // }
393 // }