https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ParsedODEKernel.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 "ODEKernel.h"
13#include "FunctionParserUtils.h"
14
18class ParsedODEKernel : public ODEKernel, public FunctionParserUtils<false>
19{
20public:
22
24
25protected:
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
55private:
57 std::vector<unsigned int> _arg_index;
58};
std::shared_ptr< SymFunction > SymFunctionPtr
Shorthand for an smart pointer to an autodiff function parser object.
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
Parsed ODE function kernel.
virtual Real computeQpResidual() override
virtual Real computeQpOffDiagJacobianScalar(unsigned int jvar) override
std::string _function
function expression
const unsigned int _number_of_nl_variables
number of non-linear variables in the problem
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.
SymFunctionPtr _func_F
function parser object for the residual and on-diagonal Jacobian
std::vector< std::string > _arg_names
virtual Real computeQpJacobian() override
unsigned int _nargs
coupled variables
std::vector< SymFunctionPtr > _func_dFdarg
function parser objects for the Jacobian
static InputParameters validParams()
std::vector< const VariableValue * > _args
usingFunctionParserUtilsMembers(false)
std::vector< const PostprocessorValue * > _pp
coupled postprocessors