https://mooseframework.inl.gov
Loading...
Searching...
No Matches
KokkosParsedFunction.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 "KokkosFunction.h"
14
16
17class FEProblemBase;
18
20{
21public:
23
26
28
29 KOKKOS_FUNCTION Real value(Real t, Real3 p) const { return _evaluator.eval(t, p); }
30
34 virtual void initialSetup() override;
35
36protected:
40 const std::string _expression;
44 std::unique_ptr<Moose::Kokkos::RPNBuilder> _builder;
52 std::vector<Real> _symbol_values;
56 std::vector<Moose::Kokkos::Function> _symbol_functions;
60 static inline const std::unordered_map<std::string, Real> _math_symbols = {{"pi", libMesh::pi},
61 {"e", std::exp(1.0)}};
62
63private:
65};
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Moose::Kokkos::RPNEvaluator _evaluator
Parsed function evaluator.
const std::string _expression
Parsed function expression.
std::vector< Real > _symbol_values
Constant values associated with symbols.
static const std::unordered_map< std::string, Real > _math_symbols
Mathematical constants.
std::vector< Moose::Kokkos::Function > _symbol_functions
Functions associated with symbols.
std::unique_ptr< Moose::Kokkos::RPNBuilder > _builder
Parsed function builder.
virtual void initialSetup() override
Create the parsed function.
KokkosParsedFunction(const KokkosParsedFunction &function)
KOKKOS_FUNCTION Real value(Real t, Real3 p) const
static InputParameters validParams()
KokkosParsedFunction(const InputParameters &parameters)
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Adds user facing parameters for parsed function.
The base class for a user to derive their own Kokkos functions.
Reverse Polish Notation (RPN) evaluator.
KOKKOS_FUNCTION Real eval(const Real t, const Real3 p, const unsigned int qp=0, Datum *datum=nullptr) const
Evaluate RPN at point (t,x,y,z)
Vector3< Real > Real3
Definition KokkosTypes.h:32
const Real pi