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

#include "include/Templates.hpp"

Static Public Member Functions

static auto get (M &data)
 

Detailed Description

template<int S, class M>
struct MoFEM::GetFTensor0FromMatImpl< S, M >

Definition at line 167 of file Templates.hpp.

Member Function Documentation

◆ get()

template<int S, class M >
static auto MoFEM::GetFTensor0FromMatImpl< S, M >::get ( M data)
inlinestatic

Definition at line 168 of file Templates.hpp.

168 {
169#ifndef NDEBUG
170 // We can do rows, or columns, does not matter for rank 0 tensor, but we need to be sure that one of them is 1
171 if (data.size1() != 1 && data.size2() != 1)
172 THROW_MESSAGE("getFTensor0FromMat: wrong size of data matrix, number of "
173 "rows should be 1 but is " +
174 boost::lexical_cast<std::string>(data.size1()));
175#endif
176 using T = std::remove_cv_t<std::remove_reference_t<decltype(data(0, 0))>>;
177 return FTensor::Tensor0<FTensor::PackPtr<T *, S>>(data.data().data());
178 }
#define THROW_MESSAGE(msg)
Throw MoFEM exception.

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