14 template <
typename scalar,
int element_type,
int element_size>
17 size_t pool_size) : domain(_domain), numPrimalDPN(_numPrimalDPN)
19 N = Kokkos::View<scalar ***, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace>(
"A", pool_size, element_size, element_size);
30 template <
typename scalar,
int element_type,
int element_size>
35 std::vector<Eigen::Vector3d> gauss_p;
36 std::vector<double> gauss_w;
39 if (element_type ==
static_cast<int>(tbox::ELTYPE::HEX8))
41 tbox::CacheHex8 &cachehex8 = this->trilinosHex8GetCache();
44 else if (element_type ==
static_cast<int>(tbox::ELTYPE::TETRA4))
46 tbox::CacheTetra4 &cachetetra4 = this->trilinosTetra4GetCache();
49 else if (element_type ==
static_cast<int>(tbox::ELTYPE::TRI3))
51 tbox::CacheTri3 &cachetri3 = this->trilinosTri3GetCache();
54 else if (element_type ==
static_cast<int>(tbox::ELTYPE::QUAD4))
56 tbox::CacheQuad4 &cachequad4 = this->trilinosQuad4GetCache();
60 for (
size_t a = 0; a < cache->getVGauss().getN(); ++a)
62 gauss_p.push_back(cache->getVGauss().getP(a));
63 gauss_w.push_back(cache->getVGauss().getW(a));
69 auto N_current = subview(N, i_thread, Kokkos::ALL(), Kokkos::ALL());
71 Kokkos::deep_copy(N_current, 0);
74 for (
auto a = 0; a < gauss_p.size(); ++a)
76 for (
auto j = 0; j < element_size; ++j)
77 if (element_type ==
static_cast<int>(tbox::ELTYPE::HEX8))
78 ff(j) = (
static_cast<tbox::CacheHex8 *
>(cache)->getSf(a))(j);
79 else if (element_type ==
static_cast<int>(tbox::ELTYPE::TETRA4))
80 ff(j) = (
static_cast<tbox::CacheTetra4 *
>(cache)->getSf(a))(j);
81 else if (element_type ==
static_cast<int>(tbox::ELTYPE::TRI3))
82 ff(j) = (
static_cast<tbox::CacheTri3 *
>(cache)->getSf(a))(j);
83 else if (element_type ==
static_cast<int>(tbox::ELTYPE::QUAD4))
84 ff(j) = (
static_cast<tbox::CacheQuad4 *
>(cache)->getSf(a))(j);
86 double detJ = this->buildJ(a, J, e, *(domain->elementsList), *(domain->nodesList));
88 for (
auto i = 0; i < element_size; ++i)
89 for (
auto j = 0; j < element_size; ++j)
90 N_current(i, j) += ff(i) * ff(j) * gauss_w[a] * detJ;
102 template <
typename scalar,
int element_type,
int element_size>
105 Kokkos::View<scalar **, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace> N_current =
106 subview(N, i_thread, Kokkos::ALL(), Kokkos::ALL());