LCOV - code coverage report
Current view: top level - src/utils - MooseTypes.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 2 40 5.0 %
Date: 2025-07-17 01:28:37 Functions: 2 40 5.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #include "MooseTypes.h"
      11             : #include "libmesh/elem.h"
      12             : #include "libmesh/libmesh.h"
      13             : 
      14             : #include "nlohmann/json.h"
      15             : 
      16             : namespace Moose
      17             : {
      18             : const processor_id_type INVALID_PROCESSOR_ID = libMesh::DofObject::invalid_processor_id;
      19             : const SubdomainID ANY_BLOCK_ID = libMesh::Elem::invalid_subdomain_id - 1;
      20             : const SubdomainID INVALID_BLOCK_ID = libMesh::Elem::invalid_subdomain_id;
      21             : const BoundaryID ANY_BOUNDARY_ID = static_cast<BoundaryID>(-1);
      22             : const BoundaryID INVALID_BOUNDARY_ID = libMesh::BoundaryInfo::invalid_id;
      23             : const TagID INVALID_TAG_ID = static_cast<TagID>(-1);
      24             : const TagTypeID INVALID_TAG_TYPE_ID = static_cast<TagTypeID>(-1);
      25             : const TagName SOLUTION_TAG = "SOLUTION";
      26             : const TagName OLD_SOLUTION_TAG = "SOLUTION_STATE_1";
      27             : const TagName OLDER_SOLUTION_TAG = "SOLUTION_STATE_2";
      28             : const TagName PREVIOUS_NL_SOLUTION_TAG = "U_PREVIOUS_NL_NEWTON";
      29             : }
      30             : 
      31             : /**
      32             :  * Defines to_json for the derivative string classes defined in MooseTypes.h via the
      33             :  * DerivativeStringClass macro.
      34             :  */
      35             : #define DerivativeStringToJSON(TheName)                                                            \
      36             :   namespace nlohmann                                                                               \
      37             :   {                                                                                                \
      38             :   void adl_serializer<TheName>::to_json(json & j, const TheName & v)                               \
      39             :   {                                                                                                \
      40             :     j = static_cast<std::string>(v);                                                               \
      41             :   }                                                                                                \
      42             :   }                                                                                                \
      43             :   static_assert(true, "")
      44           0 : DerivativeStringToJSON(FileName);
      45           0 : DerivativeStringToJSON(FileNameNoExtension);
      46           0 : DerivativeStringToJSON(RelativeFileName);
      47           0 : DerivativeStringToJSON(DataFileName);
      48           0 : DerivativeStringToJSON(MeshFileName);
      49           0 : DerivativeStringToJSON(MatrixFileName);
      50           0 : DerivativeStringToJSON(OutFileBase);
      51           0 : DerivativeStringToJSON(NonlinearVariableName);
      52           0 : DerivativeStringToJSON(LinearVariableName);
      53           0 : DerivativeStringToJSON(SolverVariableName);
      54           0 : DerivativeStringToJSON(AuxVariableName);
      55          28 : DerivativeStringToJSON(VariableName);
      56           0 : DerivativeStringToJSON(BoundaryName);
      57           0 : DerivativeStringToJSON(SubdomainName);
      58           0 : DerivativeStringToJSON(PostprocessorName);
      59           0 : DerivativeStringToJSON(VectorPostprocessorName);
      60           0 : DerivativeStringToJSON(MeshDivisionName);
      61           0 : DerivativeStringToJSON(FunctionName);
      62           0 : DerivativeStringToJSON(DistributionName);
      63           0 : DerivativeStringToJSON(SamplerName);
      64           0 : DerivativeStringToJSON(UserObjectName);
      65           0 : DerivativeStringToJSON(IndicatorName);
      66           0 : DerivativeStringToJSON(MarkerName);
      67           0 : DerivativeStringToJSON(MultiAppName);
      68           0 : DerivativeStringToJSON(OutputName);
      69           0 : DerivativeStringToJSON(MaterialPropertyName);
      70           0 : DerivativeStringToJSON(MooseFunctorName);
      71           0 : DerivativeStringToJSON(MaterialName);
      72           0 : DerivativeStringToJSON(TagName);
      73           0 : DerivativeStringToJSON(MeshGeneratorName);
      74          35 : DerivativeStringToJSON(ExtraElementIDName);
      75           0 : DerivativeStringToJSON(ReporterValueName);
      76           0 : DerivativeStringToJSON(PositionsName);
      77           0 : DerivativeStringToJSON(TimesName);
      78           0 : DerivativeStringToJSON(ExecutorName);
      79           0 : DerivativeStringToJSON(ParsedFunctionExpression);
      80           0 : DerivativeStringToJSON(NonlinearSystemName);
      81           0 : DerivativeStringToJSON(LinearSystemName);
      82           0 : DerivativeStringToJSON(SolverSystemName);
      83           0 : DerivativeStringToJSON(CLIArgString);

Generated by: LCOV version 1.14