https://mooseframework.inl.gov
MooseObject.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 "MooseUtils.h"
14 #include "ParallelParamObject.h"
15 #include "InputParameters.h"
16 #include "ConsoleStreamInterface.h"
17 #include "Registry.h"
20 
21 #define usingMooseObjectMembers \
22  usingMooseBaseMembers; \
23  using MooseObject::enabled
24 
30  public std::enable_shared_from_this<MooseObject>
31 {
32 public:
34 
36 
37 #ifdef MOOSE_KOKKOS_ENABLED
38 
41  MooseObject(const MooseObject & object, const Moose::Kokkos::FunctorCopy & key);
42 #endif
43 
44  virtual ~MooseObject() = default;
45 
49  virtual bool enabled() const { return _enabled; }
50 
55  std::shared_ptr<MooseObject> getSharedPtr();
56  std::shared_ptr<const MooseObject> getSharedPtr() const;
57 
58 #ifdef MOOSE_KOKKOS_ENABLED
60  {
61  friend class BlockRestrictable;
62  friend class BoundaryRestrictable;
64  IsKokkosObjectKey() = default;
65  IsKokkosObjectKey(const IsKokkosObjectKey &) = delete;
67  };
68 
76  {
78  }
79 #endif
80 
81  // To get warnings tracked in the SolutionInvalidityOutput
83 
84 protected:
86  const bool & _enabled;
87 
88  // Base classes have the same name for that attribute, pick one
89  using MooseBase::_app;
90 };
virtual ~MooseObject()=default
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
MooseObject(const InputParameters &parameters)
Definition: MooseObject.C:45
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
/class BoundaryRestrictable /brief Provides functionality for limiting the object to certain boundary...
std::shared_ptr< MooseObject > getSharedPtr()
Get another shared pointer to this object that has the same ownership group.
Definition: MooseObject.C:72
An interface that allows the marking of invalid solutions during a solve.
static const std::string kokkos_object_param
The name of the parameter that indicates an object is a Kokkos functor.
Definition: MooseBase.h:64
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:28
const bool & _enabled
Reference to the "enable" InputParameters, used by Controls for toggling on/off MooseObjects.
Definition: MooseObject.h:86
bool isKokkosObject(IsKokkosObjectKey &&) const
Get whether this object is a Kokkos functor The parameter is set by the Kokkos base classes: ...
Definition: MooseObject.h:75
MooseApp & _app
The MOOSE application this is associated with.
Definition: MooseBase.h:357
usingCombinedWarningSolutionWarnings
Definition: MooseObject.h:82
An interface for accessing Materials.
An interface that restricts an object to subdomains via the &#39;blocks&#39; input parameter.
static InputParameters validParams()
Definition: MooseObject.C:25
Base class shared by both Action and MooseObject.
virtual bool enabled() const
Return the enabled status of the object.
Definition: MooseObject.h:49
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.