KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
refine_conditions_in_contact_mesher_process.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosPfemSolidMechanicsApplication $
3 // Created by: $Author: JMCarbonell $
4 // Last modified by: $Co-Author: $
5 // Date: $Date: February 2016 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 
11 #if !defined(KRATOS_REFINE_CONDITIONS_IN_CONTACT_MESHER_PROCESS_H_INCLUDED )
12 #define KRATOS_REFINE_CONDITIONS_IN_CONTACT_MESHER_PROCESS_H_INCLUDED
13 
14 
15 // External includes
16 
17 // System includes
18 
19 // Project includes
20 #include "includes/model_part.h"
23 
25 
27 //StepData: NODAL_H, NORMAL, CONTACT_FORCE, DISPLACEMENT
28 //Flags: (checked) BOUNDARY, TO_SPLIT
29 // (set) BOUNDARY(nodes), TO_ERASE(conditions), NEW_ENTITY(conditions,nodes)(set), TO_SPLIT(conditions)->locally
30 // (modified)
31 // (reset) TO_SPLIT
32 //(set):=(set in this process)
33 
34 namespace Kratos
35 {
36 
39 
41 
53 {
54 public:
57 
60 
66 
70 
71 
73  {
74  public:
75 
76  //counters:
80 
83 
87 
88  void Initialize()
89  {
90  //counters:
92 
95 
98 
102 
103  }
104  };
105 
106 
110 
111 
114  std::vector<SpatialBoundingBox::Pointer> mRigidWalls,
115  MesherUtilities::MeshingParameters& rRemeshingParameters,
116  int EchoLevel)
117  :RefineConditionsMesherProcess(rModelPart,rRemeshingParameters,EchoLevel)
118  {
119 
120 
121  }
122 
125 
126 
130 
132  void operator()()
133  {
134  Execute();
135  }
136 
137 
141 
142 
144  void Execute() override
145  {
146 
147  KRATOS_TRY
148 
149  if( this->mEchoLevel > 0 ){
150  std::cout<<" [ REFINE BOUNDARY : "<<std::endl;
151  //std::cout<<" Nodes and Conditions : "<<mrModelPart.Nodes().size()<<", "<<mrModelPart.Conditions().size()<<std::endl;
152  }
153 
154  mrRemesh.Info->InsertedBoundaryConditions = mrModelPart.NumberOfConditions();
155  mrRemesh.Info->InsertedBoundaryNodes = mrModelPart.NumberOfNodes();
156 
157  RefineCounters LocalRefineInfo;
158  LocalRefineInfo.Initialize();
159 
160 
161  //if the insert switches are activated, we check if the boundaries got too coarse
162  if( (mrRemesh.Refine->RefiningOptions.Is(MesherUtilities::REFINE_INSERT_NODES) || mrRemesh.Refine->RefiningOptions.Is(MesherUtilities::REFINE_ADD_NODES)) && mrRemesh.Refine->RefiningOptions.Is(MesherUtilities::REFINE_BOUNDARY) )
163  {
164 
165  std::vector<Point > list_of_points;
166  std::vector<Condition*> list_of_conditions;
167 
168  unsigned int conditions_size = mrModelPart.Conditions().size();
169 
171 
172  list_of_points.reserve(conditions_size);
173  list_of_conditions.reserve(conditions_size);
174 
175  RefineContactBoundary(mrModelPart, list_of_points, list_of_conditions, LocalRefineInfo);
176 
177  RefineOtherBoundary(mrModelPart, list_of_points, list_of_conditions, LocalRefineInfo);
178 
179  BuildNewConditions(mrModelPart, list_of_points, list_of_conditions, LocalRefineInfo);
180 
181  CleanConditionsAndFlags(mrModelPart);
182 
183  }
184  else{
185 
187 
188  conditions_size = rModelPart.Conditions().size();
189  list_of_points.reserve(conditions_size);
190  list_of_conditions.reserve(conditions_size);
191 
192  RefineContactBoundary(rModelPart, list_of_points, list_of_conditions, LocalRefineInfo);
193 
194  RefineOtherBoundary(rModelPart, list_of_points, list_of_conditions, LocalRefineInfo);
195 
196  BuildNewConditions(rModelPart, list_of_points, list_of_conditions, LocalRefineInfo);
197 
198  CleanConditionsAndFlags(rModelPart);
199  }
200 
201 
202 
203  } // REFINE END;
204 
205 
206 
207  mrRemesh.Info->InsertedBoundaryConditions = mrModelPart.NumberOfConditions()-mrRemesh.Info->InsertedBoundaryConditions;
208  mrRemesh.Info->InsertedBoundaryNodes = mrModelPart.NumberOfNodes()-mrRemesh.Info->InsertedBoundaryNodes;
209 
210  if( this->mEchoLevel > 0 ){
211  std::cout<<" [ CONDITIONS ( inserted : "<<mrRemesh.Info->InsertedBoundaryConditions<<" ) ]"<<std::endl;
212  std::cout<<" [ NODES ( inserted : "<<mrRemesh.Info->InsertedBoundaryNodes<<" ) ]"<<std::endl;
213  std::cout<<" [ contact(TIP: "<<LocalRefineInfo.number_contact_tip_insertions<<", SIZE: "<<LocalRefineInfo.number_contact_size_insertions<<") - bound(TIP: "<<LocalRefineInfo.number_of_tip_bounds<<", SIZE: "<<LocalRefineInfo.number_of_exterior_bounds<<")]"<<std::endl;
214 
215 
216  std::cout<<" REFINE BOUNDARY ]; "<<std::endl;
217  }
218 
219  KRATOS_CATCH(" ")
220 
221  }
222 
226 
227 
231 
232 
236 
238  std::string Info() const override
239  {
240  return "RefineConditionsInContactMesherProcess";
241  }
242 
244  void PrintInfo(std::ostream& rOStream) const override
245  {
246  rOStream << "RefineConditionsInContactMesherProcess";
247  }
248 
250  void PrintData(std::ostream& rOStream) const override
251  {
252  }
253 
254 
258 
260 
261 
262 private:
265 
269 
270  std::vector<SpatialBoundingBox::Pointer> mRigidWalls;
271 
275 
276  //*******************************************************************************************
277  //*******************************************************************************************
278 
279  void CleanConditionsAndFlags(ModelPart& rModelPart)
280  {
281 
282  KRATOS_TRY
283 
284  //swap conditions for a temporary use
285  ModelPart::ConditionsContainerType TemporaryConditions;
286  TemporaryConditions.reserve(rModelPart.Conditions().size());
287  TemporaryConditions.swap(rModelPart.Conditions());
288 
289  for(ModelPart::ConditionsContainerType::iterator ic = TemporaryConditions.begin(); ic!= TemporaryConditions.end(); ic++)
290  {
291  Geometry< Node > rGeometry =ic->GetGeometry();
292  for(unsigned int i=0; i<rGeometry.size(); ++i)
293  {
294  rGeometry[i].Reset(TO_SPLIT);
295  }
296 
297  if(ic->IsNot(TO_ERASE)){
298  rModelPart.AddCondition(*(ic.base()));
299  }
300  // else{
301  // std::cout<<" Condition RELEASED:"<<ic->Id()<<std::endl;
302  // }
303  }
304 
305 
306  KRATOS_CATCH(" ")
307 
308  }
309 
310 
311  //*******************************************************************************************
312  //*******************************************************************************************
313 
314  void BuildNewConditions( ModelPart& rModelPart, std::vector<Point >& list_of_points, std::vector<Condition*>& list_of_conditions, RefineCounters& rLocalRefineInfo )
315  {
316 
317  KRATOS_TRY
318 
319  //node to get the DOFs from
320  Node::DofsContainerType& reference_dofs = (rModelPart.NodesBegin())->GetDofs();
321  //unsigned int step_data_size = rModelPart.GetNodalSolutionStepDataSize();
322  double z = 0.0;
323 
324  unsigned int initial_node_size = mrModelPart.Nodes().size()+1; //total model part node size
325  unsigned int initial_cond_size = mrModelPart.Conditions().size()+1; //total model part node size
326 
327  Node new_point(0,0.0,0.0,0.0);
328 
329  int id=0;
330  //if points were added, new nodes must be added to ModelPart
331  for(unsigned int i = 0; i<list_of_points.size(); ++i)
332  {
333  id = initial_node_size+i;
334 
335  double& x= list_of_points[i].X();
336  double& y= list_of_points[i].Y();
337 
338  Node::Pointer pnode = rModelPart.CreateNewNode(id,x,y,z);
339 
340  pnode->SetBufferSize(rModelPart.NodesBegin()->GetBufferSize() );
341 
342 
343  //assign data to dofs
344 
345  //2D edges:
346  Geometry< Node >& rConditionGeometry = list_of_conditions[i]->GetGeometry();
347 
348 
349  //generating the dofs
350  for(Node::DofsContainerType::iterator iii = reference_dofs.begin(); iii != reference_dofs.end(); ++iii)
351  {
352  Node::DofType& rDof = **iii;
353  Node::DofType::Pointer p_new_dof = pnode->pAddDof( rDof );
354 
355  if( rConditionGeometry[0].IsFixed(rDof.GetVariable()) && rConditionGeometry[1].IsFixed(rDof.GetVariable()) )
356  (p_new_dof)->FixDof();
357  else
358  (p_new_dof)->FreeDof();
359  }
360 
361  //assign data to dofs
362  VariablesList& variables_list = rModelPart.GetNodalSolutionStepVariablesList();
363 
364  PointsArrayType PointsArray;
365  PointsArray.push_back( rConditionGeometry(0) );
366  PointsArray.push_back( rConditionGeometry(1) );
367 
368  Geometry<Node > geom( PointsArray );
369 
370  std::vector<double> N(2);
371  N[0] = 0.5;
372  N[1] = 0.5;
373 
374  MeshDataTransferUtilities DataTransferUtilities;
375  DataTransferUtilities.Interpolate( geom, N, variables_list, pnode);
376 
377  // //int cond_id = list_of_points[i].Id();
378  // //Geometry< Node >& rConditionGeometry = (*(rModelPart.Conditions().find(cond_id).base()))->GetGeometry();
379 
380  //set specific control values and flags:
381  pnode->Set(BOUNDARY);
382  pnode->Set(NEW_ENTITY); //if boundary is rebuild, the flag INSERTED must be set to new conditions too
383  //std::cout<<" Node ["<<pnode->Id()<<"] is a NEW_ENTITY "<<std::endl;
384 
385  double& nodal_h = pnode->FastGetSolutionStepValue(NODAL_H);
386  //nodal_h = 0.5*(nodal_h+mrRemesh.Refine->CriticalSide); //modify nodal_h for security
387  nodal_h = mrRemesh.Refine->CriticalSide; //modify nodal_h for security
388 
389  const array_1d<double,3> ZeroNormal(3,0.0);
390  //correct normal interpolation
391  noalias(pnode->GetSolutionStepValue(NORMAL)) = list_of_conditions[i]->GetValue(NORMAL);
392 
393 
394  //correct contact_normal interpolation (laplacian boundary projection uses it)
395  array_1d<double, 3 > & ContactForceNormal1 = rConditionGeometry[0].FastGetSolutionStepValue(CONTACT_FORCE);
396  array_1d<double, 3 > & ContactForceNormal2 = rConditionGeometry[1].FastGetSolutionStepValue(CONTACT_FORCE);
397  if(norm_2(ContactForceNormal1)==0 || norm_2(ContactForceNormal2)==0)
398  noalias(pnode->FastGetSolutionStepValue(CONTACT_FORCE)) = ZeroNormal;
399 
400  //recover the original position of the node
401  const array_1d<double,3>& disp = pnode->FastGetSolutionStepValue(DISPLACEMENT);
402  pnode->X0() = pnode->X() - disp[0];
403  pnode->Y0() = pnode->Y() - disp[1];
404  pnode->Z0() = pnode->Z() - disp[2];
405 
406  //Conditions must be also created with the add of a new node:
409  face1.reserve(2);
410  face2.reserve(2);
411 
412  face1.push_back(rConditionGeometry(0));
413  face1.push_back(pnode);
414 
415  face2.push_back(pnode);
416  face2.push_back(rConditionGeometry(1));
417 
418  id = initial_cond_size+(i*2);
419 
420  ConditionType::Pointer pcond1 = list_of_conditions[i]->Clone(id, face1);
421  //std::cout<<" ID"<<id<<" 1s "<<pcond1->GetGeometry()[0].Id()<<" "<<pcond1->GetGeometry()[1].Id()<<std::endl;
422  id = initial_cond_size+(i*2+1);
423  ConditionType::Pointer pcond2 = list_of_conditions[i]->Clone(id, face2);
424  //std::cout<<" ID"<<id<<" 2s "<<pcond2->GetGeometry()[0].Id()<<" "<<pcond2->GetGeometry()[1].Id()<<std::endl;
425 
426  pcond1->Set(NEW_ENTITY);
427  pcond2->Set(NEW_ENTITY);
428 
429  pcond1->SetValue(MASTER_NODES, list_of_conditions[i]->GetValue(MASTER_NODES) );
430  pcond1->SetValue(NORMAL, list_of_conditions[i]->GetValue(NORMAL) );
431  pcond1->SetValue(CAUCHY_STRESS_VECTOR,list_of_conditions[i]->GetValue(CAUCHY_STRESS_VECTOR));
432  pcond1->SetValue(DEFORMATION_GRADIENT,list_of_conditions[i]->GetValue(DEFORMATION_GRADIENT));
433 
434  pcond2->SetValue(MASTER_NODES, list_of_conditions[i]->GetValue(MASTER_NODES) );
435  pcond2->SetValue(NORMAL, list_of_conditions[i]->GetValue(NORMAL) );
436  pcond2->SetValue(CAUCHY_STRESS_VECTOR,list_of_conditions[i]->GetValue(CAUCHY_STRESS_VECTOR));
437  pcond2->SetValue(DEFORMATION_GRADIENT,list_of_conditions[i]->GetValue(DEFORMATION_GRADIENT));
438 
439 
440  //std::cout<<" pcond0 "<<rModelPart.NumberOfConditions()<<" "<<mrRemesh.Info->InsertedBoundaryConditions<<std::endl;
441 
442  rModelPart.AddCondition(pcond1);
443 
444  //std::cout<<" pcond1 "<<rModelPart.NumberOfConditions()<<" "<<mrRemesh.Info->InsertedBoundaryConditions<<std::endl;
445 
446  rModelPart.AddCondition(pcond2);
447 
448  //std::cout<<" pcond2 "<<rModelPart.NumberOfConditions()<<" "<<mrRemesh.Info->InsertedBoundaryConditions<<std::endl;
449  }
450 
451 
452  KRATOS_CATCH(" ")
453 
454  }
455 
456  //*******************************************************************************************
457  //*******************************************************************************************
458 
459  bool RefineContactBoundary(ModelPart& rModelPart, std::vector<Point >& list_of_points, std::vector<Condition*>& list_of_conditions, RefineCounters& rLocalRefineInfo )
460  {
461 
462  KRATOS_TRY
463 
464  //ProcessInfo& CurrentProcessInfo = rModelPart.GetProcessInfo();
465 
466  //***SIZES :::: parameters do define the tolerance in mesh size:
467 
468  //DEFORMABLE CONTACT:
469  double factor_for_tip_radius = 0.2; //deformable contact tolerance in radius for detection tip sides to refine
470  double factor_for_non_tip_side = 3.0; // will be multiplied for nodal_h of the master node to compare with boundary nodes average nodal_h in a contact conditio which master node do not belongs to a tip
471 
472  double size_for_tip_contact_side = 0.4 * mrRemesh.Refine->CriticalSide; // length size for the contact tip side
473  double size_for_non_tip_contact_side = 2.0 * mrRemesh.Refine->CriticalSide; // compared with contact size which master node do not belongs to a tip
474 
475 
476  //*********************************************************************************
477  // DETECTION OF NODES ON TIP CONTACTS START
478  //*********************************************************************************
479 
480  unsigned int nodes_on_wall_tip = 0;
481  double ContactFace = 0;
482  for(ModelPart::ConditionsContainerType::iterator i_cond =rModelPart.ConditionsBegin(); i_cond!= rModelPart.ConditionsEnd(); i_cond++)
483  {
484  if( i_cond->Is(CONTACT) && i_cond->GetGeometry().size() == 1 ){
485 
486  // i_cond->GetValueOnIntegrationPoints(ContactFace, CONTACT_FACE, CurrentProcessInfo);
487 
488  if( int(ContactFace) == 2 ){ // tip
489 
490  i_cond->GetGeometry()[0].Set(TO_SPLIT);
491  nodes_on_wall_tip ++;
492 
493  }
494  }
495  }
496 
497 
498  if( this->mEchoLevel > 0 )
499  std::cout <<" [ NODES ON WALL TIP: ( " <<nodes_on_wall_tip <<" ) ]"<<std::endl;
500 
501  //*********************************************************************************
502  // DETECTION OF NODES ON TIP CONTACTS END
503  //*********************************************************************************
504 
505 
506  // std::vector<int> nodes_ids;
507  // nodes_ids.resize(rModelPart.Conditions().size()); //mesh 0
508  // std::fill( nodes_ids.begin(), nodes_ids.end(), 0 );
509 
510  //std::cout<<" List of Conditions Reserved Size: "<<conditions_size<<std::endl;
511 
512  double tool_radius = 0;
513  double side_length = 0;
514 
515  bool size_insert = false;
516  bool radius_insert = false;
517  bool contact_active = false;
518 
519  bool contact_semi_active = false;
520  bool tool_project = false;
521 
522  std::vector<bool> semi_active_nodes;
523  Node new_point(0,0.0,0.0,0.0);
524 
525 
526  for(ModelPart::ConditionsContainerType::iterator ic = mrModelPart.ConditionsBegin(); ic!= mrModelPart.ConditionsEnd(); ic++)
527  {
528 
529  size_insert = false;
530  radius_insert = false;
531  tool_project = false;
532  contact_active = false;
533 
534  tool_radius = 0;
535  side_length = 0;
536 
537  Geometry< Node > rConditionGeometry;
538  array_1d<double,3> tip_center;
539  tip_center.clear();
540 
541 
542  //LOOP TO CONSIDER ONLY CONTACT CONDITIONS
543  if( ic->Is(CONTACT) ) //Refine radius on the workpiece for the ContactDomain zone
544  {
545 
546  Node MasterNode;
547  bool condition_found = false;
548  ConditionType::Pointer MasterCondition = mMesherUtilities.FindMasterCondition(*(ic.base()),MasterNode,rModelPart.Conditions(),condition_found);
549 
550 
551  if(condition_found){
552 
553  if( MasterCondition->IsNot(TO_ERASE) ){
554 
555 
556  rConditionGeometry = MasterCondition->GetGeometry();
557 
558  //to recover TIP definition on conditions
559  if( MasterNode.SolutionStepsDataHas( WALL_TIP_RADIUS ) ) //master node in tool --> refine workpiece //
560  {
561 
562  tool_radius = MasterNode.FastGetSolutionStepValue( WALL_TIP_RADIUS );
563  tip_center = MasterNode.FastGetSolutionStepValue( WALL_REFERENCE_POINT );
564  // WARNING THE UPDATE OF THE TIP CENTER IS NEEDED !!!!
565 
566  array_1d<double, 3 > radius;
567  radius[0]=rConditionGeometry[0].X()-tip_center[0];
568  radius[1]=rConditionGeometry[0].Y()-tip_center[1];
569  radius[2]=rConditionGeometry[0].Z()-tip_center[2];
570  double distance1=norm_2(radius);
571 
572  radius[0]=rConditionGeometry[1].X()-tip_center[0];
573  radius[1]=rConditionGeometry[1].Y()-tip_center[1];
574  radius[2]=rConditionGeometry[1].Z()-tip_center[2];
575 
576  double distance2=norm_2(radius);
577 
578 
579  // TO SPLIT DETECTION START
580  //If a node is detected in the wall tip is set TO_SPLIT
581  //the criteria to splitting will be applied later in the nodes marked as TO_SPLIT
582 
583  if( (1-factor_for_tip_radius)*tool_radius < distance1 && distance1 < (1+factor_for_tip_radius)*tool_radius )
584  rConditionGeometry[0].Set(TO_SPLIT);
585 
586  if( (1-factor_for_tip_radius)*tool_radius < distance2 && distance2 < (1+factor_for_tip_radius)*tool_radius )
587  rConditionGeometry[1].Set(TO_SPLIT);
588 
589  // TO SPLIT DETECTION END
590 
591 
592  // ACTIVE CONTACT DETECTION START
593 
594  contact_active = mMesherUtilities.CheckContactActive(rConditionGeometry, contact_semi_active, semi_active_nodes);
595  if(contact_active){
596  rLocalRefineInfo.number_of_active_contacts ++;
597  }
598 
599  // ACTIVE CONTACT DETECTION END
600 
601 
602  side_length = mMesherUtilities.CalculateSideLength (rConditionGeometry[0],rConditionGeometry[1]);
603 
604  if( side_length > size_for_tip_contact_side ){
605 
606 
607  if( ((1-factor_for_tip_radius)*tool_radius < distance1 && (1-factor_for_tip_radius)*tool_radius < distance2) &&
608  (distance1 < (1+factor_for_tip_radius)*tool_radius && distance2 < (1+factor_for_tip_radius)*tool_radius) )
609  {
610  radius_insert = true;
611 
612  }
613  // else if( side_length > size_for_tip_contact_side &&
614  // ( distance1 < (1 + (side_size_factor+factor_for_tip_radius))*tool_radius && distance2 < (1 + (side_size_factor+factor_for_tip_radius))*tool_radius) ) {
615 
616  // size_insert = true;
617  // std::cout<<" insert on radius-size "<<std::endl;
618  // }
619 
620  }
621 
622 
623  if(radius_insert){
624 
625  if(!contact_active){
626 
627  radius_insert = false;
628  // std::cout<<" contact_not_active "<<std::endl;
629  // double& nodal_h1 = rConditionGeometry[0].FastGetSolutionStepValue(NODAL_H);
630  // double& nodal_h2 = rConditionGeometry[1].FastGetSolutionStepValue(NODAL_H);
631  // double& nodal_h0 = MasterNode.FastGetSolutionStepValue( NODAL_H );
632 
633  // double side = norm_2(rConditionGeometry[0]-rConditionGeometry[1]);
634  // // double d1 = mMesherUtilities.FindBoundaryH (rConditionGeometry[0]);
635  // // double d2 = mMesherUtilities.FindBoundaryH (rConditionGeometry[1]);
636  // // double d0 = mMesherUtilities.FindBoundaryH (MasterNode);
637  // // double size_master = nodal_h0;
638 
639  // bool candidate =false;
640  // if( ((nodal_h1+nodal_h2)*0.5) > factor_for_non_tip_side * nodal_h0 ){
641  // candidate = true;
642  // }
643 
644  // double crit_factor = 2;
645  // if( (side > size_for_non_tip_contact_side) && candidate ){
646  // radius_insert = true;
647  // }
648 
649  }
650 
651  }
652 
653 
654  }
655  else{ //refine boundary with nodal_h sizes to large
656 
657  double& nodal_h1 = rConditionGeometry[0].FastGetSolutionStepValue(NODAL_H);
658  double& nodal_h2 = rConditionGeometry[1].FastGetSolutionStepValue(NODAL_H);
659  double& nodal_h0 = MasterNode.FastGetSolutionStepValue( NODAL_H );
660 
661  double side = norm_2(rConditionGeometry[0]-rConditionGeometry[1]);
662  // double d1 = mMesherUtilities.FindBoundaryH (rConditionGeometry[0]);
663  // double d2 = mMesherUtilities.FindBoundaryH (rConditionGeometry[1]);
664  // double d0 = mMesherUtilities.FindBoundaryH (MasterNode);
665  // double size_master = nodal_h0;
666 
667 
668  bool candidate =false;
669  if( ((nodal_h1+nodal_h2)*0.5) > factor_for_non_tip_side * nodal_h0 ){
670  candidate = true;
671  }
672 
673  if( (side > size_for_non_tip_contact_side ) && candidate ){
674  size_insert = true;
675  }
676  }
677 
678 
679 
680  if( radius_insert || size_insert ) //Boundary must be rebuild
681  {
682 
683  //std::cout<<" CONTACT DOMAIN ELEMENT REFINED "<<ic->Id()<<std::endl;
684 
685  new_point.X() = 0.5*( rConditionGeometry[1].X() + rConditionGeometry[0].X() );
686  new_point.Y() = 0.5*( rConditionGeometry[1].Y() + rConditionGeometry[0].Y() );
687  new_point.Z() = 0.5*( rConditionGeometry[1].Z() + rConditionGeometry[0].Z() );
688 
689 
690  new_point.SetId(ic->Id()); //set condition Id
691 
692  Condition* ContactMasterCondition = ic->GetValue(MASTER_CONDITION).get();
693 
694 
695  if( (rConditionGeometry[0].Is(TO_SPLIT) && rConditionGeometry[1].Is(TO_SPLIT)) )
696  tool_project = true;
697 
698  if( (rConditionGeometry[0].Is(TO_SPLIT) || rConditionGeometry[1].Is(TO_SPLIT)) && contact_active)
699  tool_project = true;
700 
701 
702  if(tool_project) //master node in tool --> refine workpiece // (tool_radius ==0 in workpiece nodes)
703  {
704 
705  if(new_point.Y()<(tip_center[1]) && new_point.Y()>(tip_center[1]-tool_radius)){
706 
707  // std::cout<<" new_point ("<<new_point.X()<<", "<<new_point.Y()<<") "<<std::endl;
708  // std::cout<<" tip_center ("<<tip_center[0]<<", "<<tip_center[1]<<") radius "<<tool_radius<<std::endl;
709 
710  array_1d<double,3> tip_normal = tip_center-new_point;
711 
712  if(norm_2(tip_normal)<tool_radius*0.95){ //if is in the tool tip
713  tip_normal -= (tool_radius/norm_2(tip_normal)) * tip_normal;
714  if(norm_2(tip_normal)<tool_radius*0.05)
715  new_point += tip_normal;
716 
717  // std::cout<<" A: Tool Tip Correction COND ("<<ContactMasterCondition->Id()<<") "<<std::endl;
718  // std::cout<<" new_point ("<<new_point.X()<<", "<<new_point.Y()<<") "<<std::endl;
719  }
720  }
721  }
722 
723  if(radius_insert)
724  rLocalRefineInfo.number_contact_tip_insertions++;
725  if(size_insert)
726  rLocalRefineInfo.number_contact_size_insertions++;
727 
728  // std::cout<<" MasterCondition RELEASED (Id: "<<ContactMasterCondition->Id()<<") "<<std::endl;
729  ContactMasterCondition->Set(TO_ERASE);
730  list_of_points.push_back(new_point);
731  list_of_conditions.push_back(ContactMasterCondition);
732  }
733  }
734 
735  rLocalRefineInfo.number_of_contacts ++;
736  }
737  // else{
738 
739  // std::cout<<" Master Condition not found "<<std::endl;
740 
741  // }
742 
743  rLocalRefineInfo.number_of_contact_conditions ++;
744 
745  }
746  }
747 
748  // std::cout<<" [ Contact Conditions : "<<rLocalRefineInfo.number_of_contact_conditions<<", (contacts in domain: "<<rLocalRefineInfo.number_of_contacts<<", of them active: "<<rLocalRefineInfo.number_of_active_contacts<<") ] "<<std::endl;
749  // std::cout<<" Contact Search End ["<<list_of_conditions.size()<<" : "<<list_of_points.size()<<"]"<<std::endl;
750 
751  return true;
752 
753  KRATOS_CATCH(" ")
754 
755  }
756 
757  //*******************************************************************************************
758  //*******************************************************************************************
759 
760  bool RefineOtherBoundary(ModelPart& rModelPart, std::vector<Point >& list_of_points, std::vector<Condition*>& list_of_conditions, RefineCounters& rLocalRefineInfo )
761  {
762 
763  KRATOS_TRY
764 
765  ProcessInfo& CurrentProcessInfo = rModelPart.GetProcessInfo();
766 
767  //***SIZES :::: parameters do define the tolerance in mesh size:
768 
769  //RIGID WALL CONTACT:
770  double factor_for_tip_radius = 0.20; //deformable contact tolerance in radius for detection tip sides to refine
771 
772  double size_for_wall_tip_contact_side = 0.50 * mrRemesh.Refine->CriticalSide;
773  double size_for_wall_semi_tip_contact_side = 0.75 * mrRemesh.Refine->CriticalSide; // semi contact or contact which a node in a tip
774  double size_for_wall_non_tip_contact_side = 1.50 * mrRemesh.Refine->CriticalSide; // semi contact or contact which no node in a tip
775 
776  //NON CONTACT:
777  double size_for_energy_side = 1.50 * mrRemesh.Refine->CriticalSide; // non contact side which dissipates energy
778  double size_for_non_contact_side = 3.50 * mrRemesh.Refine->CriticalSide;
779 
780 
781  double tool_radius= 0;
782  double side_length= 0;
783  double plastic_power=0;
784 
785  bool radius_insert = false;
786  bool energy_insert = false;
787  bool mesh_size_insert = false;
788  bool contact_active = false;
789  bool contact_semi_active = false;
790  bool tool_project = false;
791 
792  Node new_point(0,0.0,0.0,0.0);
793 
794  std::vector<bool> semi_active_nodes;
795 
796 
797  //LOOP TO CONSIDER ALL SUBDOMAIN CONDITIONS
798  double cond_counter=0;
799  for(ModelPart::ConditionsContainerType::iterator ic = rModelPart.ConditionsBegin(); ic!= rModelPart.ConditionsEnd(); ic++)
800  {
801  cond_counter ++;
802  bool refine_candidate = false;
803  if( mrRemesh.Options.Is(MesherUtilities::CONSTRAINED) ){
804  if( ic->Is(BOUNDARY) ) //ONLY SET TO THE BOUNDARY SKIN CONDITIONS (CompositeCondition)
805  refine_candidate = true;
806  else
807  refine_candidate = false;
808  }
809  else{
810  refine_candidate = true;
811  }
812 
813 
814  if( refine_candidate ){
815  if (mrRemesh.Refine->RefiningBoxSetFlag == true ){
816  refine_candidate = mMesherUtilities.CheckConditionInBox(*(ic.base()),*(mrRemesh.Refine->RefiningBox),CurrentProcessInfo);
817  }
818  }
819 
820 
821  if( refine_candidate ){
822 
823  radius_insert = false;
824  energy_insert = false;
825  mesh_size_insert = false;
826  tool_project = false;
827  contact_active = false;
828  contact_semi_active = false;
829 
830  side_length = 0;
831  tool_radius = 0;
832  plastic_power = 0;
833 
834  //double condition_radius = 0;
835  Geometry< Node > rConditionGeometry;
836  array_1d<double,3> tip_center;
837 
838  if( ic->IsNot(TO_ERASE) ){
839 
840  //*********************************************************************************
841  // RIGID CONTACT CONDITIONS ON TIP START
842  //*********************************************************************************
843 
844  // TOOL TIP INSERT;
845 
846 
847  // ACTIVE CONTACT DETECTION START
848 
849  rConditionGeometry = ic->GetGeometry();
850  contact_active = mMesherUtilities.CheckContactActive(rConditionGeometry, contact_semi_active, semi_active_nodes);
851 
852  // ACTIVE CONTACT DETECTION END
853 
854 
855  if( contact_active ){
856 
857  side_length = mMesherUtilities.CalculateSideLength (rConditionGeometry[0],rConditionGeometry[1]);
858 
859  if( side_length > size_for_wall_tip_contact_side ){
860 
861  bool on_tip = false;
862  if(rConditionGeometry[0].Is(TO_SPLIT) && rConditionGeometry[1].Is(TO_SPLIT)){
863  on_tip = true;
864  }
865  else if (rConditionGeometry[0].Is(TO_SPLIT) || rConditionGeometry[1].Is(TO_SPLIT)){
866  if( side_length > size_for_wall_tip_contact_side ){
867  on_tip = true;
868  }
869  }
870 
871  bool on_radius = false;
872 
873  if( on_tip && mRigidWalls.size() ){
874 
875  Vector Point(3);
876  if( rConditionGeometry[0].Is(TO_SPLIT) ){
877 
878  Point[0] = rConditionGeometry[0].X();
879  Point[1] = rConditionGeometry[0].Y();
880  Point[2] = rConditionGeometry[0].Z();
881  on_radius = true;
882 
883  }
884  else if( rConditionGeometry[1].Is(TO_SPLIT) ){
885 
886  Point[0] = rConditionGeometry[1].X();
887  Point[1] = rConditionGeometry[1].Y();
888  Point[2] = rConditionGeometry[1].Z();
889  on_radius = true;
890 
891  }
892  else{
893  on_radius = false;
894  }
895 
896 
897  if( on_radius ){
898 
899  ProcessInfo& CurrentProcessInfo = rModelPart.GetProcessInfo();
900  double Time = CurrentProcessInfo[TIME];
901  for( unsigned int i = 0; i <mRigidWalls.size(); ++i )
902  {
903  if(mRigidWalls[i]->IsInside( Point, Time ) ){
904  tool_radius =mRigidWalls[i]->GetRadius(Point);
905  tip_center =mRigidWalls[i]->GetCenter(Point);
906  break;
907  }
908  }
909  }
910 
911  }
912 
913  if( on_radius && on_tip ) //master node in tool --> refine workpiece // (tool_radius ==0 in workpiece nodes)
914  {
915  Node center (0,tip_center[0],tip_center[1],tip_center[2]);
916  array_1d<double, 3 > radius;
917  radius[0]=rConditionGeometry[0].X()-center.X();
918  radius[1]=rConditionGeometry[0].Y()-center.Y();
919  radius[2]=rConditionGeometry[0].Z()-center.Z();
920 
921  double distance1=norm_2(radius);
922 
923  radius[0]=rConditionGeometry[1].X()-center.X();
924  radius[1]=rConditionGeometry[1].Y()-center.Y();
925  radius[2]=rConditionGeometry[1].Z()-center.Z();
926 
927  double distance2=norm_2(radius);
928 
929 
930  if( ((1-factor_for_tip_radius)*tool_radius < distance1 && (1-factor_for_tip_radius)*tool_radius < distance2) &&
931  (distance1 < (1+factor_for_tip_radius)*tool_radius && distance2 < (1+factor_for_tip_radius)*tool_radius) )
932  {
933  radius_insert = true;
934  }
935 
936  }
937 
938  }
939 
940  }
941 
942  //*********************************************************************************
943  // RIGID CONTACT CONDITIONS ON TIP END
944  //*********************************************************************************
945 
946 
947  //*********************************************************************************
948  // FREE BOUNDARY CONDITIONS ENERGY INSERTION START
949  //*********************************************************************************
950 
951 
952  // ENERGY INSERT
953 
954  unsigned int vsize=ic->GetValue(MASTER_ELEMENTS).size();
955 
956  if (!radius_insert && mrRemesh.Refine->RefiningOptions.Is(MesherUtilities::REFINE_BOUNDARY_ON_THRESHOLD) && vsize>0){
957 
958  Element& MasterElement = ic->GetValue(MASTER_ELEMENTS)[vsize-1];
959 
960  plastic_power=0;
961  std::vector<double> Value(1);
962 
963  MasterElement.GetValueOnIntegrationPoints(mrRemesh.Refine->GetThresholdVariable(),Value,CurrentProcessInfo);
964 
965 
966  Geometry<Node >& pGeom = MasterElement.GetGeometry();
967  plastic_power = Value[0] * pGeom.Area();
968 
969  // if( Value[0] > 0 )
970  // std::cout<<" plastic_power "<<plastic_power<<std::endl;
971 
972  //computation of the condition master element radius start:
973  //PointsArrayType& vertices = pGeom.Points();
974 
975  // double average_side_length= mMesherUtilities.CalculateAverageSideLength (vertices[0].X(), vertices[0].Y(),
976  // vertices[1].X(), vertices[1].Y(),
977  // vertices[2].X(), vertices[2].Y());
978  //condition_radius = pGeom.Area()/average_side_length;
979  //computation of the condition master element radius end;
980 
981  //condition_radius is side_length
982  side_length = mMesherUtilities.CalculateSideLength (rConditionGeometry[0],rConditionGeometry[1]);
983 
984  //condition_radius = mMesherUtilities.CalculateTriangleRadius (pGeom);
985 
986  //if( plastic_power > mrRemesh.Refine->CriticalDissipation && condition_radius > mrRemesh.Refine->CriticalRadius )
987  if( plastic_power > mrRemesh.Refine->ReferenceThreshold * pGeom.Area() && side_length > size_for_energy_side )
988  {
989  energy_insert = true;
990  }
991  }
992 
993 
994  //*********************************************************************************
995  // FREE BOUNDARY CONDITIONS ENERGY INSERTION END
996  //*********************************************************************************
997 
998 
999  //*********************************************************************************
1000  // FREE BOUNDARY CONDITIONS SIZE INSERTION
1001  //*********************************************************************************
1002 
1003 
1004  // BOUNDARY SIZE INSERT
1005 
1006  if( (!radius_insert || !energy_insert) && vsize>0 ){
1007 
1008  Element& MasterElement = ic->GetValue(MASTER_ELEMENTS)[vsize-1];
1009 
1010  //std::cout<<" MASTER_ELEMENT "<<MasterElement.Id()<<std::endl;
1011 
1012 
1013  Geometry<Node >& vertices = MasterElement.GetGeometry();
1014  double Alpha = mrRemesh.Refine->Alpha;
1015 
1016  bool accepted = mMesherUtilities.AlphaShape(Alpha,vertices,2);
1017 
1018 
1019  //condition_radius is side_length
1020  side_length = mMesherUtilities.CalculateSideLength (rConditionGeometry[0],rConditionGeometry[1]);
1021 
1022  //condition_radius = mMesherUtilities.CalculateTriangleRadius (pGeom);
1023  double critical_side_size = 0;
1024 
1025  bool on_tip = false;
1026  if( contact_semi_active ){
1027 
1028  if (rConditionGeometry[0].Is(TO_SPLIT) || rConditionGeometry[1].Is(TO_SPLIT))
1029  on_tip = true;
1030 
1031  if( on_tip == true )
1032  critical_side_size = size_for_wall_semi_tip_contact_side;
1033  else
1034  critical_side_size = size_for_wall_non_tip_contact_side;
1035 
1036 
1037 
1038  }
1039  else if( contact_active ){
1040 
1041  if (rConditionGeometry[0].Is(TO_SPLIT) || rConditionGeometry[1].Is(TO_SPLIT))
1042  on_tip = true;
1043 
1044  if( on_tip == true )
1045  critical_side_size = size_for_wall_semi_tip_contact_side;
1046  else
1047  critical_side_size = size_for_wall_non_tip_contact_side;
1048 
1049  }
1050  else{
1051 
1052  critical_side_size = size_for_non_contact_side;
1053  }
1054 
1055 
1056  //if(plastic_power > mrRemesh.Refine->CriticalDissipation && condition_radius > mrRemesh.Refine->CriticalRadius)
1057  if( !accepted && !contact_semi_active && !contact_active && side_length > critical_side_size )
1058  {
1059  mesh_size_insert = true;
1060 
1061  // std::cout<<" insert on mesh size "<<std::endl;
1062  }
1063  else if( contact_semi_active && side_length > critical_side_size )
1064  {
1065  mesh_size_insert = true;
1066 
1067  // std::cout<<" insert on mesh size semi_contact "<<std::endl;
1068 
1069  }
1070  else if( contact_active && side_length > critical_side_size )
1071  {
1072  mesh_size_insert = true;
1073 
1074  // std::cout<<" insert on mesh size on contact "<<std::endl;
1075 
1076  }
1077 
1078 
1079  }
1080 
1081 
1082  //*********************************************************************************
1083  // BOUNDARY REBUILD START //
1084  //*********************************************************************************
1085 
1086 
1087  if( radius_insert || energy_insert || mesh_size_insert ) //Boundary must be rebuild
1088  {
1089 
1090  // std::cout<<" BOUNDARY DOMAIN ELEMENT REFINED "<<ic->Id()<<std::endl;
1091 
1092  new_point.X() = 0.5*( rConditionGeometry[1].X() + rConditionGeometry[0].X() );
1093  new_point.Y() = 0.5*( rConditionGeometry[1].Y() + rConditionGeometry[0].Y() );
1094  new_point.Z() = 0.5*( rConditionGeometry[1].Z() + rConditionGeometry[0].Z() );
1095 
1096  if( this->mEchoLevel > 0 ){
1097  std::cout<<" radius_insert "<<radius_insert<<" energy_insert "<<energy_insert<<" mesh_size_insert "<<mesh_size_insert<<std::endl;
1098  std::cout<<" NEW NODE "<<new_point<<std::endl;
1099  }
1100 
1101  new_point.SetId(ic->Id()); //set condition Id
1102 
1103  //it will be good if the node is detected in the tool tip using the rigid contact standards:
1104 
1105  if( (rConditionGeometry[0].Is(TO_SPLIT) && rConditionGeometry[1].Is(TO_SPLIT)) )
1106  tool_project = true;
1107 
1108  if( (rConditionGeometry[0].Is(TO_SPLIT) || rConditionGeometry[1].Is(TO_SPLIT)) && contact_active)
1109  tool_project = true;
1110 
1111  if( (rConditionGeometry[0].Is(TO_SPLIT) || rConditionGeometry[1].Is(TO_SPLIT)) && contact_semi_active)
1112  tool_project = true;
1113 
1114  bool on_radius = false;
1115 
1116  if( tool_project && mRigidWalls.size() ){
1117 
1118  Vector Point(3);
1119  if( rConditionGeometry[0].Is(TO_SPLIT) ){
1120 
1121  Point[0] = rConditionGeometry[0].X();
1122  Point[1] = rConditionGeometry[0].Y();
1123  Point[2] = rConditionGeometry[0].Z();
1124  on_radius = true;
1125 
1126  }
1127  else if( rConditionGeometry[1].Is(TO_SPLIT) ){
1128 
1129  Point[0] = rConditionGeometry[1].X();
1130  Point[1] = rConditionGeometry[1].Y();
1131  Point[2] = rConditionGeometry[1].Z();
1132  on_radius = true;
1133 
1134  }
1135  else{
1136  on_radius = false;
1137  }
1138 
1139 
1140  if( on_radius ){
1141 
1142  ProcessInfo& CurrentProcessInfo = rModelPart.GetProcessInfo();
1143  double Time = CurrentProcessInfo[TIME];
1144  for( unsigned int i = 0; i <mRigidWalls.size(); ++i )
1145  {
1146  if(mRigidWalls[i]->IsInside( Point, Time ) ){
1147  tool_radius =mRigidWalls[i]->GetRadius(Point);
1148  tip_center =mRigidWalls[i]->GetCenter(Point);
1149  break;
1150  }
1151  }
1152  }
1153 
1154 
1155 
1156 
1157  if(on_radius){
1158 
1159  if(new_point.Y()<(tip_center[1]) && new_point.Y()>(tip_center[1]-tool_radius)){
1160 
1161  array_1d<double,3> tip_normal = tip_center-new_point;
1162 
1163  if(norm_2(tip_normal)<tool_radius){ //if is in the tool tip
1164 
1165  tip_normal -= (tool_radius/norm_2(tip_normal)) * tip_normal;
1166 
1167  if(norm_2(tip_normal)<tool_radius*0.08)
1168  new_point += tip_normal;
1169  }
1170 
1171  }
1172 
1173  if( this->mEchoLevel > 0 )
1174  std::cout<<" TOOL PROJECT::on radius "<<new_point<<std::endl;
1175 
1176 
1177  }
1178 
1179 
1180  }
1181 
1182  if(radius_insert)
1183  rLocalRefineInfo.number_of_tip_bounds ++;
1184  if(energy_insert)
1185  rLocalRefineInfo.number_of_energy_bounds ++;
1186  if(mesh_size_insert)
1187  rLocalRefineInfo.number_of_exterior_bounds++;
1188 
1189  ic->Set(TO_ERASE);
1190 
1191  if( this->mEchoLevel > 0 )
1192  std::cout<<" INSERTED NODE "<<new_point<<std::endl;
1193 
1194  list_of_points.push_back(new_point);
1195  list_of_conditions.push_back((*(ic.base())).get());
1196 
1197 
1198  // if( this->mEchoLevel > 0 ){
1199  // std::cout<<" Refine Boundary (Id:"<<ic->Id()<<"): ["<<rConditionGeometry[0].Id()<<", "<<rConditionGeometry[1].Id()<<"]"<<std::endl;
1200  // std::cout<<" (x1:"<<rConditionGeometry[0].X()<<", y1: "<<rConditionGeometry[0].Y()<<") "<<" (x2:"<<rConditionGeometry[1].X()<<", y2: "<<rConditionGeometry[1].Y()<<") "<<std::endl;
1201 
1202  // //std::cout<<" Added Node [Rcrit:"<<condition_radius<<",Scrit:"<<side_length<<",PlasticPower:"<<plastic_power<<"]"<<std::endl;
1203  // std::cout<<" Added Node [Scrit:"<<side_length<<",PlasticPower:"<<plastic_power<<"]"<<std::endl;
1204  // //std::cout<<" Conditions [Rcrit:"<<mrRemesh.Refine->CriticalRadius<<",Scrit:"<<mrRemesh.Refine->CriticalSide<<",PlasticPower:"<<mrRemesh.Refine->ReferenceThreshold<<"]"<<std::endl;
1205  // std::cout<<" Conditions [Scrit:"<<mrRemesh.Refine->CriticalSide<<",PlasticPower:"<<mrRemesh.Refine->ReferenceThreshold<<"]"<<std::endl;
1206  // }
1207 
1208  }
1209 
1210 
1211  //*********************************************************************************
1212  // BOUNDARY REBUILD END //
1213  //*********************************************************************************
1214 
1215 
1216  }
1217  else{
1218  if( this->mEchoLevel > 0 )
1219  std::cout<<" Condition "<<ic->Id()<<" Released "<<std::endl;
1220  }
1221 
1222  }
1223  }
1224 
1225  return true;
1226 
1227  KRATOS_CATCH(" ")
1228 
1229  }
1230 
1233 
1234 
1236 
1237 
1239  //Process(Process const& rOther);
1240 
1241 
1243 
1244 }; // Class Process
1245 
1247 
1250 
1251 
1255 
1256 
1258 inline std::istream& operator >> (std::istream& rIStream,
1260 
1262 inline std::ostream& operator << (std::ostream& rOStream,
1264 {
1265  rThis.PrintInfo(rOStream);
1266  rOStream << std::endl;
1267  rThis.PrintData(rOStream);
1268 
1269  return rOStream;
1270 }
1272 
1273 
1274 } // namespace Kratos.
1275 
1276 #endif // KRATOS_REFINE_CONDITIONS_IN_CONTACT_MESHER_PROCESS_H_INCLUDED defined
Base class for all Conditions.
Definition: condition.h:59
Geometry< NodeType >::PointsArrayType NodesArrayType
definition of nodes container type, redefined from GeometryType
Definition: condition.h:86
Dof * Pointer
Pointer definition of Dof.
Definition: dof.h:93
void FreeDof()
Definition: dof.h:345
bool Is(Flags const &rOther) const
Definition: flags.h:274
Geometry base class.
Definition: geometry.h:71
SizeType size() const
Definition: geometry.h:518
static double CalculateSideLength(PointType &P1, PointType &P2)
Definition: mesher_utilities.hpp:1073
bool CheckContactActive(GeometryType &rConditionGeometry, bool &rSemiActiveContact, std::vector< bool > &rSemiActiveNodes)
Definition: mesher_utilities.cpp:1847
Condition::Pointer FindMasterCondition(Condition::Pointer &pCondition, ModelPart::ConditionsContainerType &rModelConditions, bool &condition_found)
Definition: mesher_utilities.cpp:1642
bool CheckConditionInBox(Condition::Pointer &pCondition, SpatialBoundingBox &rRefiningBox, ProcessInfo &rCurrentProcessInfo)
Definition: mesher_utilities.cpp:1559
bool AlphaShape(double AlphaParameter, Geometry< Node > &rGeometry, const unsigned int dimension)
Definition: mesher_utilities.cpp:1182
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
ConditionIterator ConditionsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1361
std::string & Name()
Definition: model_part.h:1811
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
void AddCondition(ConditionType::Pointer pNewCondition, IndexType ThisIndex=0)
Definition: model_part.cpp:1436
SizeType NumberOfConditions(IndexType ThisIndex=0) const
Definition: model_part.h:1218
ModelPart & GetSubModelPart(std::string const &SubModelPartName)
Definition: model_part.cpp:2029
SizeType NumberOfNodes(IndexType ThisIndex=0) const
Definition: model_part.h:341
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
Dof< double > DofType
Dof type.
Definition: node.h:83
std::vector< std::unique_ptr< Dof< double > >> DofsContainerType
The DoF container type definition.
Definition: node.h:92
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
void reserve(size_type dim)
Definition: pointer_vector.h:319
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: pointer_vector_set.h:95
size_type size() const
Returns the number of elements in the container.
Definition: pointer_vector_set.h:502
boost::indirect_iterator< typename TContainerType::const_iterator > const_iterator
Definition: pointer_vector_set.h:96
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
Refine Mesh Boundary Process.
Definition: refine_conditions_in_contact_mesher_process.hpp:53
virtual ~RefineConditionsInContactMesherProcess()
Destructor.
Definition: refine_conditions_in_contact_mesher_process.hpp:124
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: refine_conditions_in_contact_mesher_process.hpp:250
PointerVector< NodeType > PointsArrayType
Definition: refine_conditions_in_contact_mesher_process.hpp:65
KRATOS_CLASS_POINTER_DEFINITION(RefineConditionsInContactMesherProcess)
Pointer definition of Process.
ModelPart::ConditionType ConditionType
Definition: refine_conditions_in_contact_mesher_process.hpp:62
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: refine_conditions_in_contact_mesher_process.hpp:144
ConditionsContainerType::const_iterator ConditionConstantIterator
Definition: refine_conditions_in_contact_mesher_process.hpp:69
ConditionType::GeometryType GeometryType
Definition: refine_conditions_in_contact_mesher_process.hpp:64
std::string Info() const override
Turn back information as a string.
Definition: refine_conditions_in_contact_mesher_process.hpp:238
void operator()()
This operator is provided to call the process as a function and simply calls the Execute method.
Definition: refine_conditions_in_contact_mesher_process.hpp:132
PointerVectorSet< ConditionType, IndexedObject > ConditionsContainerType
Definition: refine_conditions_in_contact_mesher_process.hpp:67
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: refine_conditions_in_contact_mesher_process.hpp:244
RefineConditionsInContactMesherProcess(ModelPart &rModelPart, std::vector< SpatialBoundingBox::Pointer > mRigidWalls, MesherUtilities::MeshingParameters &rRemeshingParameters, int EchoLevel)
Default constructor.
Definition: refine_conditions_in_contact_mesher_process.hpp:113
ModelPart::PropertiesType PropertiesType
Definition: refine_conditions_in_contact_mesher_process.hpp:63
ConditionsContainerType::iterator ConditionIterator
Definition: refine_conditions_in_contact_mesher_process.hpp:68
ModelPart::NodeType NodeType
Definition: refine_conditions_in_contact_mesher_process.hpp:61
Refine Mesh Boundary Process.
Definition: refine_conditions_mesher_process.hpp:50
int mEchoLevel
Definition: refine_conditions_mesher_process.hpp:222
MesherUtilities mMesherUtilities
Definition: refine_conditions_mesher_process.hpp:220
MesherUtilities::MeshingParameters & mrRemesh
Definition: refine_conditions_mesher_process.hpp:218
ModelPart & mrModelPart
Definition: refine_conditions_mesher_process.hpp:216
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
static int EchoLevel
Definition: co_sim_EMPIRE_API.h:42
z
Definition: GenerateWind.py:163
Parameters GetValue(Parameters &rParameters, const std::string &rEntry)
Definition: add_kratos_parameters_to_python.cpp:53
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
TExpressionType::data_type norm_2(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:625
Internals::Matrix< double, AMatrix::dynamic, 1 > Vector
Definition: amatrix_interface.h:472
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
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
y
Other simbols definition.
Definition: generate_axisymmetric_navier_stokes_element.py:54
float radius
Definition: mesh_to_mdpa_converter.py:18
def Alpha(n, j)
Definition: quadrature.py:93
N
Definition: sensitivityMatrix.py:29
x
Definition: sensitivityMatrix.py:49
integer i
Definition: TensorModule.f:17
Definition: mesher_utilities.hpp:631
MeshingInfoParameters::Pointer Info
Definition: mesher_utilities.hpp:681
Flags Options
Definition: mesher_utilities.hpp:645
RefiningParameters::Pointer Refine
Definition: mesher_utilities.hpp:684
std::string SubModelPartName
Definition: mesher_utilities.hpp:642
Definition: refine_conditions_in_contact_mesher_process.hpp:73
int number_contact_tip_insertions
Definition: refine_conditions_in_contact_mesher_process.hpp:82
int number_of_energy_bounds
Definition: refine_conditions_in_contact_mesher_process.hpp:86
int number_of_active_contacts
Definition: refine_conditions_in_contact_mesher_process.hpp:79
int number_of_tip_bounds
Definition: refine_conditions_in_contact_mesher_process.hpp:85
int number_of_contact_conditions
Definition: refine_conditions_in_contact_mesher_process.hpp:77
int number_of_exterior_bounds
Definition: refine_conditions_in_contact_mesher_process.hpp:84
void Initialize()
Definition: refine_conditions_in_contact_mesher_process.hpp:88
int number_contact_size_insertions
Definition: refine_conditions_in_contact_mesher_process.hpp:81
int number_of_contacts
Definition: refine_conditions_in_contact_mesher_process.hpp:78