https://mooseframework.inl.gov
Loading...
Searching...
No Matches
src
mfem
functions
MFEMParsedCoefficient.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
#ifdef MOOSE_MFEM_ENABLED
11
12
#include "
MFEMParsedCoefficient.h
"
13
14
MFEMParsedCoefficient::MFEMParsedCoefficient
(
15
const
unsigned
& arity,
16
const
std::vector<std::reference_wrapper<mfem::Coefficient>> & coefficients,
17
const
FunctionParserUtils<false>::SymFunctionPtr
& sym_function)
18
: _coefficients(coefficients), _sym_function(sym_function), _vals(arity), _transip(3)
19
{
20
}
21
22
mfem::real_t
23
MFEMParsedCoefficient::Eval
(mfem::ElementTransformation & T,
const
mfem::IntegrationPoint & ip)
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
}
37
38
#endif
MFEMParsedCoefficient.h
FunctionParserUtils::SymFunctionPtr
std::shared_ptr< SymFunction > SymFunctionPtr
Shorthand for an smart pointer to an autodiff function parser object.
Definition
FunctionParserUtils.h:65
MFEMParsedCoefficient::_sym_function
const FunctionParserUtils< false >::SymFunctionPtr & _sym_function
Definition
MFEMParsedCoefficient.h:24
MFEMParsedCoefficient::_coefficients
const std::vector< std::reference_wrapper< mfem::Coefficient > > & _coefficients
Definition
MFEMParsedCoefficient.h:23
MFEMParsedCoefficient::_vals
mfem::Array< mfem::real_t > _vals
Definition
MFEMParsedCoefficient.h:25
MFEMParsedCoefficient::_transip
mfem::Vector _transip
Definition
MFEMParsedCoefficient.h:26
MFEMParsedCoefficient::MFEMParsedCoefficient
MFEMParsedCoefficient(const unsigned &arity, const std::vector< std::reference_wrapper< mfem::Coefficient > > &coefs, const FunctionParserUtils< false >::SymFunctionPtr &sym_function)
Definition
MFEMParsedCoefficient.C:14
MFEMParsedCoefficient::Eval
mfem::real_t Eval(mfem::ElementTransformation &T, const mfem::IntegrationPoint &ip) override
Definition
MFEMParsedCoefficient.C:23
Generated on Fri Aug 21 2026 13:33:57 for https://mooseframework.inl.gov by
1.9.8