https://mooseframework.inl.gov
Public Member Functions | Private Attributes | List of all members
MFEMParsedCoefficient Class Reference

Scalar coefficient that, given a set of scalar (possibly, but not necessarily, gridfunction) coefficients u, v, w, ..., and a scalar, parsed function f, returns f(u, v, w, ..., x, y, z, t) More...

#include <MFEMParsedCoefficient.h>

Inheritance diagram for MFEMParsedCoefficient:
[legend]

Public Member Functions

 MFEMParsedCoefficient (const unsigned &arity, const std::vector< std::reference_wrapper< mfem::Coefficient >> &coefs, const FunctionParserUtils< false >::SymFunctionPtr &sym_function)
 
mfem::real_t Eval (mfem::ElementTransformation &T, const mfem::IntegrationPoint &ip) override
 

Private Attributes

const std::vector< std::reference_wrapper< mfem::Coefficient > > & _coefficients
 
const FunctionParserUtils< false >::SymFunctionPtr & _sym_function
 
mfem::Array< mfem::real_t > _vals
 
mfem::Vector _transip
 

Detailed Description

Scalar coefficient that, given a set of scalar (possibly, but not necessarily, gridfunction) coefficients u, v, w, ..., and a scalar, parsed function f, returns f(u, v, w, ..., x, y, z, t)

Definition at line 20 of file MFEMParsedCoefficient.h.

Constructor & Destructor Documentation

◆ MFEMParsedCoefficient()

MFEMParsedCoefficient::MFEMParsedCoefficient ( const unsigned &  arity,
const std::vector< std::reference_wrapper< mfem::Coefficient >> &  coefs,
const FunctionParserUtils< false >::SymFunctionPtr &  sym_function 
)

Definition at line 14 of file MFEMParsedCoefficient.C.

18  : _coefficients(coefficients), _sym_function(sym_function), _vals(arity), _transip(3)
19 {
20 }
const FunctionParserUtils< false >::SymFunctionPtr & _sym_function
mfem::Array< mfem::real_t > _vals
const std::vector< std::reference_wrapper< mfem::Coefficient > > & _coefficients

Member Function Documentation

◆ Eval()

mfem::real_t MFEMParsedCoefficient::Eval ( mfem::ElementTransformation &  T,
const mfem::IntegrationPoint &  ip 
)
override

Definition at line 23 of file MFEMParsedCoefficient.C.

24 {
25  for (unsigned i = 0; i < _coefficients.size(); i++)
26  _vals[i] = _coefficients[i].get().Eval(T, ip);
27 
28  T.Transform(ip, _transip);
29 
30  for (int i = 0; i < 3; i++)
31  _vals[_coefficients.size() + i] = i < _transip.Size() ? _transip(i) : 0.;
32 
33  _vals[_coefficients.size() + 3] = GetTime();
34 
35  return _sym_function->Eval(_vals.GetData());
36 }
const FunctionParserUtils< false >::SymFunctionPtr & _sym_function
mfem::Array< mfem::real_t > _vals
const std::vector< std::reference_wrapper< mfem::Coefficient > > & _coefficients

Member Data Documentation

◆ _coefficients

const std::vector<std::reference_wrapper<mfem::Coefficient> >& MFEMParsedCoefficient::_coefficients
private

Definition at line 23 of file MFEMParsedCoefficient.h.

Referenced by Eval().

◆ _sym_function

const FunctionParserUtils<false>::SymFunctionPtr& MFEMParsedCoefficient::_sym_function
private

Definition at line 24 of file MFEMParsedCoefficient.h.

Referenced by Eval().

◆ _transip

mfem::Vector MFEMParsedCoefficient::_transip
private

Definition at line 26 of file MFEMParsedCoefficient.h.

Referenced by Eval().

◆ _vals

mfem::Array<mfem::real_t> MFEMParsedCoefficient::_vals
private

Definition at line 25 of file MFEMParsedCoefficient.h.

Referenced by Eval().


The documentation for this class was generated from the following files: