Skip to content

Commit

Permalink
Merge pull request #16246 from dschwen/remove_master_slave_15457
Browse files Browse the repository at this point in the history
Remove master slave
  • Loading branch information
aeslaughter authored Nov 23, 2020
2 parents 118aa50 + 2af3357 commit 0839e8f
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 205 deletions.
24 changes: 0 additions & 24 deletions framework/include/constraints/NodalConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,12 @@ class NodalConstraint : public Constraint,

NodalConstraint(const InputParameters & parameters);

/**
* Get the list of primary nodes
* @return list of primary nodes IDs
*/
std::vector<dof_id_type> & getMasterNodeId()
{
mooseDeprecated(
"'getPrimaryNodeId' is deprecated and will be removed on September 1st, 2020. Please "
"use 'getPrimaryNodeId' instead.");
return _primary_node_vector;
}

/**
* Get the list of primary nodes
* @return list of primary nodes IDs
*/
std::vector<dof_id_type> & getPrimaryNodeId() { return _primary_node_vector; }

/**
* Get the list of connected secondary nodes
* @return list of secondary node IDs
*/
std::vector<dof_id_type> & getSlaveNodeId()
{
mooseDeprecated(
"'getSecondaryNodeId' is deprecated and will be removed on September 1st, 2020. Please "
"use 'getSecondaryNodeId' instead.");
return _connected_nodes;
}

