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 "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 922 : addClassDescription(InputParameters & params, const std::string & desc) 24 : { 25 : #ifdef THERMOCHIMICA_ENABLED 26 922 : params.addClassDescription(desc); 27 : #else 28 : params.addClassDescription(message + " (Original description: " + desc + ")"); 29 : #endif 30 922 : } 31 : 32 : void 33 242 : checkLibraryAvailability(MooseObject & self) 34 : { 35 : #ifndef THERMOCHIMICA_ENABLED 36 : self.paramError("type", message); 37 : #else 38 : libmesh_ignore(self); 39 : #endif 40 242 : } 41 : 42 : void 43 237 : checkLibraryAvailability(Action & self) 44 : { 45 : #ifndef THERMOCHIMICA_ENABLED 46 : mooseError(self.parameters().blockLocation() + ": " + message); 47 : #else 48 : libmesh_ignore(self); 49 : #endif 50 237 : } 51 : 52 : // namespace ThermochimicaUtils 53 : }