Skip to content

Commit b5b63b7

Browse files
Merge Pull Request #12925 from rppawlo/Trilinos/panzer-fix-cvfem
Automatically Merged using Trilinos Pull Request AutoTester PR Title: b'Panzer: update cvfem support for BasisValues2 changes' PR Author: rppawlo
2 parents 2975789 + ad2c228 commit b5b63b7

File tree

1 file changed

+34
-20
lines changed

1 file changed

+34
-20
lines changed

packages/panzer/disc-fe/src/Panzer_BasisValues2_impl.hpp

+34-20
Original file line numberDiff line numberDiff line change
@@ -1161,14 +1161,16 @@ getBasisValues(const bool weighted,
11611161
}
11621162
auto tmp_basis_scalar_ref = af.buildStaticArray<Scalar,Cell,BASIS,IP>("tmp_basis_scalar_ref",num_cells,num_card,num_points);
11631163
Kokkos::deep_copy(tmp_basis_scalar_ref.get_view(),tmp_basis_scalar_host);
1164+
const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1165+
auto s_aux = Kokkos::subview(tmp_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1166+
auto s_ref = Kokkos::subview(tmp_basis_scalar_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
11641167

11651168
using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
11661169
if(element_space == PureBasis::HVOL){
1167-
const std::pair<int,int> cell_range(0,num_evaluate_cells_);
11681170
auto s_cjd = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1169-
fst::HVOLtransformVALUE(tmp_basis_scalar.get_view(),s_cjd,tmp_basis_scalar_ref.get_view());
1171+
fst::HVOLtransformVALUE(s_aux,s_cjd,s_ref);
11701172
} else if(element_space == PureBasis::HGRAD || element_space == PureBasis::CONST) {
1171-
fst::HGRADtransformVALUE(tmp_basis_scalar.get_view(),tmp_basis_scalar_ref.get_view());
1173+
fst::HGRADtransformVALUE(s_aux,s_ref);
11721174
}
11731175
} else {
11741176
#endif
@@ -1184,14 +1186,16 @@ getBasisValues(const bool weighted,
11841186
}
11851187
auto tmp_basis_scalar_ref = af.buildStaticArray<Scalar,Cell,BASIS,IP>("tmp_basis_scalar_ref",num_cells,num_card,num_points);
11861188
Kokkos::deep_copy(tmp_basis_scalar_ref.get_view(),tmp_basis_scalar_host);
1189+
const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1190+
auto s_aux = Kokkos::subview(tmp_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1191+
auto s_ref = Kokkos::subview(tmp_basis_scalar_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
11871192

11881193
using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
11891194
if(element_space == PureBasis::HVOL){
1190-
const std::pair<int,int> cell_range(0,num_evaluate_cells_);
11911195
auto s_cjd = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1192-
fst::HVOLtransformVALUE(tmp_basis_scalar.get_view(),s_cjd,tmp_basis_scalar_ref.get_view());
1196+
fst::HVOLtransformVALUE(s_aux,s_cjd,s_ref);
11931197
} else if(element_space == PureBasis::HGRAD || element_space == PureBasis::CONST) {
1194-
fst::HGRADtransformVALUE(tmp_basis_scalar.get_view(),tmp_basis_scalar_ref.get_view());
1198+
fst::HGRADtransformVALUE(s_aux,s_ref);
11951199
}
11961200
#ifdef KOKKOS_ENABLE_CUDA
11971201
}
@@ -1323,15 +1327,16 @@ getVectorBasisValues(const bool weighted,
13231327

13241328
const std::pair<int,int> cell_range(0,num_evaluate_cells_);
13251329
auto s_aux = Kokkos::subview(tmp_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1330+
auto s_ref = Kokkos::subview(tmp_basis_vector_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
13261331

13271332
using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
13281333
if(element_space == PureBasis::HCURL){
13291334
auto s_jac_inv = Kokkos::subview(cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1330-
fst::HCURLtransformVALUE(s_aux,s_jac_inv,tmp_basis_vector_ref.get_view());
1335+
fst::HCURLtransformVALUE(s_aux,s_jac_inv,s_ref);
13311336
} else if(element_space == PureBasis::HDIV){
13321337
auto s_jac = Kokkos::subview(cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
13331338
auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1334-
fst::HDIVtransformVALUE(s_aux,s_jac, s_jac_det, tmp_basis_vector_ref.get_view());
1339+
fst::HDIVtransformVALUE(s_aux,s_jac, s_jac_det, s_ref);
13351340
}
13361341
} else {
13371342
#endif
@@ -1350,15 +1355,16 @@ getVectorBasisValues(const bool weighted,
13501355

13511356
const std::pair<int,int> cell_range(0,num_evaluate_cells_);
13521357
auto s_aux = Kokkos::subview(tmp_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1358+
auto s_ref = Kokkos::subview(tmp_basis_vector_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
13531359

13541360
using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
13551361
if(element_space == PureBasis::HCURL){
13561362
auto s_jac_inv = Kokkos::subview(cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1357-
fst::HCURLtransformVALUE(s_aux,s_jac_inv,tmp_basis_vector_ref.get_view());
1363+
fst::HCURLtransformVALUE(s_aux,s_jac_inv,s_ref);
13581364
} else if(element_space == PureBasis::HDIV){
13591365
auto s_jac = Kokkos::subview(cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
13601366
auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1361-
fst::HDIVtransformVALUE(s_aux,s_jac, s_jac_det, tmp_basis_vector_ref.get_view());
1367+
fst::HDIVtransformVALUE(s_aux,s_jac, s_jac_det, s_ref);
13621368
}
13631369
#ifdef KOKKOS_ENABLE_CUDA
13641370
}
@@ -1477,10 +1483,11 @@ getGradBasisValues(const bool weighted,
14771483
const std::pair<int,int> cell_range(0,num_evaluate_cells_);
14781484
auto s_aux = Kokkos::subview(tmp_grad_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
14791485
auto s_jac_inv = Kokkos::subview(cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1486+
auto s_ref = Kokkos::subview(tmp_grad_basis_ref.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
14801487

14811488
// Apply transformation
14821489
using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1483-
fst::HGRADtransformGRAD(s_aux, s_jac_inv,tmp_grad_basis_ref.get_view());
1490+
fst::HGRADtransformGRAD(s_aux, s_jac_inv, s_ref);
14841491
} else {
14851492
#endif
14861493
auto cubature_points_ref_host = Kokkos::create_mirror_view(cubature_points_ref_.get_view());
@@ -1499,10 +1506,11 @@ getGradBasisValues(const bool weighted,
14991506
const std::pair<int,int> cell_range(0,num_evaluate_cells_);
15001507
auto s_aux = Kokkos::subview(tmp_grad_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
15011508
auto s_jac_inv = Kokkos::subview(cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1509+
auto s_ref = Kokkos::subview(tmp_grad_basis_ref.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
15021510

15031511
// Apply transformation
15041512
using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1505-
fst::HGRADtransformGRAD(s_aux, s_jac_inv,tmp_grad_basis_ref.get_view());
1513+
fst::HGRADtransformGRAD(s_aux, s_jac_inv, s_ref);
15061514
#ifdef KOKKOS_ENABLE_CUDA
15071515
}
15081516
#endif
@@ -1621,12 +1629,13 @@ getCurl2DVectorBasis(const bool weighted,
16211629
const std::pair<int,int> cell_range(0,num_evaluate_cells_);
16221630
auto s_aux = Kokkos::subview(tmp_curl_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
16231631
auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1632+
auto s_ref = Kokkos::subview(tmp_curl_basis_scalar_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
16241633

16251634
// note only volume deformation is needed!
16261635
// this relates directly to this being in
16271636
// the divergence space in 2D!
16281637
using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1629-
fst::HDIVtransformDIV(s_aux,s_jac_det,tmp_curl_basis_scalar_ref.get_view());
1638+
fst::HDIVtransformDIV(s_aux,s_jac_det,s_ref);
16301639
} else {
16311640
#endif
16321641
auto cubature_points_ref_host = Kokkos::create_mirror_view(cubature_points_ref_.get_view());
@@ -1645,12 +1654,13 @@ getCurl2DVectorBasis(const bool weighted,
16451654
const std::pair<int,int> cell_range(0,num_evaluate_cells_);
16461655
auto s_aux = Kokkos::subview(tmp_curl_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
16471656
auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1657+
auto s_ref = Kokkos::subview(tmp_curl_basis_scalar_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
16481658

16491659
// note only volume deformation is needed!
16501660
// this relates directly to this being in
16511661
// the divergence space in 2D!
16521662
using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1653-
fst::HDIVtransformDIV(s_aux,s_jac_det,tmp_curl_basis_scalar_ref.get_view());
1663+
fst::HDIVtransformDIV(s_aux,s_jac_det,s_ref);
16541664
#ifdef KOKKOS_ENABLE_CUDA
16551665
}
16561666
#endif
@@ -1756,7 +1766,7 @@ getCurlVectorBasis(const bool weighted,
17561766

17571767
auto intrepid_basis_host = intrepid_basis->getHostBasis();
17581768
for(int cell=0; cell<num_evaluate_cells_; ++cell) {
1759-
auto my_cell_curl_basis_host = Kokkos::subview(tmp_curl_basis_vector_host,cell,Kokkos::ALL(),Kokkos::ALL());
1769+
auto my_cell_curl_basis_host = Kokkos::subview(tmp_curl_basis_vector_host,cell,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
17601770
auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
17611771
intrepid_basis_host->getValues(my_cell_curl_basis_host,my_cell_cub_points_ref_host,Intrepid2::OPERATOR_CURL);
17621772
}
@@ -1767,9 +1777,10 @@ getCurlVectorBasis(const bool weighted,
17671777
auto s_aux = Kokkos::subview(tmp_curl_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
17681778
auto s_jac = Kokkos::subview(cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
17691779
auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1780+
auto s_ref = Kokkos::subview(tmp_curl_basis_vector_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
17701781

17711782
using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1772-
fst::HCURLtransformCURL(s_aux, s_jac, s_jac_det, tmp_curl_basis_vector_ref.get_view());
1783+
fst::HCURLtransformCURL(s_aux, s_jac, s_jac_det, s_ref);
17731784
} else {
17741785
#endif
17751786
auto cubature_points_ref_host = Kokkos::create_mirror_view(cubature_points_ref_.get_view());
@@ -1778,7 +1789,7 @@ getCurlVectorBasis(const bool weighted,
17781789

17791790
auto intrepid_basis_host = intrepid_basis->getHostBasis();
17801791
for(int cell=0; cell<num_evaluate_cells_; ++cell) {
1781-
auto my_cell_curl_basis_host = Kokkos::subview(tmp_curl_basis_vector_host,cell,Kokkos::ALL(),Kokkos::ALL());
1792+
auto my_cell_curl_basis_host = Kokkos::subview(tmp_curl_basis_vector_host,cell,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
17821793
auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
17831794
intrepid_basis_host->getValues(my_cell_curl_basis_host,my_cell_cub_points_ref_host,Intrepid2::OPERATOR_CURL);
17841795
}
@@ -1789,9 +1800,10 @@ getCurlVectorBasis(const bool weighted,
17891800
auto s_aux = Kokkos::subview(tmp_curl_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
17901801
auto s_jac = Kokkos::subview(cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
17911802
auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1803+
auto s_ref = Kokkos::subview(tmp_curl_basis_vector_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
17921804

17931805
using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1794-
fst::HCURLtransformCURL(s_aux, s_jac, s_jac_det, tmp_curl_basis_vector_ref.get_view());
1806+
fst::HCURLtransformCURL(s_aux, s_jac, s_jac_det, s_ref);
17951807
#ifdef KOKKOS_ENABLE_CUDA
17961808
}
17971809
#endif
@@ -1905,9 +1917,10 @@ getDivVectorBasis(const bool weighted,
19051917
const std::pair<int,int> cell_range(0,num_evaluate_cells_);
19061918
auto s_aux = Kokkos::subview(tmp_div_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
19071919
auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1920+
auto s_ref = Kokkos::subview(tmp_div_basis_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
19081921

19091922
using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1910-
fst::HDIVtransformDIV(s_aux,s_jac_det,tmp_div_basis_ref.get_view());
1923+
fst::HDIVtransformDIV(s_aux,s_jac_det,s_ref);
19111924
} else {
19121925
#endif
19131926
auto cubature_points_ref_host = Kokkos::create_mirror_view(cubature_points_ref_.get_view());
@@ -1926,9 +1939,10 @@ getDivVectorBasis(const bool weighted,
19261939
const std::pair<int,int> cell_range(0,num_evaluate_cells_);
19271940
auto s_aux = Kokkos::subview(tmp_div_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
19281941
auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1942+
auto s_ref = Kokkos::subview(tmp_div_basis_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
19291943

19301944
using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1931-
fst::HDIVtransformDIV(s_aux,s_jac_det,tmp_div_basis_ref.get_view());
1945+
fst::HDIVtransformDIV(s_aux,s_jac_det,s_ref);
19321946
#ifdef KOKKOS_ENABLE_CUDA
19331947
}
19341948
#endif

0 commit comments

Comments
 (0)