www.mooseframework.org
ParsedODEKernel.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 "ODEKernel.h"
13 #include "FunctionParserUtils.h"
14 
18 class ParsedODEKernel : public ODEKernel, public FunctionParserUtils<false>
19 {
20 public:
22 
24 
25 protected:
26  void updateParams();
27 
28  virtual Real computeQpResidual() override;
29  virtual Real computeQpJacobian() override;
30  virtual Real computeQpOffDiagJacobianScalar(unsigned int jvar) override;
31 
33  std::string _function;
34 
36  unsigned int _nargs;
37  std::vector<const VariableValue *> _args;
38  std::vector<std::string> _arg_names;
39 
43 
45  std::vector<SymFunctionPtr> _func_dFdarg;
46 
48  const unsigned int _number_of_nl_variables;
49 
51  std::vector<const PostprocessorValue *> _pp;
52 
54 
55 private:
57  std::vector<unsigned int> _arg_index;
58 };
std::vector< std::string > _arg_names
Parsed ODE function kernel.
std::shared_ptr< SymFunction > SymFunctionPtr
Shorthand for an smart pointer to an autodiff function parser object.
std::vector< SymFunctionPtr > _func_dFdarg
function parser objects for the Jacobian
std::vector< const PostprocessorValue * > _pp
coupled postprocessors
usingFunctionParserUtilsMembers(false)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::string _function
function expression
SymFunctionPtr _func_dFdu
std::vector< unsigned int > _arg_index
Vector to look up the internal coupled variable index into arg* through the libMesh variable number...
ParsedODEKernel(const InputParameters &parameters)
virtual Real computeQpOffDiagJacobianScalar(unsigned int jvar) override
virtual Real computeQpJacobian() override
SymFunctionPtr _func_F
function parser object for the residual and on-diagonal Jacobian
const unsigned int _number_of_nl_variables
number of non-linear variables in the problem
virtual Real computeQpResidual() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
unsigned int _nargs
coupled variables
static InputParameters validParams()
const InputParameters & parameters() const
Get the parameters of the object.
std::vector< const VariableValue * > _args