https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
15namespace ThermochimicaUtils
16{
17
18static 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
22void
23addClassDescription(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
32void
34{
35#ifndef THERMOCHIMICA_ENABLED
36 self.paramError("type", message);
37#else
38 libmesh_ignore(self);
39#endif
40}
41
42void
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 addClassDescription(const std::string &doc_string)
std::string blockLocation() const
const InputParameters & parameters() const
void paramError(const std::string &param, Args... args) const
void addClassDescription(InputParameters &params, const std::string &desc)
Add the supplied class description if thermochimica is available, otherwise add a warning message.
static const std::string message
void checkLibraryAvailability(MooseObject &self)
Check if thermochimica is available and throw an error if it is not.