10 #if !defined(KRATOS_SETTLE_CONTACT_MODEL_STRUCTURE_PROCESS_H_INCLUDED )
11 #define KRATOS_SETTLE_CONTACT_MODEL_STRUCTURE_PROCESS_H_INCLUDED
115 this->ClearContactConditions();
117 this->ClearContactFlags();
121 std::cout<<
" Search conditions masters "<<std::endl;
147 this->AddContactConditions();
150 this->RestoreContactFlags();
156 this->ClearContactForces();
159 this->ClearContactNormals();
180 std::string
Info()
const override
182 return "SettleContactModelStructureProcess";
188 rOStream <<
"SettleContactModelStructureProcess";
228 unsigned int consecutive_index = 0;
233 if(LastElementId>LastConditionId){
234 consecutive_index = LastElementId+1;
237 consecutive_index = LastConditionId+1;
242 it->SetId(consecutive_index);
290 void ClearContactForces()
298 for(ModelPart::NodesContainerType::ptr_iterator nd = rNodes.ptr_begin(); nd != rNodes.ptr_end(); ++nd)
300 if( (*nd)->Is(BOUNDARY) && (*nd)->IsNot(CONTACT) ){
302 ContactForce.
clear();
314 void ClearContactNormals()
322 for(ModelPart::NodesContainerType::ptr_iterator nd = rNodes.ptr_begin(); nd != rNodes.ptr_end(); ++nd)
324 if( (*nd)->Is(BOUNDARY) && (*nd)->IsNot(CONTACT) ){
325 array_1d<double, 3> & ContactNormal = (*nd)->FastGetSolutionStepValue(CONTACT_NORMAL);
326 ContactNormal.clear();
338 void ClearContactFlags ( )
344 if( i_node->Is(CONTACT) ){
345 i_node->Set(CONTACT,
false);
356 void RestoreContactFlags ( )
363 if( i_cond->Is(CONTACT) ){
364 for(
unsigned int i=0;
i<i_cond->GetGeometry().size(); ++
i)
366 i_cond->GetGeometry()[
i].Set(CONTACT,
true);
377 void AddContactConditions()
383 std::string ModelPartName;
386 if(i_mp->Is(CONTACT))
387 ModelPartName = i_mp->Name();
395 if(i_mp->Is(SOLID) && i_mp->Is(ACTIVE))
396 ModelPartName = i_mp->
Name();
412 void AddContactConditions(ModelPart& rOriginModelPart, ModelPart& rDestinationModelPart)
422 std::cout<<
" ["<<rDestinationModelPart.Name()<<
" :: CONDITIONS [OLD:"<<rDestinationModelPart.NumberOfConditions();
425 for(ModelPart::ConditionsContainerType::iterator ic = rOriginModelPart.ConditionsBegin(); ic!= rOriginModelPart.ConditionsEnd(); ++ic)
429 rDestinationModelPart.AddCondition(*(ic.base()));
434 std::cout<<
" / NEW:"<<rDestinationModelPart.NumberOfConditions()<<
"] "<<std::endl;
447 void ClearContactConditions()
453 std::string ModelPartName;
456 if(i_mp->Is(SOLID) && i_mp->Is(ACTIVE))
457 ModelPartName = i_mp->Name();
473 void ClearContactConditions(ModelPart& rModelPart)
483 std::cout<<
" ["<<rModelPart.Name()<<
" :: CONDITIONS [OLD:"<<rModelPart.NumberOfConditions();
488 for(ModelPart::ConditionsContainerType::iterator ic = rModelPart.ConditionsBegin(); ic!= rModelPart.ConditionsEnd(); ++ic)
491 if(ic->IsNot(CONTACT) && ic->GetGeometry().size() > 1){
492 PreservedConditions.
push_back(*(ic.base()));
496 rModelPart.Conditions().swap(PreservedConditions);
502 std::cout<<
" / NEW:"<<rModelPart.NumberOfConditions()<<
"] "<<std::endl;
554 rOStream << std::endl;
Definition: boundary_normals_calculation_utilities.hpp:48
void CalculateWeightedBoundaryNormals(ModelPart &rModelPart, int EchoLevel=0)
Calculates the area normal (unitary vector oriented as the normal) and weight the normal to shrink.
Definition: boundary_normals_calculation_utilities.hpp:123
Short class definition.
Definition: build_model_part_boundary_process.hpp:79
bool SearchConditionMasters()
Definition: build_model_part_boundary_process.hpp:240
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
SubModelPartIterator SubModelPartsEnd()
Definition: model_part.h:1708
ConditionIterator ConditionsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1361
SubModelPartIterator SubModelPartsBegin()
Definition: model_part.h:1698
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
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
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
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
void push_back(TPointerType x)
Adds a pointer to the end of the set.
Definition: pointer_vector_set.h:544
Short class definition.
Definition: settle_model_structure_process.hpp:71
int mEchoLevel
Definition: settle_model_structure_process.hpp:193
ModelPart & mrMainModelPart
Definition: settle_model_structure_process.hpp:189
BOOST_UBLAS_INLINE void clear()
Definition: array_1d.h:325
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
Kratos::ModelPart ModelPart
Definition: kratos_wrapper.h:31
static int EchoLevel
Definition: co_sim_EMPIRE_API.h:42
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
ModelPart::NodesContainerType NodesContainerType
Definition: find_conditions_neighbours_process.h:44
ModelPart::ConditionsContainerType ConditionsContainerType
Definition: find_conditions_neighbours_process.h:45
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
ModelPart::ElementsContainerType ElementsContainerType
Definition: clear_contact_conditions_mesher_process.hpp:43
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
integer i
Definition: TensorModule.f:17