 |
waves
Basic FE playground
|
Go to the documentation of this file.
5 template <
typename scalar,
int element_type>
14 if (element_type ==
static_cast<int>(tbox::ElType::HEX8))
16 tbox::CacheHex8 &cachehex8 = trilinosHex8GetCache();
20 else if (element_type ==
static_cast<int>(tbox::ElType::TETRA4))
22 tbox::CacheTetra4 &cachetetra4 = trilinosTetra4GetCache();
26 else if (element_type ==
static_cast<int>(tbox::ElType::TRI3))
28 tbox::CacheTri3 &cachetri3 = trilinosTri3GetCache();
35 for (
auto n1 = 0; n1 < element_size; ++n1, ++i)
37 for (
auto j = 0; j < 3; ++j)
39 tg1(j) += (
static_cast<tbox::CacheTri3 *
>(cache)->getDsf(k))(0, i) *
41 tg2(j) += (
static_cast<tbox::CacheTri3 *
>(cache)->getDsf(k))(1, i) *
46 n(0) = tg1(1) * tg2(2) - tg1(2) * tg2(1);
47 n(1) = tg1(2) * tg2(0) - tg1(0) * tg2(2);
48 n(2) = tg1(0) * tg2(1) - tg1(1) * tg2(0);
49 double detJ = sqrt(pow(n(0), 2) + pow(n(1), 2) + pow(n(2), 2));
52 else if (element_type ==
static_cast<int>(tbox::ElType::QUAD4))
54 tbox::CacheQuad4 &cachequad4 = trilinosQuad4GetCache();
61 for (
auto n1 = 0; n1 < element_size; ++n1, ++i)
63 for (
auto j = 0; j < 3; ++j)
65 tg1(j) += (
static_cast<tbox::CacheQuad4 *
>(cache)->getDsf(k))(0, i) *
67 tg2(j) += (
static_cast<tbox::CacheQuad4 *
>(cache)->getDsf(k))(1, i) *
72 n(0) = tg1(1) * tg2(2) - tg1(2) * tg2(1);
73 n(1) = tg1(2) * tg2(0) - tg1(0) * tg2(2);
74 n(2) = tg1(0) * tg2(1) - tg1(1) * tg2(0);
75 double detJ = sqrt(pow(n(0), 2) + pow(n(1), 2) + pow(n(2), 2));
87 for (
auto j = 0; j < 3; ++j)
90 if (element_type ==
static_cast<int>(tbox::ElType::HEX8))
91 tmp2(j) = (
static_cast<tbox::CacheHex8 *
>(cache)->getDsf(k))(j, i);
92 else if (element_type ==
static_cast<int>(tbox::ElType::TETRA4))
93 tmp2(j) = (
static_cast<tbox::CacheTetra4 *
>(cache)->getDsf(k))(j, i);
100 double detJ = J.
det();
107 template <
typename scalar,
int element_type>
110 static tbox::Lazy<tbox::CacheHex8> cache(2);
117 template <
typename scalar,
int element_type>
120 static tbox::Lazy<tbox::CacheTetra4> cache(2);
127 template <
typename scalar,
int element_type>
130 static tbox::Lazy<tbox::CacheTri3> cache(2);
137 template <
typename scalar,
int element_type>
140 static tbox::Lazy<tbox::CacheQuad4> cache(2);
tMatrix< T, rows, rows > ddotproduct(tVector rhs)
Definition: tMatrix.h:207
T det()
Definition: tMatrix.h:91
katoptron::Map::local_ordinal_type local_ordinal_type
Definition: ElementComputation.h:32
double buildJ(int k, tMatrix< double, 3, 3 > &J, local_ordinal_type e, const katoptron::ElementsList &elementsList, const katoptron::NodesList &nodesList)
Compute the Jacobian matrix of an element.
Definition: ElementComputation.hpp:6
void clean()
Definition: tMatrix.h:29
Kokkos::View< double **, Kokkos::LayoutRight > nodes
Definition: NodesList.h:22
Class used to store the node information.
Definition: NodesList.h:19
tbox::CacheHex8 & trilinosHex8GetCache()
Return the tbox cache of the hexahedron elements.
Definition: ElementComputation.hpp:108
Class used to store the element information including:
Definition: ElementsList.h:25
tbox::CacheQuad4 & trilinosQuad4GetCache()
Return the tbox cache of the quadrangular elements.
Definition: ElementComputation.hpp:138
tbox::CacheTri3 & trilinosTri3GetCache()
Return the tbox cache of the triangular elements.
Definition: ElementComputation.hpp:128
local_ordinal_type getElementSize(const local_ordinal_type e) const
Return the size of the local element of local ID e. Argument:
Definition: ElementsList.h:67
local_ordinal_type getElementNode(const local_ordinal_type e, local_ordinal_type i) const
Return the local ID of the ith node of the local element of ID e. Argument:
Definition: ElementsList.h:92
tbox::CacheTetra4 & trilinosTetra4GetCache()
Return the tbox cache of the tetrahedron elements.
Definition: ElementComputation.hpp:118