55 template<
class TSparseSpace,
class TDenseSpace>
100 const bool PrintingOutput =
false,
101 const bool ComputeDynamicFactor =
false,
102 const bool GiDIODebug =
false
103 ) :
BaseType(ComputeDynamicFactor, GiDIODebug)
106 BaseType::mOptions.
Set(ALMFrictionlessComponentsMortarConvergenceCriteria::PRINTING_OUTPUT, PrintingOutput);
107 BaseType::mOptions.
Set(ALMFrictionlessComponentsMortarConvergenceCriteria::TABLE_IS_INITIALIZED,
false);
143 typename ConvergenceCriteriaBaseType::Pointer
Create(
Parameters ThisParameters)
const override
145 return Kratos::make_shared<ClassType>(ThisParameters);
194 if (!r_process_info[ACTIVE_SET_COMPUTED]) {
198 r_process_info[ACTIVE_SET_CONVERGED] = is_converged == 0 ? true :
false;
199 r_process_info[ACTIVE_SET_COMPUTED] =
true;
203 const bool active_set_converged = r_process_info[ACTIVE_SET_CONVERGED];
206 if (r_process_info.
Has(TABLE_UTILITY)) {
208 auto& r_table = p_table->GetTable();
209 if (active_set_converged) {
210 if (
BaseType::mOptions.IsNot(ALMFrictionlessComponentsMortarConvergenceCriteria::PRINTING_OUTPUT))
213 r_table <<
"Achieved";
215 if (
BaseType::mOptions.IsNot(ALMFrictionlessComponentsMortarConvergenceCriteria::PRINTING_OUTPUT))
218 r_table <<
"Not achieved";
221 if (active_set_converged) {
222 if (
BaseType::mOptions.IsNot(ALMFrictionlessComponentsMortarConvergenceCriteria::PRINTING_OUTPUT))
223 KRATOS_INFO(
"ALMFrictionlessComponentsMortarConvergenceCriteria") <<
BOLDFONT(
"\tActive set") <<
" convergence is " <<
BOLDFONT(
FGRN(
"achieved")) << std::endl;
225 KRATOS_INFO(
"ALMFrictionlessComponentsMortarConvergenceCriteria") <<
"\tActive set convergence is achieved" << std::endl;
227 if (
BaseType::mOptions.IsNot(ALMFrictionlessComponentsMortarConvergenceCriteria::PRINTING_OUTPUT))
228 KRATOS_INFO(
"ALMFrictionlessComponentsMortarConvergenceCriteria") <<
BOLDFONT(
"\tActive set") <<
" convergence is " <<
BOLDFONT(
FRED(
"not achieved")) << std::endl;
230 KRATOS_INFO(
"ALMFrictionlessComponentsMortarConvergenceCriteria") <<
"\tActive set convergence is not achieved" << std::endl;
235 return active_set_converged;
248 if (r_process_info.
Has(TABLE_UTILITY) &&
BaseType::mOptions.
IsNot(ALMFrictionlessComponentsMortarConvergenceCriteria::TABLE_IS_INITIALIZED)) {
250 auto& r_table = p_table->GetTable();
251 r_table.AddColumn(
"ACTIVE SET CONV", 15);
252 BaseType::mOptions.
Set(ALMFrictionlessComponentsMortarConvergenceCriteria::TABLE_IS_INITIALIZED,
true);
264 "name" : "alm_frictionless_components_mortar_criteria",
265 "print_convergence_criterion" : false
271 return default_parameters;
280 return "alm_frictionless_components_mortar_criteria";
296 std::string
Info()
const override
298 return "ALMFrictionlessComponentsMortarConvergenceCriteria";
339 BaseType::mOptions.
Set(ALMFrictionlessComponentsMortarConvergenceCriteria::PRINTING_OUTPUT, ThisParameters[
"print_convergence_criterion"].GetBool());
340 BaseType::mOptions.
Set(ALMFrictionlessComponentsMortarConvergenceCriteria::TABLE_IS_INITIALIZED,
false);
350 template<
class TSparseSpace,
class TDenseSpace>
352 template<
class TSparseSpace,
class TDenseSpace>
Custom convergence criteria for the mortar condition for frictionless case with components.
Definition: alm_frictionless_components_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
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
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
#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
std::size_t ComputeALMFrictionlessComponentsActiveSet(ModelPart &rModelPart)
This function computes the active set for penalty frictionless cases.
Definition: active_set_utilities.cpp:217
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21