Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intrepid2 - uvm removal on orientation tools #8824

Merged
merged 10 commits into from
Mar 2, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ namespace Intrepid2 {
/** \brief inverse of Generalized Vandermonde matrix (isotropic order) */
Kokkos::DynRankView<typename ScalarViewType::value_type,DeviceType> vinvLine_, vinvBubble_;
EPointType pointType_;

};

}// namespace Intrepid2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ namespace Intrepid2 {
const vinvViewType vinv );
};

template<typename Devicetype, ordinal_type numPtsPerEval,
template<typename DeviceType, ordinal_type numPtsPerEval,
typename outputValueValueType, class ...outputValueProperties,
typename inputPointValueType, class ...inputPointProperties,
typename vinvValueType, class ...vinvProperties>
Expand Down Expand Up @@ -181,27 +181,27 @@ namespace Intrepid2 {
};
}

template<typename Devicetype = void,
template<typename DeviceType = void,
typename outputValueType = double,
typename pointValueType = double>
class Basis_HGRAD_TET_Cn_FEM
: public Basis<Devicetype,outputValueType,pointValueType> {
: public Basis<DeviceType,outputValueType,pointValueType> {
public:
using OrdinalTypeArray1DHost = typename Basis<Devicetype,outputValueType,pointValueType>::OrdinalTypeArray1DHost;
using OrdinalTypeArray2DHost = typename Basis<Devicetype,outputValueType,pointValueType>::OrdinalTypeArray2DHost;
using OrdinalTypeArray3DHost = typename Basis<Devicetype,outputValueType,pointValueType>::OrdinalTypeArray3DHost;
using OrdinalTypeArray1DHost = typename Basis<DeviceType,outputValueType,pointValueType>::OrdinalTypeArray1DHost;
using OrdinalTypeArray2DHost = typename Basis<DeviceType,outputValueType,pointValueType>::OrdinalTypeArray2DHost;
using OrdinalTypeArray3DHost = typename Basis<DeviceType,outputValueType,pointValueType>::OrdinalTypeArray3DHost;

using OutputViewType = typename Basis<Devicetype,outputValueType,pointValueType>::OutputViewType;
using PointViewType = typename Basis<Devicetype,outputValueType,pointValueType>::PointViewType;
using ScalarViewType = typename Basis<Devicetype,outputValueType,pointValueType>::ScalarViewType;
using OutputViewType = typename Basis<DeviceType,outputValueType,pointValueType>::OutputViewType;
using PointViewType = typename Basis<DeviceType,outputValueType,pointValueType>::PointViewType;
using ScalarViewType = typename Basis<DeviceType,outputValueType,pointValueType>::ScalarViewType;

typedef typename Basis<Devicetype,outputValueType,pointValueType>::scalarType scalarType;
typedef typename Basis<DeviceType,outputValueType,pointValueType>::scalarType scalarType;

private:

/** \brief inverse of Generalized Vandermonde matrix, whose columns store the expansion
coefficients of the nodal basis in terms of phis_ */
Kokkos::DynRankView<scalarType,Devicetype> vinv_;
Kokkos::DynRankView<scalarType,DeviceType> vinv_;

/** \brief type of lattice used for creating the DoF coordinates */
EPointType pointType_;
Expand All @@ -215,7 +215,7 @@ namespace Intrepid2 {



using Basis<Devicetype,outputValueType,pointValueType>::getValues;
using Basis<DeviceType,outputValueType,pointValueType>::getValues;

virtual
void
Expand All @@ -231,7 +231,7 @@ namespace Intrepid2 {
#endif
constexpr ordinal_type numPtsPerEval = Parameters::MaxNumPtsPerBasisEval;
Impl::Basis_HGRAD_TET_Cn_FEM::
getValues<Devicetype,numPtsPerEval>( outputValues,
getValues<DeviceType,numPtsPerEval>( outputValues,
inputPoints,
this->vinv_,
operatorType);
Expand Down Expand Up @@ -287,7 +287,7 @@ namespace Intrepid2 {
return (this->basisDegree_ > 2);
}

Kokkos::DynRankView<typename ScalarViewType::const_value_type,Devicetype>
Kokkos::DynRankView<typename ScalarViewType::const_value_type,DeviceType>

getVandermondeInverse() const {
return vinv_;
Expand All @@ -314,15 +314,15 @@ namespace Intrepid2 {
\param [in] subCellOrd - position of the subCell among of the subCells having the same dimension
\return pointer to the subCell basis of dimension subCellDim and position subCellOrd
*/
BasisPtr<Devicetype,outputValueType,pointValueType>
BasisPtr<DeviceType,outputValueType,pointValueType>
getSubCellRefBasis(const ordinal_type subCellDim, const ordinal_type subCellOrd) const override{
if(subCellDim == 1) {
return Teuchos::rcp(new
Basis_HGRAD_LINE_Cn_FEM<Devicetype,outputValueType,pointValueType>
Basis_HGRAD_LINE_Cn_FEM<DeviceType,outputValueType,pointValueType>
(this->basisDegree_, pointType_));
} else if(subCellDim == 2) {
return Teuchos::rcp(new
Basis_HGRAD_TRI_Cn_FEM<Devicetype,outputValueType,pointValueType>
Basis_HGRAD_TRI_Cn_FEM<DeviceType,outputValueType,pointValueType>
(this->basisDegree_, pointType_));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class Basis_HGRAD_TET_Cn_FEM_ORTH {
const ordinal_type order);
};

template<typename Devicetype, ordinal_type numPtsPerEval,
template<typename DeviceType, ordinal_type numPtsPerEval,
typename outputValueValueType, class ...outputValueProperties,
typename inputPointValueType, class ...inputPointProperties>
static void
Expand Down Expand Up @@ -210,26 +210,26 @@ class Basis_HGRAD_TET_Cn_FEM_ORTH {

}

template<typename Devicetype = void,
template<typename DeviceType = void,
typename outputValueType = double,
typename pointValueType = double>
class Basis_HGRAD_TET_Cn_FEM_ORTH
: public Basis<Devicetype,outputValueType,pointValueType> {
: public Basis<DeviceType,outputValueType,pointValueType> {
public:
typedef double value_type;
typedef typename Basis<Devicetype,outputValueType,pointValueType>::OrdinalTypeArray1DHost OrdinalTypeArray1DHost;
typedef typename Basis<Devicetype,outputValueType,pointValueType>::OrdinalTypeArray2DHost OrdinalTypeArray2DHost;
typedef typename Basis<Devicetype,outputValueType,pointValueType>::OrdinalTypeArray3DHost OrdinalTypeArray3DHost;
typedef typename Basis<DeviceType,outputValueType,pointValueType>::OrdinalTypeArray1DHost OrdinalTypeArray1DHost;
typedef typename Basis<DeviceType,outputValueType,pointValueType>::OrdinalTypeArray2DHost OrdinalTypeArray2DHost;
typedef typename Basis<DeviceType,outputValueType,pointValueType>::OrdinalTypeArray3DHost OrdinalTypeArray3DHost;

/** \brief Constructor.
*/
Basis_HGRAD_TET_Cn_FEM_ORTH( const ordinal_type order );

using OutputViewType = typename Basis<Devicetype,outputValueType,pointValueType>::OutputViewType;
using PointViewType = typename Basis<Devicetype,outputValueType,pointValueType>::PointViewType;
using ScalarViewType = typename Basis<Devicetype,outputValueType,pointValueType>::ScalarViewType;
using OutputViewType = typename Basis<DeviceType,outputValueType,pointValueType>::OutputViewType;
using PointViewType = typename Basis<DeviceType,outputValueType,pointValueType>::PointViewType;
using ScalarViewType = typename Basis<DeviceType,outputValueType,pointValueType>::ScalarViewType;

using Basis<Devicetype,outputValueType,pointValueType>::getValues;
using Basis<DeviceType,outputValueType,pointValueType>::getValues;

virtual
void
Expand All @@ -245,7 +245,7 @@ class Basis_HGRAD_TET_Cn_FEM_ORTH
#endif
constexpr ordinal_type numPtsPerEval = Parameters::MaxNumPtsPerBasisEval;
Impl::Basis_HGRAD_TET_Cn_FEM_ORTH::
getValues<Devicetype,numPtsPerEval>( outputValues,
getValues<DeviceType,numPtsPerEval>( outputValues,
inputPoints,
this->getDegree(),
operatorType );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ namespace Intrepid2 {
const elemNodeViewType elemNodes,
const ordinal_type subCellDim,
const ordinal_type subCellOrd) {
static_assert(Kokkos::Impl::MemorySpaceAccess
<Kokkos::HostSpace,typename elemNodeViewType::device_type::memory_space>::accessible,
"host space cannot access elemNodeViewType");
switch (subCellDim) {
case 0: {
numVerts = 1;
Expand Down Expand Up @@ -153,6 +156,10 @@ namespace Intrepid2 {
Orientation
Orientation::getOrientation(const shards::CellTopology cellTopo,
const elemNodeViewType elemNodes) {
static_assert(Kokkos::Impl::MemorySpaceAccess
<Kokkos::HostSpace,typename elemNodeViewType::device_type::memory_space>::accessible,
"host space cannot access elemNodeViewType");

Orientation ort;
const ordinal_type nedge = cellTopo.getEdgeCount();

Expand Down
Loading