17 #include <unordered_set>
18 #include <unordered_map>
57 template<
class TSparseSpace,
119 typename TLinearSolver::Pointer pNewLinearSystemSolver,
121 ) :
BaseType(pNewLinearSystemSolver)
131 typename TLinearSolver::Pointer pNewLinearSystemSolver)
155 typename BaseBuilderAndSolverType::Pointer
Create(
156 typename TLinearSolver::Pointer pNewLinearSystemSolver,
160 return Kratos::make_shared<ClassType>(pNewLinearSystemSolver,ThisParameters);
176 std::unordered_map<IndexType, IndexSetType> set_nodes_with_lm_associated;
189 const IndexType key_lm_x = VECTOR_LAGRANGE_MULTIPLIER_X.Key();
190 const IndexType key_lm_y = VECTOR_LAGRANGE_MULTIPLIER_Y.Key();
191 const IndexType key_lm_z = VECTOR_LAGRANGE_MULTIPLIER_Z.Key();
196 auto it = set_nodes_with_lm_associated.find(
node_id);
197 if ( it != set_nodes_with_lm_associated.end()) {
198 const auto& r_variable = i_dof.GetVariable();
199 auto& aux_set = (it->second);
200 if (i_dof.IsFixed()) {
201 if (r_variable == DISPLACEMENT_X) {
202 aux_set.insert(key_lm_x);
203 }
else if (r_variable == DISPLACEMENT_Y) {
204 aux_set.insert(key_lm_y);
205 }
else if (r_variable == DISPLACEMENT_Z) {
206 aux_set.insert(key_lm_z);
214 if (i_dof.IsFree()) {
216 auto it = set_nodes_with_lm_associated.find(
node_id);
217 if (it != set_nodes_with_lm_associated.end()) {
218 auto& aux_set = it->second;
219 if (aux_set.find((i_dof.GetVariable()).Key()) != aux_set.end()) {
237 "name" : "contact_residual_elimination_builder_and_solver"
243 return default_parameters;
252 return "contact_residual_elimination_builder_and_solver";
328 static inline bool IsDisplacementDof(
const DofType& rDoF)
330 const auto& r_variable = rDoF.GetVariable();
331 if (r_variable == DISPLACEMENT_X ||
332 r_variable == DISPLACEMENT_Y ||
333 r_variable == DISPLACEMENT_Z) {
345 static inline bool IsLMDof(
const DofType& rDoF)
347 const auto& r_variable = rDoF.GetVariable();
348 if (r_variable == VECTOR_LAGRANGE_MULTIPLIER_X ||
349 r_variable == VECTOR_LAGRANGE_MULTIPLIER_Y ||
350 r_variable == VECTOR_LAGRANGE_MULTIPLIER_Z) {
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
virtual Parameters ValidateAndAssignParameters(Parameters ThisParameters, const Parameters DefaultParameters) const
This method validate and assign default parameters.
Definition: builder_and_solver.h:767
TSparseSpace::DataType TDataType
Definition of the data type.
Definition: builder_and_solver.h:79
DofsArrayType mDofSet
Pointer to the linear solver.
Definition: builder_and_solver.h:739
std::size_t SizeType
Definition of the size type.
Definition: builder_and_solver.h:73
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
Dof< double > DofType
Definition: model_part.h:109
bool HasSubModelPart(std::string const &ThisSubModelPartName) const
Definition: model_part.cpp:2142
ModelPart & GetSubModelPart(std::string const &SubModelPartName)
Definition: model_part.cpp:2029
SizeType NumberOfNodes(IndexType ThisIndex=0) const
Definition: model_part.h:341
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
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
Current class provides an implementation for standard elimination builder and solving operations.
Definition: residualbased_elimination_builder_and_solver.h:76
BaseType::TSchemeType TSchemeType
Definition: residualbased_elimination_builder_and_solver.h:93
BaseType::TDataType TDataType
Definition: residualbased_elimination_builder_and_solver.h:94
BaseType::TSystemVectorType TSystemVectorType
Definition: residualbased_elimination_builder_and_solver.h:97
Parameters GetDefaultParameters() const override
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: residualbased_elimination_builder_and_solver.h:942
BaseType::DofsArrayType DofsArrayType
Definition: residualbased_elimination_builder_and_solver.h:95
void AssignSettings(const Parameters ThisParameters) override
This method assigns settings to member variables.
Definition: residualbased_elimination_builder_and_solver.h:1314
BaseType::TSystemMatrixType TSystemMatrixType
Definition: residualbased_elimination_builder_and_solver.h:96
void SetUpSystem(ModelPart &rModelPart) override
Organises the dofset in order to speed up the building phase.
Definition: residualbased_elimination_builder_and_solver.h:759
This class provides the implementation of the basic tasks that are needed by the solution strategy.
Definition: scheme.h:56
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
int node_id
Definition: read_stl.py:12