31 "derivative_threshold",
33 "Threshold to discard automatic differentiation derivatives. This number is chosen on the " 34 "order of the machine epsilon based on current experience.");
41 _ad_derivative_threshold(getParam<
Real>(
"derivative_threshold")),
42 _apply_derivative_threshold(true)
54 if (dynamic_cast<const VariableCondensationPreconditioner *>(mpc))
66 unsigned int test_space_size = 0;
80 mooseAssert(
_var,
"LM variable is null");
82 test_space_size =
_test.size();
86 std::vector<unsigned int> is_index_on_lower_dimension;
88 for (
_i = 0;
_i < test_space_size;
_i++)
96 is_index_on_lower_dimension.push_back(
_i);
100 for (
const auto index : is_index_on_lower_dimension)
112 std::vector<ADReal> residuals;
113 size_t test_space_size = 0;
116 std::vector<JType> jacobian_types;
117 std::vector<dof_id_type> dof_indices;
118 Real scaling_factor = 1;
127 case MType::Secondary:
129 jacobian_types = {JType::SecondarySecondary, JType::SecondaryPrimary, JType::SecondaryLower};
135 jacobian_types = {JType::PrimarySecondary, JType::PrimaryPrimary, JType::PrimaryLower};
140 mooseAssert(
_var,
"This should be non-null");
142 jacobian_types = {JType::LowerSecondary, JType::LowerPrimary, JType::LowerLower};
146 test_space_size = dof_indices.size();
148 residuals.resize(test_space_size, 0);
150 std::vector<unsigned int> is_index_on_lower_dimension;
151 std::vector<dof_id_type> dof_indices_lower;
154 unsigned int number_indices_on_lowerd = 0;
156 for (
_i = 0;
_i < test_space_size;
_i++)
164 is_index_on_lower_dimension.push_back(
_i);
165 dof_indices_lower.push_back(dof_indices[
_i]);
166 number_indices_on_lowerd++;
169 std::vector<ADReal> residuals_lower;
170 residuals_lower.resize(number_indices_on_lowerd, 0);
179 unsigned int index_lower = 0;
180 for (
const auto index : is_index_on_lower_dimension)
MooseVariableField< Real > & _secondary_var
const VariableTestValue & _test_secondary
void accumulateTaggedLocalResidual()
unsigned int number() const
std::map< unsigned int, unsigned int > getPrimaryIpToLowerElementMap(const Elem &primary_elem, const Elem &primary_elem_ip, const Elem &lower_secondary_elem) const
const std::vector< dof_id_type > & dofIndicesLower() const final
Elem const *const & _lower_primary_elem
const std::vector< Real > & _JxW_msm
virtual ADReal computeQpResidual(Moose::MortarType mortar_type)=0
virtual void computeResidual() override
const libMesh::QBase *const & _qrule_msm
static InputParameters validParams()
const VariableTestValue & _test
void addJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Elem const *const & _lower_secondary_elem
virtual const std::vector< dof_id_type > & dofIndicesNeighbor() const=0
const AutomaticMortarGeneration & amg() const
virtual const std::vector< dof_id_type > & dofIndices() const
unsigned int n_points() const
std::map< unsigned int, unsigned int > _primary_ip_lowerd_map
Nodal map from primary interior parent to lower dimensional domain.
std::map< unsigned int, unsigned int > getSecondaryIpToLowerElementMap(const Elem &lower_secondary_elem) const
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
unsigned int number() const
const FEProblemBase & feProblem() const
virtual void initialSetup() override
std::map< unsigned int, unsigned int > _secondary_ip_lowerd_map
Nodal map from secondary interior parent to lower dimensional domain.
MooseVariable *const _var
void prepareVectorTagNeighbor(Assembly &assembly, unsigned int ivar)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool _apply_derivative_threshold
Whether to apply derivative trimming.
DenseVector< Number > _local_re
virtual void computeJacobian() override
ADMortarLagrangeConstraint(const InputParameters ¶meters)
static InputParameters validParams()
void prepareVectorTagLower(Assembly &assembly, unsigned int ivar)
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
const MooseArray< Real > & _coord
virtual void initialSetup()
const VariableTestValue & _test_primary
void scalingFactor(const std::vector< Real > &factor)
MooseVariableField< Real > & _primary_var