forked from idaholab/moose
-
Notifications
You must be signed in to change notification settings - Fork 1
/
NodalBC.h
82 lines (66 loc) · 2.51 KB
/
NodalBC.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
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/
#ifndef NODALBC_H
#define NODALBC_H
#include "NodalBCBase.h"
// Forward declarations
class NodalBC;
// libMesh forward declarations
namespace libMesh
{
template <typename T> class NumericVector;
}
template<>
InputParameters validParams<NodalBC>();
/**
* Base class for deriving any boundary condition that works at nodes
*/
class NodalBC : public NodalBCBase
{
public:
NodalBC(const InputParameters & parameters);
virtual void computeResidual(NumericVector<Number> & residual);
virtual void computeJacobian();
virtual void computeOffDiagJacobian(unsigned int jvar);
protected:
/// The MooseVariable this BC is acting on
MooseVariable & _moose_var;
/// current node being processed
const Node * & _current_node;
/// Quadrature point index
unsigned int _qp;
/// Value of the unknown variable this BC is acting on
const VariableValue & _u;
/// The aux variables to save the residual contributions to
bool _has_save_in;
std::vector<MooseVariable*> _save_in;
std::vector<AuxVariableName> _save_in_strings;
/// The aux variables to save the diagonal Jacobian contributions to
bool _has_diag_save_in;
std::vector<MooseVariable*> _diag_save_in;
std::vector<AuxVariableName> _diag_save_in_strings;
virtual Real computeQpResidual() = 0;
/**
* The user can override this function to compute the "on-diagonal"
* Jacobian contribution for this NodalBC. If not overriden,
* returns 1.
*/
virtual Real computeQpJacobian();
/**
* This is the virtual that derived classes should override for
* computing an off-diagonal jacobian component.
*/
virtual Real computeQpOffDiagJacobian(unsigned int jvar);
};
#endif /* NODALBC_H */