Exemplo n.º 1
0
PenetrationAux::PenetrationAux(const InputParameters & parameters)
  : AuxKernel(parameters),

    // Here we cast the value of the MOOSE enum to an integer to the class-based enum.
    _quantity(getParam<MooseEnum>("quantity").getEnum<PenetrationAux::PA_ENUM>()),
    _penetration_locator(
        _nodal ? getPenetrationLocator(
                     parameters.get<BoundaryName>("paired_boundary"),
                     boundaryNames()[0],
                     Utility::string_to_enum<Order>(parameters.get<MooseEnum>("order")))
               : getQuadraturePenetrationLocator(
                     parameters.get<BoundaryName>("paired_boundary"),
                     boundaryNames()[0],
                     Utility::string_to_enum<Order>(parameters.get<MooseEnum>("order"))))
{
  if (parameters.isParamValid("tangential_tolerance"))
    _penetration_locator.setTangentialTolerance(getParam<Real>("tangential_tolerance"));

  if (parameters.isParamValid("normal_smoothing_distance"))
    _penetration_locator.setNormalSmoothingDistance(getParam<Real>("normal_smoothing_distance"));

  if (parameters.isParamValid("normal_smoothing_method"))
    _penetration_locator.setNormalSmoothingMethod(
        parameters.get<std::string>("normal_smoothing_method"));
}
Exemplo n.º 2
0
SlaveConstraint::SlaveConstraint(const std::string & name, InputParameters parameters) :
    DiracKernel(name, parameters),
    _component(getParam<unsigned int>("component")),
    _model(contactModel(getParam<std::string>("model"))),
    _formulation(contactFormulation(getParam<std::string>("formulation"))),
    _normalize_penalty(getParam<bool>("normalize_penalty")),
    _penetration_locator(getPenetrationLocator(getParam<BoundaryName>("master"), getParam<BoundaryName>("boundary"), Utility::string_to_enum<Order>(getParam<MooseEnum>("order")))),
    _penalty(getParam<Real>("penalty")),
    _friction_coefficient(getParam<Real>("friction_coefficient")),
    _residual_copy(_sys.residualGhosted()),
    _x_var(coupled("disp_x")),
    _y_var(isCoupled("disp_y") ? coupled("disp_y") : libMesh::invalid_uint),
    _z_var(isCoupled("disp_z") ? coupled("disp_z") : libMesh::invalid_uint),
    _vars(_x_var, _y_var, _z_var),
    _mesh_dimension(_mesh.dimension()),
    _nodal_area_var(getVar("nodal_area", 0)),
    _aux_system(_nodal_area_var->sys()),
    _aux_solution(_aux_system.currentSolution())
{
  if (parameters.isParamValid("tangential_tolerance"))
  {
    _penetration_locator.setTangentialTolerance(getParam<Real>("tangential_tolerance"));
  }
  if (parameters.isParamValid("normal_smoothing_distance"))
  {
    _penetration_locator.setNormalSmoothingDistance(getParam<Real>("normal_smoothing_distance"));
  }
  if (parameters.isParamValid("normal_smoothing_method"))
  {
    _penetration_locator.setNormalSmoothingMethod(parameters.get<std::string>("normal_smoothing_method"));
  }
}
Exemplo n.º 3
0
GapValueAux::GapValueAux(const InputParameters & parameters) :
    AuxKernel(parameters),
    _penetration_locator(_nodal ?  getPenetrationLocator(parameters.get<BoundaryName>("paired_boundary"), boundaryNames()[0], Utility::string_to_enum<Order>(parameters.get<MooseEnum>("order"))) : getQuadraturePenetrationLocator(parameters.get<BoundaryName>("paired_boundary"), boundaryNames()[0], Utility::string_to_enum<Order>(parameters.get<MooseEnum>("order")))),
    _moose_var(_subproblem.getVariable(_tid, getParam<VariableName>("paired_variable"))),
    _serialized_solution(_moose_var.sys().currentSolution()),
    _dof_map(_moose_var.dofMap()),
    _warnings(getParam<bool>("warnings"))
{
  if (parameters.isParamValid("tangential_tolerance"))
    _penetration_locator.setTangentialTolerance(getParam<Real>("tangential_tolerance"));

  if (parameters.isParamValid("normal_smoothing_distance"))
    _penetration_locator.setNormalSmoothingDistance(getParam<Real>("normal_smoothing_distance"));

  if (parameters.isParamValid("normal_smoothing_method"))
    _penetration_locator.setNormalSmoothingMethod(parameters.get<std::string>("normal_smoothing_method"));

  Order pairedVarOrder(_moose_var.getOrder());
  Order gvaOrder(Utility::string_to_enum<Order>(parameters.get<MooseEnum>("order")));
  if (pairedVarOrder != gvaOrder && pairedVarOrder != CONSTANT)
    mooseError("ERROR: specified order for GapValueAux ("<<Utility::enum_to_string<Order>(gvaOrder)
               <<") does not match order for paired_variable \""<< _moose_var.name() << "\" ("
               <<Utility::enum_to_string<Order>(pairedVarOrder)<<")");

}
Exemplo n.º 4
0
ContactPressureAux::ContactPressureAux(const InputParameters & params)
  : AuxKernel(params),
    _nodal_area(coupledValue("nodal_area")),
    _penetration_locator(
        getPenetrationLocator(getParam<BoundaryName>("paired_boundary"),
                              getParam<std::vector<BoundaryName>>("boundary")[0],
                              Utility::string_to_enum<Order>(getParam<MooseEnum>("order"))))
{
}
Exemplo n.º 5
0
NodeFaceConstraint::NodeFaceConstraint(const std::string & name, InputParameters parameters) :
    Constraint(name, parameters),
    // The slave side is at nodes (hence passing 'true').  The neighbor side is the master side and it is not at nodes (so passing false)
    NeighborCoupleableMooseVariableDependencyIntermediateInterface(parameters, true, false),
    _slave(_mesh.getBoundaryID(getParam<BoundaryName>("slave"))),
    _master(_mesh.getBoundaryID(getParam<BoundaryName>("master"))),

    _master_q_point(_assembly.qPointsFace()),
    _master_qrule(_assembly.qRuleFace()),

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

    _current_node(_var.node()),
    _current_master(_var.neighbor()),
    _u_slave(_var.nodalSln()),
    _phi_slave(1),  // One entry
    _test_slave(1),  // One entry

    _master_var(*getVar("master_variable", 0)),
    _master_var_num(_master_var.number()),

    _phi_master(_assembly.phiFaceNeighbor()),
    _grad_phi_master(_assembly.gradPhiFaceNeighbor()),

    _test_master(_var.phiFaceNeighbor()),
    _grad_test_master(_var.gradPhiFaceNeighbor()),

    _u_master(_master_var.slnNeighbor()),
    _grad_u_master(_master_var.gradSlnNeighbor()),

    _dof_map(_sys.dofMap()),
    _node_to_elem_map(_mesh.nodeToElemMap()),

    _overwrite_slave_residual(true)
{
  if (parameters.isParamValid("tangential_tolerance"))
  {
    _penetration_locator.setTangentialTolerance(getParam<Real>("tangential_tolerance"));
  }
  if (parameters.isParamValid("normal_smoothing_distance"))
  {
    _penetration_locator.setNormalSmoothingDistance(getParam<Real>("normal_smoothing_distance"));
  }
  if (parameters.isParamValid("normal_smoothing_method"))
  {
    _penetration_locator.setNormalSmoothingMethod(parameters.get<std::string>("normal_smoothing_method"));
  }
  // Put a "1" into test_slave
  // will always only have one entry that is 1
  _test_slave[0].push_back(1);
}
Exemplo n.º 6
0
SlaveConstraint::SlaveConstraint(const InputParameters & parameters)
  : DiracKernel(parameters),
    _component(getParam<unsigned int>("component")),
    _model(ContactMaster::contactModel(getParam<std::string>("model"))),
    _formulation(ContactMaster::contactFormulation(getParam<std::string>("formulation"))),
    _normalize_penalty(getParam<bool>("normalize_penalty")),
    _penetration_locator(
        getPenetrationLocator(getParam<BoundaryName>("master"),
                              getParam<BoundaryName>("boundary"),
                              Utility::string_to_enum<Order>(getParam<MooseEnum>("order")))),
    _penalty(getParam<Real>("penalty")),
    _friction_coefficient(getParam<Real>("friction_coefficient")),
    _residual_copy(_sys.residualGhosted()),
    _vars(3, libMesh::invalid_uint),
    _mesh_dimension(_mesh.dimension()),
    _nodal_area_var(getVar("nodal_area", 0)),
    _aux_system(_nodal_area_var->sys()),
    _aux_solution(_aux_system.currentSolution())
{
  if (isParamValid("displacements"))
  {
    // modern parameter scheme for displacements
    for (unsigned int i = 0; i < coupledComponents("displacements"); ++i)
      _vars[i] = coupled("displacements", i);
  }
  else
  {
    // Legacy parameter scheme for displacements
    if (isParamValid("disp_x"))
      _vars[0] = coupled("disp_x");
    if (isParamValid("disp_y"))
      _vars[1] = coupled("disp_y");
    if (isParamValid("disp_z"))
      _vars[2] = coupled("disp_z");

    mooseDeprecated("use the `displacements` parameter rather than the `disp_*` parameters (those "
                    "will go away with the deprecation of the Solid Mechanics module).");
  }

  if (parameters.isParamValid("tangential_tolerance"))
    _penetration_locator.setTangentialTolerance(getParam<Real>("tangential_tolerance"));

  if (parameters.isParamValid("normal_smoothing_distance"))
    _penetration_locator.setNormalSmoothingDistance(getParam<Real>("normal_smoothing_distance"));

  if (parameters.isParamValid("normal_smoothing_method"))
    _penetration_locator.setNormalSmoothingMethod(
        parameters.get<std::string>("normal_smoothing_method"));
}
Exemplo n.º 7
0
ContactMaster::ContactMaster(const std::string & name, InputParameters parameters) :
  DiracKernel(name, parameters),
  _component(getParam<unsigned int>("component")),
  _model(contactModel(getParam<std::string>("model"))),
  _formulation(contactFormulation(getParam<std::string>("formulation"))),
  _normalize_penalty(getParam<bool>("normalize_penalty")),
  _penetration_locator(getPenetrationLocator(getParam<BoundaryName>("boundary"), getParam<BoundaryName>("slave"), Utility::string_to_enum<Order>(getParam<MooseEnum>("order")))),
  _penalty(getParam<Real>("penalty")),
  _friction_coefficient(getParam<Real>("friction_coefficient")),
  _tension_release(getParam<Real>("tension_release")),
  _updateContactSet(true),
  _time_last_called(-std::numeric_limits<Real>::max()),
  _residual_copy(_sys.residualGhosted()),
  _x_var(isCoupled("disp_x") ? coupled("disp_x") : 99999),
  _y_var(isCoupled("disp_y") ? coupled("disp_y") : 99999),
  _z_var(isCoupled("disp_z") ? coupled("disp_z") : 99999),
  _mesh_dimension(_mesh.dimension()),
  _vars(_x_var, _y_var, _z_var),
  _nodal_area_var(getVar("nodal_area", 0)),
  _aux_system( _nodal_area_var->sys() ),
  _aux_solution( _aux_system.currentSolution() )

