v0.15.0
Loading...
Searching...
No Matches
MoFEM::GetFTensor2FromMatImpl< Tensor_Dim1, Tensor_Dim2, S, T, L, A > Struct Template Reference

#include "include/Templates.hpp"

Static Public Member Functions

static auto get (ublas::matrix< T, L, A > &data)
 

Detailed Description

template<int Tensor_Dim1, int Tensor_Dim2, int S, class T, class L, class A>
struct MoFEM::GetFTensor2FromMatImpl< Tensor_Dim1, Tensor_Dim2, S, T, L, A >

Definition at line 252 of file Templates.hpp.

Member Function Documentation

◆ get()

template<int Tensor_Dim1, int Tensor_Dim2, int S, class T , class L , class A >
static auto MoFEM::GetFTensor2FromMatImpl< Tensor_Dim1, Tensor_Dim2, S, T, L, A >::get ( ublas::matrix< T, L, A > & data)
inlinestatic

Definition at line 253 of file Templates.hpp.

253 {
254#ifndef NDEBUG
255 if (data.size1() != Tensor_Dim1 * Tensor_Dim2) {
257 "getFTensor2FromMat<" +
258 boost::lexical_cast<std::string>(Tensor_Dim1) + "," +
259 boost::lexical_cast<std::string>(Tensor_Dim2) +
260 ">: wrong size of rows in data matrix, should be " +
261 boost::lexical_cast<std::string>(Tensor_Dim1 * Tensor_Dim2) +
262 " but is " + boost::lexical_cast<std::string>(data.size1()));
263 }
264#endif
265 std::array<double *, Tensor_Dim1 * Tensor_Dim2> ptrs;
266 for (auto i = 0; i != Tensor_Dim1 * Tensor_Dim2; ++i)
267 ptrs[i] = &data(i, 0);
269 Tensor_Dim2>(ptrs);
270 }
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
FTensor::Index< 'i', SPACE_DIM > i

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