-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes for shell stress in gpu_fem (#126)
* isotropic shell stress and other fixes for shell element on GPU * remove shell code from a2d and into shell fem code itself * remove test ad shell tests * clang-format * clang-format v2 * clang format a2dbinary.h
- Loading branch information
1 parent
17ba8d1
commit 502cc08
Showing
9 changed files
with
60 additions
and
1,727 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#ifndef A2D_SYMMAT_VEC_CORE_H | ||
#define A2D_SYMMAT_VEC_CORE_H | ||
|
||
#include "../../a2ddefs.h" | ||
|
||
namespace A2D { | ||
|
||
template <typename T, bool additive = false> | ||
A2D_FUNCTION void SymMatVecCore3x3(const T A[], const T x[], T b[]) { | ||
// compute b = A*x | ||
if constexpr (additive) { | ||
b[0] += A[0] * x[0] + A[1] * x[1] + A[2] * x[2]; | ||
b[1] += A[1] * x[0] + A[3] * x[1] + A[4] * x[2]; | ||
b[2] += A[2] * x[0] + A[4] * x[1] + A[5] * x[2]; | ||
} else { | ||
b[0] = A[0] * x[0] + A[1] * x[1] + A[2] * x[2]; | ||
b[1] = A[1] * x[0] + A[3] * x[1] + A[4] * x[2]; | ||
b[2] = A[2] * x[0] + A[4] * x[1] + A[5] * x[2]; | ||
} | ||
} | ||
|
||
template <typename T, bool additive = false> | ||
A2D_FUNCTION void SymMatVecCoreScale3x3(const T& scale, const T A[], | ||
const T x[], T b[]) { | ||
// compute b = A * x | ||
if constexpr (additive) { | ||
b[0] += scale * (A[0] * x[0] + A[1] * x[1] + A[2] * x[2]); | ||
b[1] += scale * (A[1] * x[0] + A[3] * x[1] + A[4] * x[2]); | ||
b[2] += scale * (A[2] * x[0] + A[4] * x[1] + A[5] * x[2]); | ||
} else { | ||
b[0] = scale * (A[0] * x[0] + A[1] * x[1] + A[2] * x[2]); | ||
b[1] = scale * (A[1] * x[0] + A[3] * x[1] + A[4] * x[2]); | ||
b[2] = scale * (A[2] * x[0] + A[4] * x[1] + A[5] * x[2]); | ||
} | ||
} | ||
} // namespace A2D | ||
|
||
#endif // A2D_SYMMAT_VEC_CORE_H |
Oops, something went wrong.