v0.16.0
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
MoFEM::GetFTensor2SymmetricFromMatImpl< Tensor_Dim, S, DataLayoutTraits< DataLayout::GaussByCoeffs >, M > Struct Template Reference

#include "include/Templates.hpp"

Static Public Member Functions

static auto get (M &data, int rr=0, int cc=0)
 

Detailed Description

template<int Tensor_Dim, int S, class M>
struct MoFEM::GetFTensor2SymmetricFromMatImpl< Tensor_Dim, S, DataLayoutTraits< DataLayout::GaussByCoeffs >, M >

Definition at line 752 of file Templates.hpp.

Member Function Documentation

◆ get()

template<int Tensor_Dim, int S, class M >
static auto MoFEM::GetFTensor2SymmetricFromMatImpl< Tensor_Dim, S, DataLayoutTraits< DataLayout::GaussByCoeffs >, M >::get ( M data,
int  rr = 0,
int  cc = 0 
)
inlinestatic

Definition at line 754 of file Templates.hpp.

754 {
755 using T = std::remove_cv_t<std::remove_reference_t<decltype(data(0, 0))>>;
756 constexpr int symm_size = (Tensor_Dim * (Tensor_Dim + 1)) / 2;
757 constexpr int stride = S == -1 ? symm_size : S;
758 static_assert(stride % symm_size == 0,
759 "getFTensor2SymmetricFromMat: stride should be a multiple of "
760 "symm_size");
761
762#ifndef NDEBUG
763 if (data.size2() != symm_size)
765 "getFTensor2SymmetricFromMat<" +
766 boost::lexical_cast<std::string>(Tensor_Dim) +
767 ">: wrong size of data matrix, number of columns should be " +
768 boost::lexical_cast<std::string>(symm_size) + " but is " +
769 boost::lexical_cast<std::string>(data.size2()));
770 auto *first = &data(rr + 0, cc + 0);
771 auto *last = &data(rr + 0, cc + 0 + symm_size - 1);
772 if (last - first != symm_size - 1)
773 THROW_MESSAGE("getFTensor2SymmetricFromMat<" +
774 boost::lexical_cast<std::string>(Tensor_Dim) +
775 ">: row slice is not contiguous");
776#endif
778 Tensor_Dim>(&data(rr + 0, cc + 0));
779 }
#define THROW_MESSAGE(msg)
Throw MoFEM exception.

The documentation for this struct was generated from the following file: