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 =
false,
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 if (!r_process_info[ACTIVE_SET_COMPUTED]) {
199 r_process_info[ACTIVE_SET_CONVERGED] = is_converged[0] == 0 ? true :
false;
200 r_process_info[SLIP_SET_CONVERGED] = is_converged[1] == 0 ? true :
false;
201 r_process_info[ACTIVE_SET_COMPUTED] =
true;
205 const bool active_set_converged = r_process_info[ACTIVE_SET_CONVERGED];
206 const bool slip_set_converged = r_process_info[SLIP_SET_CONVERGED];
209 if (r_process_info.
Has(TABLE_UTILITY)) {
211 auto& r_table = p_table->GetTable();
212 if (active_set_converged) {
213 if (
BaseType::mOptions.IsNot(ALMFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT))
216 r_table <<
"Achieved";
218 if (
BaseType::mOptions.IsNot(ALMFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT))
221 r_table <<
"Not achieved";
224 if (slip_set_converged) {
225 if (
BaseType::mOptions.IsNot(ALMFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT))
228 r_table <<
"Achieved";
230 if (
BaseType::mOptions.IsNot(ALMFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT))
233 r_table <<
"Not achieved";
237 if (active_set_converged) {
238 if (
BaseType::mOptions.IsNot(ALMFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT))
241 KRATOS_INFO(
"ALMFrictionalMortarConvergenceCriteria") <<
"\tActive set convergence is achieved" << std::endl;
243 if (
BaseType::mOptions.IsNot(ALMFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT))
244 KRATOS_INFO(
"ALMFrictionalMortarConvergenceCriteria") <<
BOLDFONT(
"\tActive set") <<
" convergence is " <<
BOLDFONT(
FRED(
"not achieved")) << std::endl;
246 KRATOS_INFO(
"ALMFrictionalMortarConvergenceCriteria") <<
"\tActive set convergence is not achieved" << std::endl;
250 if (slip_set_converged) {
251 if (
BaseType::mOptions.IsNot(ALMFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT))
252 KRATOS_INFO(
"ALMFrictionalMortarConvergenceCriteria") <<
BOLDFONT(
"\tSlip/stick set") <<
" convergence is " <<
BOLDFONT(
FGRN(
"achieved")) << std::endl;
254 KRATOS_INFO(
"ALMFrictionalMortarConvergenceCriteria") <<
"\tSlip/stick set convergence is achieved" << std::endl;
256 if (
BaseType::mOptions.IsNot(ALMFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT))
257 KRATOS_INFO(
"ALMFrictionalMortarConvergenceCriteria") <<
BOLDFONT(
"\tSlip/stick set") <<
" convergence is " <<
BOLDFONT(
FRED(
"not achieved")) << std::endl;
259 KRATOS_INFO(
"ALMFrictionalMortarConvergenceCriteria") <<
"\tSlip/stick set convergence is not achieved" << std::endl;
265 return (active_set_converged && slip_set_converged);
278 if (r_process_info.
Has(TABLE_UTILITY) &&
BaseType::mOptions.
IsNot(ALMFrictionalMortarConvergenceCriteria::TABLE_IS_INITIALIZED)) {
280 auto& r_table = p_table->GetTable();
281 r_table.AddColumn(
"ACTIVE SET CONV", 15);
283 r_table.AddColumn(
"SLIP/STICK CONV", 15);
297 "name" : "alm_frictional_mortar_criteria",
298 "print_convergence_criterion" : false
304 return default_parameters;
313 return "alm_frictional_mortar_criteria";
329 std::string
Info()
const override
331 return "ALMFrictionalMortarConvergenceCriteria";
372 BaseType::mOptions.
Set(ALMFrictionalMortarConvergenceCriteria::PRINTING_OUTPUT, ThisParameters[
"print_convergence_criterion"].GetBool());
398 template<
class TSparseSpace,
class TDenseSpace>
400 template<
class TSparseSpace,
class TDenseSpace>
Custom convergence criteria for the mortar condition for frictional case.
Definition: alm_frictional_mortar_criteria.h:58
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 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
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 > ComputeALMFrictionalActiveSet(ModelPart &rModelPart, const bool PureSlip, const SizeType EchoLevel)
This function computes the active set for penalty frictional cases.
Definition: active_set_utilities.cpp:265
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561