{
  if (parameters.isParamValid("tangential_tolerance"))
  {
    _penetration_locator.setTangentialTolerance(getParam<Real>("tangential_tolerance"));
  }
  if (parameters.isParamValid("normal_smoothing_distance"))
  {
    _penetration_locator.setNormalSmoothingDistance(getParam<Real>("normal_smoothing_distance"));
  }
  if (parameters.isParamValid("normal_smoothing_method"))
  {
    _penetration_locator.setNormalSmoothingMethod(parameters.get<std::string>("normal_smoothing_method"));
  }
  if (_model == CM_GLUED ||
      (_model == CM_COULOMB && _formulation == CF_DEFAULT))
  {
    _penetration_locator.setUpdate(false);
  }
  if (_friction_coefficient < 0)
  {
    mooseError("The friction coefficient must be nonnegative");
  }
}
// DEPRECATED CONSTRUCTOR
GapHeatPointSourceMaster::GapHeatPointSourceMaster(const std::string & deprecated_name, InputParameters parameters)
  :DiracKernel(deprecated_name, parameters),
   _penetration_locator(getPenetrationLocator(getParam<BoundaryName>("boundary"), getParam<BoundaryName>("slave"), Utility::string_to_enum<Order>(getParam<MooseEnum>("order")))),
   _slave_flux(_sys.getVector("slave_flux"))
{
  if (parameters.isParamValid("tangential_tolerance"))
  {
    _penetration_locator.setTangentialTolerance(getParam<Real>("tangential_tolerance"));
  }
  if (parameters.isParamValid("normal_smoothing_distance"))
  {
    _penetration_locator.setNormalSmoothingDistance(getParam<Real>("normal_smoothing_distance"));
  }
  if (parameters.isParamValid("normal_smoothing_method"))
  {
    _penetration_locator.setNormalSmoothingMethod(parameters.get<std::string>("normal_smoothing_method"));
  }
}