10 #if !defined(KRATOS_HM_PARAMETRIC_WALL_CONTACT_SEARCH_PROCESS_H_INCLUDED )
11 #define KRATOS_HM_PARAMETRIC_WALL_CONTACT_SEARCH_PROCESS_H_INCLUDED
90 std::string rSubModelPartName,
91 SpatialBoundingBox::Pointer pParametricWall,
99 mpHydraulicConditionType = CreateConditionPrototypeHM( CustomParameters );
100 mpHydraulicConditionType->SetValue(HYDRAULIC,
true);
141 virtual std::string
Info()
const override
143 return "HMParametricWallContactSearchProcess";
147 virtual void PrintInfo(std::ostream& rOStream)
const override
149 rOStream <<
"HMParametricWallContactSearchProcess";
153 virtual void PrintData(std::ostream& rOStream)
const override
186 double Dimension = rCurrentProcessInfo[SPACE_DIMENSION];
193 std::cout<<
" ["<<rContactModelPart.
Name()<<
" :: CONDITIONS [OLD:"<<rContactModelPart.
NumberOfConditions();
201 for(ModelPart::NodesContainerType::ptr_iterator nd = rNodes.ptr_begin(); nd != rNodes.ptr_end(); ++nd)
203 if( (*nd)->Is(BOUNDARY) && (*nd)->Is(CONTACT) ){
205 ConditionType::Pointer pCondition;
207 if( (*nd)->Is(RIGID) ){
209 GeometryType::Pointer pGeometry;
211 pGeometry = Kratos::make_shared<Point2DType>(*nd);
212 else if( Dimension == 3 )
213 pGeometry = Kratos::make_shared<Point3DType>(*nd);
217 ContactConditions.push_back(pCondition);
225 ConditionType::Pointer pConditionType = FindPointConditionHM(rContactModelPart, (*nd) ,
false);
226 pCondition = pConditionType->Clone(
id, pConditionNode);
227 pCondition->Set(CONTACT);
228 pCondition->SetValue(HYDRAULIC,
false);
229 ContactConditions.push_back(pCondition);
231 pConditionType = FindPointConditionHM(rContactModelPart, (*nd) ,
true);
232 pCondition = pConditionType->Clone(
id+1, pConditionNode);
233 pCondition->Set(CONTACT);
234 pCondition->SetValue(HYDRAULIC,
true);
235 ContactConditions.push_back(pCondition);
244 rContactModelPart.
Conditions().swap(ContactConditions);
251 std::string ModelPartName;
256 if(i_mp->Is(SOLID) && i_mp->Is(ACTIVE))
257 ModelPartName = i_mp->Name();
303 ConditionType::Pointer mpHydraulicConditionType;
312 ConditionType::Pointer CreateConditionPrototypeHM(
Parameters& CustomParameters )
320 double Dimension = rCurrentProcessInfo[SPACE_DIMENSION];
323 GeometryType::Pointer pGeometry;
326 else if( Dimension == 3 )
330 unsigned int LastConditionId = 1;
334 std::string ConditionName = CustomParameters[
"hydraulic_condition_type"].
GetString();
336 if ( ConditionName ==
"HydraulicPointContactCondition2D1N" ) {
339 else if ( ConditionName ==
"HydraulicAxisymPointContactCondition2D1N") {
340 return Kratos::make_intrusive<HydraulicAxisymRigidContactPenalty2DCondition>(LastConditionId, pGeometry,
mpProperties,
mpParametricWall);
342 std::cout << ConditionName << std::endl;
343 KRATOS_ERROR <<
"the specified hydraulic contact condition does not exist " << std::endl;
356 ConditionType::Pointer FindPointConditionHM(ModelPart & rModelPart, Node::Pointer pPoint,
bool rHydraulic)
360 for(ModelPart::ConditionsContainerType::iterator i_cond =rModelPart.ConditionsBegin(); i_cond!= rModelPart.ConditionsEnd(); ++i_cond)
362 if( i_cond->Is(CONTACT) && i_cond->GetGeometry().size() == 1 ){
363 if( i_cond->GetGeometry()[0].Id() == pPoint->Id() ){
364 if ( i_cond->GetValue(HYDRAULIC) == rHydraulic) {
365 return ( *(i_cond.base()) );
371 if ( rHydraulic ==
false) {
374 return mpHydraulicConditionType;
425 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
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
SubModelPartIterator SubModelPartsBegin()
Definition: model_part.h:1698
std::string & Name()
Definition: model_part.h:1811
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
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
SizeType NumberOfConditions(IndexType ThisIndex=0) const
Definition: model_part.h:1218
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
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
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
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