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