https://mooseframework.inl.gov
ParsedMaterial.C
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 #include "ParsedMaterial.h"
11 
14 
15 template <bool is_ad>
18 {
21  params.addClassDescription("Parsed expression Material.");
22  return params;
23 }
24 
25 template <bool is_ad>
27  : ParsedMaterialBase(parameters, this),
28  ParsedMaterialHelper<is_ad>(
29  parameters, VariableNameMappingMode::USE_MOOSE_NAMES, _function_param)
30 {
31 
32  // get all reserved names
33  std::set<std::string> reserved_names;
35 
36  // validate, reserved names are not used
38 
39  // Build function and optimize
43  this->template getParam<std::vector<std::string>>("material_property_names"),
44  this->template getParam<std::vector<PostprocessorName>>("postprocessor_names"),
45  _tol_names,
49 }
50 
51 // explicit instantiation
52 template class ParsedMaterialTempl<false>;
53 template class ParsedMaterialTempl<true>;
std::vector< std::string > _constant_expressions
void insertReservedNames(std::set< std::string > &reserved_names)
Populates the given set with names not to be used as user-defined symbol (e.g.
std::vector< std::string > _constant_names
constant vectors
Helper class for ParsedMaterial and DerivativeParsedMaterial to declare and read the input parameters...
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: MooseBase.h:384
static InputParameters validParams()
const std::string _function
function expression
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
registerMooseObject("MooseApp", ParsedMaterial)
static InputParameters validParams()
std::vector< std::string > _tol_names
tolerance vectors
void validateVectorNames(const std::set< std::string > &reserved_names={})
Function to ensure that the names of constants, tolerances, and functors do not overlap with each oth...
static InputParameters validParams()
std::vector< std::string > _functor_symbols
FunctionMaterialBase child class to evaluate a parsed function.
Helper class to perform the parsing and optimization of the function expression.
ParsedMaterialTempl(const InputParameters &parameters)
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
std::vector< MooseFunctorName > _functor_names
Functor vectors (names, count, and symbols)
void functionParse(const std::string &function_expression)
This method sets up and parses the function string given by the user.
std::vector< Real > _tol_values