www.mooseframework.org
InitialConditionBase.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "MooseObject.h"
13 #include "Coupleable.h"
14 #include "FunctionInterface.h"
15 #include "UserObjectInterface.h"
16 #include "PostprocessorInterface.h"
17 #include "Restartable.h"
18 #include "BlockRestrictable.h"
20 #include "BoundaryRestrictable.h"
22 #include "MooseTypes.h"
23 #include "ElementIDInterface.h"
24 
25 class SystemBase;
27 namespace libMesh
28 {
29 class Point;
30 }
31 
39  public BlockRestrictable,
40  public Coupleable,
42  public FunctionInterface,
43  public UserObjectInterface,
45  public BoundaryRestrictable,
47  public Restartable,
48  public ElementIDInterface
49 {
50 public:
57 
58  virtual ~InitialConditionBase();
59 
61 
65  virtual MooseVariableFEBase & variable() = 0;
66 
70  const std::set<UserObjectName> & getDependObjects() const { return _depend_uo; }
71 
75  virtual void compute() = 0;
80  virtual void computeNodal(const Point & p) = 0;
81 
88  virtual void initialSetup() {}
89 
90  virtual const std::set<std::string> & getRequestedItems() override;
91 
92  virtual const std::set<std::string> & getSuppliedItems() override;
93 
94 protected:
97 
100 
101 private:
102  void addUserObjectDependencyHelper(const UserObject & uo) const override final;
103  void addPostprocessorDependencyHelper(const PostprocessorName & name) const override final;
104 
106  std::set<std::string> _depend_vars;
108  std::set<std::string> _supplied_vars;
109 
111  mutable std::set<UserObjectName> _depend_uo;
112 };
A class for creating restricted objects.
Definition: Restartable.h:28
virtual const std::set< std::string > & getRequestedItems() override
Return a set containing the names of items requested by the object.
void addUserObjectDependencyHelper(const UserObject &uo) const override final
Helper for deriving classes to override to add dependencies when a UserObject is requested.
virtual void computeNodal(const Point &p)=0
Workhorse method for projecting the initial conditions for boundary restricted initial conditions...
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...
This class provides an interface for common operations on field variables of both FE and FV types wit...
InitialConditionBase serves as the abstract base class for InitialConditions and VectorInitialConditi...
std::set< UserObjectName > _depend_uo
Depend UserObjects. Mutable so that the getters can be const and still add dependencies.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
const std::set< UserObjectName > & getDependObjects() const
getter method for dependent user objects
Base class for a system (of equations)
Definition: SystemBase.h:84
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:56
virtual MooseVariableFEBase & variable()=0
retrieves the MOOSE variable that this initial condition acts upon
static InputParameters validParams()
SystemBase & _sys
The system object.
void addPostprocessorDependencyHelper(const PostprocessorName &name) const override final
Helper for deriving classes to override to add dependencies when a Postprocessor is requested...
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:33
const bool _ignore_uo_dependency
If set, UOs retrieved by this IC will not be executed before this IC.
Interface for objects that need to use UserObjects.
InitialConditionBase(const InputParameters &parameters)
Constructor.
std::set< std::string > _depend_vars
Dependent variables.
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:44
An interface for accessing Materials.
std::set< std::string > _supplied_vars
Supplied variables.
An interface that restricts an object to subdomains via the &#39;blocks&#39; input parameter.
Interface for sorting dependent vectors of objects.
const InputParameters & parameters() const
Get the parameters of the object.
virtual void compute()=0
Workhorse method for projecting the initial conditions for block initial conditions.
virtual void initialSetup()
Gets called at the beginning of the simulation before this object is asked to do its job...
virtual const std::set< std::string > & getSuppliedItems() override
Return a set containing the names of items owned by the object.
Interface for objects that need to use functions.
Base class for user-specific data.
Definition: UserObject.h:39
Interface class for classes which interact with Postprocessors.