https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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"
17#include "Registry.h"
20
21#define usingMooseObjectMembers \
22 usingMooseBaseMembers; \
23 using MooseObject::enabled
24
30 public std::enable_shared_from_this<MooseObject>
31{
32public:
34
36
37#ifdef MOOSE_KOKKOS_ENABLED
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
63 bool isKokkosObject() const { return parameters().isKokkosObject(); }
64#endif
65
66 // To get warnings tracked in the SolutionInvalidityOutput
68
69protected:
71 const bool & _enabled;
72
73 // Base classes have the same name for that attribute, pick one
74 using MooseBase::_app;
75};
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
bool isKokkosObject() const
Returns whether this InputParameters belongs to a Kokkos object Checks whether MooseBase::kokkos_obje...
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
MooseApp & _app
The MOOSE application this is associated with.
Definition MooseBase.h:375
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
bool isKokkosObject() const
Get whether this object is a Kokkos functor The parameter MooseBase::kokkos_object_param is set by th...
Definition MooseObject.h:63
const bool & _enabled
Reference to the "enable" InputParameters, used by Controls for toggling on/off MooseObjects.
Definition MooseObject.h:71
usingCombinedWarningSolutionWarnings
Definition MooseObject.h:67
static InputParameters validParams()
Definition MooseObject.C:25
virtual bool enabled() const
Return the enabled status of the object.
Definition MooseObject.h:49
std::shared_ptr< MooseObject > getSharedPtr()
Get another shared pointer to this object that has the same ownership group.
Definition MooseObject.C:70
virtual ~MooseObject()=default
Base class shared by both Action and MooseObject.
An interface that allows the marking of invalid solutions during a solve.