62 template<
class TSparseSpace,
class TDenseSpace>
102 const bool ComputeDynamicFactor =
false,
103 const bool IODebug =
false,
104 const bool PureSlip =
false
110 mOptions.
Set(BaseMortarConvergenceCriteria::COMPUTE_DYNAMIC_FACTOR, ComputeDynamicFactor);
111 mOptions.
Set(BaseMortarConvergenceCriteria::IO_DEBUG, IODebug);
112 mOptions.
Set(BaseMortarConvergenceCriteria::PURE_SLIP, PureSlip);
114 if (
mOptions.
Is(BaseMortarConvergenceCriteria::IO_DEBUG)) {
156 return Kratos::make_shared<ClassType>(ThisParameters);
185 ComputeNodesMeanNormalModelPartWithPairedNormal(rModelPart);
189 const bool frictional_problem = rModelPart.
IsDefined(SLIP) ? rModelPart.
Is(SLIP) :
false;
190 if (frictional_problem) {
192 if (has_lm &&
mOptions.
IsNot(BaseMortarConvergenceCriteria::PURE_SLIP)) {
199 const bool adapt_penalty = r_process_info.
Has(ADAPT_PENALTY) ? r_process_info.
GetValue(ADAPT_PENALTY) :
false;
203 if (adapt_penalty || dynamic_case) {
212 if ( dynamic_case &&
mOptions.
Is(BaseMortarConvergenceCriteria::COMPUTE_DYNAMIC_FACTOR)) {
214 compute_dynamic_factor_process.
Execute();
218 if ( adapt_penalty ) {
220 aalm_adaptation_of_penalty.
Execute();
256 if (
mOptions.
Is(BaseMortarConvergenceCriteria::IO_DEBUG)) {
257 const bool frictional_problem = rModelPart.
IsDefined(SLIP) ? rModelPart.
Is(SLIP) :
false;
258 const int nl_iter = rModelPart.
GetProcessInfo()[NL_ITERATION_NUMBER];
259 const double label =
static_cast<double>(nl_iter);
262 mpIO->InitializeMesh(
label);
263 mpIO->WriteMesh(rModelPart.
GetMesh());
264 mpIO->FinalizeMesh();
268 mpIO->WriteNodalFlags(INTERFACE,
"INTERFACE", rModelPart.
Nodes(),
label);
269 mpIO->WriteNodalFlags(ACTIVE,
"ACTIVE", rModelPart.
Nodes(),
label);
270 mpIO->WriteNodalFlags(SLAVE,
"SLAVE", rModelPart.
Nodes(),
label);
271 mpIO->WriteNodalFlags(ISOLATED,
"ISOLATED", rModelPart.
Nodes(),
label);
272 mpIO->WriteNodalResults(NORMAL, rModelPart.
Nodes(),
label, 0);
273 mpIO->WriteNodalResultsNonHistorical(DYNAMIC_FACTOR, rModelPart.
Nodes(),
label);
274 mpIO->WriteNodalResultsNonHistorical(AUGMENTED_NORMAL_CONTACT_PRESSURE, rModelPart.
Nodes(),
label);
275 mpIO->WriteNodalResults(DISPLACEMENT, rModelPart.
Nodes(),
label, 0);
276 if (rModelPart.
Nodes().begin()->SolutionStepsDataHas(VELOCITY_X)) {
277 mpIO->WriteNodalResults(VELOCITY, rModelPart.
Nodes(),
label, 0);
278 mpIO->WriteNodalResults(ACCELERATION, rModelPart.
Nodes(),
label, 0);
280 if (r_nodes_array.begin()->SolutionStepsDataHas(LAGRANGE_MULTIPLIER_CONTACT_PRESSURE))
281 mpIO->WriteNodalResults(LAGRANGE_MULTIPLIER_CONTACT_PRESSURE, rModelPart.
Nodes(),
label, 0);
282 else if (r_nodes_array.begin()->SolutionStepsDataHas(VECTOR_LAGRANGE_MULTIPLIER_X))
283 mpIO->WriteNodalResults(VECTOR_LAGRANGE_MULTIPLIER, rModelPart.
Nodes(),
label, 0);
284 mpIO->WriteNodalResults(WEIGHTED_GAP, rModelPart.
Nodes(),
label, 0);
285 if (frictional_problem) {
286 mpIO->WriteNodalFlags(SLIP,
"SLIP", rModelPart.
Nodes(),
label);
287 mpIO->WriteNodalResults(WEIGHTED_SLIP, rModelPart.
Nodes(),
label, 0);
288 mpIO->WriteNodalResultsNonHistorical(AUGMENTED_TANGENT_CONTACT_PRESSURE, rModelPart.
Nodes(),
label);
306 r_process_info.
SetValue(ACTIVE_SET_COMPUTED,
false);
328 const bool frictional_problem = rModelPart.
IsDefined(SLIP) ? rModelPart.
Is(SLIP) :
false;
329 if (frictional_problem) {
331 if (has_lm &&
mOptions.
IsNot(BaseMortarConvergenceCriteria::PURE_SLIP)) {
339 if (
mOptions.
Is(BaseMortarConvergenceCriteria::IO_DEBUG)) {
340 mpIO->CloseResultFile();
341 std::ostringstream new_name ;
342 new_name <<
"POST_LINEAR_ITER_STEP=""POST_LINEAR_ITER_STEP=" << rModelPart.
GetProcessInfo()[STEP];
343 mpIO->ChangeOutputName(new_name.str());
364 if (
mOptions.
Is(BaseMortarConvergenceCriteria::IO_DEBUG)) {
365 mpIO->FinalizeResults();
390 r_process_info.
SetValue(ACTIVE_SET_COMPUTED,
false);
401 "name" : "base_mortar_criteria",
402 "compute_dynamic_factor" : false,
403 "gidio_debug" : false,
410 return default_parameters;
419 return "base_mortar_criteria";
435 std::string
Info()
const override
437 return "BaseMortarConvergenceCriteria";
480 mOptions.
Set(BaseMortarConvergenceCriteria::COMPUTE_DYNAMIC_FACTOR, ThisParameters[
"compute_dynamic_factor"].GetBool());
481 mOptions.
Set(BaseMortarConvergenceCriteria::IO_DEBUG, ThisParameters[
"gidio_debug"].GetBool());
482 mOptions.
Set(BaseMortarConvergenceCriteria::PURE_SLIP, ThisParameters[
"pure_slip"].GetBool());
484 if (
mOptions.
Is(BaseMortarConvergenceCriteria::IO_DEBUG)) {
508 GidIOBaseType::Pointer mpIO;
522 inline void ComputeNodesMeanNormalModelPartWithPairedNormal(
ModelPart& rModelPart)
530 auto& r_conditions_array = r_computing_contact_model_part.
Conditions();
549 template<
class TSparseSpace,
class TDenseSpace>
551 template<
class TSparseSpace,
class TDenseSpace>
553 template<
class TSparseSpace,
class TDenseSpace>
This process is used in order to adapt the penalty in the ALM formulation.
Definition: aalm_adapt_penalty_value_process.h:50
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: aalm_adapt_penalty_value_process.cpp:25
Custom convergence criteria for the mortar condition.
Definition: base_mortar_criteria.h:65
This process is used in order to compute the dynamic factor for dynamic problems.
Definition: compute_dynamic_factor_process.h:49
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: compute_dynamic_factor_process.cpp:24
Base class for all Conditions.
Definition: condition.h:59
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
TSparseSpace::MatrixType TSystemMatrixType
Matrix type definition.
Definition: convergence_criteria.h:72
ModelPart::DofsArrayType DofsArrayType
DoF array type definition.
Definition: convergence_criteria.h:81
virtual Parameters GetDefaultParameters() const
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: convergence_criteria.h:384
virtual void Initialize(ModelPart &rModelPart)
This function initialize the convergence criteria.
Definition: convergence_criteria.h:276
virtual void FinalizeNonLinearIteration(ModelPart &rModelPart, DofsArrayType &rDofSet, const TSystemMatrixType &rA, const TSystemVectorType &rDx, const TSystemVectorType &rb)
This function finalizes the non-linear iteration.
Definition: convergence_criteria.h:356
TSparseSpace::VectorType TSystemVectorType
Vector type definition.
Definition: convergence_criteria.h:74
virtual void AssignSettings(const Parameters ThisParameters)
This method assigns settings to member variables.
Definition: convergence_criteria.h:479
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 SetValue(const Variable< TDataType > &rThisVariable, TDataType const &rValue)
Sets the value for a given variable.
Definition: data_value_container.h:320
TDataType & GetValue(const Variable< TDataType > &rThisVariable)
Gets the value associated with a given variable.
Definition: data_value_container.h:268
void Set(const Flags ThisFlag)
Definition: flags.cpp:33
bool IsDefined(Flags const &rOther) const
Definition: flags.h:279
bool Is(Flags const &rOther) const
Definition: flags.h:274
static Flags Create(IndexType ThisPosition, bool Value=true)
Definition: flags.h:138
bool IsNot(Flags const &rOther) const
Definition: flags.h:291
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
void SetValue(const TVariableType &rThisVariable, typename TVariableType::Type const &rValue)
Definition: geometrical_object.h:238
Geometry base class.
Definition: geometry.h:71
virtual array_1d< double, 3 > UnitNormal(const CoordinatesArrayType &rPointLocalCoordinates) const
It computes the unit normal of the geometry in the given local point.
Definition: geometry.h:1639
virtual CoordinatesArrayType & PointLocalCoordinates(CoordinatesArrayType &rResult, const CoordinatesArrayType &rPoint) const
Returns the local coordinates of a given arbitrary point.
Definition: geometry.h:1854
virtual Point Center() const
Definition: geometry.h:1514
This class defines an interface to the GiDPost library in order to provide GiD compliant I/O function...
Definition: gid_io.h:112
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
bool HasNodalSolutionStepVariable(VariableData const &ThisVariable) const
Definition: model_part.h:544
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
ModelPart & GetSubModelPart(std::string const &SubModelPartName)
Definition: model_part.cpp:2029
MeshType & GetMesh(IndexType ThisIndex=0)
Definition: model_part.h:1791
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
TVariableType::Type & FastGetSolutionStepValue(const TVariableType &rThisVariable)
Definition: node.h:435
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
void ComputeNodesTangentModelPart(ModelPart &rModelPart, const Variable< array_1d< double, 3 >> *pSlipVariable, const double SlipCoefficient, const bool SlipAlways)
It computes the tangent in all the nodes of the model part.
Definition: mortar_utilities.cpp:149
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
@ WriteUndeformed
Definition: gid_io.h:52
@ SingleFile
Definition: gid_io.h:54
NormalDerivativesComputation
An enumeration of the different options for normal derivatives computation.
Definition: contact_structural_mechanics_application_variables.h:57
@ NO_DERIVATIVES_COMPUTATION
No computation of normal derivatives.
void block_for_each(TIterator itBegin, TIterator itEnd, TFunction &&rFunction)
Execute a functor on all items of a range in parallel.
Definition: parallel_utilities.h:299
@ WriteElementsOnly
Definition: gid_io.h:53
Tool to evaluate the normals on nodes based on the normals of a set of surface conditions.
label
Definition: angle_finder.py:48