57 template<
class TSparseSpace,
60 class TBuilderAndSolver = ResidualBasedBlockBuilderAndSolver< TSparseSpace, TDenseSpace, TLinearSolver >
63 :
public TBuilderAndSolver
111 typename TLinearSolver::Pointer pNewLinearSystemSolver,
113 ) :
BaseType(pNewLinearSystemSolver)
123 typename TLinearSolver::Pointer pNewLinearSystemSolver)
147 typename BaseBuilderAndSolverType::Pointer
Create(
148 typename TLinearSolver::Pointer pNewLinearSystemSolver,
152 return Kratos::make_shared<ClassType>(pNewLinearSystemSolver,ThisParameters);
164 typename TSchemeType::Pointer pScheme,
171 FixIsolatedNodes(rModelPart);
173 BaseType::ApplyDirichletConditions(pScheme, rModelPart,
A, Dx,
b);
175 FreeIsolatedNodes(rModelPart);
185 typename TSchemeType::Pointer pScheme,
190 FixIsolatedNodes(rModelPart);
192 BaseType::BuildRHS(pScheme, rModelPart,
b);
194 FreeIsolatedNodes(rModelPart);
205 "name" : "contact_block_builder_and_solver"
209 const Parameters base_default_parameters = BaseType::GetDefaultParameters();
211 return default_parameters;
220 return "contact_block_builder_and_solver";
259 BaseType::AssignSettings(ThisParameters);
292 void FixIsolatedNodes(
ModelPart& rModelPart)
300 auto& r_nodes_array = r_contact_model_part.
Nodes();
302 rNode.
Set(VISITED,
false);
303 rNode.
Set(ISOLATED,
false);
307 auto& r_conditions_array = r_computing_contact_model_part.
Conditions();
309 auto& r_parent_geometry = rCond.GetGeometry().GetGeometryPart(0);
310 for (std::size_t i_node = 0; i_node < r_parent_geometry.size(); ++i_node) {
311 r_parent_geometry[i_node].SetLock();
312 if (r_parent_geometry[i_node].Is(VISITED) ==
false) {
313 r_parent_geometry[i_node].Set(ISOLATED, rCond.Is(ISOLATED));
314 r_parent_geometry[i_node].Set(VISITED,
true);
316 r_parent_geometry[i_node].Set(ISOLATED, r_parent_geometry[i_node].Is(ISOLATED) && rCond.Is(ISOLATED));
318 r_parent_geometry[i_node].UnSetLock();
324 if (rNode.Is(ISOLATED)) {
325 if (rNode.SolutionStepsDataHas(LAGRANGE_MULTIPLIER_CONTACT_PRESSURE)) {
326 rNode.Fix(LAGRANGE_MULTIPLIER_CONTACT_PRESSURE);
327 }
else if (rNode.SolutionStepsDataHas(VECTOR_LAGRANGE_MULTIPLIER_X)) {
328 rNode.Fix(VECTOR_LAGRANGE_MULTIPLIER_X);
329 rNode.Fix(VECTOR_LAGRANGE_MULTIPLIER_Y);
330 rNode.Fix(VECTOR_LAGRANGE_MULTIPLIER_Z);
340 void FreeIsolatedNodes(ModelPart& rModelPart)
342 KRATOS_ERROR_IF_NOT(rModelPart.HasSubModelPart(
"Contact")) <<
"CONTACT MODEL PART NOT CREATED" << std::endl;
346 auto& r_nodes_array = r_contact_model_part.
Nodes();
348 if (rNode.Is(ISOLATED)) {
349 if (rNode.SolutionStepsDataHas(LAGRANGE_MULTIPLIER_CONTACT_PRESSURE)) {
350 rNode.Free(LAGRANGE_MULTIPLIER_CONTACT_PRESSURE);
351 }
else if (rNode.SolutionStepsDataHas(VECTOR_LAGRANGE_MULTIPLIER_X)) {
352 rNode.Free(VECTOR_LAGRANGE_MULTIPLIER_X);
353 rNode.Free(VECTOR_LAGRANGE_MULTIPLIER_Y);
354 rNode.Free(VECTOR_LAGRANGE_MULTIPLIER_Z);
Current class provides an implementation for the base builder and solving operations.
Definition: builder_and_solver.h:64
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
void Set(const Flags ThisFlag)
Definition: flags.cpp:33
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
bool HasSubModelPart(std::string const &ThisSubModelPartName) const
Definition: model_part.cpp:2142
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
ModelPart & GetSubModelPart(std::string const &SubModelPartName)
Definition: model_part.cpp:2029
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
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
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
This class provides the implementation of the basic tasks that are needed by the solution strategy.
Definition: scheme.h:56
#define KRATOS_ERROR_IF_NOT(conditional)
Definition: exception.h:163
Kratos::ModelPart ModelPart
Definition: kratos_wrapper.h:31
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
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
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
A
Definition: sensitivityMatrix.py:70