20 #ifndef OPM_UTIL_VOIGT_ARRAY_HPP 21 #define OPM_UTIL_VOIGT_ARRAY_HPP 26 #include <initializer_list> 27 #include <type_traits> 32 enum class VoigtIndex {
33 XX = 0, XY = 5, XZ = 4,
34 YX = XY, YY = 1, YZ = 3,
35 ZX = XZ, ZY = YZ, ZZ = 2,
42 static constexpr
auto indices = std::array<VoigtIndex, 9>{
54 static constexpr
auto unique_indices = std::array<VoigtIndex, 6>{
63 static constexpr
auto diag_indices = std::array<VoigtIndex, 3>{
76 std::copy_n(
value.begin(),
77 std::min(data_.size(),
value.size()),
81 const T& operator[](
const VoigtIndex idx)
const 82 {
return data_[
static_cast<std::underlying_type_t<VoigtIndex>
>(idx)]; }
84 T& operator [](
const VoigtIndex idx)
85 {
return data_[
static_cast<std::underlying_type_t<VoigtIndex>
>(idx)]; }
87 constexpr std::size_t size()
const {
return data_.size(); }
90 std::array<T, 6> data_{};
93 template<
class Scalar>
100 void resize(
const std::size_t size);
102 Scalar operator()(
const VoigtIndex idx,
const std::size_t i)
const;
103 Scalar& operator()(
const VoigtIndex idx,
const std::size_t i);
110 #endif // OPM_UTIL_VOIGT_ARRAY_HPP This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: VoigtArray.hpp:94
Definition: VoigtArray.hpp:39