/**
* Get the list of connected secondary nodes
* @return list of secondary node IDs
Expand Down
4 changes: 1 addition & 3 deletions framework/src/constraints/ConstraintWarehouse.C
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ ConstraintWarehouse::addObject(std::shared_ptr<Constraint> object,
if (nfc)
{
MooseMesh & mesh = nfc->getParam<FEProblemBase *>("_fe_problem_base")->mesh();
unsigned int secondary =
mesh.getBoundaryID(nfc->isParamValid("secondary") ? nfc->getParam<BoundaryName>("secondary")
: nfc->getParam<BoundaryName>("slave"));
unsigned int secondary = mesh.getBoundaryID(nfc->getParam<BoundaryName>("secondary"));
bool displaced = nfc->parameters().have_parameter<bool>("use_displaced_mesh") &&
nfc->getParam<bool>("use_displaced_mesh");

Expand Down
29 changes: 3 additions & 26 deletions framework/src/constraints/EqualValueBoundaryConstraint.C
Original file line number Diff line number Diff line change
Expand Up @@ -60,41 +60,18 @@ EqualValueBoundaryConstraint::validParams()
"primary",
std::numeric_limits<unsigned int>::max(),
"The ID of the primary node. If no ID is provided, first node of secondary set is chosen.");
params.addDeprecatedParam<unsigned int>(
"master",
std::numeric_limits<unsigned int>::max(),
"The ID of the primary node. If no ID is provided, first node of secondary set is chosen.",
"The 'master' param is deprecated and will be removed on September 1, 2020. Please use the "
"'primary' parameter instead.");
params.addParam<std::vector<unsigned int>>("secondary_node_ids", "The IDs of the secondary node");
params.addParam<BoundaryName>(
"secondary", "NaN", "The boundary ID associated with the secondary side");
params.addDeprecatedParam<std::vector<unsigned int>>(
"slave_node_ids",
"The IDs of the slave node",
"The 'slave_node_ids' param is deprecated and will be removed on September 1, 2020. Please "
"use "
"the 'secondary_node_ids' param instead");
params.addDeprecatedParam<BoundaryName>(
"slave",
"NaN",
"The boundary ID associated with the slave side",
"The 'slave' param is deprecated and will be removed on "
"September 1, 2020. Please use the 'secondary' param instead");
params.addRequiredParam<Real>("penalty", "The penalty used for the boundary term");
return params;
}

EqualValueBoundaryConstraint::EqualValueBoundaryConstraint(const InputParameters & parameters)
: NodalConstraint(parameters),
_primary_node_id(parameters.isParamSetByUser("master") ? getParam<unsigned int>("master")
: getParam<unsigned int>("primary")),
_secondary_node_ids(isParamValid("secondary_node_ids")
? getParam<std::vector<unsigned int>>("secondary_node_ids")
: getParam<std::vector<unsigned int>>("slave_node_ids")),
_secondary_node_set_id(parameters.isParamSetByUser("slave")
? getParam<BoundaryName>("slave")
: getParam<BoundaryName>("secondary")),
_primary_node_id(getParam<unsigned int>("primary")),
_secondary_node_ids(getParam<std::vector<unsigned int>>("secondary_node_ids")),
_secondary_node_set_id(getParam<BoundaryName>("secondary")),
_penalty(getParam<Real>("penalty"))
{
updateConstrainedNodes();
Expand Down
24 changes: 5 additions & 19 deletions framework/src/constraints/NodeFaceConstraint.C
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ NodeFaceConstraint::validParams()
InputParameters params = Constraint::validParams();
params.addParam<BoundaryName>("secondary", "The boundary ID associated with the secondary side");
params.addParam<BoundaryName>("primary", "The boundary ID associated with the primary side");
params.addDeprecatedParam<BoundaryName>("slave",
"The boundary ID associated with the secondary side",
"This parameter is deprecated in favor of 'secondary' "
"and will be removed on September 1st, 2020");
params.addDeprecatedParam<BoundaryName>("master",
"The boundary ID associated with the primary side",
"This parameter is deprecated in favor of 'primary' and "
"will be removed on September 1st, 2020");
params.addParam<Real>("tangential_tolerance",
"Tangential distance to extend edges of contact surfaces");
params.addParam<Real>(
Expand All @@ -46,7 +38,6 @@ NodeFaceConstraint::validParams()
params.addParam<MooseEnum>("order", orders, "The finite element order used for projections");

params.addCoupledVar("primary_variable", "The variable on the primary side of the domain");
params.addDeprecatedCoupledVar("master_variable", "primary_variable", "September 1st, 2020");

return params;
}
Expand All @@ -58,20 +49,16 @@ NodeFaceConstraint::NodeFaceConstraint(const InputParameters & parameters)
NeighborCoupleableMooseVariableDependencyIntermediateInterface(this, true, false),
NeighborMooseVariableInterface<Real>(
this, true, Moose::VarKindType::VAR_NONLINEAR, Moose::VarFieldType::VAR_FIELD_STANDARD),
_secondary(isParamValid("secondary") ? _mesh.getBoundaryID(getParam<BoundaryName>("secondary"))
: _mesh.getBoundaryID(getParam<BoundaryName>("slave"))),
_primary(isParamValid("primary") ? _mesh.getBoundaryID(getParam<BoundaryName>("primary"))
: _mesh.getBoundaryID(getParam<BoundaryName>("master"))),
_secondary(_mesh.getBoundaryID(getParam<BoundaryName>("secondary"))),
_primary(_mesh.getBoundaryID(getParam<BoundaryName>("primary"))),
_var(_sys.getFieldVariable<Real>(_tid, parameters.get<NonlinearVariableName>("variable"))),

_primary_q_point(_assembly.qPointsFace()),
_primary_qrule(_assembly.qRuleFace()),

_penetration_locator(
getPenetrationLocator(isParamValid("primary") ? getParam<BoundaryName>("primary")
: getParam<BoundaryName>("master"),
isParamValid("secondary") ? getParam<BoundaryName>("secondary")
: getParam<BoundaryName>("slave"),
getPenetrationLocator(getParam<BoundaryName>("primary"),
getParam<BoundaryName>("secondary"),
Utility::string_to_enum<Order>(getParam<MooseEnum>("order")))),

_current_node(_var.node()),
Expand All @@ -80,8 +67,7 @@ NodeFaceConstraint::NodeFaceConstraint(const InputParameters & parameters)
_phi_secondary(1), // One entry
_test_secondary(1), // One entry

_primary_var(isCoupled("primary_variable") ? *getVar("primary_variable", 0)
: *getVar("master_variable", 0)),
_primary_var(*getVar("primary_variable", 0)),
_primary_var_num(_primary_var.number()),

_phi_primary(_assembly.phiFaceNeighbor(_primary_var)),
Expand Down
20 changes: 4 additions & 16 deletions modules/contact/src/actions/ContactAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,8 @@ ContactAction::validParams()
InputParameters params = Action::validParams();
params += ContactAction::commonParameters();

params.addParam<BoundaryName>("primary", "The primary surface");
params.addParam<BoundaryName>("secondary", "The secondary surface");
params.addDeprecatedParam<BoundaryName>(
"master",
"The primary surface",
"The 'master' parameter will be removed on September 1, 2020. "
"Please use the 'primary' parameter instead.");
params.addDeprecatedParam<BoundaryName>(
"slave",
"The secondary surface",
"The 'slave' parameter will be removed on September 1, 2020. "
"Please use the 'secondary' parameter instead.");
params.addRequiredParam<BoundaryName>("primary", "The primary surface");
params.addRequiredParam<BoundaryName>("secondary", "The secondary surface");

params.addParam<MeshGeneratorName>("mesh", "", "The mesh generator for mortar method");
params.addParam<VariableName>("secondary_gap_offset",
Expand Down Expand Up @@ -131,10 +121,8 @@ ContactAction::validParams()

ContactAction::ContactAction(const InputParameters & params)
: Action(params),
_primary(isParamValid("primary") ? getParam<BoundaryName>("primary")
: getParam<BoundaryName>("master")),
_secondary(isParamValid("secondary") ? getParam<BoundaryName>("secondary")
: getParam<BoundaryName>("slave")),
_primary(getParam<BoundaryName>("primary")),
_secondary(getParam<BoundaryName>("secondary")),
_model(getParam<MooseEnum>("model")),
_formulation(getParam<MooseEnum>("formulation")),
_system(getParam<MooseEnum>("system")),
Expand Down
5 changes: 0 additions & 5 deletions modules/contact/src/constraints/MechanicalContactConstraint.C
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ MechanicalContactConstraint::validParams()

params.addRequiredParam<BoundaryName>("boundary", "The primary boundary");
params.addParam<BoundaryName>("secondary", "The secondary boundary");
params.addDeprecatedParam<BoundaryName>("slave",
"The secondary boundary",
"The 'slave' parameter is deprecated and will be removed "
"on September 1, 2020. Please use the "
"'secondary' parameter instead");
params.addRequiredParam<unsigned int>("component",
"An integer corresponding to the direction "
"the variable this kernel acts in. (0 for x, "
Expand Down
16 changes: 2 additions & 14 deletions modules/contact/src/dampers/ContactSlipDamper.C
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ ContactSlipDamper::validParams()
"primary", "IDs of the primary surfaces for which slip reversals should be damped");
params.addParam<std::vector<int>>(
"secondary", "IDs of the secondary surfaces for which slip reversals should be damped");
params.addDeprecatedParam<std::vector<int>>(
"master",
"IDs of the primary surfaces for which slip reversals should be damped",
"The 'master' param is deprecated and will be removed on September 1, 2020. Please use the "
"'primary' parameter instead.");
params.addDeprecatedParam<std::vector<int>>(
"slave",
"IDs of the secondary surfaces for which slip reversals should be damped",
"The 'slave' param is deprecated and will be removed on "
"September 1, 2020. Please use the 'secondary' param instead");
params.addParam<Real>(
"max_iterative_slip", std::numeric_limits<Real>::max(), "Maximum iterative slip");
params.addRangeCheckedParam<Real>("min_damping_factor",
Expand Down Expand Up @@ -70,10 +60,8 @@ ContactSlipDamper::ContactSlipDamper(const InputParameters & parameters)
if (!_displaced_problem)
mooseError("Must have displaced problem to use ContactSlipDamper");

std::vector<int> primary = isParamValid("primary") ? getParam<std::vector<int>>("primary")
: getParam<std::vector<int>>("master");
std::vector<int> secondary = isParamValid("secondary") ? getParam<std::vector<int>>("secondary")
: getParam<std::vector<int>>("slave");
std::vector<int> primary = getParam<std::vector<int>>("primary");
std::vector<int> secondary = getParam<std::vector<int>>("secondary");

unsigned int num_interactions = primary.size();
if (num_interactions != secondary.size())
Expand Down
46 changes: 5 additions & 41 deletions modules/heat_conduction/src/actions/ThermalContactAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,7 @@ ThermalContactAction::validParams()
"A string representing the Moose object that will be used for computing the gap size");
params.addRequiredParam<NonlinearVariableName>("variable", "The variable for thermal contact");
params.addParam<BoundaryName>("primary", "The primary surface");
params.addParam<BoundaryName>("secondary", "The secondary surface");
params.addDeprecatedParam<BoundaryName>(
"master",
"The primary surface",
"The 'master' parameter will be removed on September 1, 2020. "
"Please use the 'primary' parameter instead.");
params.addDeprecatedParam<BoundaryName>(
"slave",
"The secondary surface",
"The 'slave' parameter will be removed on September 1, 2020. "
"Please use the 'secondary' parameter instead.");
params.addRequiredParam<BoundaryName>("secondary", "The secondary surface");
params.addRangeCheckedParam<Real>("tangential_tolerance",
"tangential_tolerance>=0",
"Tangential distance to extend edges of contact surfaces");
Expand Down Expand Up @@ -108,35 +98,10 @@ ThermalContactAction::ThermalContactAction(const InputParameters & params)
_order(getParam<MooseEnum>("order")),
_penetration_var_name(_quadrature ? "qpoint_penetration" : "penetration"),
_gap_value_name("paired_" + getParam<NonlinearVariableName>("variable")),
_gap_conductivity_name("paired_k_" + getParam<NonlinearVariableName>("variable"))
_gap_conductivity_name("paired_k_" + getParam<NonlinearVariableName>("variable")),
_primary_name(getParam<BoundaryName>("primary")),
_secondary_name(getParam<BoundaryName>("secondary"))
{
bool valid_secondary = false;
if (isParamValid("secondary"))
{
valid_secondary = true;
_secondary_name = getParam<BoundaryName>("secondary");
}
else if (isParamValid("slave"))
{
valid_secondary = true;
_secondary_name = getParam<BoundaryName>("slave");
}
if (!valid_secondary)
mooseError("The 'secondary' input parameter is not set!");

bool valid_primary = false;
if (isParamValid("primary"))
{
valid_primary = true;
_primary_name = getParam<BoundaryName>("primary");
}
else if (isParamValid("master"))
{
valid_primary = true;
_primary_name = getParam<BoundaryName>("master");
}
if (!valid_primary)
mooseError("The 'primary' input parameter is not set!");
}

void
Expand Down Expand Up @@ -275,13 +240,12 @@ ThermalContactAction::addDiracKernels()

const std::string object_name = "GapHeatPointSourceMaster";
InputParameters params = _factory.getValidParams(object_name);
std::string secondary_name = isParamValid("secondary") ? "secondary" : "slave";
params.applySpecificParameters(parameters(),
{"tangential_tolerance",
"normal_smoothing_distance",
"normal_smoothing_method",
"order",
secondary_name,
"secondary",
"variable"});
params.set<BoundaryName>("boundary") = _primary_name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ GapHeatPointSourceMaster::validParams()
InputParameters params = DiracKernel::validParams();
params.addParam<BoundaryName>("boundary", "The primary boundary");
params.addParam<BoundaryName>("secondary", "The secondary boundary");
params.addDeprecatedParam<BoundaryName>("slave",
"The secondary boundary",
"The 'slave' parameter is deprecated and will be removed "
"on September 1, 2020. Please use the "
"'secondary' parameter instead");
params.addParam<MooseEnum>("order", orders, "The finite element order");
params.set<bool>("use_displaced_mesh") = true;
params.addParam<Real>("tangential_tolerance",
Expand All @@ -46,8 +41,7 @@ GapHeatPointSourceMaster::GapHeatPointSourceMaster(const InputParameters & param
: DiracKernel(parameters),
_penetration_locator(
getPenetrationLocator(getParam<BoundaryName>("boundary"),
isParamValid("secondary") ? getParam<BoundaryName>("secondary")
: getParam<BoundaryName>("slave"),
getParam<BoundaryName>("secondary"),
Utility::string_to_enum<Order>(getParam<MooseEnum>("order")))),
_secondary_flux(_sys.getVector("secondary_flux"))
{
Expand Down
Loading

0 comments on commit 0839e8f

Please sign in to comment.