https://mooseframework.inl.gov
Loading...
Searching...
No Matches
BoundsBase.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 "AuxKernel.h"
17class BoundsBase : public AuxKernel
18{
19public:
21
23 {
25 LOWER
26 };
27
29
30protected:
31 virtual void initialSetup() override final;
32 virtual Real computeValue() override final;
33
37 virtual Real getBound() = 0;
38
41
43 NumericVector<Number> & _bounded_vector;
44
47
49 NonlinearVariableName _bounded_var_name;
50
53
54private:
56 dof_id_type getDoFIndex() const;
57};
This is a base class used to set an upper and/or lower bound of a variable for the PETSc's variationa...
Definition BoundsBase.h:18
static InputParameters validParams()
Definition BoundsBase.C:16
MooseVariableFE< Real > * _fe_var
Pointer to the finite element variable we set the bound for. Will be null for finite volume.
Definition BoundsBase.h:52
virtual Real getBound()=0
Method to get bound value for a variable.
virtual void initialSetup() override final
Gets called at the beginning of the simulation before this object is asked to do its job.
Definition BoundsBase.C:54
NumericVector< Number > & _bounded_vector
Reference to the bounded vector of nonlinear system.
Definition BoundsBase.h:43
virtual Real computeValue() override final
Compute and return the value of the aux variable.
Definition BoundsBase.C:62
BoundType _type
The bound type ("upper" or "lower")
Definition BoundsBase.h:40
MooseVariableFieldBase & _bounded_var
MOOSE variable (base class) we set the bound for.
Definition BoundsBase.h:46
NonlinearVariableName _bounded_var_name
Name of MOOSE variable we set the bound for.
Definition BoundsBase.h:49
dof_id_type getDoFIndex() const
Return the current DOF index to apply the bound on.
Definition BoundsBase.C:76
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Class for stuff related to variables.
This class provides an interface for common operations on field variables of both FE and FV types wit...