https://mooseframework.inl.gov
XFEMCutSwitchingMaterial.h
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 #pragma once
11 
12 #include "Material.h"
13 #include "XFEM.h"
14 #include "ADRankTwoTensorForward.h"
17 
22 template <typename T, bool is_ad>
24 {
25 public:
27 
29 
30 protected:
31  // At the time of initializing this switching material, the initQpStatefulProperties methods of
32  // the base materials are already called. So we only need to assign the current values at _qp to
33  // the switching material property.
34  virtual void initQpStatefulProperties() override { computeProperties(); }
35 
36  virtual void computeProperties() override;
37 
38  virtual void computeQpProperties() override { _prop[_qp] = (*_mapped_prop)[_qp]; }
39 
40 private:
43 
45  const std::vector<CutSubdomainID> _keys;
46  const std::vector<std::string> _vals;
48 
50  const std::string _base_name;
51 
53  const std::string _prop_name;
54 
56  std::unordered_map<unsigned int, const GenericMaterialProperty<T, is_ad> *> _prop_map;
57 
60 
62  std::shared_ptr<XFEM> _xfem;
63 
66 };
67 
73 
static InputParameters validParams()
XFEMCutSwitchingMaterialTempl< RankTwoTensor, false > XFEMCutSwitchingMaterialRankTwoTensor
XFEMCutSwitchingMaterialTempl< Real, false > XFEMCutSwitchingMaterialReal
const std::string _base_name
global material property base name
XFEMCutSwitchingMaterialTempl< RankTwoTensor, true > ADXFEMCutSwitchingMaterialRankTwoTensor
virtual void computeQpProperties() override
virtual void computeProperties() override
const GeometricCutUserObject * _cut
The geometric cut userobject that provides the cut subdomain IDs.
std::shared_ptr< XFEM > _xfem
shared pointer to XFEM
Switches between materials in a multi-material system where the interfaces are defined by multiple ge...
unsigned int _qp
XFEMCutSwitchingMaterialTempl< RankThreeTensor, false > XFEMCutSwitchingMaterialRankThreeTensor
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< Real, true > ADXFEMCutSwitchingMaterialReal
typename GenericMaterialPropertyStruct< T, is_ad >::type GenericMaterialProperty
XFEMCutSwitchingMaterialTempl(const InputParameters &parameters)
GenericMaterialProperty< T, is_ad > & _prop
the global material property
const GenericMaterialProperty< T, is_ad > * _mapped_prop
current mapped material property
XFEMCutSwitchingMaterialTempl< RankFourTensor, false > XFEMCutSwitchingMaterialRankFourTensor
XFEMCutSwitchingMaterialTempl< RankFourTensor, true > ADXFEMCutSwitchingMaterialRankFourTensor
const InputParameters & parameters() const
const std::vector< CutSubdomainID > _keys
{@ map keys and values
const std::vector< std::string > _vals
virtual void initQpStatefulProperties() override
XFEMCutSwitchingMaterialTempl< RankThreeTensor, true > ADXFEMCutSwitchingMaterialRankThreeTensor