https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Namespaces | Classes | Functions
Eigen Namespace Reference

Namespaces

namespace  internal
 

Classes

struct  NumTraits< MetaPhysicL::DualNumber< V, D, asd > >
 
struct  ScalarBinaryOpTraits< MetaPhysicL::DualNumber< V, D, asd >, Real, BinaryOp >
 
struct  ScalarBinaryOpTraits< Real, MetaPhysicL::DualNumber< V, D, asd >, BinaryOp >
 

Functions

template<typename Scalar , int Rows, int Cols, int Options, int MaxRows, int MaxCols>
void to_json (nlohmann::json &json, const Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols > &matrix)
 

Function Documentation

◆ to_json()

template<typename Scalar , int Rows, int Cols, int Options, int MaxRows, int MaxCols>
void Eigen::to_json ( nlohmann::json &  json,
const Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols > &  matrix 
)

Definition at line 143 of file JsonIO.h.

144{
145 if constexpr (Rows == 1 || Cols == 1)
146 {
147 std::vector<Scalar> values(matrix.data(), matrix.data() + matrix.rows() * matrix.cols());
148 nlohmann::to_json(json, values);
149 }
150 else
151 {
152 const auto nrows = matrix.rows();
153 const auto ncols = matrix.cols();
154 std::vector<std::vector<Scalar>> values(nrows, std::vector<Scalar>(ncols));
155 for (const auto i : make_range(nrows))
156 for (const auto j : make_range(ncols))
157 values[i][j] = matrix(i, j);
158 nlohmann::to_json(json, values);
159 }
160}
std::array< Real, 2 > values
Definition MortarUtils.C:52
for(PetscInt i=0;i< nvars;++i)