13 #if !defined(KRATOS_RESIDUAL_BASED_BLOCK_BUILDER_AND_SOLVER_WITH_LAGRANGE_MULTIPLIER )
14 #define KRATOS_RESIDUAL_BASED_BLOCK_BUILDER_AND_SOLVER_WITH_LAGRANGE_MULTIPLIER
63 template<
class TSparseSpace,
135 typename TLinearSolver::Pointer pNewLinearSystemSolver,
137 ) :
BaseType(pNewLinearSystemSolver)
170 typename BaseBuilderAndSolverType::Pointer
Create(
171 typename TLinearSolver::Pointer pNewLinearSystemSolver,
175 return Kratos::make_shared<ClassType>(pNewLinearSystemSolver,ThisParameters);
187 typename TSchemeType::Pointer pScheme,
223 if (norm_b < std::numeric_limits<double>::epsilon()) {
227 TSparseSpace::SetToZero(rDx);
264 typename TSchemeType::Pointer pScheme,
275 if (rDx.size() != total_system_size) {
276 rDx.resize(total_system_size,
false);
277 TSparseSpace::SetToZero(rDx);
300 typename TSchemeType::Pointer pScheme,
311 if (rDx.size() != total_system_size) {
312 rDx.resize(total_system_size,
false);
313 TSparseSpace::SetToZero(rDx);
335 typename TSchemeType::Pointer pScheme,
362 typename TSchemeType::Pointer pScheme,
369 TSparseSpace::SetToZero(rb);
380 rDof.GetSolutionStepReactionValue() = -rb[rDof.EquationId()];
387 auto it_dof = it_dof_begin + equation_id;
404 typename TSchemeType::Pointer pScheme,
411 const std::size_t system_size = rA.size1();
412 Vector scaling_factors (system_size);
419 auto it_dof_iterator = it_dof_iterator_begin +
Index;
420 if (it_dof_iterator->IsFixed()) {
421 scaling_factors[Index] = 0.0;
423 scaling_factors[Index] = 1.0;
428 const std::size_t loop_size = system_size - ndofs;
431 scaling_factors[ndofs +
Index] = 1.0;
435 double* Avalues = rA.value_data().begin();
436 std::size_t* Arow_indices = rA.index1_data().begin();
437 std::size_t* Acol_indices = rA.index2_data().begin();
440 const double zero_tolerance = std::numeric_limits<double>::epsilon();
447 std::size_t col_begin = 0, col_end = 0;
450 col_begin = Arow_indices[
Index];
451 col_end = Arow_indices[
Index + 1];
453 for (std::size_t
j = col_begin;
j < col_end; ++
j) {
454 if(std::abs(Avalues[
j]) > zero_tolerance) {
467 const std::size_t col_begin = Arow_indices[
Index];
468 const std::size_t col_end = Arow_indices[
Index+1];
469 const double k_factor = scaling_factors[
Index];
470 if (k_factor == 0.0) {
472 for (std::size_t
j = col_begin;
j < col_end; ++
j)
473 if (Acol_indices[
j] !=
Index )
480 for (std::size_t
j = col_begin;
j < col_end; ++
j)
481 if(scaling_factors[ Acol_indices[
j] ] == 0 )
494 typename TSchemeType::Pointer pScheme,
539 b_modified[start_index +
Index] = 0.0;
542 rb.resize(total_size_of_system,
false);
552 TSparseSpace::Copy(b_modified, rb);
566 typename TSchemeType::Pointer pScheme,
587 SparseMatrixMultiplicationUtility::TransposeMatrix<TSystemMatrixType, TSystemMatrixType>(transpose_of_T,
BaseType::mT);
606 b_modified[start_index +
Index] = 0.0;
608 rb.resize(total_size_of_system,
false);
620 KRATOS_ERROR_IF(has_constraint_scale_factor && !r_current_process_info.
Has(CONSTRAINT_SCALE_FACTOR)) <<
"Constraint scale factor not defined at process info" << std::endl;
626 matrices_p_blocks(0,0) = ©_of_A;
627 matrices_p_blocks(0,1) = &transpose_of_T;
628 matrices_p_blocks(1,0) = ©_of_T;
631 contribution_coefficients(0, 0) = 1.0;
638 transpose_blocks(
i,
j) =
false;
646 KRATOS_ERROR_IF(has_auxiliar_constraint_scale_factor && !r_current_process_info.
Has(AUXILIAR_CONSTRAINT_SCALE_FACTOR)) <<
"Auxiliar constraint scale factor not defined at process info" << std::endl;
653 identity_matrix.push_back(
i,
i, 1.0);
656 KRATOS_ERROR_IF_NOT(identity_matrix.nnz() == number_of_slave_dofs) <<
"Inconsistent number of non-zero values in the identity matrix: " << number_of_slave_dofs <<
" vs " << identity_matrix.nnz() << std::endl;
659 matrices_p_blocks(0,2) = &transpose_of_T;
660 matrices_p_blocks(2,0) = ©_of_T;
661 matrices_p_blocks(1,1) = &identity_matrix;
662 matrices_p_blocks(1,2) = &identity_matrix;
663 matrices_p_blocks(2,1) = &identity_matrix;
664 matrices_p_blocks(2,2) = &identity_matrix;
681 matrices_p_blocks(1,1) = &zero_matrix;
684 contribution_coefficients(1, 1) = 0.0;
692 ComputeRHSLMContributions(b_lm, constraint_scale_factor);
698 TSparseSpace::Copy(b_modified, rb);
743 "name" : "ResidualBasedBlockBuilderAndSolverWithLagrangeMultiplier",
744 "consider_lagrange_multiplier_constraint_resolution" : "double",
745 "constraint_scale_factor" : "use_mean_diagonal",
746 "auxiliar_constraint_scale_factor" : "use_mean_diagonal"
752 return default_parameters;
761 return "block_builder_and_solver_with_lagrange_multiplier";
777 std::string
Info()
const override
779 return "ResidualBasedBlockBuilderAndSolverWithLagrangeMultiplier";
843 std::vector<std::unordered_set<IndexType>> indices(size_indices);
845 std::vector<LockObject> lock_array(size_indices);
847 #pragma omp parallel firstprivate(slave_dof_list, master_dof_list)
851 std::unordered_map<IndexType, std::unordered_set<IndexType>> temp_indices;
853 #pragma omp for schedule(guided, 512) nowait
854 for (
int i_const = 0; i_const < static_cast<int>(rModelPart.
MasterSlaveConstraints().size()); ++i_const) {
855 auto it_const = it_const_begin + i_const;
858 if(it_const->IsActive()) {
859 it_const->EquationIdVector(slave_ids, master_ids, r_current_process_info);
862 for (
auto &id_i : slave_ids) {
863 temp_indices[id_i].insert(id_i);
864 temp_indices[id_i].insert(master_ids.begin(), master_ids.end());
870 for (
int i = 0; i < static_cast<int>(temp_indices.size()); ++
i) {
871 lock_array[
i].lock();
872 indices[
i].insert(temp_indices[
i].begin(), temp_indices[
i].end());
873 lock_array[
i].unlock();
881 for (
int i = 0; i < static_cast<int>(size_indices); ++
i) {
882 if (indices[
i].size() == 0) {
911 for (
int i = 0; i < static_cast<int>(slave_size); ++
i) {
920 for (
auto it = indices[i_slave].begin(); it != indices[i_slave].end(); ++it) {
921 Tcol_indices[
k] = *it;
926 indices[i_slave].clear();
928 std::sort(&Tcol_indices[row_begin], &Tcol_indices[row_end]);
968 #pragma omp parallel firstprivate(transformation_matrix, constant_vector, slave_equation_ids, master_equation_ids)
970 #pragma omp for schedule(guided, 512)
971 for (
int i_const = 0; i_const < number_of_constraints; ++i_const) {
975 if (it_const->IsActive()) {
976 it_const->CalculateLocalSystem(transformation_matrix, constant_vector, r_current_process_info);
977 it_const->EquationIdVector(slave_equation_ids, master_equation_ids, r_current_process_info);
979 for (
IndexType i = 0;
i < slave_equation_ids.size(); ++
i) {
986 const double constant_value = constant_vector[
i];
1017 return ThisParameters;
1029 std::set<std::string> available_options_for_constraints_scale = {
"use_mean_diagonal",
"use_diagonal_norm",
"defined_in_process_info"};
1032 const std::string& r_constraint_scale_factor = ThisParameters[
"constraint_scale_factor"].
GetString();
1035 if (available_options_for_constraints_scale.find(r_constraint_scale_factor) == available_options_for_constraints_scale.end()) {
1036 std::stringstream msg;
1037 msg <<
"Currently prescribed constraint scale factor : " << r_constraint_scale_factor <<
"\n";
1038 msg <<
"Admissible values for the constraint scale factor are : use_mean_diagonal, use_diagonal_norm, or defined_in_process_info" <<
"\n";
1043 if (r_constraint_scale_factor ==
"use_mean_diagonal") {
1045 }
else if (r_constraint_scale_factor ==
"use_diagonal_norm") {
1052 const std::string& r_auxiliar_constraint_scale_factor = ThisParameters[
"auxiliar_constraint_scale_factor"].
GetString();
1055 if (available_options_for_constraints_scale.find(r_auxiliar_constraint_scale_factor) == available_options_for_constraints_scale.end()) {
1056 std::stringstream msg;
1057 msg <<
"Currently prescribed constraint scale factor : " << r_auxiliar_constraint_scale_factor <<
"\n";
1058 msg <<
"Admissible values for the constraint scale factor are : use_mean_diagonal, use_diagonal_norm, or defined_in_process_info" <<
"\n";
1063 if (r_auxiliar_constraint_scale_factor ==
"use_mean_diagonal") {
1065 }
else if (r_auxiliar_constraint_scale_factor ==
"use_diagonal_norm") {
1072 if (ThisParameters[
"consider_lagrange_multiplier_constraint_resolution"].GetString() ==
"double") {
1117 void ComputeRHSLMContributions(
1131 rbLM.resize(total_size_of_system,
false);
1137 auto it_dof = it_dof_begin +
Index;
1138 aux_whole_dof_vector[
Index] = it_dof->GetSolutionStepValue();
1149 IndexPartition<std::size_t>(number_of_slave_dofs).for_each([&](std::size_t
Index){
1150 rbLM[ndofs +
Index] = aux_lm_rhs_contribution[
Index];
1151 rbLM[ndofs + number_of_slave_dofs +
Index] = aux_lm_rhs_contribution[
Index];
1154 IndexPartition<std::size_t>(number_of_slave_dofs).for_each([&](std::size_t
Index){
1155 rbLM[ndofs +
Index] = aux_lm_rhs_contribution[
Index];
1161 SparseMatrixMultiplicationUtility::TransposeMatrix<TSystemMatrixType, TSystemMatrixType>(T_transpose_matrix,
BaseType::mT, -
ScaleFactor);
1164 IndexPartition<std::size_t>(ndofs).for_each([&](std::size_t
Index){
1197 template<
class TSparseSpace,
class TDenseSpace,
class TLinearSolver>
1198 const Kratos::Flags ResidualBasedBlockBuilderAndSolverWithLagrangeMultiplier<TSparseSpace, TDenseSpace, TLinearSolver>::DOUBLE_LAGRANGE_MULTIPLIER(
Kratos::Flags::Create(1));
1199 template<
class TSparseSpace,
class TDenseSpace,
class TLinearSolver>
1200 const Kratos::Flags ResidualBasedBlockBuilderAndSolverWithLagrangeMultiplier<TSparseSpace, TDenseSpace, TLinearSolver>::TRANSFORMATION_MATRIX_COMPUTED(
Kratos::Flags::Create(2));
Current class provides an implementation for the base builder and solving operations.
Definition: builder_and_solver.h:64
std::size_t IndexType
Definition of the index type.
Definition: builder_and_solver.h:76
TSparseSpace::VectorType TSystemVectorType
Definition of the vector size.
Definition: builder_and_solver.h:85
TSparseSpace::MatrixType TSystemMatrixType
Definition of the sparse matrix.
Definition: builder_and_solver.h:82
TDenseSpace::MatrixType LocalSystemMatrixType
The local matrix definition.
Definition: builder_and_solver.h:94
TSparseSpace::VectorPointerType TSystemVectorPointerType
Definition of the pointer to the vector.
Definition: builder_and_solver.h:91
TSparseSpace::DataType TDataType
Definition of the data type.
Definition: builder_and_solver.h:79
TLinearSolver::Pointer mpLinearSystemSolver
Definition: builder_and_solver.h:737
DofsArrayType mDofSet
Pointer to the linear solver.
Definition: builder_and_solver.h:739
TDenseSpace::VectorType LocalSystemVectorType
The local vector definition.
Definition: builder_and_solver.h:97
TSparseSpace::MatrixPointerType TSystemMatrixPointerType
Definition of the pointer to the sparse matrix.
Definition: builder_and_solver.h:88
std::size_t SizeType
Definition of the size type.
Definition: builder_and_solver.h:73
int GetEchoLevel() const
It returns the echo level.
Definition: builder_and_solver.h:674
unsigned int mEquationSystemSize
Flag taking in account if it is needed or not to calculate the reactions.
Definition: builder_and_solver.h:747
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
TDataType & GetValue(const Variable< TDataType > &rThisVariable)
Gets the value associated with a given variable.
Definition: data_value_container.h:268
Dof represents a degree of freedom (DoF).
Definition: dof.h:86
bool IsFixed() const
Definition: dof.h:376
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
void Set(const Flags ThisFlag)
Definition: flags.cpp:33
bool Is(Flags const &rOther) const
Definition: flags.h:274
static Flags Create(IndexType ThisPosition, bool Value=true)
Definition: flags.h:138
This class is useful for index iteration over containers.
Definition: parallel_utilities.h:451
void for_each(TUnaryFunction &&f)
Definition: parallel_utilities.h:514
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MasterSlaveConstraintContainerType & MasterSlaveConstraints(IndexType ThisIndex=0)
Definition: model_part.h:654
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
This class defines the node.
Definition: node.h:65
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
void RecursivelyValidateAndAssignDefaults(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing match the form prescribed by th...
Definition: kratos_parameters.cpp:1389
std::string GetString() const
This method returns the string contained in the current Parameter.
Definition: kratos_parameters.cpp:684
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
size_type size() const
Returns the number of elements in the container.
Definition: pointer_vector_set.h:502
iterator begin()
Returns an iterator pointing to the beginning of the container.
Definition: pointer_vector_set.h:278
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Current class provides an implementation for standard builder and solving operations.
Definition: residualbased_block_builder_and_solver.h:82
void Clear() override
This function is intended to be called at the end of the solution step to clean up memory storage not...
Definition: residualbased_block_builder_and_solver.h:1081
void BuildAndSolve(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Function to perform the building and solving phase at the same time.
Definition: residualbased_block_builder_and_solver.h:479
double mScaleFactor
The set containing the inactive slave dofs.
Definition: residualbased_block_builder_and_solver.h:1223
std::vector< IndexType > mSlaveIds
This is vector containing the rigid movement of the constraint.
Definition: residualbased_block_builder_and_solver.h:1220
void AssembleRowContribution(TSystemMatrixType &A, const Matrix &Alocal, const unsigned int i, const unsigned int i_local, Element::EquationIdVectorType &EquationId)
Definition: residualbased_block_builder_and_solver.h:1624
void BuildRHSNoDirichlet(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemVectorType &b)
Definition: residualbased_block_builder_and_solver.h:1236
SCALING_DIAGONAL mScalingDiagonal
The manually set scale factor.
Definition: residualbased_block_builder_and_solver.h:1225
void AssignSettings(const Parameters ThisParameters) override
This method assigns settings to member variables.
Definition: residualbased_block_builder_and_solver.h:1666
TSystemMatrixType mT
Definition: residualbased_block_builder_and_solver.h:1218
void InternalSystemSolveWithPhysics(TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb, ModelPart &rModelPart)
This is a call to the linear system solver (taking into account some physical particularities of the ...
Definition: residualbased_block_builder_and_solver.h:437
virtual void ConstructMatrixStructure(typename TSchemeType::Pointer pScheme, TSystemMatrixType &A, ModelPart &rModelPart)
Definition: residualbased_block_builder_and_solver.h:1457
Element::DofsVectorType DofsVectorType
Definition: residualbased_block_builder_and_solver.h:120
void BuildLHS(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA) override
Function to perform the building of the LHS.
Definition: residualbased_block_builder_and_solver.h:271
TSystemVectorType mConstantVector
This is matrix containing the global relation for the constraints.
Definition: residualbased_block_builder_and_solver.h:1219
void BuildRHSAndSolve(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
Corresponds to the previews, but the System's matrix is considered already built and only the RHS is ...
Definition: residualbased_block_builder_and_solver.h:637
void Build(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &b) override
Function to perform the build of the RHS. The vector could be sized as the total number of dofs or as...
Definition: residualbased_block_builder_and_solver.h:195
Parameters GetDefaultParameters() const override
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: residualbased_block_builder_and_solver.h:1111
int Check(ModelPart &rModelPart) override
This function is designed to be called once to perform all the checks needed on the input provided....
Definition: residualbased_block_builder_and_solver.h:1099
Flags mOptions
We identify the scaling considered for the dirichlet dofs.
Definition: residualbased_block_builder_and_solver.h:1226
std::vector< IndexType > mMasterIds
The equation ids of the slaves.
Definition: residualbased_block_builder_and_solver.h:1221
void BuildRHS(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemVectorType &b) override
Function to perform the build of the RHS.
Definition: residualbased_block_builder_and_solver.h:678
Current class provides an implementation for standard builder and solving operations.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:69
void AssignSettings(const Parameters ThisParameters) override
This method assigns settings to member variables.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:1024
void BuildRHSAndSolve(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
Corresponds to the previews, but the System's matrix is considered already built and only the RHS is ...
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:299
Element::EquationIdVectorType EquationIdVectorType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:112
BuilderAndSolver< TSparseSpace, TDenseSpace, TLinearSolver > BaseBuilderAndSolverType
Definition of the base class.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:86
BaseType::ConditionsArrayType ConditionsArrayType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:108
Element::DofsVectorType DofsVectorType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:113
std::size_t SizeType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:93
NodeType::DofType DofType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:117
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:783
void SystemSolveWithPhysics(TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb, ModelPart &rModelPart) override
This is a call to the linear system solver (taking into account some physical particularities of the ...
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:243
void CalculateReactions(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
This method computes the reactions of the system.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:361
AUXILIAR_CONSTRAINT_FACTOR mAuxiliarConstraintFactorConsidered
The value considered for the constraint factor.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:814
ResidualBasedBlockBuilderAndSolverWithLagrangeMultiplier(typename TLinearSolver::Pointer pNewLinearSystemSolver)
Default constructor.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:147
void Build(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rb) override
Function to perform the build of the RHS. The vector could be sized as the total number of dofs or as...
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:186
KRATOS_DEFINE_LOCAL_FLAG(TRANSFORMATION_MATRIX_COMPUTED)
ResidualBasedBlockBuilderAndSolverWithLagrangeMultiplier()
Default constructor.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:127
AUXILIAR_CONSTRAINT_FACTOR
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:80
@ CONSIDER_MEAN_DIAGONAL_CONSTRAINT_FACTOR
@ CONSIDER_PRESCRIBED_CONSTRAINT_FACTOR
@ CONSIDER_NORM_DIAGONAL_CONSTRAINT_FACTOR
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:789
ResidualBasedBlockBuilderAndSolver< TSparseSpace, TDenseSpace, TLinearSolver > BaseType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:87
KRATOS_CLASS_POINTER_DEFINITION(ResidualBasedBlockBuilderAndSolverWithLagrangeMultiplier)
Definition of the pointer.
void BuildAndSolve(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
Function to perform the building and solving phase at the same time.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:263
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:102
void ConstructMasterSlaveConstraintsStructure(ModelPart &rModelPart) override
This method constructs the master slaeve constraint structure.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:828
ResidualBasedBlockBuilderAndSolverWithLagrangeMultiplier(typename TLinearSolver::Pointer pNewLinearSystemSolver, Parameters ThisParameters)
Default constructor. (with parameters)
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:134
BaseType::ElementsArrayType ElementsArrayType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:107
std::string Info() const override
Turn back information as a string.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:777
KRATOS_DEFINE_LOCAL_FLAG(DOUBLE_LAGRANGE_MULTIPLIER)
Definition of the flags.
ResidualBasedBlockBuilderAndSolverWithLagrangeMultiplier< TSparseSpace, TDenseSpace, TLinearSolver > ClassType
The definition of the current class.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:90
~ResidualBasedBlockBuilderAndSolverWithLagrangeMultiplier() override
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:161
int Check(ModelPart &rModelPart) override
This function is designed to be called once to perform all the checks needed on the input provided....
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:726
DofType::Pointer DofPointerType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:118
void SystemSolve(TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
This is a call to the linear system solver.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:213
std::size_t IndexType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:94
Parameters GetDefaultParameters() const override
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:739
BaseType::TSystemMatrixType TSystemMatrixType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:100
double mAuxiliarConstraintFactor
The constraint scale factor.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:811
BaseType::TSystemVectorPointerType TSystemVectorPointerType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:105
BaseBuilderAndSolverType::Pointer Create(typename TLinearSolver::Pointer pNewLinearSystemSolver, Parameters ThisParameters) const override
Create method.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:170
void BuildRHS(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemVectorType &rb) override
Function to perform the build of the RHS.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:334
void BuildMasterSlaveConstraints(ModelPart &rModelPart) override
This method builds the master slave relation matrix and vector.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:946
static std::string Name()
Returns the name of the class as used in the settings (snake_case format)
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:759
Parameters ValidateAndAssignParameters(Parameters ThisParameters, const Parameters DefaultParameters) const override
This method validate and assign default parameters.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:1011
BaseType::TDataType TDataType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:98
TSystemVectorType mLagrangeMultiplierVector
A map of the correspondance between the slave dofs.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:809
BaseType::NodesArrayType NodesArrayType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:106
void ApplyConstraints(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rb) override
Applies the constraints with master-slave relation matrix.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:565
BaseType::TSchemeType TSchemeType
Definition of the classes from the base class.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:97
void ApplyRHSConstraints(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemVectorType &rb) override
Applies the constraints with master-slave relation matrix (RHS only)
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:493
BaseType::DofsArrayType DofsArrayType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:99
BaseType::TSystemMatrixPointerType TSystemMatrixPointerType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:104
CONSTRAINT_FACTOR
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:79
@ CONSIDER_MEAN_DIAGONAL_CONSTRAINT_FACTOR
@ CONSIDER_PRESCRIBED_CONSTRAINT_FACTOR
@ CONSIDER_NORM_DIAGONAL_CONSTRAINT_FACTOR
BaseType::TSystemVectorType TSystemVectorType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:101
CONSTRAINT_FACTOR mConstraintFactorConsidered
The auxiliar constraint scale factor.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:813
void ApplyDirichletConditions(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
Applies the dirichlet conditions. This operation may be very heavy or completely unexpensive dependin...
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:403
PointerVectorSet< Element, IndexedObject > ElementsContainerType
Additional definitions.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:111
void Clear() override
This function is intended to be called at the end of the solution step to clean up memory storage not...
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:707
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:103
Node NodeType
DoF types definition.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:116
double mConstraintFactor
This is vector containing the Lagrange multiplier solution.
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:810
std::unordered_map< IndexType, IndexType > mCorrespondanceDofsSlave
Definition: residualbased_block_builder_and_solver_with_lagrange_multiplier.h:808
This class provides the implementation of the basic tasks that are needed by the solution strategy.
Definition: scheme.h:56
static void AssembleSparseMatrixByBlocks(CompressedMatrix &rMatrix, const DenseMatrix< CompressedMatrix * > &rMatricespBlocks, DenseMatrix< double > ContributionCoefficients=DenseMatrix< double >(0, 0), DenseMatrix< bool > TransposeBlocks=DenseMatrix< bool >(0, 0))
This method assembles several sparse matrices into one large sparse matrix.
Definition: sparse_matrix_multiplication_utility.h:695
utility function to do a sum reduction
Definition: reduction_utilities.h:68
static void Start(std::string const &rIntervalName)
This method starts the timer meassures.
Definition: timer.cpp:109
static void Stop(std::string const &rIntervalName)
This method stops the timer meassures.
Definition: timer.cpp:125
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF_NOT(conditional)
Definition: exception.h:163
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
#define KRATOS_INFO_IF(label, conditional)
Definition: logger.h:251
TSpaceType::IndexType Size1(TSpaceType &dummy, typename TSpaceType::MatrixType const &rM)
Definition: add_strategies_to_python.cpp:117
TSpaceType::IndexType Size2(TSpaceType &dummy, typename TSpaceType::MatrixType const &rM)
Definition: add_strategies_to_python.cpp:123
double TwoNorm(SparseSpaceType &dummy, SparseSpaceType::VectorType &x)
Definition: add_strategies_to_python.cpp:164
TSpaceType::IndexType Size(TSpaceType &dummy, typename TSpaceType::VectorType const &rV)
Definition: add_strategies_to_python.cpp:111
void Mult(TSpaceType &dummy, typename TSpaceType::MatrixType &rA, typename TSpaceType::VectorType &rX, typename TSpaceType::VectorType &rY)
Definition: add_strategies_to_python.cpp:98
void UnaliasedAdd(TSpaceType &dummy, typename TSpaceType::VectorType &x, const double A, const typename TSpaceType::VectorType &rY)
Definition: add_strategies_to_python.cpp:170
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
void AtomicAdd(TDataType &target, const TDataType &value)
Definition: atomic_utilities.h:55
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
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
ScaleFactor
Definition: generate_frictional_mortar_condition.py:131
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
int counter
Definition: script_THERMAL_CORRECT.py:218
A
Definition: sensitivityMatrix.py:70
integer i
Definition: TensorModule.f:17