Chi-Tech
mat_prop_scalarfuncXYZTV.cc
Go to the documentation of this file.
2
3#include "ChiObjectFactory.h"
4#include "chi_runtime.h"
5
6namespace chi
7{
8
10
12{
14
15 params.AddRequiredParameter<size_t>("function_handle",
16 "Handle to a function to be used for "
17 "evaluation of this material property.");
19 "dependent_variables",
20 std::vector<std::string>{},
21 "List of variable names denoting how the associated "
22 "propery function will be called.");
23
24 return params;
25}
26
28
30 const InputParameters& params)
31 : MaterialProperty(params),
32 function_(
33 Chi::GetStackItem<SFXYZV>(Chi::object_stack,
34 params.GetParamValue<size_t>("function_handle"),
35 __FUNCTION__)),
36 dependent_variables_(
37 params.GetParamVectorValue<std::string>("dependent_variables"))
38{
39 printf("Test eval: %g %g\n", 400.0, Evaluate({400.0}));
40 for (const auto& dep_var : dependent_variables_)
41 printf("%s\n", dep_var.c_str());
42}
43
44double
45MaterialPropertyScalarFuncXYZTV::Evaluate(const std::vector<double>& vars)
46{
47 return function_.Evaluate(vars).front();
48}
49
50} // namespace chi_objects
void AddRequiredParameter(const std::string &name, const std::string &doc_string)
void AddOptionalParameterArray(const std::string &name, const std::vector< T > &array, const std::string &doc_string)
static chi::InputParameters GetInputParameters()
const std::vector< std::string > dependent_variables_
double Evaluate(const std::vector< double > &vars)
const chi_math::FunctionDimAToDimB & function_
MaterialPropertyScalarFuncXYZTV(const InputParameters &params)
virtual std::vector< double > Evaluate(const std::vector< double > &vals) const =0
chi_math::FunctionDimAToDimB SFXYZV
RegisterChiObject(chi, KBAGraphPartitioner)