https://mooseframework.inl.gov
Classes | Namespaces | Typedefs | Functions
JsonIO.h File Reference

Go to the source code of this file.

Classes

class  libMesh::DenseVector< T >
 
class  libMesh::DenseMatrix< T >
 
class  libMesh::NumericVector< T >
 
struct  nlohmann::adl_serializer< AttributeVariant >
 
struct  nlohmann::adl_serializer< std::unique_ptr< T > >
 

Namespaces

 libMesh
 The following methods are specializations for using the libMesh::Parallel::packed_range_* routines for std::strings.
 
 Eigen
 
 nlohmann
 
 MetaPhysicL
 We need to instantiate the following CompareTypes to tell the compiler that ADReal is a subtype of ChainedADReal.
 

Typedefs

typedef std::variant< int, unsigned int, std::string, Real, bool, std::vector< int >, std::vector< unsigned int >, std::vector< std::string >, std::vector< Real >, std::vector< bool > > AttributeVariant
 Type definition for a variant that can hold all the supported types for lattice attributes. More...
 

Functions

void to_json (nlohmann::json &json, const MooseApp &app)
 
void libMesh::to_json (nlohmann::json &json, const Point &p)
 
void libMesh::to_json (nlohmann::json &json, const DenseVector< Real > &vector)
 
void libMesh::to_json (nlohmann::json &json, const DenseMatrix< Real > &matrix)
 
void libMesh::to_json (nlohmann::json &json, const std::unique_ptr< NumericVector< Number >> &vector)
 
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)
 
template<template< typename, size_t > class Array, typename T , size_t N>
void MetaPhysicL::to_json (nlohmann::json &json, const DynamicArrayWrapper< Array, T, N > &array)
 
template<typename T , typename I , typename N , typename ArrayWrapper >
void MetaPhysicL::to_json (nlohmann::json &json, const SemiDynamicSparseNumberArrayGeneric< T, I, N, ArrayWrapper > &sdsna)
 
template<typename T , typename D , bool asd>
void MetaPhysicL::to_json (nlohmann::json &json, const DualNumber< T, D, asd > &dn)
 
template<typename T >
void to_json (nlohmann::json &json, const GenericTwoVector< T > &two_vector)
 

Typedef Documentation

◆ AttributeVariant

typedef std::variant<int, unsigned int, std::string, Real, bool, std::vector<int>, std::vector<unsigned int>, std::vector<std::string>, std::vector<Real>, std::vector<bool> > AttributeVariant

Type definition for a variant that can hold all the supported types for lattice attributes.

Definition at line 25 of file JsonIO.h.

Function Documentation

◆ to_json() [1/2]

void to_json ( nlohmann::json &  json,
const MooseApp app 
)

Definition at line 22 of file JsonIO.C.

Referenced by libMesh::to_json(), Eigen::to_json(), MetaPhysicL::to_json(), and to_json().

23 {
24  json["app_name"] = app.name();
25  json["current_time"] = app.getSystemInfo().getTimeStamp();
26  json["executable"] = app.getSystemInfo().getExecutable();
27  json["executable_time"] = app.getSystemInfo().getExecutableTimeStamp(json["executable"]);
28 
29  json["moose_version"] = MOOSE_REVISION;
30  json["libmesh_version"] = LIBMESH_BUILD_VERSION;
31 #ifdef LIBMESH_DETECTED_PETSC_VERSION_MAJOR
32  json["petsc_version"] = std::to_string(LIBMESH_DETECTED_PETSC_VERSION_MAJOR) + "." +
33  std::to_string(LIBMESH_DETECTED_PETSC_VERSION_MINOR) + "." +
34  std::to_string(LIBMESH_DETECTED_PETSC_VERSION_SUBMINOR);
35 #endif
36 #ifdef LIBMESH_DETECTED_SLEPC_VERSION_MAJOR
37  json["slepc_version"] = std::to_string(LIBMESH_DETECTED_SLEPC_VERSION_MAJOR) + "." +
38  std::to_string(LIBMESH_DETECTED_SLEPC_VERSION_MINOR) + "." +
39  std::to_string(LIBMESH_DETECTED_SLEPC_VERSION_SUBMINOR);
40 #endif
41 }
std::string getExecutable() const
Definition: SystemInfo.C:139
std::string getTimeStamp(std::time_t *time_stamp=NULL) const
Definition: SystemInfo.C:66
std::string getExecutableTimeStamp() const
Definition: SystemInfo.C:145
const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:103
const SystemInfo & getSystemInfo() const
Get SystemInfo object.
Definition: MooseApp.h:566

◆ to_json() [2/2]

template<typename T >
void to_json ( nlohmann::json &  json,
const GenericTwoVector< T > &  two_vector 
)

Definition at line 161 of file JsonIO.h.

162 {
163  to_json(json, static_cast<const Eigen::Matrix<T, 2, 1> &>(two_vector));
164 }
void to_json(nlohmann::json &json, const MooseApp &app)
Definition: JsonIO.C:22