v0.16.0
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
MoFEM::GetFTensor1FromMatImpl< 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, int cc)
 

Detailed Description

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

Definition at line 235 of file Templates.hpp.

Member Function Documentation

◆ get()

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

Definition at line 237 of file Templates.hpp.

237 {
238 using T = std::remove_cv_t<std::remove_reference_t<decltype(data(0, 0))>>;
239 constexpr int stride = S == -1 ? Tensor_Dim : S;
240 static_assert(
241 stride % Tensor_Dim == 0,
242 "getFTensor1FromMat: stride should be a multiple of Tensor_Dim");
243
244#ifndef NDEBUG
245 if (data.size2() != Tensor_Dim)
247 "getFTensor1FromMat<" + boost::lexical_cast<std::string>(Tensor_Dim) +
248 ">: wrong size of data matrix, number of columns should be " +
249 boost::lexical_cast<std::string>(Tensor_Dim) + " but is " +
250 boost::lexical_cast<std::string>(data.size2()));
251 auto *first = &data(rr + 0, cc + 0);
252 auto *last = &data(rr + 0, cc + 0 + Tensor_Dim - 1);
253 if (last - first != Tensor_Dim - 1)
254 THROW_MESSAGE("getFTensor1FromMat<" +
255 boost::lexical_cast<std::string>(Tensor_Dim) +
256 ">: row slice is not contiguous");
257
258#endif
260 &data(rr + 0, cc + 0));
261 }
#define THROW_MESSAGE(msg)
Throw MoFEM exception.

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