16 params.
addClassDescription(
"Base class to compute a scalar value or rate across an interface");
19 "Type of value to compute and store");
34 std::vector<std::tuple<dof_id_type, unsigned short int, boundary_id_type>> elem_side_bid =
41 for (
unsigned int i = 0; i < elem_side_bid.size(); i++)
45 if (boundaryList.find(std::get<2>(elem_side_bid[i])) != boundaryList.end())
48 std::pair<dof_id_type, unsigned int> elem_side_pair =
49 std::make_pair(std::get<0>(elem_side_bid[i]), std::get<1>(elem_side_bid[i]));
51 std::vector<Real> var_values(0, 0);
55 _map_JxW[elem_side_pair] = var_values;
69 vec.resize(
_qrule->n_points());
71 jxw.resize(
_qrule->n_points());
74 for (
unsigned int qp = 0; qp <
_qrule->n_points(); ++qp)
82 mooseError(
"InterfaceQpUserObjectBase:: cannot find the required element and side");
87 const unsigned int side,
88 const unsigned int qp)
const
90 auto data =
_map_values.find(std::make_pair(elem, side));
92 return data->second[qp];
94 mooseError(
"getQpValue: can't find the given qp");
99 const unsigned int side)
const
101 auto data =
_map_values.find(std::make_pair(elem, side));
103 mooseError(
"getSideAverageValue: can't find the given qp");
104 auto weights =
_map_JxW.find(std::make_pair(elem, side));
106 mooseError(
"getSideAverageValue: can't find the given qp");
110 for (
unsigned int i = 0; i < data->second.size(); i++)
112 val += data->second[i] * weights->second[i];
113 vol += weights->second[i];
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
const ExecFlagType EXEC_TIMESTEP_END
const ExecFlagType EXEC_INITIAL
virtual const std::set< BoundaryID > & boundaryIDs() const
Return the boundary IDs for this object.
A MultiMooseEnum object to hold "execute_on" flags.
static InputParameters validParams()
std::map< std::pair< dof_id_type, unsigned int >, std::vector< Real > > _map_JxW
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job.
Real getSideAverageValue(const dof_id_type elem, const unsigned int side) const
function returning the element side average value
InterfaceQpUserObjectBase(const InputParameters ¶meters)
Real getQpValue(const dof_id_type elem, const unsigned int side, unsigned int qp) const
method returning the quadrature point value
virtual Real computeRealValue(const unsigned int)=0
method to overrid in child classes returnig a real value
std::map< std::pair< dof_id_type, unsigned int >, std::vector< Real > > _map_values
these maps are used to store QP data.
static MooseEnum valueOptions()
the method defining the returning value type: value, rate or increment
virtual void execute() override
Execute method.
const unsigned int & _current_side
current side of the current element
const MooseArray< Real > & _JxW
const QBase *const & _qrule
const Elem *const & _current_elem
current element
A special InterfaceUserObject computing average values across an interface given the average type (se...
static InputParameters validParams()
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
std::vector< std::tuple< dof_id_type, unsigned short int, boundary_id_type > > buildSideList()
Calls BoundaryInfo::build_side_list(), returns a std::vector of (elem-id, side-id,...