Intrepid2
Intrepid2_CellToolsDefValidateArguments.hpp
Go to the documentation of this file.
1// @HEADER
2// ************************************************************************
3//
4// Intrepid2 Package
5// Copyright (2007) Sandia Corporation
6//
7// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8// license for use of this work by or on behalf of the U.S. Government.
9//
10// Redistribution and use in source and binary forms, with or without
11// modification, are permitted provided that the following conditions are
12// met:
13//
14// 1. Redistributions of source code must retain the above copyright
15// notice, this list of conditions and the following disclaimer.
16//
17// 2. Redistributions in binary form must reproduce the above copyright
18// notice, this list of conditions and the following disclaimer in the
19// documentation and/or other materials provided with the distribution.
20//
21// 3. Neither the name of the Corporation nor the names of the
22// contributors may be used to endorse or promote products derived from
23// this software without specific prior written permission.
24//
25// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36//
37// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or
38// Mauro Perego (mperego@sandia.gov)
39//
40// ************************************************************************
41// @HEADER
42
43
49#ifndef __INTREPID2_CELLTOOLS_DEF_VALIDATE_ARGUMENTS_HPP__
50#define __INTREPID2_CELLTOOLS_DEF_VALIDATE_ARGUMENTS_HPP__
51
52// disable clang warnings
53#if defined (__clang__) && !defined (__INTEL_COMPILER)
54#pragma clang system_header
55#endif
56
57namespace Intrepid2 {
58
59 //============================================================================================//
60 // //
61 // Validation of input/output arguments for CellTools methods //
62 // //
63 //============================================================================================//
64
65 template<typename jacobianViewType,
66 typename PointViewType,
67 typename worksetCellViewType>
68 void
69 CellTools_setJacobianArgs( const jacobianViewType jacobian,
70 const PointViewType points,
71 const worksetCellViewType worksetCell,
72 const shards::CellTopology cellTopo,
73 const int startCell, const int endCell) {
74 // Validate worksetCell array
75 INTREPID2_TEST_FOR_EXCEPTION( worksetCell.rank() != 3, std::invalid_argument,
76 ">>> ERROR (Intrepid2::CellTools::setJacobian): rank = 3 required for worksetCell array." );
77 //TODO: check this. not working for composite tet
78 //INTREPID2_TEST_FOR_EXCEPTION( worksetCell.extent(1) != cellTopo.getSubcellCount(0), std::invalid_argument,
79 // ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 1 (number of cell nodes) of worksetCell array does not match cell topology." );
80
81 INTREPID2_TEST_FOR_EXCEPTION( worksetCell.extent(2) != cellTopo.getDimension(), std::invalid_argument,
82 ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 2 (spatial dimension) of worksetCell array does not match cell dimension." );
83
84 // Validate points array: can be rank-2 (P,D) or rank-3 (C,P,D)
85 // If rank-2: admissible jacobians: rank-3 (P,D,D) or rank-4 (C,P,D,D); admissible whichCell: -1 (default) or cell ordinal.
86 const auto pointRank = points.rank();
87 INTREPID2_TEST_FOR_EXCEPTION( pointRank != 2 &&
88 pointRank != 3, std::invalid_argument,
89 ">>> ERROR (Intrepid2::CellTools::setJacobian): points must have rank 2 or 3." );
90
91 const int endCellResolved = (endCell == -1) ? worksetCell.extent_int(0) : endCell;
92 const int numCells = endCellResolved - startCell;
93
94 INTREPID2_TEST_FOR_EXCEPTION(startCell < 0, std::invalid_argument, "Invalid startCell");
95 INTREPID2_TEST_FOR_EXCEPTION(startCell >= worksetCell.extent_int(0), std::invalid_argument, "startCell is out of bounds in workset.");
96 INTREPID2_TEST_FOR_EXCEPTION(endCellResolved > worksetCell.extent_int(0), std::invalid_argument, "resolved endCell is out of bounds in workset.");
97
98 switch (pointRank) {
99 case 2: {
100 INTREPID2_TEST_FOR_EXCEPTION( points.extent(1) != cellTopo.getDimension(), std::invalid_argument,
101 ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 1 (spatial dimension) of points array does not match cell dimension." );
102
103 INTREPID2_TEST_FOR_EXCEPTION( jacobian.rank() != 4, std::invalid_argument,
104 ">>> ERROR (Intrepid2::CellTools::setJacobian): rank = 4 required for jacobian array." );
105
106 INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent_int(0) != numCells, std::invalid_argument,
107 ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 0 (number of cells) of jacobian array must equal number of cells requested from in the workset." );
108
109 INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(1) != points.extent(0), std::invalid_argument,
110 ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 1 (number of points) of jacobian array must equal dim 0 of points array." );
111
112 INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(2) != points.extent(1), std::invalid_argument,
113 ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 2 (spatial dimension) of jacobian array must equal dim 1 of points array." );
114
115 INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(2) != jacobian.extent(3), std::invalid_argument,
116 ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 2 = dim 3 (same spatial dimensions) required for jacobian array." );
117
118 INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(3) < 1 || jacobian.extent(3) > 3, std::invalid_argument,
119 ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 2 and dim 3 (spatial dimensions) must be between 1 and 3." );
120 break;
121 }
122 case 3: {
123 INTREPID2_TEST_FOR_EXCEPTION( points.extent_int(0) != numCells, std::invalid_argument,
124 ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 0 (number of cells) of points array must equal number of cells requested from in the workset.");
125
126 INTREPID2_TEST_FOR_EXCEPTION( points.extent(2) != cellTopo.getDimension(), std::invalid_argument,
127 ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 2 (spatial dimension) of points array does not match cell dimension");
128
129 // rank-4 (C,P,D,D) jacobian required for rank-3 (C,P,D) input points
130 INTREPID2_TEST_FOR_EXCEPTION( jacobian.rank() != 4, std::invalid_argument,
131 ">>> ERROR (Intrepid2::CellTools::setJacobian): rank = 4 required for jacobian array." );
132
133 INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(0) != points.extent(0), std::invalid_argument,
134 ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 0 (number of cells) of jacobian array must equal dim 0 of points array");
135
136 INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(1) != points.extent(1), std::invalid_argument,
137 ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 1 (number of points) of jacobian array must equal dim 1 of points array");
138
139 INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(2) != points.extent(2), std::invalid_argument,
140 ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 2 (spatial dimension) of jacobian array must equal dim 2 of points array");
141
142 INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(2) != jacobian.extent(3), std::invalid_argument,
143 ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 2 = dim 3 (same spatial dimensions) required for jacobian array. ");
144
145 INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(3) < 1 || jacobian.extent(3) > 3, std::invalid_argument,
146 ">>> ERROR (Intrepid2::CellTools::setJacobian): dim 2 and dim 3 (spatial dimensions) must be between 1 and 3." );
147 break;
148 }
149 }
150 }
151
152 template<typename jacobianInvViewType,
153 typename jacobianViewType>
154 void
155 CellTools_setJacobianInvArgs( const jacobianInvViewType jacobianInv,
156 const jacobianViewType jacobian ) {
157 // Validate input jacobian array: admissible ranks & dimensions are:
158 // - rank-4 with dimensions (C,P,D,D), or rank-3 with dimensions (P,D,D).
159 const ordinal_type jacoRank = jacobian.rank();
160 INTREPID2_TEST_FOR_EXCEPTION( jacoRank != 4 &&
161 jacoRank != 3, std::invalid_argument,
162 ">>> ERROR (Intrepid2::CellTools::setJacobianInv): rank = 4 or 3 required for jacobian array." );
163
164 // Verify correctness of spatial dimensions - they are the last two dimensions of the array: rank-2 and rank-1
165 INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(jacoRank - 1) != jacobian.extent(jacoRank - 2), std::invalid_argument,
166 ">>> ERROR (Intrepid2::CellTools::setJacobianInv): dim(rank-2) = dim(rank-2) (same spatial dimensions) required for jacobian array." );
167
168 INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(jacoRank - 1) < 1 ||
169 jacobian.extent(jacoRank - 1) > 3, std::invalid_argument,
170 ">>> ERROR (Intrepid2::CellTools::setJacobianInv): dim(rank-1) and dim(rank-2) (spatial dimensions) must be between 1 and 3." );
171
172 // Validate output jacobianInv array: must have the same rank and dimensions as the input array.
173 const ordinal_type jacoInvRank = jacobianInv.rank();
174 INTREPID2_TEST_FOR_EXCEPTION( jacoInvRank != jacoRank, std::invalid_argument,
175 ">>> ERROR (Intrepid2::CellTools::setJacobianInv): jacobian rank does not match to jacobianInv." );
176
177 for (ordinal_type i=0;i<jacoRank;++i) {
178 INTREPID2_TEST_FOR_EXCEPTION( jacobianInv.extent(i) != jacobian.extent(i), std::invalid_argument,
179 ">>> ERROR (Intrepid2::CellTools::setJacobianInv): jacobian dimension (i) does not match to jacobianInv dimension (i)." );
180 }
181 }
182
183
184 template<typename jacobianDetViewType,
185 typename jacobianViewType>
186 void
187 CellTools_setJacobianDetArgs( const jacobianDetViewType jacobianDet,
188 const jacobianViewType jacobian ) {
189 // Validate input jacobian array: admissible ranks & dimensions are:
190 // - rank-4 with dimensions (C,P,D,D), or rank-3 with dimensions (P,D,D).
191 const ordinal_type jacoRank = jacobian.rank();
192 INTREPID2_TEST_FOR_EXCEPTION( jacoRank != 4 &&
193 jacoRank != 3, std::invalid_argument,
194 ">>> ERROR (Intrepid2::CellTools::setJacobianInv): rank = 4 or 3 required for jacobian array." );
195
196 // Verify correctness of spatial dimensions - they are the last two dimensions of the array: rank-2 and rank-1
197 INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(jacoRank - 1) != jacobian.extent(jacoRank - 2), std::invalid_argument,
198 ">>> ERROR (Intrepid2::CellTools::setJacobianInv): dim(rank-2) = dim(rank-2) (same spatial dimensions) required for jacobian array." );
199
200 INTREPID2_TEST_FOR_EXCEPTION( jacobian.extent(jacoRank - 1) < 1 ||
201 jacobian.extent(jacoRank - 1) > 3, std::invalid_argument,
202 ">>> ERROR (Intrepid2::CellTools::setJacobianInv): dim(rank-1) and dim(rank-2) (spatial dimensions) must be between 1 and 3." );
203
204 // Validate output jacobianDet array
205 const ordinal_type jacoDetRank = jacobianDet.rank();
206 // must be rank-2 with dimensions (C,P) if jacobian was rank-4
207 // must be rank-1 with dimension (P) if jacobian was rank-3
208 INTREPID2_TEST_FOR_EXCEPTION( jacoDetRank != (jacoRank-2), std::invalid_argument,
209 ">>> ERROR (Intrepid2::CellTools::setJacobianDetArgs): rank = 2 required for jacobianDet if jacobian is rank-4." );
210
211 for (ordinal_type i=0;i<jacoDetRank;++i) {
212 INTREPID2_TEST_FOR_EXCEPTION( jacobianDet.extent(i) != jacobian.extent(i), std::invalid_argument,
213 ">>> ERROR (Intrepid2::CellTools::setJacobianDetArgs): jacobianDet dimension (i) does not match to jacobian dimension (i)." );
214 }
215 }
216
217
218
219 template<typename physPointViewType,
220 typename refPointViewType,
221 typename worksetCellViewType>
222 void
223 CellTools_mapToPhysicalFrameArgs( const physPointViewType physPoints,
224 const refPointViewType refPoints,
225 const worksetCellViewType worksetCell,
226 const shards::CellTopology cellTopo ) {
227 // Validate worksetCell array
228 INTREPID2_TEST_FOR_EXCEPTION( worksetCell.rank() != 3, std::invalid_argument,
229 ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): rank = 3 required for worksetCell array." );
230
231 //TODO: check this, not working for tria6
232 //INTREPID2_TEST_FOR_EXCEPTION( worksetCell.extent(1) != cellTopo.getSubcellCount(0), std::invalid_argument,
233 // ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): dim 1 (number of cell nodes) of worksetCell array does not match cell topology." );
234
235 INTREPID2_TEST_FOR_EXCEPTION( worksetCell.extent(2) != cellTopo.getDimension(), std::invalid_argument,
236 ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): dim 2 (spatial dimension) of worksetCell array does not match cell dimension." );
237
238
239 // Validate refPoints array: can be rank-2 (P,D) or rank-3 (C,P,D) array
240 const ordinal_type refPointRank = refPoints.rank();
241 const ordinal_type physPointRank = physPoints.rank();
242
243 INTREPID2_TEST_FOR_EXCEPTION( refPointRank != 2 &&
244 refPointRank != 3, std::invalid_argument,
245 ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): refPoints requires rank 2 or 3." );
246
247 switch (refPointRank) {
248 case 2: {
249 // If rank-2: admissible output array is (P,D) or (C,P,D)
250 INTREPID2_TEST_FOR_EXCEPTION( refPoints.extent(1) != cellTopo.getDimension(), std::invalid_argument,
251 ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): dim 1 (spatial dimension) of refPoints array does not match cell dimension." );
252
253 INTREPID2_TEST_FOR_EXCEPTION( physPoints.rank() != 3, std::invalid_argument,
254 ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): rank = 3 required for physPoints array for the default whichCell value." );
255
256 INTREPID2_TEST_FOR_EXCEPTION( physPoints.extent(0) != worksetCell.extent(0), std::invalid_argument,
257 ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): dim 0 (number of cells) of physPoints array must equal dim 0 of worksetCell array." );
258
259 INTREPID2_TEST_FOR_EXCEPTION( physPoints.extent(1) != refPoints.extent(0), std::invalid_argument,
260 ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): dim 1 (number of points) of physPoints array must equal dim 0 of refPoints array." );
261
262 INTREPID2_TEST_FOR_EXCEPTION( physPoints.extent(2) != cellTopo.getDimension(), std::invalid_argument,
263 ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): dim 2 (spatial dimension) does not match cell dimension." );
264 break;
265 }
266 case 3: {
267 // refPoints is (C,P,D): requires physPoints to be (C,P,D) and whichCell=-1 (because all cell mappings are applied)
268 // validate refPoints dimensions and rank
269 INTREPID2_TEST_FOR_EXCEPTION( refPoints.extent(0) != worksetCell.extent(0), std::invalid_argument,
270 ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): dim 0 (number of cells) of refPoints and worksetCell arraya are required to match." );
271
272 INTREPID2_TEST_FOR_EXCEPTION( refPoints.extent(2) != cellTopo.getDimension(), std::invalid_argument,
273 ">>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): dim 2 (spatial dimension) of refPoints array does not match cell dimension." );
274
275 // physPoints must match rank and dimensions of refPoints
276 INTREPID2_TEST_FOR_EXCEPTION( refPointRank != physPointRank, std::invalid_argument,
277 " >>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): refPoints rank does not match to physPoints rank." );
278
279 for (ordinal_type i=0;i<refPointRank;++i) {
280 INTREPID2_TEST_FOR_EXCEPTION( refPoints.extent(i) != physPoints.extent(i), std::invalid_argument,
281 " >>> ERROR (Intrepid2::CellTools::mapToPhysicalFrame): refPoints dimension(i) does not match to physPoints dimension(i)." );
282 }
283 break;
284 }
285 }
286 }
287
288 template<typename refPointViewType,
289 typename physPointViewType,
290 typename worksetCellViewType>
291 void
292 CellTools_mapToReferenceFrameArgs( const refPointViewType refPoints,
293 const physPointViewType physPoints,
294 const worksetCellViewType worksetCell,
295 const shards::CellTopology cellTopo ) {
296 // Validate worksetCell array
297 const ordinal_type worksetCellRank = worksetCell.rank();
298 INTREPID2_TEST_FOR_EXCEPTION( worksetCellRank != 3, std::invalid_argument,
299 ">>> ERROR (Intrepid2::CellTools::mapToReferenceFrame): rank = 3 required for worksetCell array" );
300 // TODO: check this.
301 // INTREPID2_TEST_FOR_EXCEPTION( worksetCell.extent(1) != cellTopo.getSubcellCount(0), std::invalid_argument,
302 // ">>> ERROR (Intrepid2::CellTools::mapToReferenceFrame): dim 1 (number of cell nodes) of worksetCell array does not match cell topology" );
303
304 INTREPID2_TEST_FOR_EXCEPTION( worksetCell.extent(2) != cellTopo.getDimension(), std::invalid_argument,
305 ">>> ERROR (Intrepid2::CellTools::mapToReferenceFrame): dim 2 (spatial dimension) of worksetCell array does not match cell dimension" );
306
307 // Admissible ranks and dimensions of refPoints and physPoints depend on whichCell value:
308 // default is to map multiple sets of points to multiple sets of points. (C,P,D) arrays required
309
310 const ordinal_type physPointRank = physPoints.rank();
311 const ordinal_type refPointRank = refPoints.rank();
312
313 INTREPID2_TEST_FOR_EXCEPTION( refPointRank != 2 &&
314 refPointRank != 3, std::invalid_argument,
315 ">>> ERROR (Intrepid2::CellTools::mapToReferenceFrame): refPoint must have rank 2 or 3." );
316
317 INTREPID2_TEST_FOR_EXCEPTION( physPointRank != refPointRank, std::invalid_argument,
318 ">>> ERROR (Intrepid2::CellTools::mapToReferenceFrame): physPoints rank does not match refPoints rank." );
319 for (ordinal_type i=0;i<refPointRank;++i) {
320 INTREPID2_TEST_FOR_EXCEPTION( refPoints.extent(i) != physPoints.extent(i), std::invalid_argument,
321 ">>> ERROR (Intrepid2::CellTools::mapToReferenceFrame): physPoints dimension (i) does not match refPoints dimension (i)." );
322 }
323 }
324
325 template<typename refPointViewType,
326 typename initGuessViewType,
327 typename physPointViewType,
328 typename worksetCellViewType>
329 void CellTools_mapToReferenceFrameInitGuessArgs( const refPointViewType refPoints,
330 const initGuessViewType initGuess,
331 const physPointViewType physPoints,
332 const worksetCellViewType worksetCell,
333 const shards::CellTopology cellTopo ) {
334 // Call the method that validates arguments with the default initial guess selection
335 CellTools_mapToReferenceFrameArgs(refPoints, physPoints, worksetCell, cellTopo);
336
337 // Then check initGuess: its rank and dimensions must match those of physPoints.
338 INTREPID2_TEST_FOR_EXCEPTION( initGuess.rank() != physPoints.rank(), std::invalid_argument,
339 ">>> ERROR (Intrepid2::CellTools::mapToReferenceFrame): InitGuess must have the same rank as physPoints");
340
341 const ordinal_type r = initGuess.rank();
342 for (ordinal_type i=0;i<r;++i) {
343 INTREPID2_TEST_FOR_EXCEPTION( initGuess.extent(i) != physPoints.extent(i), std::invalid_argument,
344 ">>> ERROR (Intrepid2::CellTools::mapToReferenceFrame): InitGuess dimension (i) does not match ot physPoints dimension(i).");
345 }
346 }
347
348
349} // end of intrepid2
350
351#endif
352
353
354
355
356
357// template<class Scalar>
358// template<class ArrayIncl, class ArrayPoint, class ArrayCell>
359// void CellTools<Scalar>::checkPointwiseInclusion(ArrayIncl & inCell,
360// const ArrayPoint & physPoints,
361// const ArrayCell & worksetCell,
362// const ordinal_type & whichCell,
363// const shards::CellTopology & cell)
364// {
365// // Validate worksetCell array
366// INTREPID2_TEST_FOR_EXCEPTION( (getrank(worksetCell) != 3), std::invalid_argument,
367// ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): rank = 3 required for worksetCell array" );
368
369// INTREPID2_TEST_FOR_EXCEPTION( (static_cast<index_type>(worksetCell.extent(1)) != (index_type)cell.getSubcellCount(0) ), std::invalid_argument,
370// ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): dim 1 (number of cell nodes) of worksetCell array does not match cell topology" );
371
372// INTREPID2_TEST_FOR_EXCEPTION( (static_cast<index_type>(worksetCell.extent(2)) != (index_type)cell.getDimension() ), std::invalid_argument,
373// ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): dim 2 (spatial dimension) of worksetCell array does not match cell dimension" );
374
375
376// // Validate whichCell It can be either -1 (default value) or a valid cell ordinal.
377// INTREPID2_TEST_FOR_EXCEPTION( !( ( (0 <= whichCell ) && (whichCell < worksetCell.extent(0) ) ) || (whichCell == -1) ), std::invalid_argument,
378// ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): whichCell = -1 or a valid cell ordinal is required." );
379
380// // Validate points array: can be rank-2 (P,D) or rank-3 (C,P,D)
381// // If rank-2: admissible inCell is rank-1 (P); admissible whichCell is valid cell ordinal but not -1.
382// if(getrank(physPoints) == 2) {
383
384// INTREPID2_TEST_FOR_EXCEPTION( (whichCell == -1), std::invalid_argument,
385// ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): whichCell = a valid cell ordinal is required with rank-2 input array." );
386
387// INTREPID2_TEST_FOR_EXCEPTION( (static_cast<index_type>(physPoints.extent(1)) != (index_type)cell.getDimension() ), std::invalid_argument,
388// ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): dim 1 (spatial dimension) of physPoints array does not match cell dimension" );
389
390// // Validate inCell
391// INTREPID2_TEST_FOR_EXCEPTION( (getrank(inCell) != 1), std::invalid_argument,
392// ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): rank = 1 required for inCell array" );
393
394// INTREPID2_TEST_FOR_EXCEPTION( (static_cast<index_type>(inCell.extent(0)) != static_cast<index_type>(physPoints.extent(0))), std::invalid_argument,
395// ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): dim 0 (number of points) of inCell array must equal dim 0 of physPoints array" );
396// }
397// // If rank-3: admissible inCell is rank-2 (C,P); admissible whichCell = -1.
398// else if (getrank(physPoints) == 3){
399
400// INTREPID2_TEST_FOR_EXCEPTION( !(whichCell == -1), std::invalid_argument,
401// ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): whichCell = -1 is required with rank-3 input array." );
402
403// INTREPID2_TEST_FOR_EXCEPTION( (static_cast<index_type>(physPoints.extent(0)) != static_cast<index_type>(worksetCell.extent(0)) ), std::invalid_argument,
404// ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): dim 0 (number of cells) of physPoints array must equal dim 0 of worksetCell array " );
405
406// INTREPID2_TEST_FOR_EXCEPTION( (static_cast<index_type>(physPoints.extent(2)) != (index_type)cell.getDimension() ), std::invalid_argument,
407// ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): dim 2 (spatial dimension) of physPoints array does not match cell dimension" );
408
409// // Validate inCell
410// INTREPID2_TEST_FOR_EXCEPTION( (getrank(inCell) != 2), std::invalid_argument,
411// ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): rank = 2 required for inCell array" );
412
413// INTREPID2_TEST_FOR_EXCEPTION( (static_cast<index_type>(inCell.extent(0)) != static_cast<index_type>(physPoints.extent(0))), std::invalid_argument,
414// ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): dim 0 (number of cells) of inCell array must equal dim 0 of physPoints array" );
415
416// INTREPID2_TEST_FOR_EXCEPTION( (static_cast<index_type>(inCell.extent(1)) != static_cast<index_type>(physPoints.extent(1))), std::invalid_argument,
417// ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): dim 1 (number of points) of inCell array must equal dim 1 of physPoints array" );
418// }
419// else {
420// INTREPID2_TEST_FOR_EXCEPTION( !( (getrank(physPoints) == 2) && (getrank(physPoints) ==3) ), std::invalid_argument,
421// ">>> ERROR (Intrepid2::CellTools::checkPointwiseInclusion): rank = 2 or 3 required for points array" );
422// }
423// }
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.