https://mooseframework.inl.gov
ThermochimicaUtils.C
Go to the documentation of this file.
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 "ThermochimicaUtils.h"
11 #include "InputParameters.h"
12 #include "MooseObject.h"
13 #include "Action.h"
14 
15 namespace ThermochimicaUtils
16 {
17 
18 static const std::string message =
19  "To use this object, you need to have the `Thermochimica` library installed. Refer to the "
20  "documentation for guidance on how to enable it.";
21 
22 void
23 addClassDescription(InputParameters & params, const std::string & desc)
24 {
25 #ifdef THERMOCHIMICA_ENABLED
26  params.addClassDescription(desc);
27 #else
28  params.addClassDescription(message + " (Original description: " + desc + ")");
29 #endif
30 }
31 
32 void
34 {
35 #ifndef THERMOCHIMICA_ENABLED
36  self.paramError("type", message);
37 #else
38  libmesh_ignore(self);
39 #endif
40 }
41 
42 void
44 {
45 #ifndef THERMOCHIMICA_ENABLED
46  mooseError(self.parameters().blockLocation() + ": " + message);
47 #else
48  libmesh_ignore(self);
49 #endif
50 }
51 
52 // namespace ThermochimicaUtils
53 }
void mooseError(Args &&... args)
void libmesh_ignore(const Args &...)
void checkLibraryAvailability(MooseObject &self)
Check if thermochimica is available and throw an error if it is not.
static const std::string message
void addClassDescription(const std::string &doc_string)
void addClassDescription(InputParameters &params, const std::string &desc)
Add the supplied class description if thermochimica is available, otherwise add a warning message...