22 template <
typename T,
bool is_ad>
29 "The geometric cut userobject");
31 "cut_subdomain_ids",
"The CutSubdomainIDs that the geometric_cut_userobject may provide.");
33 "base_names",
"The base_names for each of the cut subdomain.");
34 params.
addParam<std::string>(
"base_name",
35 "Base name to prepend for the computed material property.");
36 params.
addRequiredParam<std::string>(
"prop_name",
"name of the material property to switch");
40 template <
typename T,
bool is_ad>
46 _vals(getParam<
std::vector<
std::string>>(
"base_names")),
47 _base_name(isParamValid(
"base_name") ? getParam<
std::string>(
"base_name") +
"_" :
""),
48 _prop_name(getParam<
std::string>(
"prop_name")),
49 _prop(declareGenericProperty<T, is_ad>(_base_name + _prop_name))
53 mooseError(
"Problem casting _subproblem to FEProblemBase");
54 _xfem = MooseSharedNamespace::dynamic_pointer_cast<
XFEM>(fe_problem->
getXFEM());
59 mooseError(
"The number of base_name_keys must be equal to the number of base_name_vals. ",
61 " keys are provided, but ",
63 " values are provided.");
64 for (
unsigned int i = 0; i <
_keys.size(); i++)
68 template <
typename T,
bool is_ad>
72 CutSubdomainID key = _xfem->getCutSubdomainID(_cut, _current_elem);
80 _mapped_prop = _prop_map.at(key);
82 catch (std::out_of_range &)
86 "provided in the base_name_keys");
static InputParameters validParams()
registerMooseObject("XFEMApp", XFEMCutSwitchingMaterialReal)
virtual void computeProperties() override
virtual void computeProperties() override
std::shared_ptr< XFEM > _xfem
shared pointer to XFEM
virtual const std::string & name() const
unsigned int CutSubdomainID
Switches between materials in a multi-material system where the interfaces are defined by multiple ge...
static InputParameters validParams()
std::unordered_map< unsigned int, const GenericMaterialProperty< T, is_ad > * > _prop_map
map of keys to material property
const std::string _prop_name
property name
XFEMCutSwitchingMaterialTempl(const InputParameters ¶meters)
std::string stringify(const T &t)
std::shared_ptr< XFEMInterface > getXFEM()
void mooseError(Args &&... args) const
const std::vector< CutSubdomainID > _keys
{@ map keys and values
const std::vector< std::string > _vals