https://mooseframework.inl.gov
Loading...
Searching...
No Matches
UserObject.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#include "UserObjectBase.h"
13
14#include "libmesh/parallel.h"
15
20{
21public:
23
24 UserObject(const InputParameters & params);
25
29 virtual void execute() = 0;
30
36 virtual Real spatialValue(const Point & /*p*/) const
37 {
38 mooseError(name(), " does not satisfy the Spatial UserObject interface!");
39 }
40
47 virtual const std::vector<Point> spatialPoints() const
48 {
49 mooseError("Spatial UserObject interface is not satisfied; spatialPoints() must be overridden");
50 }
51
58 virtual void threadJoin(const UserObject & uo) = 0;
59
60 void setPrimaryThreadCopy(UserObject * primary);
61
63
64protected:
67
68private:
70};
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const std::string & name() const
Get the name of the class.
Definition MooseBase.h:103
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition MooseBase.h:271
Base class for user-specific data.
Definition UserObject.h:20
static InputParameters validParams()
Definition UserObject.C:14
void setPrimaryThreadCopy(UserObject *primary)
Definition UserObject.C:29
virtual void threadJoin(const UserObject &uo)=0
Must override.
virtual const std::vector< Point > spatialPoints() const
Optional interface function for providing the points at which a UserObject attains spatial values.
Definition UserObject.h:47
virtual Real spatialValue(const Point &) const
Optional interface function for "evaluating" a UserObject at a spatial position.
Definition UserObject.h:36
UserObject * _primary_thread_copy
Definition UserObject.h:69
virtual void execute()=0
Execute method.
const Moose::CoordinateSystemType & _coord_sys
Coordinate system.
Definition UserObject.h:66
UserObject * primaryThreadCopy()
Definition UserObject.h:62
CoordinateSystemType
Definition MooseTypes.h:864