12#include "MooseRevision.h"
15#include "libmesh/bounding_box.h"
16#include "libmesh/libmesh_config.h"
17#include "libmesh/int_range.h"
18#include "libmesh/dense_vector.h"
19#include "libmesh/dense_matrix.h"
25 json[
"app_name"] = app.
name();
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);
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);
50 json = {{
"max", bbox.
max()}, {
"min", bbox.
min()}};
56 json = {{
"x", p(0)}, {
"y", p(1)}, {
"z", p(2)}};
68 std::vector<std::vector<Real>>
values(matrix.
m(), std::vector<Real>(matrix.
n()));
71 values[i][j] = matrix(i, j);
72 nlohmann::to_json(json,
values);
78 mooseAssert(vector,
"vector must be non-null");
79 std::vector<Number> local_values;
80 local_values.reserve(vector->local_size());
81 for (
const auto i :
make_range(vector->first_local_index(), vector->last_local_index()))
82 local_values.push_back((*vector)(i));
83 nlohmann::to_json(json, local_values);
void to_json(nlohmann::json &json, const MooseApp &app)
std::array< Real, 2 > values
Base class for MOOSE-based applications.
const SystemInfo & getSystemInfo() const
Get SystemInfo object.
const std::string & name() const
Get the name of the class.
std::string getExecutableTimeStamp() const
std::string getExecutable() const
std::string getTimeStamp(std::time_t *time_stamp=NULL) const
const Point & max() const
const Point & min() const
std::vector< T > & get_values()
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
void to_json(nlohmann::json &json, const BoundingBox &p)
IntRange< T > make_range(T beg, T end)