55 template<
class TSparseSpace,
class TDenseSpace>
92 static constexpr
double Tolerance = std::numeric_limits<double>::epsilon();
100 const bool PureSlip =
false,
101 const bool PrintingOutput =
false,
102 const bool ComputeDynamicFactor =
true,
103 const bool IODebug =
false
104 ) :
BaseType(ComputeDynamicFactor, IODebug, PureSlip)
144 typename ConvergenceCriteriaBaseType::Pointer
Create(
Parameters ThisParameters)
const override
146 return Kratos::make_shared<ClassType>(ThisParameters);
195 const bool active_set_converged = (is_converged[0] + is_converged[1]) == 0 ?
true :
false;
199 r_process_info[ACTIVE_SET_CONVERGED] = active_set_converged;
202 if (r_process_info.
Has(TABLE_UTILITY)) {
204 auto& r_table = p_table->GetTable();
205 if (is_converged[0] == 0) {
206 if (
BaseType::mOptions.IsNot(PenaltyFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT))
209 r_table <<
"Achieved";
211 if (
BaseType::mOptions.IsNot(PenaltyFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT))
214 r_table <<
"Not achieved";
216 if (is_converged[1] == 0) {
217 if (
BaseType::mOptions.IsNot(PenaltyFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT))
220 r_table <<
"Achieved";
222 if (
BaseType::mOptions.IsNot(PenaltyFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT))
225 r_table <<
"Not achieved";
228 if (is_converged[0] == 0) {
229 if (
BaseType::mOptions.IsNot(PenaltyFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT))
230 KRATOS_INFO(
"PenaltyFrictionalMortarConvergenceCriteria") <<
BOLDFONT(
"\tActive set") <<
" convergence is " <<
BOLDFONT(
FGRN(
"achieved")) << std::endl;
232 KRATOS_INFO(
"PenaltyFrictionalMortarConvergenceCriteria") <<
"\tActive set convergence is achieved" << std::endl;
234 if (
BaseType::mOptions.IsNot(PenaltyFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT))
235 KRATOS_INFO(
"PenaltyFrictionalMortarConvergenceCriteria") <<
BOLDFONT(
"\tActive set") <<
" convergence is " <<
BOLDFONT(
FRED(
"not achieved")) << std::endl;
237 KRATOS_INFO(
"PenaltyFrictionalMortarConvergenceCriteria") <<
"\tActive set convergence is not achieved" << std::endl;
240 if (is_converged[1] == 0) {
241 if (
BaseType::mOptions.IsNot(PenaltyFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT))
242 KRATOS_INFO(
"PenaltyFrictionalMortarConvergenceCriteria") <<
BOLDFONT(
"\tSlip/stick set") <<
" convergence is " <<
BOLDFONT(
FGRN(
"achieved")) << std::endl;
244 KRATOS_INFO(
"PenaltyFrictionalMortarConvergenceCriteria") <<
"\tSlip/stick set convergence is achieved" << std::endl;
246 if (
BaseType::mOptions.IsNot(PenaltyFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT))
247 KRATOS_INFO(
"PenaltyFrictionalMortarConvergenceCriteria") <<
BOLDFONT(
"\tSlip/stick set") <<
" convergence is " <<
BOLDFONT(
FRED(
"not achieved")) << std::endl;
249 KRATOS_INFO(
"PenaltyFrictionalMortarConvergenceCriteria") <<
"\tSlip/stick set convergence is not achieved" << std::endl;
254 return active_set_converged;
266 if (r_process_info.
Has(TABLE_UTILITY) &&
BaseType::mOptions.
IsNot(PenaltyFrictionalMortarConvergenceCriteria::TABLE_IS_INITIALIZED)) {
268 auto& r_table = p_table->GetTable();
269 r_table.AddColumn(
"ACTIVE SET CONV", 15);
270 r_table.AddColumn(
"SLIP/STICK CONV", 15);
283 "name" : "penalty_frictional_mortar_criteria",
284 "print_convergence_criterion" : false
290 return default_parameters;
299 return "penalty_frictional_mortar_criteria";
315 std::string
Info()
const override
317 return "PenaltyFrictionalMortarConvergenceCriteria";
358 BaseType::mOptions.
Set(PenaltyFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT, ThisParameters[
"print_convergence_criterion"].GetBool());
384 template<
class TSparseSpace,
class TDenseSpace>
386 template<
class TSparseSpace,
class TDenseSpace>
Custom convergence criteria for the mortar condition.
Definition: base_mortar_criteria.h:65
virtual int MyPID() const
Definition: communicator.cpp:91
This is the base class to define the different convergence criterion considered.
Definition: convergence_criteria.h:58
int GetEchoLevel()
This returns the level of echo for the solving strategy.
Definition: convergence_criteria.h:209
virtual Parameters ValidateAndAssignParameters(Parameters ThisParameters, const Parameters DefaultParameters) const
This method validate and assign default parameters.
Definition: convergence_criteria.h:466
bool mConvergenceCriteriaIsInitialized
This "flag" is set in order to know if it is necessary to actualize the RHS.
Definition: convergence_criteria.h:448
bool Has(const Variable< TDataType > &rThisVariable) const
Checks if the data container has a value associated with a given variable.
Definition: data_value_container.h:382
void Set(const Flags ThisFlag)
Definition: flags.cpp:33
static Flags Create(IndexType ThisPosition, bool Value=true)
Definition: flags.h:138
bool IsNot(Flags const &rOther) const
Definition: flags.h:291
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
Communicator & GetCommunicator()
Definition: model_part.h:1821
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
ModelPart & GetSubModelPart(std::string const &SubModelPartName)
Definition: model_part.cpp:2029
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
void RecursivelyAddMissingParameters(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing contain at least all parameters...
Definition: kratos_parameters.cpp:1457
Custom convergence criteria for the mortar condition for frictional case.
Definition: penalty_frictional_mortar_criteria.h:58
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
This class implements a set of auxiliar, already parallelized, methods to perform some common tasks r...
Definition: variable_utils.h:63
void SetVariable(const TVarType &rVariable, const TDataType &rValue, NodesContainerType &rNodes, const unsigned int Step=0)
Sets the nodal value of a scalar variable.
Definition: variable_utils.h:675
Short class definition.
Definition: array_1d.h:61
#define FGRN(x)
Definition: color_utilities.h:27
#define FRED(x)
Definition: color_utilities.h:26
#define BOLDFONT(x)
Definition: color_utilities.h:34
#define KRATOS_INFO(label)
Definition: logger.h:250
array_1d< std::size_t, 2 > ComputePenaltyFrictionalActiveSet(ModelPart &rModelPart, const bool PureSlip, const SizeType EchoLevel)
This function computes the active set for penalty frictional cases.
Definition: active_set_utilities.cpp:68
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561