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
94 ">>> ERROR (Intrepid2::OrientationTools::getLineJacobian): " \
95 "Orientation is invalid (0--1)." );
98 ordinal_type
jac[2] = { 1, -1 };
103 template<
typename VT>
111 const ordinal_type
ort) {
116#ifdef HAVE_INTREPID2_DEBUG
119 INTREPID2_TEST_FOR_ABORT( !( -eps <= lambda[0] && lambda[0] <= 1.0+eps ),
120 ">>> ERROR (Intrepid::OrientationTools::getModifiedTrianglePoint): " \
121 "Computed bicentric coordinate (lamba[0]) is out of range [0, 1].");
123 INTREPID2_TEST_FOR_ABORT( !( -eps <= lambda[1] && lambda[1] <= 1.0+eps ),
124 ">>> ERROR (Intrepid::OrientationTools::getModifiedTrianglePoint): " \
125 "Computed bicentric coordinate (lamba[1]) is out of range [0, 1].");
127 INTREPID2_TEST_FOR_ABORT( !( -eps <= lambda[2] && lambda[2] <= 1.0+eps ),
128 ">>> ERROR (Intrepid::OrientationTools::getModifiedTrianglePoint): "
129 "Computed bicentric coordinate (lamba[2]) is out of range [0, 1].");
133 case 0: ot0 = lambda[1]; ot1 = lambda[2];
break;
134 case 1: ot0 = lambda[0]; ot1 = lambda[1];
break;
135 case 2: ot0 = lambda[2]; ot1 = lambda[0];
break;
137 case 3: ot0 = lambda[2]; ot1 = lambda[1];
break;
138 case 4: ot0 = lambda[0]; ot1 = lambda[2];
break;
139 case 5: ot0 = lambda[1]; ot1 = lambda[0];
break;
141 INTREPID2_TEST_FOR_ABORT(
true,
142 ">>> ERROR (Intrepid2::OrientationTools::getModifiedTrianglePoint): " \
143 "Orientation is invalid (0--5)." );
147 template<
typename JacobianViewType>
148 KOKKOS_INLINE_FUNCTION
152#ifdef HAVE_INTREPID2_DEBUG
154 ">>> ERROR (Intrepid2::OrientationTools::getTriangleJacobian): " \
155 "Orientation is invalid (0--5)." );
158 ordinal_type
jac[6][2][2] = { { { 1, 0 },
177 template<
typename VT>
185 const ordinal_type
ort) {
186#ifdef HAVE_INTREPID2_DEBUG
187 INTREPID2_TEST_FOR_ABORT( !( -1.0 <=
pt0 &&
pt0 <= 1.0 ),
188 ">>> ERROR (Intrepid::OrientationTools::getModifiedQuadrilateralPoint): " \
189 "Input point(0) is out of range [-1, 1].");
191 INTREPID2_TEST_FOR_ABORT( !( -1.0 <=
pt1 &&
pt1 <= 1.0 ),
192 ">>> ERROR (Intrepid::OrientationTools::getModifiedQuadrilateralPoint): " \
193 "Input point(1) is out of range [-1, 1].");
200 case 0: ot0 = lambda[0][0]; ot1 = lambda[1][0];
break;
201 case 1: ot0 = lambda[1][1]; ot1 = lambda[0][0];
break;
202 case 2: ot0 = lambda[0][1]; ot1 = lambda[1][1];
break;
203 case 3: ot0 = lambda[1][0]; ot1 = lambda[0][1];
break;
205 case 4: ot0 = lambda[1][0]; ot1 = lambda[0][0];
break;
206 case 5: ot0 = lambda[0][1]; ot1 = lambda[1][0];
break;
207 case 6: ot0 = lambda[1][1]; ot1 = lambda[0][1];
break;
208 case 7: ot0 = lambda[0][0]; ot1 = lambda[1][1];
break;
210 INTREPID2_TEST_FOR_ABORT(
true,
211 ">>> ERROR (Intrepid2::OrientationTools::getModifiedQuadrilateralPoint): " \
212 "Orientation is invalid (0--7)." );
216 template<
typename JacobianViewType>
217 KOKKOS_INLINE_FUNCTION
221#ifdef HAVE_INTREPID2_DEBUG
223 ">>> ERROR (Intrepid2::OrientationTools::getQuadrilateralJacobian): " \
224 "Orientation is invalid (0--7)." );
227 ordinal_type
jac[8][2][2] = { { { 1, 0 },
257 const shards::CellTopology
cellTopo,
259#ifdef HAVE_INTREPID2_DEBUG
261 const auto cellDim =
cellTopo.getDimension();
262 INTREPID2_TEST_FOR_EXCEPTION( !( (1 <= cellDim) && (cellDim <= 2 ) ), std::invalid_argument,
263 ">>> ERROR (Intrepid::OrientationTools::mapToModifiedReference): " \
264 "Method defined only for 1 and 2-dimensional subcells.");
266 INTREPID2_TEST_FOR_EXCEPTION( !(
outPoints.extent(0) ==
refPoints.extent(0) ), std::invalid_argument,
267 ">>> ERROR (Intrepid::OrientationTools::mapToModifiedReference): " \
268 "Size of input and output point arrays does not match each other.");
288 case shards::Line<>::key : {
295 case shards::Triangle<>::key : {
302 case shards::Quadrilateral<>::key : {
310 INTREPID2_TEST_FOR_ABORT(
true,
311 ">>> ERROR (Intrepid2::OrientationTools::mapToModifiedReference): " \
312 "Invalid cell topology key." );
319 template<
typename outPo
intViewType>
324 const shards::CellTopology
cellTopo,
326#ifdef HAVE_INTREPID2_DEBUG
328 const auto cellDim =
cellTopo.getDimension();
329 INTREPID2_TEST_FOR_EXCEPTION( !( (1 <= cellDim) && (cellDim <= 2 ) ), std::invalid_argument,
330 ">>> ERROR (Intrepid::OrientationTools::getJacobianOfOrientationMap): " \
331 "Method defined only for 1 and 2-dimensional subcells.");
333 INTREPID2_TEST_FOR_ABORT(
jacobian.rank() != 2,
334 ">>> ERROR (Intrepid2::OrientationTools::getJacobianOfOrientationMap): " \
335 "Jacobian should have rank 2" );
337 INTREPID2_TEST_FOR_EXCEPTION( ((
jacobian.extent(0) != cellDim) || (
jacobian.extent(1) != cellDim)), std::invalid_argument,
338 ">>> ERROR (Intrepid::OrientationTools::getJacobianOfOrientationMap): " \
339 "Size of jacobian is not compatible with cell topology.");
346 template<
typename outPo
intViewType>
347 KOKKOS_INLINE_FUNCTION
351 const unsigned cellTopoKey,
352 const ordinal_type cellOrt) {
353 switch (cellTopoKey) {
354 case shards::Line<>::key :
357 case shards::Triangle<>::key :
360 case shards::Quadrilateral<>::key :
364 INTREPID2_TEST_FOR_ABORT(
true,
365 ">>> ERROR (Intrepid2::OrientationTools::mapToModifiedReference): " \
366 "Invalid cell topology key." );
373 template<
typename TanViewType,
typename ParamViewType>
374 KOKKOS_INLINE_FUNCTION
380 const ordinal_type
ort){
381 typename ParamViewType::non_const_value_type
data[4];
382 typename ParamViewType::non_const_type
jac(
data, 2, 2);
388 for(ordinal_type
d=0;
d<cellDim; ++
d)
397 template<
typename TanNormViewType,
typename ParamViewType>
404 const ordinal_type
ort){
406 auto range = Kokkos::pair<ordinal_type, ordinal_type>(0,cellDim-1);
422 template<
typename coordsViewType,
typename subcellCoordsViewType,
typename ParamViewType>
430 const ordinal_type
ort){
438 typename coordsViewType::value_type
subCoord[2];
444 for(ordinal_type
d=0;
d<cellDim; ++
d) {