/
ScalarInitialCondition.h
95 lines (77 loc) · 2.41 KB
/
ScalarInitialCondition.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "MooseObject.h"
#include "ScalarCoupleable.h"
#include "FunctionInterface.h"
#include "UserObjectInterface.h"
#include "DependencyResolverInterface.h"
// forward declarations
class ScalarInitialCondition;
class FeProblem;
class SystemBase;
class Assembly;
class MooseVariableScalar;
namespace libMesh
{
template <typename T>
class DenseVector;
}
template <>
InputParameters validParams<ScalarInitialCondition>();
/**
* InitialConditions are objects that set the initial value of variables.
*/
class ScalarInitialCondition : public MooseObject,
public ScalarCoupleable,
public FunctionInterface,
public UserObjectInterface,
public DependencyResolverInterface
{
public:
/**
* Constructor
*
* @param parameters The parameters object holding data for the class to use.
*/
ScalarInitialCondition(const InputParameters & parameters);
virtual ~ScalarInitialCondition();
MooseVariableScalar & variable() { return _var; }
/**
* Compute the initial condition
*/
virtual void compute(DenseVector<Number> & vals);
/**
* The value of the variable.
*
* This must be overridden by derived classes.
*/
virtual Real value() = 0;
/**
* Gets called at the beginning of the simulation before this object is asked to do its job.
* Note: This method is normally inherited from SetupInterface. However in this case it makes
* no sense to inherit the other virtuals available in that class so we are adding this virtual
* directly to this class with out the extra inheritance.
*/
virtual void initialSetup() {}
virtual const std::set<std::string> & getRequestedItems();
virtual const std::set<std::string> & getSuppliedItems();
protected:
FEProblemBase & _fe_problem;
SystemBase & _sys;
THREAD_ID _tid;
Assembly & _assembly;
/// Time
Real & _t;
/// Scalar variable this initial condition works on
MooseVariableScalar & _var;
unsigned int _i;
std::set<std::string> _depend_vars;
std::set<std::string> _supplied_vars;
};