10 #if !defined(KRATOS_PARAMETRIC_WALL_CONTACT_SEARCH_PROCESS_H_INCLUDED )
11 #define KRATOS_PARAMETRIC_WALL_CONTACT_SEARCH_PROCESS_H_INCLUDED
103 std::string rSubModelPartName,
104 SpatialBoundingBox::Pointer pParametricWall,
116 "contact_condition_type": "PointContactCondition2D1N",
117 "hydraulic_condition_type": "HydraulicPointContactCondition2D1N",
118 "kratos_module": "KratosMultiphysics.ContactMechanicsApplication",
119 "friction_law_type": "FrictionLaw",
120 "variables_of_properties":{
121 "FRICTION_ACTIVE": false,
124 "PENALTY_PARAMETER": 1000,
125 "TANGENTIAL_PENALTY_RATIO": 0.1,
141 std::cout<<
" ERROR:: PROTOTYPE CONTACT WALL CONDITION NOT DEFINED PROPERLY "<<std::endl;
176 std::cout<<
" [PARAMETRIC_CONTACT_SEARCH]:: -START- "<<std::endl;
180 const double Time = rCurrentProcessInfo[TIME];
188 SearchContactConditions();
194 std::cout<<
" [PARAMETRIC_CONTACT_SEARCH]:: -END- "<<std::endl;
209 if( ie->GetGeometry().size() == 2 ){
210 for(
unsigned int i=0;
i<ie->GetGeometry().size();
i++ )
212 ie->GetGeometry()[
i].Set(BOUNDARY,
true);
299 std::string
Info()
const override
301 return "ParametricWallContactSearchProcess";
307 rOStream <<
"ParametricWallContactSearchProcess";
353 double Dimension = rCurrentProcessInfo[SPACE_DIMENSION];
360 std::cout<<
" ["<<rContactModelPart.
Name()<<
" :: CONDITIONS [OLD:"<<rContactModelPart.
NumberOfConditions();
368 for(ModelPart::NodesContainerType::ptr_iterator nd = rNodes.ptr_begin(); nd != rNodes.ptr_end(); ++nd)
370 if( (*nd)->Is(BOUNDARY) && (*nd)->Is(CONTACT) ){
372 ConditionType::Pointer pCondition;
375 if( (*nd)->Is(RIGID) ){
377 GeometryType::Pointer pGeometry;
379 pGeometry = Kratos::make_shared<Point2DType>(*nd);
380 else if( Dimension == 3 )
381 pGeometry = Kratos::make_shared<Point3DType>(*nd);
385 ContactConditions.push_back(pCondition);
393 ConditionType::Pointer pConditionType = FindPointCondition(rContactModelPart, (*nd) );
395 pCondition = pConditionType->Clone(
id, pConditionNode);
397 pCondition->Set(CONTACT);
399 ContactConditions.push_back(pCondition);
409 rContactModelPart.
Conditions().swap(ContactConditions);
416 std::string ModelPartName;
421 if(i_mp->Is(SOLID) && i_mp->Is(ACTIVE))
422 ModelPartName = i_mp->Name();
451 std::cout<<
" ["<<rDestinationModelPart.
Name()<<
" :: CONDITIONS [OLD:"<<rDestinationModelPart.
NumberOfConditions();
507 ConditionType::Pointer CreateConditionPrototype(
Parameters& CustomParameters )
512 double Dimension = rCurrentProcessInfo[SPACE_DIMENSION];
517 mpProperties = Kratos::make_shared<PropertiesType>(NumberOfProperties);
524 Parameters CustomProperties = CustomParameters[
"variables_of_properties"];
526 mpProperties->SetValue(FRICTION_ACTIVE, CustomProperties[
"FRICTION_ACTIVE"].GetBool());
527 mpProperties->SetValue(MU_STATIC, CustomProperties[
"MU_STATIC"].GetDouble());
528 mpProperties->SetValue(MU_DYNAMIC, CustomProperties[
"MU_DYNAMIC"].GetDouble());
529 mpProperties->SetValue(PENALTY_PARAMETER, CustomProperties[
"PENALTY_PARAMETER"].GetDouble());
530 mpProperties->SetValue(TANGENTIAL_PENALTY_RATIO, CustomProperties[
"TANGENTIAL_PENALTY_RATIO"].GetDouble());
531 mpProperties->SetValue(TAU_STAB, CustomProperties[
"TAU_STAB"].GetDouble());
538 GeometryType::Pointer pGeometry;
541 else if( Dimension == 3 )
546 std::string ConditionName = CustomParameters[
"contact_condition_type"].
GetString();
548 unsigned int LastConditionId = 1;
553 if( ConditionName ==
"PointContactPenaltyCondition2D1N" ){
556 else if( ConditionName ==
"PointContactPenaltyCondition3D1N" ){
559 else if( ConditionName ==
"AxisymPointContactPenaltyCondition2D1N" ){
562 else if( ConditionName ==
"EPPointContactPenaltyCondition3D1N" ) {
565 else if( ConditionName ==
"EPPointContactPenaltyCondition2D1N" ) {
568 else if( ConditionName ==
"EPPointContactPenaltywPCondition3D1N" ) {
571 else if( ConditionName ==
"EPAxisymPointContactPenaltyCondition2D1N" ) {
574 std::cout << ConditionName << std::endl;
575 KRATOS_ERROR <<
"the specified contact condition does not exist " << std::endl;
601 void SearchContactConditions()
609 double Time = rCurrentProcessInfo[TIME];
613 int number_of_threads = omp_get_max_threads();
615 int number_of_threads = 1;
620 vector<unsigned int> nodes_partition;
621 OpenMPUtils::CreatePartition(number_of_threads, rNodes.size(), nodes_partition);
628 ModelPart::NodesContainerType::iterator NodesBegin = rNodes.begin() + nodes_partition[
k];
629 ModelPart::NodesContainerType::iterator NodesEnd = rNodes.begin() + nodes_partition[
k + 1];
631 for(ModelPart::NodesContainerType::const_iterator nd = NodesBegin; nd != NodesEnd; nd++)
633 if( nd->Is(BOUNDARY) ){
635 if( nd->IsNot(RIGID) )
640 if( nd->IsNot(SLAVE) ){
711 Condition::Pointer FindPointCondition(ModelPart& rModelPart, Node::Pointer pPoint)
716 if ( rCurrentProcessInfo.Has(IS_RESTARTED) && rCurrentProcessInfo.Has(LOAD_RESTART) ) {
717 if ( rCurrentProcessInfo[IS_RESTARTED] ==
true) {
718 if ( rCurrentProcessInfo[STEP] == rCurrentProcessInfo[LOAD_RESTART] ) {
719 std::cout <<
" doing my.... ";
726 for(ModelPart::ConditionsContainerType::iterator i_cond =rModelPart.ConditionsBegin(); i_cond!= rModelPart.ConditionsEnd(); i_cond++)
728 if( i_cond->Is(CONTACT) && i_cond->GetGeometry().size() == 1 ){
729 if( i_cond->GetGeometry()[0].Id() == pPoint->Id() ){
730 return ( *(i_cond.base()) );
744 void ClearContactFlags ( )
750 if( i_node->Is(CONTACT) ){
751 i_node->Set(CONTACT,
false);
761 void RestoreContactFlags ( )
767 if( i_cond->Is(CONTACT) ){
768 for(
unsigned int i=0;
i<i_cond->GetGeometry().size();
i++)
770 i_cond->GetGeometry()[
i].Set(CONTACT,
true);
828 rOStream << std::endl;
Base class for all Conditions.
Definition: condition.h:59
Geometry base class.
Definition: geometry.h:71
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementIterator ElementsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1169
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
SubModelPartIterator SubModelPartsEnd()
Definition: model_part.h:1708
ConditionIterator ConditionsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1361
SubModelPartIterator SubModelPartsBegin()
Definition: model_part.h:1698
SizeType NumberOfProperties(IndexType ThisIndex=0) const
Returns the number of properties of the mesh.
Definition: model_part.cpp:575
std::string & Name()
Definition: model_part.h:1811
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
SubModelPartsContainerType::iterator SubModelPartIterator
Iterator over the sub model parts of this model part.
Definition: model_part.h:258
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
void AddProperties(PropertiesType::Pointer pNewProperties, IndexType ThisIndex=0)
Inserts a properties in the current mesh.
Definition: model_part.cpp:582
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
void AddCondition(ConditionType::Pointer pNewCondition, IndexType ThisIndex=0)
Definition: model_part.cpp:1436
SizeType NumberOfConditions(IndexType ThisIndex=0) const
Definition: model_part.h:1218
ElementIterator ElementsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1179
ModelPart & GetSubModelPart(std::string const &SubModelPartName)
Definition: model_part.cpp:2029
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
ConditionIterator ConditionsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1371
This class defines the node.
Definition: node.h:65
static int ThisThread()
Wrapper for omp_get_thread_num().
Definition: openmp_utils.h:108
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
void ValidateAndAssignDefaults(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing match the form prescribed by th...
Definition: kratos_parameters.cpp:1306
std::string GetString() const
This method returns the string contained in the current Parameter.
Definition: kratos_parameters.cpp:684
Definition: point_2d.h:53
Definition: point_3d.h:53
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
void push_back(const TPointerType &x)
Definition: pointer_vector.h:270
The base class for all processes in Kratos.
Definition: process.h:49
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR
Definition: exception.h:161
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Internals::Matrix< double, AMatrix::dynamic, 1 > Vector
Definition: amatrix_interface.h:472
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
ProcessInfo
Definition: edgebased_PureConvection.py:116
int k
Definition: quadrature.py:595
integer i
Definition: TensorModule.f:17