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.
build_string_skin_process.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosSolidMechanicsApplication $
3 // Created by: $Author: JMCarbonell $
4 // Last modified by: $Co-Author: $
5 // Date: $Date: March 2018 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined(KRATOS_BUILD_STRING_SKIN_PROCESS_H_INCLUDED)
11 #define KRATOS_BUILD_STRING_SKIN_PROCESS_H_INCLUDED
12 
13 
14 // System includes
15 
16 // External includes
17 
18 // Project includes
19 #include "includes/model_part.h"
21 #include "processes/process.h"
22 #include "geometries/point_3d.h"
26 
27 namespace Kratos
28 {
29 
32 
40 {
41 public:
44 
49  typedef NodesContainerType::Pointer NodesContainerPointerType;
56 
59 
65 
70  unsigned int sides,
71  double radius
72  ) : Process() , mrModelPart(rModelPart), mSides(sides), mRadius(radius)
73  {
75 
76  mMaxId = GetMaxNodeId(mrModelPart.GetParentModelPart());
77 
78  KRATOS_CATCH("")
79  }
80 
83 
84 
88 
90  void operator()()
91  {
92  Execute();
93  }
94 
95 
99 
100 
102  void Execute() override
103  {
104  }
105 
108  void ExecuteInitialize() override
109  {
110  KRATOS_TRY
111 
112  CreateGeneratrix();
113  CreateSkinNodes();
114  CreateSkinElements();
115 
116  TransferSkinToOutput();
117 
118  // set nodes to RIGID and ACTIVE
119  for (ModelPart::NodeIterator i = mrModelPart.NodesBegin(); i != mrModelPart.NodesEnd(); ++i)
120  {
121  (i)->Set(RIGID,true);
122  (i)->Set(ACTIVE,true);
123  }
124 
125  // set elements to RIGID and ACTIVE
126  for (ModelPart::ConditionIterator i = mrModelPart.ConditionsBegin(); i != mrModelPart.ConditionsEnd(); ++i)
127  {
128  (i)->Set(RIGID,true);
129  (i)->Set(ACTIVE,true);
130  }
131 
132  KRATOS_CATCH("")
133  }
134 
138  {
139  }
140 
141 
144  {
145 
146  KRATOS_TRY
147 
148  SetInActiveFlag(mrModelPart);
149 
150  KRATOS_CATCH("")
151 
152  }
153 
156  {
157 
158  KRATOS_TRY
159 
160  MoveSkinNodes();
161 
162  KRATOS_CATCH("")
163 
164  }
165 
166 
168  void ExecuteBeforeOutputStep() override
169  {
170 
171  KRATOS_TRY
172 
173  SetActiveFlag(mrModelPart);
174 
175  KRATOS_CATCH("")
176  }
177 
178 
180  void ExecuteAfterOutputStep() override
181  {
182  KRATOS_TRY
183 
184 
185  KRATOS_CATCH("")
186  }
187 
188 
191  void ExecuteFinalize() override
192  {
193  }
194 
195 
199 
200 
204 
205 
209 
211  std::string Info() const override
212  {
213  return "BuildStringSkinProcess";
214  }
215 
217  void PrintInfo(std::ostream& rOStream) const override
218  {
219  rOStream << "BuildStringSkinProcess";
220  }
221 
223  void PrintData(std::ostream& rOStream) const override
224  {
225  }
226 
227 
232 
233 protected:
234 
243 
246 
260 
261 private:
262 
268 
269  ModelPart& mrModelPart;
270 
271  NodesContainerType mGeneratrixNodes;
272 
273  unsigned int mSides;
274 
275  unsigned int mMaxId;
276 
277  double mRadius;
278 
285 
286 
287  //************************************************************************************
288  //************************************************************************************
289 
290  void CreateGeneratrix()
291  {
292  KRATOS_TRY
293 
294  //Set generatrix control points for a given set of two noded line conditions
295  //unsigned int id = 0; //start with 0;
296 
297  //NEIGHBOURS SEARCH
298  SearchNeighbours();
299 
300  //SEARCH INITIAL NODE OF THE STRING
301  Node::Pointer Starter;
302  for(auto i_node(mrModelPart.NodesBegin()); i_node != mrModelPart.NodesEnd(); ++i_node)
303  {
304  NodeWeakPtrVectorType& nNodes = i_node->GetValue(NEIGHBOUR_NODES);
305  if( nNodes.size() <= 1 )
306  Starter = *i_node.base();
307  }
308 
309  //SEARCH CONSECUTIVE NODES
310  unsigned int previous_id = 0;
311  unsigned int current_id = 0;
312  Element::Pointer CurrentElement;
313  for(unsigned int i=0; i<mrModelPart.NumberOfNodes(); i++)
314  {
315 
316  //std::cout<<" Node ("<<Starter->Id()<<") "<<std::endl;
317 
318  current_id = Starter->Id();
319 
320  mGeneratrixNodes.push_back( Starter );
321 
322  ElementWeakPtrVectorType& nElements = Starter->GetValue(NEIGHBOUR_ELEMENTS);
323 
324  for(auto& i_nelem : nElements)
325  {
326  Element::GeometryType& rGeometry = i_nelem.GetGeometry();
327 
328  bool selected = true;
329  for(unsigned int j = 0; j < rGeometry.size(); j++)
330  {
331  if( rGeometry[j].Id() == previous_id )
332  {
333  selected = false;
334  }
335  }
336 
337  if( selected ){
338 
339  for(unsigned int j = 0; j < rGeometry.size(); j++)
340  {
341  if( rGeometry[j].Id() != current_id )
342  {
343  previous_id = Starter->Id();
344  Starter = rGeometry(j);
345  }
346  }
347  }
348 
349  }
350 
351  }
352 
353 
354  //SET MEAN_RADIUS TO NODES
355  /*for(ElementsContainerType::iterator ie = mrModelPart.ElementsBegin(); ie!=mrModelPart.ElementsEnd(); ie++)
356  {
357  PointsArrayType& Vertices = ie->GetGeometry().Points();
358 
359  //set radius to nodes
360  PropertiesType& Properties = ie->GetProperties();
361  Radius = Properties[MEAN_RADIUS];
362 
363  Vertices(0)->SetValue(MEAN_RADIUS, Radius);
364  }
365 
366  ElementsContainerType::iterator LastElement = mrModelPart.ElementsEnd()-1;
367  int num_nodes = LastElement->GetGeometry().size()-1;
368 
369  PointsArrayType& Vertices = LastElement->GetGeometry().Points();
370 
371  //set radius to nodes
372  PropertiesType& Properties = LastElement->GetProperties();
373  Radius = Properties[MEAN_RADIUS];
374  Vertices(num_nodes)->SetValue(MEAN_RADIUS, Radius);*/
375 
376  //REMOVE STRING NODES FROM GIVEN SKIN MODELPART AFTER CONSTRUCTING THE GENERATRIX
377  SetActiveFlag(mrModelPart,TO_ERASE);
378 
379  mrModelPart.RemoveNodes();
380  mrModelPart.RemoveElements();
381 
382  std::cout<<" [String_builder] [Defined by "<<mGeneratrixNodes.size()<<" control points]"<<std::endl;
383 
384  KRATOS_CATCH( "" )
385  }
386 
387  //************************************************************************************
388  //************************************************************************************
389 
390  void CreateSkinNodes()
391  {
392  KRATOS_TRY
393 
394  unsigned int node_id = mMaxId;
395 
396  PointType Point0 = ZeroVector(3);
397  PointType Point = ZeroVector(3);
398  PointType BasePoint = ZeroVector(3);
399 
400  PointType DirectionX = ZeroVector(3);
401  PointType DirectionY = ZeroVector(3);
402  PointType DirectionZ = ZeroVector(3);
403 
404  PointType RotatedDirectionX = ZeroVector(3);
405 
406  ModelPart::NodesContainerType::iterator nodes_begin = mGeneratrixNodes.begin();
407 
408  double Radius = 0;
409  for(unsigned int i=0; i<mGeneratrixNodes.size(); i++)
410  {
411 
412  Point0[0] = (nodes_begin+i)->X0();
413  Point0[1] = (nodes_begin+i)->Y0();
414  Point0[2] = (nodes_begin+i)->Z0();
415 
416  Point[0] = (nodes_begin+i)->X();
417  Point[1] = (nodes_begin+i)->Y();
418  Point[2] = (nodes_begin+i)->Z();
419 
420  // rotations
421  double alpha = 0;
422  Matrix Q = ZeroMatrix(3,3); //rotation along the local axis X
423 
424  //vector of beam section rotation
425  array_1d<double,3>& NodeRotation = (nodes_begin+i)->FastGetSolutionStepValue( ROTATION );
426 
427  PointType SectionRotation = ZeroVector(3);
428 
429  for( unsigned int j=0; j<3; j++ )
430  {
431  SectionRotation[j] = NodeRotation[j];
432  }
433 
434  QuaternionType SectionQuaternion;
435  SectionQuaternion = QuaternionType::FromRotationVector(SectionRotation);
436 
437  QuaternionType RotationQuaternion;
438 
439  PointType RotationAxis = ZeroVector(3);
440 
441  PointType DirectionZ1 = ZeroVector(3);
442  PointType DirectionZ2 = ZeroVector(3);
443 
444  PointType DirectionEllipse = ZeroVector(3);
445  double RadiusCorrection = 1;
446 
447  if( i == mGeneratrixNodes.size()-1 ){
448  BasePoint[0] = (nodes_begin+(i-1))->X0();
449  BasePoint[1] = (nodes_begin+(i-1))->Y0();
450  BasePoint[2] = (nodes_begin+(i-1))->Z0();
451  DirectionZ = Point0 - BasePoint;
452  }
453  else if( i == 0 ){
454  BasePoint[0] = (nodes_begin+(i+1))->X0();
455  BasePoint[1] = (nodes_begin+(i+1))->Y0();
456  BasePoint[2] = (nodes_begin+(i+1))->Z0();
457  DirectionZ = BasePoint - Point0;
458  }
459  else{
460  BasePoint[0] = (nodes_begin+(i-1))->X0();
461  BasePoint[1] = (nodes_begin+(i-1))->Y0();
462  BasePoint[2] = (nodes_begin+(i-1))->Z0();
463 
464  DirectionZ1 = (Point0 - BasePoint);
465  DirectionZ1 /= norm_2(DirectionZ1);
466 
467  BasePoint[0] = (nodes_begin+(i+1))->X0();
468  BasePoint[1] = (nodes_begin+(i+1))->Y0();
469  BasePoint[2] = (nodes_begin+(i+1))->Z0();
470 
471  DirectionZ2 = (BasePoint - Point0);
472  DirectionZ2 /= norm_2(DirectionZ2);
473 
474  DirectionZ = DirectionZ1 + DirectionZ2;
475 
476  if(norm_2(DirectionZ))
477  DirectionZ /= norm_2(DirectionZ);
478  else
479  DirectionZ = DirectionZ1;
480 
481  DirectionEllipse = DirectionZ1 - DirectionZ2;
482 
483  if(norm_2(DirectionEllipse))
484  DirectionEllipse/=norm_2(DirectionEllipse);
485 
486  RadiusCorrection = inner_prod(DirectionZ,DirectionZ1);
487  RadiusCorrection += inner_prod(DirectionZ,DirectionZ2);
488  RadiusCorrection *= 0.5;
489  if(RadiusCorrection)
490  RadiusCorrection = 1.0/RadiusCorrection;
491  else
492  RadiusCorrection = 1.0;
493  }
494 
495 
496  BeamMathUtilsType::CalculateLocalAxesVectors(DirectionZ,DirectionX,DirectionY);
497 
498  if( DirectionZ[0] == 0 && DirectionZ[1] == 0 && DirectionZ[2] == 1){ //if e3 change the orthornormal base
499  PointType Temp = DirectionX;
500  DirectionX = DirectionY;
501  DirectionY = (-1) * Temp;
502  }
503 
504  double EllipsoidalCorrection = 1;
505 
506  for(unsigned int k=0; k<mSides; k++)
507  {
508  alpha = (2.0 * Globals::Pi * k)/double(mSides) + 0.25 * Globals::Pi;
509 
510  //vector of rotation
511  RotationAxis = DirectionZ * alpha;
512 
513  RotationQuaternion = QuaternionType::FromRotationVector(RotationAxis);
514 
515  RotatedDirectionX = DirectionX;
516 
517  RotationQuaternion.RotateVector3(RotatedDirectionX);
518 
519 
520  EllipsoidalCorrection = inner_prod(DirectionEllipse,RotatedDirectionX);
521  EllipsoidalCorrection = 1 + ( RadiusCorrection - 1 ) * (EllipsoidalCorrection * EllipsoidalCorrection);
522 
523  //Add four points along the circular base of the tube
524  node_id += 1;
525 
526  //Radius = (nodes_begin+i)->GetValue(MEAN_RADIUS);
527  Radius = mRadius;
528 
529  BasePoint = Radius * EllipsoidalCorrection * RotatedDirectionX;
530 
531  SectionQuaternion.RotateVector3(BasePoint);
532 
533  BasePoint += Point;
534 
535  // std::cout<<" DirectionZ "<<DirectionZ<<std::endl;
536  // std::cout<<" alpha "<<alpha<<" cos "<<Q(1,1)<<std::endl;
537  // std::cout<<" Rotated "<<RotatedDirectionX<<" alpha "<<alpha<<std::endl;
538  // std::cout<<" EllipsoidalCorrection "<<EllipsoidalCorrection<<std::endl;
539  // std::cout<<" Radius "<<Radius<<std::endl;
540  // std::cout<<" Base Point ["<<node_id<<"]"<<BasePoint<<std::endl;
541 
542  mrModelPart.AddNode(this->CreateNode(mrModelPart.GetParentModelPart(), BasePoint, node_id));
543 
544  }
545 
546 
547  }
548 
549  KRATOS_CATCH( "" )
550 
551  }
552 
553  //************************************************************************************
554  //************************************************************************************
555  void MoveSkinNodes()
556  {
557 
558  KRATOS_TRY
559 
560  //set new nodes position:
561 
562  int number_of_angles = mSides; //number of lines in radius
563 
564  PointType Point0 = ZeroVector(3);
565  PointType Point = ZeroVector(3);
566  PointType BasePoint = ZeroVector(3);
567 
568  PointType DirectionX = ZeroVector(3);
569  PointType DirectionY = ZeroVector(3);
570  PointType DirectionZ = ZeroVector(3);
571 
572  PointType RotatedDirectionX = ZeroVector(3);
573 
574  ModelPart::NodesContainerType::iterator nodes_begin = mGeneratrixNodes.begin();
575 
576  ModelPart::NodesContainerType::iterator skin_nodes_begin = mrModelPart.NodesBegin();
577 
578  //std::cout<<" Number of Nodes "<<mrModelPart.NumberOfNodes()<<std::endl;
579 
580  int counter = 0;
581  double Radius = 0;
582  for(unsigned int i=0; i<mGeneratrixNodes.size(); i++)
583  {
584 
585  Point0[0] = (nodes_begin+i)->X0();
586  Point0[1] = (nodes_begin+i)->Y0();
587  Point0[2] = (nodes_begin+i)->Z0();
588 
589  Point[0] = (nodes_begin+i)->X();
590  Point[1] = (nodes_begin+i)->Y();
591  Point[2] = (nodes_begin+i)->Z();
592 
593  // rotations
594  double alpha = 0;
595  Matrix Q(3,3);
596  noalias(Q) = ZeroMatrix(3,3); //rotation along the local axis X
597 
598  //vector of beam section rotation
599  PointType& NodeRotation = (nodes_begin+i)->FastGetSolutionStepValue( ROTATION );
600 
601  PointType SectionRotation = ZeroVector(3);
602 
603  for( unsigned int j=0; j<3; j++ )
604  {
605  SectionRotation[j] = NodeRotation[j];
606  }
607 
608  QuaternionType SectionQuaternion;
609  SectionQuaternion = QuaternionType::FromRotationVector(SectionRotation);
610 
611  QuaternionType RotationQuaternion;
612 
613  PointType RotationAxis;
614  PointType DirectionZ1;
615  PointType DirectionZ2;
616 
617  PointType DirectionEllipse;
618  double RadiusCorrection = 1;
619 
620  if( i == mGeneratrixNodes.size()-1 ){
621  BasePoint[0] = (nodes_begin+(i-1))->X0();
622  BasePoint[1] = (nodes_begin+(i-1))->Y0();
623  BasePoint[2] = (nodes_begin+(i-1))->Z0();
624  DirectionZ = Point0 - BasePoint;
625  }
626  else if( i == 0 ){
627  BasePoint[0] = (nodes_begin+(i+1))->X0();
628  BasePoint[1] = (nodes_begin+(i+1))->Y0();
629  BasePoint[2] = (nodes_begin+(i+1))->Z0();
630  DirectionZ = BasePoint - Point0;
631  }
632  else{
633  BasePoint[0] = (nodes_begin+(i-1))->X0();
634  BasePoint[1] = (nodes_begin+(i-1))->Y0();
635  BasePoint[2] = (nodes_begin+(i-1))->Z0();
636 
637  DirectionZ1 = (Point0 - BasePoint);
638  DirectionZ1 /= norm_2(DirectionZ1);
639 
640  BasePoint[0] = (nodes_begin+(i+1))->X0();
641  BasePoint[1] = (nodes_begin+(i+1))->Y0();
642  BasePoint[2] = (nodes_begin+(i+1))->Z0();
643 
644  DirectionZ2 = (BasePoint - Point0);
645  DirectionZ2 /= norm_2(DirectionZ2);
646 
647  DirectionZ = DirectionZ1 + DirectionZ2;
648  DirectionZ /= norm_2(DirectionZ);
649 
650  DirectionEllipse = DirectionZ1 - DirectionZ2;
651 
652  if(norm_2(DirectionEllipse))
653  DirectionEllipse/=norm_2(DirectionEllipse);
654 
655  RadiusCorrection = inner_prod(DirectionZ,DirectionZ1);
656  RadiusCorrection += inner_prod(DirectionZ,DirectionZ2);
657  RadiusCorrection *= 0.5;
658  RadiusCorrection = 1.0/RadiusCorrection;
659  }
660 
661 
662  //std::cout<<" DirectionZ "<<DirectionZ<<std::endl;
663 
664  BeamMathUtilsType::CalculateLocalAxesVectors(DirectionZ,DirectionX,DirectionY);
665 
666  if( DirectionZ[0] == 0 && DirectionZ[1] == 0 && DirectionZ[2] == 1){ //if e3 change the orthornormal base
667  PointType Temp = DirectionX;
668  DirectionX = DirectionY;
669  DirectionY = (-1) * Temp;
670  }
671 
672  //std::cout<<" OrthonormalBase "<<DirectionX<<" "<<DirectionY<<std::endl;
673 
674  double EllipsoidalCorrection = 1;
675 
676  for(int k=0; k<number_of_angles; k++)
677  {
678  alpha = (2.0 * Globals::Pi * k)/double(number_of_angles) + 0.25 * Globals::Pi;
679 
680  //vector of rotation
681  RotationAxis = DirectionZ * alpha;
682 
683  RotationQuaternion = QuaternionType::FromRotationVector(RotationAxis);
684 
685  RotatedDirectionX = DirectionX;
686 
687  RotationQuaternion.RotateVector3(RotatedDirectionX);
688 
689  //std::cout<<" alpha "<<alpha<<" cos "<<Q(1,1)<<std::endl;
690  //std::cout<<" Rotated "<<RotatedDirectionX<<" alpha "<<alpha<<std::endl;
691 
692  EllipsoidalCorrection = inner_prod(DirectionEllipse,RotatedDirectionX);
693  EllipsoidalCorrection = 1 + ( RadiusCorrection - 1 ) * (EllipsoidalCorrection * EllipsoidalCorrection);
694 
695  //Add four points along the circular base of the tube
696  //Radius = (nodes_begin+i)->GetValue(MEAN_RADIUS);
697  Radius = mRadius;
698 
699  BasePoint = Radius * EllipsoidalCorrection * RotatedDirectionX;
700 
701  SectionQuaternion.RotateVector3(BasePoint);
702 
703  //set displacement velocity and acceleration START
704  PointType RadiusVector = ZeroVector(3);
705  RadiusVector[0] = BasePoint[0];
706  RadiusVector[1] = BasePoint[1];
707  RadiusVector[2] = BasePoint[2];
708 
709  //get coordinates
710  PointType PreviousPosition = ZeroVector(3);
711  PreviousPosition[0] = (skin_nodes_begin+counter)->X0();
712  PreviousPosition[1] = (skin_nodes_begin+counter)->Y0();
713  PreviousPosition[2] = (skin_nodes_begin+counter)->Z0();
714 
715  BasePoint += Point;
716 
717  (skin_nodes_begin+counter)->X() = BasePoint[0];
718  (skin_nodes_begin+counter)->Y() = BasePoint[1];
719  (skin_nodes_begin+counter)->Z() = BasePoint[2];
720 
721 
722  PointType& Displacement = (skin_nodes_begin+counter)->FastGetSolutionStepValue(DISPLACEMENT);
723 
724  for(int j=0; j<3; j++)
725  Displacement[j] = BasePoint[j]-PreviousPosition[j];
726 
727  bool DynamicVariables = false;
728 
729  if( DynamicVariables ){
730 
731  array_1d<double, 3 >& Velocity = (nodes_begin+i)->FastGetSolutionStepValue(VELOCITY);
732  array_1d<double, 3 >& Acceleration = (nodes_begin+i)->FastGetSolutionStepValue(ACCELERATION);
733  array_1d<double, 3 >& AngularVelocity = (nodes_begin+i)->FastGetSolutionStepValue(ANGULAR_VELOCITY);
734  array_1d<double, 3 >& AngularAcceleration = (nodes_begin+i)->FastGetSolutionStepValue(ANGULAR_ACCELERATION);
735 
736  Matrix SkewSymVariable(3,3);
737  noalias(SkewSymVariable) = ZeroMatrix(3,3);
738  PointType Variable;
739  PointType AngularVariable;
740 
741  //********************
742  //compute the skewsymmmetric tensor of the angular velocity
743  BeamMathUtilsType::VectorToSkewSymmetricTensor(AngularVelocity, SkewSymVariable);
744 
745  //compute the contribution of the angular velocity to the velocity v = Wxr
746  Variable = prod(SkewSymVariable,RadiusVector);
747 
748  (skin_nodes_begin+counter)->FastGetSolutionStepValue(VELOCITY) = Velocity + Variable;
749 
750  //********************
751 
752  //centripetal acceleration:
753 
754  //compute the skewsymmmetric tensor of the angular velocity
755  BeamMathUtilsType::VectorToSkewSymmetricTensor(AngularVelocity, SkewSymVariable);
756 
757  AngularVariable = prod(SkewSymVariable,Variable); //ac = Wx(Wxr)
758 
759  //compute the skewsymmmetric tensor of the angular acceleration
760  BeamMathUtilsType::VectorToSkewSymmetricTensor(AngularAcceleration, SkewSymVariable);
761 
762  //compute the contribution of the angular velocity to the velocity a = Axr
763  Variable = prod(SkewSymVariable,RadiusVector);
764 
765  (skin_nodes_begin+counter)->FastGetSolutionStepValue(ACCELERATION) = Acceleration + Variable + AngularVariable;
766 
767  //set displacement velocity and acceleration END
768  }
769 
770  counter++;
771  }
772 
773 
774  }
775 
776  KRATOS_CATCH( "" )
777 
778  }
779 
780  //************************************************************************************
781  //************************************************************************************
782 
783 
784  void CreateSkinElements()
785  {
786  KRATOS_TRY
787 
788  //return this->CreateSkinTriangles();
789  return this->CreateSkinQuadrilaterals();
790 
791  KRATOS_CATCH( "" )
792 
793  }
794 
795 
796  //************************************************************************************
797  //************************************************************************************
798 
799  void CreateSkinTriangles()
800  {
801  KRATOS_TRY
802 
803  unsigned int number_of_angles = mSides; //number of lines in radius x 2
804 
805  unsigned int wall_nodes_number_id = mMaxId; //used in the creation of the tube surface conditions
806 
807  //Triangles:
808 
809  // Create surface of the tube with triangular shell conditions
810  unsigned int number_of_elements = (mrModelPart.Nodes().back().Id() - wall_nodes_number_id) - (number_of_angles - 1);
811 
812  //GEOMETRY:
813  GeometryType::Pointer pFace;
814  ConditionType::Pointer pSkinCondition;
815 
816  //PROPERTIES:
817  //int number_properties = mrModelPart.GetParentModelPart().NumberOfProperties();
818  //Properties::Pointer pProperties = mrModelPart.GetParentModelPart().pGetProperties(number_properties-1);
819  Properties::Pointer pProperties = mrModelPart.GetParentModelPart().pGetProperties(0);
820 
821  //Properties 0 in order to change the Id to 0 and then write tube elements in another layer
822  /* ModelPart::PropertiesContainerType::ContainerType& PropertiesArray = mrModelPart.PropertiesArray(); */
823  /* PropertiesArray[0] = Kratos::make_shared<PropertiesType>(0); */
824  /* PropertiesArray[0]->Data() =PropertiesArray[1]->Data(); */
825  /* Properties::Pointer pProperties = PropertiesArray[0]; */
826 
827  unsigned int condition_id = GetMaxConditionId(mrModelPart.GetParentModelPart());
828 
829  unsigned int counter = 1;
830 
831  std::vector<int> FaceNodesIds(3);
832 
833  for(unsigned int i=1; i<number_of_elements; i++)
834  {
835  condition_id += 1;
836 
837  if( counter < number_of_angles ){
838 
839  //triangle 1
840  FaceNodesIds[0] = wall_nodes_number_id + i ;
841  FaceNodesIds[2] = wall_nodes_number_id + i + number_of_angles;
842  FaceNodesIds[1] = wall_nodes_number_id + i + number_of_angles + 1;
843 
845  FaceNodes1.reserve(3);
846 
847  //NOTE: when creating a PointsArrayType
848  //important ask for pGetNode, if you ask for GetNode a copy is created
849  //if a copy is created a segmentation fault occurs when the node destructor is called
850 
851  for(unsigned int j=0; j<3; j++)
852  FaceNodes1.push_back(mrModelPart.pGetNode(FaceNodesIds[j]));
853 
854  pFace = Kratos::make_shared<Triangle3DType>(FaceNodes1);
855 
856  pSkinCondition = Kratos::make_intrusive<Condition>(condition_id, pFace, pProperties);
857 
858  pSkinCondition->Set(ACTIVE,false);
859 
860  //set to beam tube mesh
861  mrModelPart.AddCondition(pSkinCondition);
862 
863  condition_id += 1;
864 
865  //triangle 2
866  FaceNodesIds[0] = wall_nodes_number_id + i ;
867  FaceNodesIds[2] = wall_nodes_number_id + i + number_of_angles + 1;
868  FaceNodesIds[1] = wall_nodes_number_id + i + 1;
869 
871  FaceNodes2.reserve(3);
872 
873 
874  //NOTE: when creating a PointsArrayType
875  //important ask for pGetNode, if you ask for GetNode a copy is created
876  //if a copy is created a segmentation fault occurs when the node destructor is called
877 
878  for(unsigned int j=0; j<3; j++)
879  FaceNodes2.push_back(mrModelPart.pGetNode(FaceNodesIds[j]));
880 
881  pFace = Kratos::make_shared<Triangle3DType>(FaceNodes2);
882 
883  pSkinCondition = Kratos::make_intrusive<Condition>(condition_id, pFace, pProperties);
884 
885  pSkinCondition->Set(ACTIVE,false);
886 
887  //set to beam tube mesh
888  mrModelPart.AddCondition(pSkinCondition);
889 
890  counter++;
891 
892  }
893  else if( counter == number_of_angles ){
894 
895  //triangle 1
896  FaceNodesIds[0] = wall_nodes_number_id + i ;
897  FaceNodesIds[1] = wall_nodes_number_id + i + 1 - number_of_angles;
898  FaceNodesIds[2] = wall_nodes_number_id + i + 1;
899 
901  FaceNodes1.reserve(3);
902 
903  for(unsigned int j=0; j<3; j++)
904  FaceNodes1.push_back(mrModelPart.pGetNode(FaceNodesIds[j]));
905 
906  pFace = Kratos::make_shared<Triangle3DType>(FaceNodes1);
907 
908  pSkinCondition = Kratos::make_intrusive<Condition>(condition_id, pFace, pProperties);
909 
910  pSkinCondition->Set(ACTIVE,false);
911 
912  //set to beam tube mesh
913  mrModelPart.AddCondition(pSkinCondition);
914 
915  condition_id += 1;
916 
917  //triangle 2
918  FaceNodesIds[0] = wall_nodes_number_id + i ;
919  FaceNodesIds[1] = wall_nodes_number_id + i + 1;
920  FaceNodesIds[2] = wall_nodes_number_id + i + number_of_angles;
921 
923  FaceNodes2.reserve(3);
924 
925  for(unsigned int j=0; j<3; j++)
926  FaceNodes2.push_back(mrModelPart.pGetNode(FaceNodesIds[j]));
927 
928  pFace = Kratos::make_shared<Triangle3DType>(FaceNodes2);
929 
930  pSkinCondition = Kratos::make_intrusive<Condition>(condition_id, pFace, pProperties);
931 
932  pSkinCondition->Set(ACTIVE,false);
933 
934  //set to beam tube mesh
935  mrModelPart.AddCondition(pSkinCondition);
936 
937  counter = 1;
938  }
939 
940 
941  }
942 
943 
944  KRATOS_CATCH( "" )
945  }
946 
947  //************************************************************************************
948  //************************************************************************************
949 
950  void CreateSkinQuadrilaterals()
951  {
952  KRATOS_TRY
953 
954  unsigned int number_of_angles = mSides; //number of lines in radius x 2
955 
956  unsigned int wall_nodes_number_id = mMaxId; //used in the creation of the tube surface conditions
957 
958  //Quadrilaterals:
959 
960  // Create surface of the tube with quadrilateral shell conditions
961  unsigned int number_of_elements = (mrModelPart.Nodes().back().Id() - wall_nodes_number_id) - (number_of_angles - 1);
962 
963  //GEOMETRY:
964  GeometryType::Pointer pFace;
965  ConditionType::Pointer pSkinCondition;
966 
967  //PROPERTIES:
968  //int number_properties = mrModelPart.GetParentModelPart().NumberOfProperties();
969  //Properties::Pointer pProperties = mrModelPart.GetParentModelPart().pGetProperties(number_properties-1);
970  Properties::Pointer pProperties = mrModelPart.GetParentModelPart().pGetProperties(0);
971 
972  //Properties 0 in order to change the Id to 0 and then write tube elements in another layer
973  /* ModelPart::PropertiesContainerType::ContainerType& PropertiesArray = mrModelPart.PropertiesArray(); */
974  /* PropertiesArray[0] = Kratos::make_shared<PropertiesType>(0); */
975  /* PropertiesArray[0]->Data() =PropertiesArray[1]->Data(); */
976  /* Properties::Pointer pProperties = PropertiesArray[0]; */
977 
978  unsigned int condition_id = GetMaxConditionId(mrModelPart.GetParentModelPart());
979 
980  unsigned int counter = 1;
981 
982  std::vector<int> FaceNodesIds(4);
983 
984 
985  for(unsigned int i=1; i<number_of_elements; i++)
986  {
987  condition_id += 1;
988 
989  if( counter < number_of_angles ){
990 
991  FaceNodesIds[0] = wall_nodes_number_id + i ;
992  FaceNodesIds[1] = wall_nodes_number_id + i + number_of_angles;
993  FaceNodesIds[2] = wall_nodes_number_id + i + number_of_angles + 1;
994  FaceNodesIds[3] = wall_nodes_number_id + i + 1;
995 
997  FaceNodes.reserve(4);
998 
999  //NOTE: when creating a PointsArrayType
1000  //important ask for pGetNode, if you ask for GetNode a copy is created
1001  //if a copy is created a segmentation fault occurs when the node destructor is called
1002 
1003  for(unsigned int j=0; j<4; j++)
1004  FaceNodes.push_back(mrModelPart.pGetNode(FaceNodesIds[j]));
1005 
1006  pFace = Kratos::make_shared<Quadrilateral3DType>(FaceNodes);
1007 
1008  pSkinCondition = Kratos::make_intrusive<Condition>(condition_id, pFace, pProperties);
1009 
1010  pSkinCondition->Set(ACTIVE,false);
1011 
1012  //set to beam tube mesh
1013  mrModelPart.AddCondition(pSkinCondition);
1014 
1015  counter++;
1016 
1017  }
1018  else if( counter == number_of_angles ){
1019 
1020  FaceNodesIds[0] = wall_nodes_number_id + i ;
1021  FaceNodesIds[1] = wall_nodes_number_id + i + 1 - number_of_angles;
1022  FaceNodesIds[2] = wall_nodes_number_id + i + 1;
1023  FaceNodesIds[3] = wall_nodes_number_id + i + number_of_angles;
1024 
1026  FaceNodes.reserve(4);
1027 
1028  for(unsigned int j=0; j<4; j++)
1029  FaceNodes.push_back(mrModelPart.pGetNode(FaceNodesIds[j]));
1030 
1031  pFace = Kratos::make_shared<Quadrilateral3DType>(FaceNodes);
1032 
1033  pSkinCondition = Kratos::make_intrusive<Condition>(condition_id, pFace, pProperties);
1034 
1035  pSkinCondition->Set(ACTIVE,false);
1036 
1037  //set to beam tube mesh
1038  mrModelPart.AddCondition(pSkinCondition);
1039 
1040  counter = 1;
1041  }
1042 
1043 
1044  }
1045 
1046  KRATOS_CATCH( "" )
1047  }
1048 
1049  //*******************************************************************************************
1050  //*******************************************************************************************
1051 
1052  static inline unsigned int GetMaxNodeId(ModelPart& rModelPart)
1053  {
1054  KRATOS_TRY
1055 
1056  unsigned int max_id = rModelPart.Nodes().back().Id();
1057 
1058  for(ModelPart::NodesContainerType::iterator i_node = rModelPart.NodesBegin(); i_node!= rModelPart.NodesEnd(); i_node++)
1059  {
1060  if(i_node->Id() > max_id)
1061  max_id = i_node->Id();
1062  }
1063 
1064  return max_id;
1065 
1066  KRATOS_CATCH( "" )
1067  }
1068 
1069  //*******************************************************************************************
1070  //*******************************************************************************************
1071 
1072  static inline unsigned int GetMaxElementId(ModelPart& rModelPart)
1073  {
1074  KRATOS_TRY
1075 
1076  if( rModelPart.NumberOfElements() == 0 )
1077  return 0;
1078 
1079  unsigned int max_id = rModelPart.Elements().back().Id();
1080 
1081  for(ModelPart::ElementsContainerType::iterator i_elem = rModelPart.ElementsBegin(); i_elem!= rModelPart.ElementsEnd(); i_elem++)
1082  {
1083  if(i_elem->Id() > max_id)
1084  max_id = i_elem->Id();
1085  }
1086 
1087  return max_id;
1088 
1089  KRATOS_CATCH( "" )
1090  }
1091 
1092 
1093  //*******************************************************************************************
1094  //*******************************************************************************************
1095 
1096  static inline unsigned int GetMaxConditionId(ModelPart& rModelPart)
1097  {
1098  KRATOS_TRY
1099 
1100  if( rModelPart.NumberOfConditions() == 0 )
1101  return 0;
1102 
1103  unsigned int max_id = rModelPart.Conditions().back().Id();
1104 
1105  for(ModelPart::ConditionsContainerType::iterator i_cond = rModelPart.ConditionsBegin(); i_cond!= rModelPart.ConditionsEnd(); i_cond++)
1106  {
1107  if(i_cond->Id() > max_id)
1108  max_id = i_cond->Id();
1109  }
1110 
1111  return max_id;
1112 
1113  KRATOS_CATCH( "" )
1114  }
1115 
1116  //************************************************************************************
1117  //************************************************************************************
1118 
1119  NodeType::Pointer CreateNode (ModelPart& rModelPart, PointType& rPoint, const unsigned int& rNodeId)
1120  {
1121 
1122  KRATOS_TRY
1123 
1124  NodeType::Pointer Node = rModelPart.CreateNewNode( rNodeId, rPoint[0], rPoint[1], rPoint[2]);
1125 
1126  //generating the dofs
1127  NodeType::DofsContainerType& reference_dofs = (rModelPart.NodesBegin())->GetDofs();
1128 
1129 
1130  for(NodeType::DofsContainerType::iterator iii = reference_dofs.begin(); iii != reference_dofs.end(); iii++)
1131  {
1132  NodeType::DofType& rDof = **iii;
1133  Node->pAddDof( rDof );
1134  }
1135 
1136  //set fix dofs:
1137  NodeType::DofsContainerType& new_dofs = Node->GetDofs();
1138 
1139  for(NodeType::DofsContainerType::iterator iii = new_dofs.begin(); iii != new_dofs.end(); iii++)
1140  {
1141  NodeType::DofType& rDof = **iii;
1142  rDof.FixDof(); // dofs free
1143  }
1144 
1145  //generating step data
1146  /*unsigned int buffer_size = (rModelPart.NodesBegin())->GetBufferSize();
1147  unsigned int step_data_size = rModelPart.GetNodalSolutionStepDataSize();
1148  for(unsigned int step = 0; step<buffer_size; step++)
1149  {
1150  double* NodeData = Node->SolutionStepData().Data(step);
1151  double* ReferenceData = (rModelPart.NodesBegin())->SolutionStepData().Data(step);
1152 
1153  //copying this data in the position of the vector we are interested in
1154  for(unsigned int j= 0; j<step_data_size; j++)
1155  {
1156  NodeData[j] = ReferenceData[j];
1157  }
1158  }
1159  */
1160 
1161  return Node;
1162 
1163  KRATOS_CATCH( "" )
1164 
1165  }
1166 
1167  //************************************************************************************
1168  //************************************************************************************
1169 
1170  void CleanElementNeighbours()
1171  {
1172 
1173  KRATOS_TRY
1174 
1175  NodesContainerType& rNodes = mrModelPart.Nodes();
1176  ElementsContainerType& rElements = mrModelPart.Elements();
1177 
1178  //first of all the neighbour nodes and neighbour elements arrays are initialized to the guessed size
1179  //this cleans the old entries:
1180 
1181  unsigned int AverageNodes = 2;
1182  unsigned int AverageElements = 2;
1183 
1184  //************* Erase old node neighbours *************//
1185  for(auto& i_node : rNodes)
1186  {
1187  NodeWeakPtrVectorType& nNodes = i_node.GetValue(NEIGHBOUR_NODES);
1188  nNodes.clear();
1189  nNodes.resize(AverageNodes);
1190 
1191  ElementWeakPtrVectorType& nElements = i_node.GetValue(NEIGHBOUR_ELEMENTS);
1192  nElements.clear();
1193  nElements.resize(AverageElements);
1194  }
1195 
1196  //************* Erase old element neighbours ************//
1197  for(auto& i_elem : rElements)
1198  {
1199  Element::GeometryType& rGeometry = i_elem.GetGeometry();
1200  int size= rGeometry.FacesNumber();
1201 
1202  ElementWeakPtrVectorType& nElements = i_elem.GetValue(NEIGHBOUR_ELEMENTS);
1203  nElements.clear();
1204  nElements.resize(size);
1205 
1206  }
1207 
1208  KRATOS_CATCH( "" )
1209  }
1210 
1211  //************************************************************************************
1212  //************************************************************************************
1213  template<class TDataType> void AddUniquePointer
1214  (GlobalPointersVector<TDataType>& v, const typename TDataType::WeakPointer candidate)
1215  {
1216  typename GlobalPointersVector< TDataType >::iterator i = v.begin();
1217  typename GlobalPointersVector< TDataType >::iterator endit = v.end();
1218  while ( i != endit && (i)->Id() != (candidate)->Id())
1219  {
1220  i++;
1221  }
1222  if( i == endit )
1223  {
1224  v.push_back(candidate);
1225  }
1226 
1227  }
1228 
1229  //************************************************************************************
1230  //************************************************************************************
1231 
1232  ElementWeakPtrType CheckForNeighbourElems1D (unsigned int Id_1, ElementWeakPtrVectorType& nElements, ElementsContainerType::iterator i_elem)
1233  {
1234  //look for the faces around node Id_1
1235  for(auto i_nelem(nElements.begin()); i_nelem != nElements.end(); ++i_nelem)
1236  {
1237  //look for the nodes of the neighbour faces
1238  Geometry<Node >& nGeometry = i_nelem->GetGeometry();
1239  if(nGeometry.LocalSpaceDimension() == 1){
1240  for(unsigned int node_i = 0; node_i < nGeometry.size(); ++node_i)
1241  {
1242  if(nGeometry[node_i].Id() == Id_1)
1243  {
1244  if(i_nelem->Id() != i_elem->Id())
1245  {
1246  return *i_nelem.base();
1247  }
1248  }
1249  }
1250  }
1251  }
1252  return *i_elem.base();
1253  }
1254 
1255  //************************************************************************************
1256  //************************************************************************************
1257 
1258  void SearchNeighbours()
1259  {
1260  KRATOS_TRY
1261 
1262  NodesContainerType& rNodes = mrModelPart.Nodes();
1263  ElementsContainerType& rElements = mrModelPart.Elements();
1264 
1265  //first of all the neighbour nodes and neighbour elements arrays are initialized to the guessed size
1266  //this cleans the old entries:
1267 
1268  //***** Erase old node and element neighbours *********//
1269  CleanElementNeighbours();
1270 
1271 
1272  //************* Neigbours of nodes ************//
1273  //add the neighbour elements to all the nodes in the mesh
1274  for(auto i_elem(rElements.begin()); i_elem != rElements.end(); ++i_elem)
1275  {
1276  Element::GeometryType& rGeometry = i_elem->GetGeometry();
1277  for(unsigned int i = 0; i < rGeometry.size(); i++)
1278  {
1279  rGeometry[i].GetValue(NEIGHBOUR_ELEMENTS).push_back( *i_elem.base() );
1280  }
1281  }
1282 
1283  //adding the neighbouring nodes to all nodes in the mesh
1284  for(auto& i_node : rNodes)
1285  {
1286  ElementWeakPtrVectorType& nElements = i_node.GetValue(NEIGHBOUR_ELEMENTS);
1287  for(auto& i_nelem : nElements)
1288  {
1289  Element::GeometryType& rGeometry = i_nelem.GetGeometry();
1290  for(unsigned int i = 0; i < rGeometry.size(); i++)
1291  {
1292  if( rGeometry[i].Id() != i_node.Id() )
1293  {
1294  NodeWeakPtrVectorType& nNodes = i_nelem.GetValue(NEIGHBOUR_NODES);
1295  AddUniquePointer< Node >(nNodes, rGeometry(i));
1296  }
1297 
1298  }
1299  }
1300  }
1301 
1302 
1303  //************* Neigbours of elements *********//
1304  //add the neighbour elements to all the elements in the mesh
1305 
1306  //loop over faces
1307  for(auto i_elem(rElements.begin()); i_elem != rElements.end(); ++i_elem)
1308  {
1309  //face nodes
1310  Geometry<Node >& rGeometry = i_elem->GetGeometry();
1311  if( rGeometry.FacesNumber() == 2 ){
1312 
1313  ElementWeakPtrVectorType& nElements = i_elem->GetValue(NEIGHBOUR_ELEMENTS);
1314 
1315  //vector of the 2 faces around the given face
1316  if( nElements.size() != 2 )
1317  nElements.resize(2);
1318 
1319  //neighb_face is the vector containing pointers to the three faces around ic:
1320 
1321  unsigned int size = rGeometry.size();
1322 
1323  // neighbour element over edge 0 of element ic;
1324  nElements(0) = CheckForNeighbourElems1D(rGeometry[0].Id(), rGeometry[0].GetValue(NEIGHBOUR_ELEMENTS), i_elem);
1325  // neighbour element over edge 1 of element ic;
1326  nElements(1) = CheckForNeighbourElems1D(rGeometry[size-1].Id(), rGeometry[size-1].GetValue(NEIGHBOUR_ELEMENTS), i_elem);
1327 
1328  }
1329  }
1330 
1331 
1332  KRATOS_CATCH( "" )
1333  }
1334 
1335 
1336  void TransferSkinToOutput()
1337  {
1338  KRATOS_TRY
1339 
1340  ModelPart& rOutputModelPart = GetOutputModelPart();
1341 
1342  std::vector<std::size_t> NodeIds;
1343  // set nodes to ACTIVE (to write them in output)
1344  for (ModelPart::NodeIterator i = mrModelPart.NodesBegin(); i != mrModelPart.NodesEnd(); ++i)
1345  {
1346  NodeIds.push_back(i->Id());
1347  }
1348  std::vector<std::size_t> ConditionIds;
1349  // set elements ACTIVE (to write them in output)
1350  for (ModelPart::ConditionIterator i = mrModelPart.ConditionsBegin(); i != mrModelPart.ConditionsEnd(); ++i)
1351  {
1352  ConditionIds.push_back(i->Id());
1353  }
1354 
1355  rOutputModelPart.AddNodes(NodeIds);
1356  rOutputModelPart.AddConditions(ConditionIds);
1357 
1358  SetInActiveFlag(rOutputModelPart,TO_ERASE);
1359 
1360  KRATOS_CATCH("")
1361  }
1362 
1363  ModelPart& GetOutputModelPart()
1364  {
1365  KRATOS_TRY
1366 
1367  std::string OutputModelPartName;
1368  ModelPart& rMainModelPart = mrModelPart.GetParentModelPart();
1369  for(ModelPart::SubModelPartIterator i_mp= rMainModelPart.SubModelPartsBegin(); i_mp!=rMainModelPart.SubModelPartsEnd(); i_mp++)
1370  {
1371  if( i_mp->Is(ACTIVE) )
1372  OutputModelPartName = i_mp->Name();
1373  }
1374 
1375  return (rMainModelPart.GetSubModelPart(OutputModelPartName));
1376 
1377  KRATOS_CATCH("")
1378  }
1379 
1380 
1381  virtual void SetActiveFlag(ModelPart& rModelPart, Flags id_flag = ACTIVE)
1382  {
1383  KRATOS_TRY
1384 
1385  // set nodes to ACTIVE (to write them in output)
1386  for (ModelPart::NodeIterator i = rModelPart.NodesBegin(); i != rModelPart.NodesEnd(); ++i)
1387  {
1388  (i)->Set(id_flag,true);
1389  }
1390 
1391  // set elements ACTIVE (to write them in output)
1392  for (ModelPart::ConditionIterator i = rModelPart.ConditionsBegin(); i != rModelPart.ConditionsEnd(); ++i)
1393  {
1394  (i)->Set(id_flag,true);
1395  }
1396 
1397 
1398  KRATOS_CATCH("")
1399  }
1400 
1401  virtual void SetInActiveFlag(ModelPart& rModelPart, Flags id_flag = ACTIVE)
1402  {
1403  KRATOS_TRY
1404 
1405 
1406  // set nodes to NOT ACTIVE (to not consider them in computation)
1407  for (ModelPart::NodeIterator i = rModelPart.NodesBegin(); i != rModelPart.NodesEnd(); ++i)
1408  {
1409  (i)->Set(id_flag,false);
1410  }
1411 
1412  // set elements NOT ACTIVE (to not consider them in computation)
1413  for (ModelPart::ConditionIterator i = rModelPart.ConditionsBegin(); i != rModelPart.ConditionsEnd(); ++i)
1414  {
1415  (i)->Set(id_flag,false);
1416  }
1417 
1418 
1419  KRATOS_CATCH("")
1420  }
1421 
1425 
1427  BuildStringSkinProcess& operator=(BuildStringSkinProcess const& rOther);
1428 
1429 
1439 
1440 }; // Class BuildStringSkinProcess
1441 
1442 
1444 
1447 
1448 
1452 
1453 
1455 inline std::istream& operator >> (std::istream& rIStream,
1456  BuildStringSkinProcess& rThis);
1457 
1459 inline std::ostream& operator << (std::ostream& rOStream,
1460  const BuildStringSkinProcess& rThis)
1461 {
1462  rThis.PrintInfo(rOStream);
1463  rOStream << std::endl;
1464  rThis.PrintData(rOStream);
1465 
1466  return rOStream;
1467 }
1469 
1470 
1471 } // namespace Kratos.
1472 
1473 #endif // KRATOS_BUILD_STRING_SKIN_PROCESS_H_INCLUDED defined
Definition: beam_math_utilities.hpp:31
static void CalculateLocalAxesVectors(TVector3 &rLocalX, TVector3 &rLocalY, TVector3 &rLocalZ)
Definition: beam_math_utilities.hpp:723
static void VectorToSkewSymmetricTensor(const TVector3 &rVector, TMatrix3 &rSkewSymmetricTensor)
Definition: beam_math_utilities.hpp:231
Definition: build_string_skin_process.hpp:40
array_1d< double, 3 > PointType
Definition: build_string_skin_process.hpp:45
void operator()()
This operator is provided to call the process as a function and simply calls the Execute method.
Definition: build_string_skin_process.hpp:90
Quadrilateral3D4< NodeType > Quadrilateral3DType
Definition: build_string_skin_process.hpp:55
Quaternion< double > QuaternionType
Definition: build_string_skin_process.hpp:58
BuildStringSkinProcess(BuildStringSkinProcess const &rOther)
Copy constructor.
Point3D< NodeType > Point3DType
Definition: build_string_skin_process.hpp:54
BuildStringSkinProcess(ModelPart &rModelPart, unsigned int sides, double radius)
Definition: build_string_skin_process.hpp:69
~BuildStringSkinProcess() override
Destructor.
Definition: build_string_skin_process.hpp:82
ModelPart::PropertiesType PropertiesType
Definition: build_string_skin_process.hpp:51
KRATOS_CLASS_POINTER_DEFINITION(BuildStringSkinProcess)
Pointer definition of BuildStringSkinProcess.
GlobalPointersVector< Element > ElementWeakPtrVectorType
Definition: build_string_skin_process.hpp:61
void ExecuteFinalizeSolutionStep() override
this function will be executed at every time step AFTER performing the solve phase
Definition: build_string_skin_process.hpp:155
void ExecuteInitializeSolutionStep() override
this function will be executed at every time step BEFORE performing the solve phase
Definition: build_string_skin_process.hpp:143
void ExecuteAfterOutputStep() override
this function will be executed at every time step AFTER writing the output
Definition: build_string_skin_process.hpp:180
ModelPart::ConditionType ConditionType
Definition: build_string_skin_process.hpp:50
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: build_string_skin_process.hpp:217
GlobalPointersVector< Condition > ConditionWeakPtrVectorType
Definition: build_string_skin_process.hpp:62
void ExecuteInitialize() override
Definition: build_string_skin_process.hpp:108
BeamMathUtils< double > BeamMathUtilsType
Definition: build_string_skin_process.hpp:57
void Execute() override
Execute method is used to execute the BuildStringSkinProcess algorithms.
Definition: build_string_skin_process.hpp:102
ModelPart::NodeType NodeType
Definition: build_string_skin_process.hpp:46
ModelPart::NodesContainerType NodesContainerType
Definition: build_string_skin_process.hpp:47
void ExecuteBeforeSolutionLoop() override
Definition: build_string_skin_process.hpp:137
void ExecuteBeforeOutputStep() override
this function will be executed at every time step BEFORE writing the output
Definition: build_string_skin_process.hpp:168
ModelPart::ElementsContainerType ElementsContainerType
Definition: build_string_skin_process.hpp:48
NodesContainerType::Pointer NodesContainerPointerType
Definition: build_string_skin_process.hpp:49
Triangle3D3< NodeType > Triangle3DType
Definition: build_string_skin_process.hpp:53
std::string Info() const override
Turn back information as a string.
Definition: build_string_skin_process.hpp:211
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: build_string_skin_process.hpp:223
void ExecuteFinalize() override
Definition: build_string_skin_process.hpp:191
ConditionType::GeometryType GeometryType
Definition: build_string_skin_process.hpp:52
GlobalPointersVector< Node > NodeWeakPtrVectorType
Definition: build_string_skin_process.hpp:60
Base class for all Conditions.
Definition: condition.h:59
Dof represents a degree of freedom (DoF).
Definition: dof.h:86
void FixDof()
Definition: dof.h:338
Geometry< NodeType > GeometryType
definition of the geometry type with given NodeType
Definition: element.h:83
void Set(const Flags ThisFlag)
Definition: flags.cpp:33
Flags()
Default constructor.
Definition: flags.h:119
Geometry base class.
Definition: geometry.h:71
SizeType size() const
Definition: geometry.h:518
IndexType const & Id() const
Id of this Geometry.
Definition: geometry.h:964
PointerVector< TPointType > PointsArrayType
Definition: geometry.h:118
virtual SizeType FacesNumber() const
Returns the number of faces of the current geometry.
Definition: geometry.h:2152
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: global_pointers_vector.h:79
void clear()
Definition: global_pointers_vector.h:361
size_type size() const
Definition: global_pointers_vector.h:307
void resize(size_type new_dim) const
Definition: global_pointers_vector.h:366
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ConditionIterator ConditionsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1361
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
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
MeshType::NodeIterator NodeIterator
Definition: model_part.h:134
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
ModelPart & GetParentModelPart()
Definition: model_part.cpp:2124
MeshType::ConditionIterator ConditionIterator
Definition: model_part.h:189
ConditionIterator ConditionsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1371
This class defines the node.
Definition: node.h:65
std::vector< std::unique_ptr< Dof< double > >> DofsContainerType
The DoF container type definition.
Definition: node.h:92
Definition: point_3d.h:53
void reserve(size_type dim)
Definition: pointer_vector.h:319
The base class for all processes in Kratos.
Definition: process.h:49
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
A four node 3D quadrilateral geometry with bi-linear shape functions.
Definition: quadrilateral_3d_4.h:76
static Quaternion FromRotationVector(double rx, double ry, double rz)
Definition: quaternion.h:427
A three node 3D triangle geometry with linear shape functions.
Definition: triangle_3d_3.h:77
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
Kratos::ModelPart ModelPart
Definition: kratos_wrapper.h:31
constexpr double Pi
Definition: global_variables.h:25
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
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
TExpressionType::data_type norm_2(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:625
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
Internals::Matrix< double, AMatrix::dynamic, AMatrix::dynamic > Matrix
Definition: amatrix_interface.h:470
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
TExpression1Type::data_type inner_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:592
Element::WeakPointer ElementWeakPtrType
Definition: generate_new_conditions_mesher_process.hpp:44
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
Temp
Definition: PecletTest.py:105
v
Definition: generate_convection_diffusion_explicit_element.py:114
alpha
Definition: generate_convection_diffusion_explicit_element.py:113
tuple Q
Definition: isotropic_damage_automatic_differentiation.py:235
float radius
Definition: mesh_to_mdpa_converter.py:18
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
int node_id
Definition: read_stl.py:12
int counter
Definition: script_THERMAL_CORRECT.py:218
int current_id
Output settings end ####.
Definition: script.py:194
integer i
Definition: TensorModule.f:17
Configure::PointType PointType
Definition: transfer_utility.h:245