forked from idaholab/moose
/
MaterialFunctorConverter.h
41 lines (33 loc) · 1.27 KB
/
MaterialFunctorConverter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "Material.h"
/**
* This material converts functor to regular (AD or not) material properties
*/
template <typename T>
class MaterialFunctorConverterTempl : public Material
{
public:
static InputParameters validParams();
MaterialFunctorConverterTempl(const InputParameters & parameters);
protected:
virtual void computeQpProperties() override;
void initQpStatefulProperties() override;
/// Number of material properties to create
const std::size_t _num_functors_to_convert;
/// Incoming functors to convert
std::vector<const Moose::Functor<Moose::GenericType<T, true>> *> _functors_in;
/// Regular material properties to create
std::vector<MaterialProperty<T> *> _reg_props_out;
/// AD material properties to create
std::vector<ADMaterialProperty<T> *> _ad_props_out;
};
typedef MaterialFunctorConverterTempl<Real> MaterialFunctorConverter;
typedef MaterialFunctorConverterTempl<RealVectorValue> VectorMaterialFunctorConverter;