https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMGenericFunctorMatrixMaterial.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
13#include "MFEMProblem.h"
14
16
19{
21 params.addClassDescription("Declares material matrix properties based on names and coefficients "
22 "prescribed by input parameters.");
23 params.addRequiredParam<std::vector<std::string>>(
24 "prop_names", "The names of the properties this material will have");
25 params.addRequiredParam<std::vector<MFEMMatrixCoefficientName>>(
26 "prop_values",
27 "The corresponding names of coefficients associated with the named properties");
28
29 return params;
30}
31
33 const InputParameters & parameters)
34 : MFEMFunctorMaterial(parameters),
35 _prop_names(getParam<std::vector<std::string>>("prop_names")),
36 _prop_values(processLiterals(getParam<std::vector<MFEMMatrixCoefficientName>>("prop_values")))
37{
38 if (_prop_names.size() != _prop_values.size())
39 paramError("prop_names", "Must match the size of prop_values");
40
41 for (const auto i : index_range(_prop_names))
45 _prop_values[i]);
46}
47
49
50#endif
registerMooseObject("MooseApp", MFEMGenericFunctorMatrixMaterial)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
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< std::string > subdomainsToStrings()
std::vector< std::string > boundariesToStrings()
bool isBoundaryRestricted() const
Returns a bool indicating if the object is restricted to a subset of boundaries.
Moose::MFEM::CoefficientManager & _properties
static InputParameters validParams()
Declares constant matrix material properties based on names and values prescribed by input parameters...
MFEMGenericFunctorMatrixMaterial(const InputParameters &parameters)
const std::vector< std::string > & _prop_names
const std::vector< MFEMMatrixCoefficientName > _prop_values
void paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Definition MooseBase.h:457
mfem::MatrixCoefficient & declareMatrixProperty(const std::string &name, const std::vector< std::string > &blocks, const std::string &existing_coef)
Use an existing matrix coefficient for a property on some blocks of the mesh.