v0.14.0
Static Public Member Functions | List of all members
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>(
260  Tensor_Dim2) + ">: 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  }

The documentation for this struct was generated from the following file:
THROW_MESSAGE
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:561
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27