https://mooseframework.inl.gov
SolutionInvalidInterface.h
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 #pragma once
11 
12 // MOOSE includes
13 #include "Moose.h"
14 #include "SolutionInvalidity.h"
15 
16 // Forward declarations
17 class MooseObject;
18 class FEProblemBase;
19 
20 #define flagInvalidSolution(message) \
21  do \
22  { \
23  static const auto __invalid_id = this->registerInvalidSolutionInternal(message, false); \
24  this->flagInvalidSolutionInternal<false>(__invalid_id); \
25  } while (0)
26 
27 #define flagSolutionWarning(message) \
28  do \
29  { \
30  static const auto __invalid_id = this->registerInvalidSolutionInternal(message, true); \
31  this->flagInvalidSolutionInternal<true>(__invalid_id); \
32  } while (0)
33 
38 {
39 public:
40  SolutionInvalidInterface(MooseObject * const moose_object);
41 
42 protected:
43  template <bool warning>
44  void flagInvalidSolutionInternal(const InvalidSolutionID invalid_solution_id) const;
45 
46  // Register invalid solution with a message
47  InvalidSolutionID registerInvalidSolutionInternal(const std::string & message,
48  const bool warning) const;
49 
50 private:
53 
56 };
unsigned int InvalidSolutionID
Definition: MooseTypes.h:213
FEProblemBase & _si_problem
A reference to FEProblem base.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
InvalidSolutionID registerInvalidSolutionInternal(const std::string &message, const bool warning) const
An interface that allows the marking of invalid solutions during a solve.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:28
void flagInvalidSolutionInternal(const InvalidSolutionID invalid_solution_id) const
Set solution invalid mark for the given solution ID.
MooseObject & _si_moose_object
The MooseObject that owns this interface.
SolutionInvalidInterface(MooseObject *const moose_object)