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 : const TagName PREVIOUS_FP_SOLUTION_TAG = "U_PREVIOUS_FP"; 30 : const TagName SOLUTION_DOT_TAG = "u_dot_factor"; 31 : const TagName SOLUTION_DOTDOT_TAG = "u_dotdot_factor"; 32 : } 33 : 34 : /** 35 : * Defines to_json for the derivative string classes defined in MooseTypes.h via the 36 : * DerivativeStringClass macro. 37 : */ 38 : #define DerivativeStringToJSON(TheName) \ 39 : namespace nlohmann \ 40 : { \ 41 : void adl_serializer<TheName>::to_json(json & j, const TheName & v) \ 42 : { \ 43 : j = static_cast<std::string>(v); \ 44 : } \ 45 : } \ 46 : static_assert(true, "") 47 0 : DerivativeStringToJSON(FileName); 48 0 : DerivativeStringToJSON(FileNameNoExtension); 49 0 : DerivativeStringToJSON(RelativeFileName); 50 0 : DerivativeStringToJSON(DataFileName); 51 0 : DerivativeStringToJSON(MeshFileName); 52 0 : DerivativeStringToJSON(MatrixFileName); 53 0 : DerivativeStringToJSON(OutFileBase); 54 0 : DerivativeStringToJSON(NonlinearVariableName); 55 0 : DerivativeStringToJSON(LinearVariableName); 56 0 : DerivativeStringToJSON(SolverVariableName); 57 0 : DerivativeStringToJSON(AuxVariableName); 58 32 : DerivativeStringToJSON(VariableName); 59 0 : DerivativeStringToJSON(BoundaryName); 60 0 : DerivativeStringToJSON(SubdomainName); 61 0 : DerivativeStringToJSON(PostprocessorName); 62 0 : DerivativeStringToJSON(VectorPostprocessorName); 63 0 : DerivativeStringToJSON(MeshDivisionName); 64 0 : DerivativeStringToJSON(FunctionName); 65 0 : DerivativeStringToJSON(DistributionName); 66 0 : DerivativeStringToJSON(SamplerName); 67 0 : DerivativeStringToJSON(UserObjectName); 68 0 : DerivativeStringToJSON(IndicatorName); 69 0 : DerivativeStringToJSON(MarkerName); 70 0 : DerivativeStringToJSON(MultiAppName); 71 0 : DerivativeStringToJSON(OutputName); 72 0 : DerivativeStringToJSON(MaterialPropertyName); 73 0 : DerivativeStringToJSON(MooseFunctorName); 74 0 : DerivativeStringToJSON(MaterialName); 75 0 : DerivativeStringToJSON(TagName); 76 0 : DerivativeStringToJSON(MeshGeneratorName); 77 40 : DerivativeStringToJSON(ExtraElementIDName); 78 0 : DerivativeStringToJSON(ReporterValueName); 79 0 : DerivativeStringToJSON(PositionsName); 80 0 : DerivativeStringToJSON(TimesName); 81 0 : DerivativeStringToJSON(ExecutorName); 82 0 : DerivativeStringToJSON(ParsedFunctionExpression); 83 0 : DerivativeStringToJSON(NonlinearSystemName); 84 0 : DerivativeStringToJSON(LinearSystemName); 85 0 : DerivativeStringToJSON(SolverSystemName); 86 0 : DerivativeStringToJSON(CLIArgString);