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

Go to the source code of this file.

Classes

struct  nlohmann::adl_serializer< AttributeVariant >
 
struct  nlohmann::adl_serializer< std::unique_ptr< T > >
 

Namespaces

namespace  libMesh
 The following methods are specializations for using the libMesh::Parallel::packed_range_* routines for std::strings.
 
namespace  Eigen
 
namespace  nlohmann
 
namespace  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.
 

Functions

void to_json (nlohmann::json &json, const MooseApp &app)
 
void libMesh::to_json (nlohmann::json &json, const BoundingBox &p)
 
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 40 of file JsonIO.h.

Function Documentation

◆ to_json() [1/2]

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

Definition at line 163 of file JsonIO.h.

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

◆ to_json() [2/2]

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

Definition at line 23 of file JsonIO.C.

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

Referenced by to_json().