https://mooseframework.inl.gov
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 
19 class UserObject : public UserObjectBase
20 {
21 public:
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 
64 protected:
67 
68 private:
70 };
void setPrimaryThreadCopy(UserObject *primary)
Definition: UserObject.C:29
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
UserObject * primaryThreadCopy()
Definition: UserObject.h:62
UserObject * _primary_thread_copy
Definition: UserObject.h:69
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void execute()=0
Execute method.
const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:103
virtual Real spatialValue(const Point &) const
Optional interface function for "evaluating" a UserObject at a spatial position.
Definition: UserObject.h:36
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Moose::CoordinateSystemType & _coord_sys
Coordinate system.
Definition: UserObject.h:66
CoordinateSystemType
Definition: MooseTypes.h:858
UserObject(const InputParameters &params)
Definition: UserObject.C:23
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:281
Base class for user-specific data.
Definition: UserObject.h:19
virtual void threadJoin(const UserObject &uo)=0
Must override.
static InputParameters validParams()
Definition: UserObject.C:14