15#include "libmesh/quadrature.h"
23 ret.
set<std::vector<BoundaryName>>(
"boundary") = {
24 params_in.
get<BoundaryName>(
"secondary_boundary")};
29template <
typename ComputeValueType>
35 params.
set<
bool>(
"ghost_point_neighbors") =
true;
39 "incremental",
false,
"Whether to accumulate mortar auxiliary kernel value");
49template <
typename ComputeValueType>
54 *parameters.getCheckedPointerParam<
FEProblemBase *>(
"_fe_problem_base")),
56 _displaced(this->template getParam<bool>(
"use_displaced_mesh")),
57 _fe_problem(*this->template getCheckedPointerParam<
FEProblemBase *>(
"_fe_problem_base")),
59 _incremental(this->template getParam<bool>(
"incremental")),
61 _test_lower(_var.phiLower()),
62 _coord_msm(_assembly.mortarCoordTransformation())
66 "MortarNodalAuxKernel derived classes populate nodal aux variables only.");
69template <
typename ComputeValueType>
75 setupMortarMaterials();
78template <
typename ComputeValueType>
82 std::array<const MortarNodalAuxKernelTempl<ComputeValueType> *, 1> consumers = {{
this}};
88 _secondary_ip_sub_to_mats,
89 _primary_ip_sub_to_mats,
90 _secondary_boundary_mats);
93template <
typename ComputeValueType>
99 if (&amg_in == &amg())
100 setupMortarMaterials();
103template <
typename ComputeValueType>
107 if (!_var.isNodalDefined())
110 ComputeValueType value(0);
111 Real total_volume = 0;
113 const auto & its = amg().secondariesToMortarSegments(*_current_node);
115 auto act_functor = [&value, &total_volume,
this]()
119 value += computeValue();
120 total_volume += _msm_volume;
123 std::array<MortarNodalAuxKernelTempl<ComputeValueType> *, 1> consumers = {{
this}};
133 _secondary_ip_sub_to_mats,
134 _primary_ip_sub_to_mats,
135 _secondary_boundary_mats,
146 if (MooseUtils::relativeFuzzyEqual(total_volume, 0.0))
149 value /= total_volume;
153 _var.setNodalValue(value);
156 mooseAssert(_u_old.size() == 1,
157 "Expected 1 value in MortarNodalAuxKernel, but got " << _u_old.size());
158 _var.setNodalValue(value + _u_old[0]);
162template <
typename ComputeValueType>
167 "not clear where this should be implemented in the compute loop. If you want to implement "
168 "this function, please contact a MOOSE developer and tell them your use case");
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
This class is a container/interface for the objects involved in automatic generation of mortar spaces...
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job.
Base class for creating new auxiliary kernels and auxiliary boundary conditions.
bool isNodal() const
Nodal or elemental kernel?
static InputParameters validParams()
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
An interface for accessing mortar mesh data.
static InputParameters validParams()
friend class MortarNodalAuxKernelTempl
Interface for objects that need to be notified when the mortar segment mesh for an interface they con...
Base class for creating new nodally-based mortar auxiliary kernels.
void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job.
void precalculateValue() override final
This callback is used for AuxKernelTempls that need to perform a per-element calculation.
void compute() override
Computes the value and stores it in the solution vector.
static InputParameters validParams()
void setupMortarMaterials()
(Re)builds the material containers required by this mortar auxiliary kernel for the mortar segment me...
void mortarSetup(const AutomaticMortarGeneration &amg) override
Called by the MortarInterfaceWarehouse whenever amg's mortar segment mesh coverage has changed,...
void loopOverMortarSegments(const Iterators &secondary_elems_to_mortar_segments, Assembly &assembly, SubProblem &subproblem, FEProblemBase &fe_problem, const AutomaticMortarGeneration &amg, const bool displaced, const Consumers &consumers, const THREAD_ID tid, const std::map< SubdomainID, std::deque< MaterialBase * > > &secondary_ip_sub_to_mats, const std::map< SubdomainID, std::deque< MaterialBase * > > &primary_ip_sub_to_mats, const std::deque< MaterialBase * > &secondary_boundary_mats, const ActionFunctor act, const bool reinit_mortar_user_objects)
This method will loop over pairs of secondary elements and their corresponding mortar segments,...
void setupMortarMaterials(const Consumers &consumers, FEProblemBase &fe_problem, const AutomaticMortarGeneration &amg, const THREAD_ID tid, std::map< SubdomainID, std::deque< MaterialBase * > > &secondary_ip_sub_to_mats, std::map< SubdomainID, std::deque< MaterialBase * > > &primary_ip_sub_to_mats, std::deque< MaterialBase * > &secondary_boundary_mats)
This function creates containers of materials necessary to execute the mortar method for a supplied s...