48 #ifndef __INTREPID2_ORIENTATIONTOOLS_DEF_MODIFY_POINTS_HPP__ 49 #define __INTREPID2_ORIENTATIONTOOLS_DEF_MODIFY_POINTS_HPP__ 52 #if defined (__clang__) && !defined (__INTEL_COMPILER) 53 #pragma clang system_header 65 KOKKOS_INLINE_FUNCTION
70 const ordinal_type ort) {
71 #ifdef HAVE_INTREPID2_DEBUG 72 INTREPID2_TEST_FOR_ABORT( !( -1.0 <= pt && pt <= 1.0 ),
73 ">>> ERROR (Intrepid::OrientationTools::getModifiedLinePoint): " 74 "Input point is out of range [-1, 1].");
78 case 0: ot = pt;
break;
79 case 1: ot = -pt;
break;
81 INTREPID2_TEST_FOR_ABORT(
true,
82 ">>> ERROR (Intrepid2::OrientationTools::getModifiedLinePoint): " 83 "Orientation is invalid (0--1)." );
87 template<
typename JacobianViewType>
88 KOKKOS_INLINE_FUNCTION
92 #ifdef HAVE_INTREPID2_DEBUG 93 INTREPID2_TEST_FOR_ABORT( ort <0 || ort >1,
94 ">>> ERROR (Intrepid2::OrientationTools::getLineJacobian): " \
95 "Orientation is invalid (0--1)." );
98 ordinal_type jac[2] = { 1, -1 };
100 jacobian(0,0) = jac[ort];
103 template<
typename VT>
104 KOKKOS_INLINE_FUNCTION
111 const ordinal_type ort) {
112 const VT lambda[3] = { 1.0 - pt0 - pt1,
116 #ifdef HAVE_INTREPID2_DEBUG 117 INTREPID2_TEST_FOR_ABORT( !( 0.0 <= lambda[0] && lambda[0] <= 1.0 ),
118 ">>> ERROR (Intrepid::OrientationTools::getModifiedTrianglePoint): " \
119 "Computed bicentric coordinate (lamba[0]) is out of range [0, 1].");
121 INTREPID2_TEST_FOR_ABORT( !( 0.0 <= lambda[1] && lambda[1] <= 1.0 ),
122 ">>> ERROR (Intrepid::OrientationTools::getModifiedTrianglePoint): " \
123 "Computed bicentric coordinate (lamba[1]) is out of range [0, 1].");
125 INTREPID2_TEST_FOR_ABORT( !( 0.0 <= lambda[2] && lambda[2] <= 1.0 ),
126 ">>> ERROR (Intrepid::OrientationTools::getModifiedTrianglePoint): " 127 "Computed bicentric coordinate (lamba[2]) is out of range [0, 1].");
131 case 0: ot0 = lambda[1]; ot1 = lambda[2];
break;
132 case 1: ot0 = lambda[0]; ot1 = lambda[1];
break;
133 case 2: ot0 = lambda[2]; ot1 = lambda[0];
break;
135 case 3: ot0 = lambda[2]; ot1 = lambda[1];
break;
136 case 4: ot0 = lambda[0]; ot1 = lambda[2];
break;
137 case 5: ot0 = lambda[1]; ot1 = lambda[0];
break;
139 INTREPID2_TEST_FOR_ABORT(
true,
140 ">>> ERROR (Intrepid2::OrientationTools::getModifiedTrianglePoint): " \
141 "Orientation is invalid (0--5)." );
145 template<
typename JacobianViewType>
146 KOKKOS_INLINE_FUNCTION
150 #ifdef HAVE_INTREPID2_DEBUG 151 INTREPID2_TEST_FOR_ABORT( ort <0 || ort >5,
152 ">>> ERROR (Intrepid2::OrientationTools::getTriangleJacobian): " \
153 "Orientation is invalid (0--5)." );
156 ordinal_type jac[6][2][2] = { { { 1, 0 },
169 jacobian(0,0) = jac[ort][0][0];
170 jacobian(0,1) = jac[ort][0][1];
171 jacobian(1,0) = jac[ort][1][0];
172 jacobian(1,1) = jac[ort][1][1];
175 template<
typename VT>
176 KOKKOS_INLINE_FUNCTION
183 const ordinal_type ort) {
184 #ifdef HAVE_INTREPID2_DEBUG 185 INTREPID2_TEST_FOR_ABORT( !( -1.0 <= pt0 && pt0 <= 1.0 ),
186 ">>> ERROR (Intrepid::OrientationTools::getModifiedQuadrilateralPoint): " \
187 "Input point(0) is out of range [-1, 1].");
189 INTREPID2_TEST_FOR_ABORT( !( -1.0 <= pt1 && pt1 <= 1.0 ),
190 ">>> ERROR (Intrepid::OrientationTools::getModifiedQuadrilateralPoint): " \
191 "Input point(1) is out of range [-1, 1].");
194 const VT lambda[2][2] = { { pt0, -pt0 },
198 case 0: ot0 = lambda[0][0]; ot1 = lambda[1][0];
break;
199 case 1: ot0 = lambda[1][1]; ot1 = lambda[0][0];
break;
200 case 2: ot0 = lambda[0][1]; ot1 = lambda[1][1];
break;
201 case 3: ot0 = lambda[1][0]; ot1 = lambda[0][1];
break;
203 case 4: ot0 = lambda[1][0]; ot1 = lambda[0][0];
break;
204 case 5: ot0 = lambda[0][1]; ot1 = lambda[1][0];
break;
205 case 6: ot0 = lambda[1][1]; ot1 = lambda[0][1];
break;
206 case 7: ot0 = lambda[0][0]; ot1 = lambda[1][1];
break;
208 INTREPID2_TEST_FOR_ABORT(
true,
209 ">>> ERROR (Intrepid2::OrientationTools::getModifiedQuadrilateralPoint): " \
210 "Orientation is invalid (0--7)." );
214 template<
typename JacobianViewType>
215 KOKKOS_INLINE_FUNCTION
219 #ifdef HAVE_INTREPID2_DEBUG 220 INTREPID2_TEST_FOR_ABORT( ort <0 || ort >7,
221 ">>> ERROR (Intrepid2::OrientationTools::getQuadrilateralJacobian): " \
222 "Orientation is invalid (0--7)." );
225 ordinal_type jac[8][2][2] = { { { 1, 0 },
242 jacobian(0,0) = jac[ort][0][0];
243 jacobian(0,1) = jac[ort][0][1];
244 jacobian(1,0) = jac[ort][1][0];
245 jacobian(1,1) = jac[ort][1][1];
248 template<
typename outPointViewType,
249 typename refPointViewType>
254 const refPointViewType refPoints,
255 const shards::CellTopology cellTopo,
256 const ordinal_type cellOrt) {
257 #ifdef HAVE_INTREPID2_DEBUG 259 const auto cellDim = cellTopo.getDimension();
260 INTREPID2_TEST_FOR_EXCEPTION( !( (1 <= cellDim) && (cellDim <= 2 ) ), std::invalid_argument,
261 ">>> ERROR (Intrepid::OrientationTools::mapToModifiedReference): " \
262 "Method defined only for 1 and 2-dimensional subcells.");
264 INTREPID2_TEST_FOR_EXCEPTION( !( outPoints.extent(0) == refPoints.extent(0) ), std::invalid_argument,
265 ">>> ERROR (Intrepid::OrientationTools::mapToModifiedReference): " \
266 "Size of input and output point arrays does not match each other.");
271 const ordinal_type numPts = outPoints.extent(0);
272 const auto key = cellTopo.getBaseCellTopologyData()->key;
274 case shards::Line<>::key : {
275 for (ordinal_type pt=0;pt<numPts;++pt)
281 case shards::Triangle<>::key : {
282 for (ordinal_type pt=0;pt<numPts;++pt)
284 refPoints(pt, 0), refPoints(pt, 1),
288 case shards::Quadrilateral<>::key : {
289 for (ordinal_type pt=0;pt<numPts;++pt)
291 refPoints(pt, 0), refPoints(pt, 1),
296 INTREPID2_TEST_FOR_WARNING(
true,
297 ">>> ERROR (Intrepid2::OrientationTools::mapToModifiedReference): " \
298 "Invalid cell topology." );
305 template<
typename outPo
intViewType>
310 const shards::CellTopology cellTopo,
311 const ordinal_type cellOrt) {
312 #ifdef HAVE_INTREPID2_DEBUG 314 const auto cellDim = cellTopo.getDimension();
315 INTREPID2_TEST_FOR_EXCEPTION( !( (1 <= cellDim) && (cellDim <= 2 ) ), std::invalid_argument,
316 ">>> ERROR (Intrepid::OrientationTools::getJacobianOfOrientationMap): " \
317 "Method defined only for 1 and 2-dimensional subcells.");
319 INTREPID2_TEST_FOR_ABORT( jacobian.rank() != 2,
320 ">>> ERROR (Intrepid2::OrientationTools::getJacobianOfOrientationMap): " \
321 "Jacobian should have rank 2" );
323 INTREPID2_TEST_FOR_EXCEPTION( ((jacobian.extent(0) != cellDim) || (jacobian.extent(1) != cellDim)), std::invalid_argument,
324 ">>> ERROR (Intrepid::OrientationTools::getJacobianOfOrientationMap): " \
325 "Size of jacobian is not compatible with cell topology.");
329 const auto key = cellTopo.getBaseCellTopologyData()->key;
331 case shards::Line<>::key :
334 case shards::Triangle<>::key :
337 case shards::Quadrilateral<>::key :
341 INTREPID2_TEST_FOR_WARNING(
true,
342 ">>> ERROR (Intrepid2::OrientationTools::mapToModifiedReference): " \
343 "Invalid cell topology." );