This class implements a custom line search for use with mechanical contact. More...
#include <ContactLineSearchBase.h>
Public Types | |
typedef DataFileName | DataFileParameterType |
Public Member Functions | |
ContactLineSearchBase (const InputParameters ¶meters) | |
void | printContactInfo (const std::set< dof_id_type > &contact_set) |
Method for printing the contact information. More... | |
void | insertSet (const std::set< dof_id_type > &mech_set) |
Unionize sets from different constraints. More... | |
virtual void | reset () |
Reset the line search data. More... | |
void | zeroIts () |
size_t | nlIts () const |
virtual void | lineSearch () |
virtual void | timestepSetup () |
virtual void | customSetup (const ExecFlagType &) |
virtual void | initialSetup () |
virtual bool | enabled () const |
std::shared_ptr< MooseObject > | getSharedPtr () |
std::shared_ptr< const MooseObject > | getSharedPtr () const |
MooseApp & | getMooseApp () const |
const std::string & | type () const |
virtual const std::string & | name () const |
std::string | typeAndName () const |
std::string | errorPrefix (const std::string &error_type) const |
void | callMooseError (std::string msg, const bool with_prefix) const |
MooseObjectParameterName | uniqueParameterName (const std::string ¶meter_name) const |
const InputParameters & | parameters () const |
MooseObjectName | uniqueName () const |
const T & | getParam (const std::string &name) const |
std::vector< std::pair< T1, T2 > > | getParam (const std::string ¶m1, const std::string ¶m2) const |
const T & | getRenamedParam (const std::string &old_name, const std::string &new_name) const |
T | getCheckedPointerParam (const std::string &name, const std::string &error_string="") const |
bool | isParamValid (const std::string &name) const |
bool | isParamSetByUser (const std::string &nm) const |
void | paramError (const std::string ¶m, Args... args) const |
void | paramWarning (const std::string ¶m, Args... args) const |
void | paramInfo (const std::string ¶m, Args... args) const |
void | connectControllableParams (const std::string ¶meter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const |
void | mooseError (Args &&... args) const |
void | mooseErrorNonPrefixed (Args &&... args) const |
void | mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const |
void | mooseWarning (Args &&... args) const |
void | mooseWarningNonPrefixed (Args &&... args) const |
void | mooseDeprecated (Args &&... args) const |
void | mooseInfo (Args &&... args) const |
std::string | getDataFileName (const std::string ¶m) const |
std::string | getDataFileNameByName (const std::string &name, const std::string *param=nullptr) const |
const Parallel::Communicator & | comm () const |
processor_id_type | n_processors () const |
processor_id_type | processor_id () const |
Static Public Member Functions | |
static InputParameters | validParams () |
Public Attributes | |
const ConsoleStream | _console |
Protected Attributes | |
std::set< dof_id_type > | _current_contact_state |
The current contact set. More... | |
std::set< dof_id_type > | _old_contact_state |
The old contact set. More... | |
Real | _user_ksp_rtol |
the linear tolerance set by the user in the input file More... | |
bool | _user_ksp_rtol_set |
Whether the user linear tolerance has been set yet in this object. More... | |
Real | _contact_lambda |
The multiplier of the newton step. More... | |
unsigned | _allowed_lambda_cuts |
How many times the linsearch is allowed to cut lambda. More... | |
Real | _contact_ltol |
What the linear tolerance should be while the contact state is changing. More... | |
bool | _affect_ltol |
Whether to modify the linear tolerance. More... | |
FEProblem & | _fe_problem |
size_t | _nl_its |
const bool & | _enabled |
MooseApp & | _app |
const std::string | _type |
const std::string | _name |
const InputParameters & | _pars |
Factory & | _factory |
ActionFactory & | _action_factory |
const Parallel::Communicator & | _communicator |
This class implements a custom line search for use with mechanical contact.
The line search is not fancy. It takes two parameters, set in the MOOSE Executioner block: contact_line_search_ltol
and contact_line_search_allowed_lambda_cuts
. The allowed_lambda_cuts parameter specifies the number of times the line search is allowed to cut lambda. If allowed to be cut, lambda will be reduced by half, and a new residual will be evaluated. If the residual is smaller with a smaller lambda, then cuts will continue until reaching allowed_lambda_cuts. If the residual is larger with a smaller lambda, then the line search is curtailed and the smaller residual is used. It's recommended that allowed_lambda_cuts be <= 3, with smaller values being used for smaller contact problems. This is to allow necessary residual increases when the transient problem requires significant changes in the contact state.
When the contact set is changing, the user may optionally use a looser linear tolerance set by the contact_line_search_ltol
parameter. Then when the contact set is changing during the beginning of the Newton solve, unnecessary computational expense is avoided. Then when the contact set is resolved late in the Newton solve, the linear tolerance will return to the finer tolerance set through the traditional l_tol
parameter.
Definition at line 34 of file ContactLineSearchBase.h.
ContactLineSearchBase::ContactLineSearchBase | ( | const InputParameters & | parameters | ) |
Definition at line 34 of file ContactLineSearchBase.C.
void ContactLineSearchBase::insertSet | ( | const std::set< dof_id_type > & | mech_set | ) |
Unionize sets from different constraints.
Definition at line 53 of file ContactLineSearchBase.C.
Referenced by MechanicalContactConstraint::residualEnd().
void ContactLineSearchBase::printContactInfo | ( | const std::set< dof_id_type > & | contact_set | ) |
Method for printing the contact information.
Definition at line 44 of file ContactLineSearchBase.C.
Referenced by PetscContactLineSearch::lineSearch().
|
virtual |
Reset the line search data.
Definition at line 63 of file ContactLineSearchBase.C.
Referenced by MechanicalContactConstraint::timestepSetup().
|
static |
Definition at line 20 of file ContactLineSearchBase.C.
Referenced by PetscContactLineSearch::validParams().
|
protected |
Whether to modify the linear tolerance.
Definition at line 77 of file ContactLineSearchBase.h.
Referenced by PetscContactLineSearch::lineSearch().
|
protected |
How many times the linsearch is allowed to cut lambda.
Definition at line 71 of file ContactLineSearchBase.h.
Referenced by PetscContactLineSearch::lineSearch().
|
protected |
The multiplier of the newton step.
Definition at line 68 of file ContactLineSearchBase.h.
Referenced by PetscContactLineSearch::lineSearch().
|
protected |
What the linear tolerance should be while the contact state is changing.
Definition at line 74 of file ContactLineSearchBase.h.
Referenced by PetscContactLineSearch::lineSearch().
|
protected |
The current contact set.
Definition at line 58 of file ContactLineSearchBase.h.
Referenced by insertSet(), PetscContactLineSearch::lineSearch(), and reset().
|
protected |
The old contact set.
Definition at line 60 of file ContactLineSearchBase.h.
Referenced by PetscContactLineSearch::lineSearch().
|
protected |
the linear tolerance set by the user in the input file
Definition at line 63 of file ContactLineSearchBase.h.
Referenced by PetscContactLineSearch::lineSearch().
|
protected |
Whether the user linear tolerance has been set yet in this object.
Definition at line 65 of file ContactLineSearchBase.h.
Referenced by PetscContactLineSearch::lineSearch().