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.
elemental_neighbours_search_process.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosDelaunayMeshingApplication $
3 // Created by: $Author: JMCarbonell $
4 // Last modified by: $Co-Author: $
5 // Date: $Date: April 2018 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined(KRATOS_ELEMENTAL_NEIGHBOURS_SEARCH_PROCESS_H_INCLUDED )
11 #define KRATOS_ELEMENTAL_NEIGHBOURS_SEARCH_PROCESS_H_INCLUDED
12 
13 // System includes
14 
15 // External includes
16 
17 // Project includes
18 #include "processes/process.h"
19 #include "includes/node.h"
20 #include "includes/element.h"
21 #include "includes/model_part.h"
22 #include "utilities/openmp_utils.h"
25 
26 namespace Kratos
27 {
42 
44 
47  : public MesherProcess
48 {
49  public:
54 
57 
58  typedef Node::WeakPointer NodeWeakPtrType;
59  typedef Element::WeakPointer ElementWeakPtrType;
60  typedef Condition::WeakPointer ConditionWeakPtrType;
61 
68 
73 
75  int Dimension,
76  int EchoLevel = 0,
77  int AverageElements = 10)
78  : mrModelPart(rModelPart)
79  {
80  mAverageElements = AverageElements;
81  mDimension = Dimension;
82  mEchoLevel = EchoLevel;
83  }
84 
87  {
88  }
89 
90 
94 
95  void operator()()
96  {
97  Execute();
98  }
99 
100 
104 
105  void Execute() override
106  {
107  bool success=false;
108 
109  int method = 0; //Kratos or Lohner method
110 
111  // double begin_time = OpenMPUtils::GetCurrentTime();
112 
113  if(method==0)
114  {
115  //std::cout<<" Kratos Search "<<std::endl;
116  success=KratosSearch();
117  }
118  else
119  {
120  //std::cout<<" Lohner Search "<<std::endl;
121  success=LohnerSearch(); //seems to be worse (needs to be optimized)
122  }
123 
124  if(!success)
125  {
126  std::cout<<" ERROR: Element Neighbours Search FAILED !!! "<<std::endl;
127  }
128  // else
129  // {
130  // //print out the mesh generation time
131  // if( mEchoLevel > 1 ){
132  // double end_time = OpenMPUtils::GetCurrentTime();
133  // std::cout<<" Neighbour Elements Search time = "<<end_time-begin_time<<std::endl;
134  // }
135  // //PrintElementNeighbours();
136  // }
137 
138 
139  };
140 
141 
143  {
144  for(auto& i_node: mrModelPart.Nodes())
145  {
146  ElementWeakPtrVectorType& nElements = i_node.GetValue(NEIGHBOUR_ELEMENTS);
147  nElements.clear();
148  }
149  for(auto& i_elem : mrModelPart.Elements())
150  {
151  ElementWeakPtrVectorType& nElements = i_elem.GetValue(NEIGHBOUR_ELEMENTS);
152  nElements.clear();
153  }
154  }
155 
159 
160 
164 
165 
169 
171  std::string Info() const override
172  {
173  return "ElementalNeighboursSearchProcess";
174  }
175 
177  void PrintInfo(std::ostream& rOStream) const override
178  {
179  rOStream << "ElementalNeighboursSearchProcess";
180  }
181 
183  void PrintData(std::ostream& rOStream) const override
184  {
185  }
186 
191 
192  protected:
214 
215  private:
221  ModelPart& mrModelPart;
222  int mAverageElements;
223  int mDimension;
224  int mEchoLevel;
225 
229  template<class TDataType> void AddUniquePointer
230  (GlobalPointersVector<TDataType>& v, const typename TDataType::WeakPointer candidate)
231  {
233  typename GlobalPointersVector< TDataType >::iterator endit = v.end();
234  while ( i != endit && (i)->Id() != (candidate.lock())->Id())
235  {
236  i++;
237  }
238  if( i == endit )
239  {
240  v.push_back(candidate);
241  }
242 
243  }
244 
245  ElementWeakPtrType CheckForNeighbourElems1D (unsigned int Id_1, ElementWeakPtrVectorType& nElements, ElementsContainerType::iterator i_elem)
246  {
247  //look for the faces around node Id_1
248  for(auto i_nelem(nElements.begin()); i_nelem != nElements.end(); ++i_nelem)
249  {
250  //look for the nodes of the neighbour faces
251  Geometry<Node >& nGeometry = i_nelem->GetGeometry();
252  if(nGeometry.LocalSpaceDimension() == 1){
253  for(unsigned int node_i = 0; node_i < nGeometry.size(); ++node_i)
254  {
255  if(nGeometry[node_i].Id() == Id_1)
256  {
257  if(i_nelem->Id() != i_elem->Id())
258  {
259  return Element::WeakPointer(*i_nelem.base());
260  }
261  }
262  }
263  }
264  }
265  return Element::WeakPointer(*i_elem.base());
266  }
267 
268 
269  ElementWeakPtrType CheckForNeighbourElems2D (unsigned int Id_1, unsigned int Id_2, ElementWeakPtrVectorType& nElements, ElementsContainerType::iterator i_elem)
270  {
271  //look for the faces around node Id_1
272  for(auto i_nelem(nElements.begin()); i_nelem != nElements.end(); ++i_nelem)
273  {
274  //look for the nodes of the neighbour faces
275  Geometry<Node >& nGeometry = i_nelem->GetGeometry();
276  if(nGeometry.LocalSpaceDimension() == 2){
277  for(unsigned int node_i = 0; node_i < nGeometry.size(); ++node_i)
278  {
279  if (nGeometry[node_i].Id() == Id_2)
280  {
281  if(i_nelem->Id() != i_elem->Id())
282  {
283  return *i_nelem.base();
284  }
285  }
286  }
287  }
288  }
289  return *i_elem.base();
290  }
291 
292  ElementWeakPtrType CheckForNeighbourElems3D (unsigned int Id_1, unsigned int Id_2, unsigned int Id_3, ElementWeakPtrVectorType& nElements, ElementsContainerType::iterator i_elem)
293  {
294  //look for the faces around node Id_1
295  for(auto i_nelem(nElements.begin()); i_nelem != nElements.end(); ++i_nelem)
296  {
297  //look for the nodes of the neighbour faces
298  Geometry<Node >& nGeometry = i_nelem->GetGeometry();
299  if(nGeometry.LocalSpaceDimension() == 3){
300  for(unsigned int node_i = 0; node_i < nGeometry.size(); ++node_i)
301  {
302  if(nGeometry[node_i].Id() == Id_2)
303  {
304  for(unsigned int node_j = 0; node_j < nGeometry.size(); ++node_j)
305  {
306  if (nGeometry[node_j].Id() == Id_3)
307  if(i_nelem->Id() != i_elem->Id())
308  {
309  return *i_nelem.base();
310  }
311  }
312  }
313  }
314  }
315  }
316  return *i_elem.base();
317  }
318 
319 
320  void ResetFlagOptions (Node& rNode)
321  {
322  rNode.Reset(BOUNDARY);
323  }
324 
325  void ResetFlagOptions (Element& rElement)
326  {
327  rElement.Reset(BOUNDARY);
328  }
329 
330 
331  void CleanElementNeighbours()
332  {
333 
334  KRATOS_TRY
335 
336  //first of all the neighbour nodes and neighbour elements arrays are initialized to the guessed size
337  //this cleans the old entries:
338 
339  //************* Erase old node neighbours *************//
340  for(auto& i_node : mrModelPart.Nodes())
341  {
342  auto& nElements = i_node.GetValue(NEIGHBOUR_ELEMENTS);
343  nElements.clear();
344  nElements.reserve(mAverageElements);
345 
346  ResetFlagOptions(i_node);
347  }
348 
349  //************* Erase old element neighbours ************//
350  for(auto& i_elem : mrModelPart.Elements())
351  {
352  auto& nElements = i_elem.GetValue(NEIGHBOUR_ELEMENTS);
353  nElements.clear();
354  nElements.resize(i_elem.GetGeometry().FacesNumber());
355 
356  ResetFlagOptions(i_elem);
357  }
358 
359  KRATOS_CATCH( "" )
360  }
361 
362 
363  void PrintElementNeighbours()
364  {
365  KRATOS_TRY
366 
367  std::cout<<" NODES: neighbour elems: "<<std::endl;
368  for(auto& i_node : mrModelPart.Nodes())
369  {
370  std::cout<<"["<<i_node.Id()<<"]:"<<std::endl;
371  std::cout<<"( ";
372  auto& nElements = i_node.GetValue(NEIGHBOUR_ELEMENTS);
373  for(const auto& i_nelem : nElements)
374  {
375  std::cout<< i_nelem.Id()<<", ";
376  }
377  std::cout<<" )"<<std::endl;
378  }
379 
380  std::cout<<std::endl;
381 
382  std::cout<<" ELEMENTS: neighbour elems: "<<std::endl;
383 
384  for(auto& i_elem : mrModelPart.Elements())
385  {
386  std::cout<<"["<<i_elem.Id()<<"]:"<<std::endl;
387  std::cout<<"( ";
388  auto& nElements = i_elem.GetValue(NEIGHBOUR_ELEMENTS);
389  for(auto& i_nelem : nElements)
390  {
391  std::cout<< i_nelem.Id()<<", ";
392  }
393  std::cout<<" )"<<std::endl;
394  }
395 
396 
397  std::cout<<std::endl;
398 
399  KRATOS_CATCH( "" )
400  }
401 
402 
403 
404  bool KratosSearch()
405  {
406 
407  KRATOS_TRY
408 
409  ElementsContainerType& rElements = mrModelPart.Elements();
410 
411  //first of all the neighbour nodes and neighbour elements arrays are initialized to the guessed size
412  //this cleans the old entries:
413 
414  //***** Erase old node and element neighbours *********//
415  CleanElementNeighbours();
416 
417 
418  //************* Neigbours of nodes ************//
419  //add the neighbour elements to all the nodes in the mesh
420  for(auto i_elem(rElements.begin()); i_elem != rElements.end(); ++i_elem)
421  {
422  Element::GeometryType& rGeometry = i_elem->GetGeometry();
423  for(unsigned int i = 0; i < rGeometry.size(); ++i)
424  {
425  rGeometry[i].GetValue(NEIGHBOUR_ELEMENTS).push_back(*i_elem.base());
426  }
427  }
428 
429  //************* Neigbours of elements *********//
430  //add the neighbour elements to all the elements in the mesh
431 
432  unsigned int search_performed = false;
433 
434  //loop over faces
435  if (mDimension==2)
436  {
437  for(auto i_elem(rElements.begin()); i_elem != rElements.end(); ++i_elem)
438  {
439  //face nodes
440  Geometry<Node >& rGeometry = i_elem->GetGeometry();
441 
442  if( rGeometry.FacesNumber() == 3 ){
443 
444  auto& nElements = i_elem->GetValue(NEIGHBOUR_ELEMENTS);
445  //vector of the 3 faces around the given face
446  if(nElements.size() != 3 )
447  nElements.resize(3);
448 
449  //neighb_face is the vector containing pointers to the three faces around ic:
450 
451  // neighbour element over edge 1-2 of element ic;
452  nElements(0) = CheckForNeighbourElems2D(rGeometry[1].Id(), rGeometry[2].Id(), rGeometry[1].GetValue(NEIGHBOUR_ELEMENTS), i_elem);
453  // neighbour element over edge 2-0 of element ic;
454  nElements(1) = CheckForNeighbourElems2D(rGeometry[2].Id(), rGeometry[0].Id(), rGeometry[2].GetValue(NEIGHBOUR_ELEMENTS), i_elem);
455  // neighbour element over edge 0-1 of element ic;
456  nElements(2) = CheckForNeighbourElems2D(rGeometry[0].Id(), rGeometry[1].Id(), rGeometry[0].GetValue(NEIGHBOUR_ELEMENTS), i_elem);
457 
458  unsigned int iface=0;
459  for(auto& i_nelem : nElements)
460  {
461  if (i_nelem.Id() == i_elem->Id()) // If there is no shared element in face nf (the Id coincides)
462  {
463  i_elem->Set(BOUNDARY);
464 
465  DenseMatrix<unsigned int> lpofa; //points that define the faces
466  rGeometry.NodesInFaces(lpofa);
467 
468  for(unsigned int i = 1; i < rGeometry.FacesNumber(); ++i)
469  {
470  rGeometry[lpofa(i,iface)].Set(BOUNDARY); //set boundary particles
471  }
472  }
473  iface++;
474  }
475 
476  }
477  else if( rGeometry.FacesNumber() == 2 ){
478 
479  auto& nElements = i_elem->GetValue(NEIGHBOUR_ELEMENTS);
480 
481  //vector of the 2 faces around the given face
482  if( nElements.size() != 2 )
483  nElements.resize(2);
484 
485  //neighb_face is the vector containing pointers to the three faces around ic:
486 
487  // neighbour element over edge 0 of element ic;
488  nElements(0) = CheckForNeighbourElems1D(rGeometry[0].Id(), rGeometry[0].GetValue(NEIGHBOUR_ELEMENTS), i_elem);
489  // neighbour element over edge 1 of element ic;
490  nElements(1) = CheckForNeighbourElems1D(rGeometry[1].Id(), rGeometry[1].GetValue(NEIGHBOUR_ELEMENTS), i_elem);
491 
492  unsigned int iface=0;
493  for(auto& i_nelem : nElements)
494  {
495  if(i_nelem.Id() == i_elem->Id()) // If there is no shared element in face nf (the Id coincides)
496  {
497  i_elem->Set(BOUNDARY);
498 
499  DenseMatrix<unsigned int> lpofa; //points that define the faces
500  rGeometry.NodesInFaces(lpofa);
501 
502  for(unsigned int i = 1; i < rGeometry.FacesNumber(); ++i)
503  {
504  rGeometry[lpofa(i,iface)].Set(BOUNDARY); //set boundary particles
505  }
506  }
507  iface++;
508  }
509  }
510  }
511 
512  search_performed = true;
513  }
514 
515  if (mDimension==3)
516  {
517  for(auto i_elem(rElements.begin()); i_elem != rElements.end(); ++i_elem)
518  {
519  //face nodes
520  Geometry<Node >& rGeometry = i_elem->GetGeometry();
521 
522  if(rGeometry.FacesNumber() == 4){
523 
524  //vector of the 4 faces around the given element (3D tetrahedron)
525  auto& nElements = i_elem->GetValue(NEIGHBOUR_ELEMENTS);
526 
527  if(nElements.size() != 4)
528  nElements.resize(4);
529 
530  //neighb_face is the vector containing pointers to the three faces around ic:
531 
532  // neighbour element over face 1-2-3 of element ic;
533  nElements(0) = CheckForNeighbourElems3D(rGeometry[1].Id(), rGeometry[2].Id(), rGeometry[3].Id(), rGeometry[1].GetValue(NEIGHBOUR_ELEMENTS), i_elem);
534  // neighbour element over face 2-3-0 of element ic;
535  nElements(1) = CheckForNeighbourElems3D(rGeometry[2].Id(), rGeometry[3].Id(), rGeometry[0].Id(), rGeometry[2].GetValue(NEIGHBOUR_ELEMENTS), i_elem);
536  // neighbour element over face 3-0-1 of element ic;
537  nElements(2) = CheckForNeighbourElems3D(rGeometry[3].Id(), rGeometry[0].Id(), rGeometry[1].Id(), rGeometry[3].GetValue(NEIGHBOUR_ELEMENTS), i_elem);
538  // neighbour element over face 0-1-2 of element ic;
539  nElements(3) = CheckForNeighbourElems3D(rGeometry[0].Id(), rGeometry[1].Id(), rGeometry[2].Id(), rGeometry[0].GetValue(NEIGHBOUR_ELEMENTS), i_elem);
540 
541 
542  unsigned int iface=0;
543  for(auto& i_nelem : nElements)
544  {
545  if(i_nelem.Id() == i_elem->Id()) // If there is no shared element in face nf (the Id coincides)
546  {
547  i_elem->Set(BOUNDARY);
548 
549  DenseMatrix<unsigned int> lpofa; //points that define the faces
550  rGeometry.NodesInFaces(lpofa);
551 
552  for(unsigned int i = 1; i < rGeometry.FacesNumber(); ++i)
553  {
554  rGeometry[lpofa(i,iface)].Set(BOUNDARY); //set boundary particles
555  //std::cout<<" SetBoundary ("<<rGeometry[lpofa(i,0)].Id()<<")"<<std::endl;
556  }
557  }
558  iface++;
559  }
560 
561  }
562  else if(rGeometry.FacesNumber() == 3){
563 
564  //vector of the 3 faces around the given element (3D triangle)
565  auto& nElements = i_elem->GetValue(NEIGHBOUR_ELEMENTS);
566 
567  if(nElements.size() != 3)
568  nElements.resize(3);
569 
570  //neighb_face is the vector containing pointers to the three faces around ic:
571 
572  // neighbour element over edge 1-2 of element ic;
573  nElements(0) = CheckForNeighbourElems2D(rGeometry[1].Id(), rGeometry[2].Id(), rGeometry[1].GetValue(NEIGHBOUR_ELEMENTS), i_elem);
574  // neighbour element over edge 2-0 of element ic;
575  nElements(1) = CheckForNeighbourElems2D(rGeometry[2].Id(), rGeometry[0].Id(), rGeometry[2].GetValue(NEIGHBOUR_ELEMENTS), i_elem);
576  // neighbour element over edge 0-1 of element ic;
577  nElements(2) = CheckForNeighbourElems2D(rGeometry[0].Id(), rGeometry[1].Id(), rGeometry[0].GetValue(NEIGHBOUR_ELEMENTS), i_elem);
578 
579  unsigned int iface=0;
580  for(auto& i_nelem : nElements)
581  {
582  if(i_nelem.Id() == i_elem->Id()) // If there is no shared element in face nf (the Id coincides)
583  {
584  i_elem->Set(BOUNDARY);
585 
586  Geometry<Node >& rGeometry = (i_elem)->GetGeometry();
587 
588  DenseMatrix<unsigned int> lpofa; //points that define the faces
589  rGeometry.NodesInFaces(lpofa);
590 
591  for(unsigned int i = 1; i < rGeometry.FacesNumber(); ++i)
592  {
593  rGeometry[lpofa(i,iface)].Set(BOUNDARY); //set boundary particles
594  }
595  }
596  iface++;
597  }
598 
599  }
600  }
601  search_performed = true;
602  }
603 
604  if( mrModelPart.NumberOfElements()>0 && search_performed )
605  return true;
606  else
607  return false;
608 
609  KRATOS_CATCH( "" )
610  }
611 
612 
613  bool LohnerSearch()
614  {
615 
616  KRATOS_TRY
617 
618  NodesContainerType& rNodes = mrModelPart.Nodes();
619  ElementsContainerType& rElements = mrModelPart.Elements();
620 
621 
622  unsigned int Ne=rElements.size();
623  unsigned int Np=rNodes.size();
624 
625  //***** Erase old node and element neighbours *********//
626  CleanElementNeighbours();
627 
628 
629  //************* Neigbours of nodes ************//
630  //add the neighbour elements to all the nodes in the mesh
631  for(auto i_elem(rElements.begin()); i_elem != rElements.end(); ++i_elem)
632  {
633  Element::GeometryType& rGeometry = i_elem->GetGeometry();
634  if(rGeometry.LocalSpaceDimension() == mrModelPart.GetProcessInfo()[SPACE_DIMENSION]){
635  for(unsigned int i = 0; i < rGeometry.size(); ++i)
636  {
637  rGeometry[i].GetValue(NEIGHBOUR_ELEMENTS).push_back(*i_elem.base());
638  }
639  }
640  }
641 
642  //************* Neigbours of elements *********//
643  //add the neighbour elements to all the elements in the mesh
644  //loop over faces
645 
646  unsigned int ipoin=0;
647  unsigned int nnofa=0;
648  unsigned int jelem=0;
649  unsigned int icoun=0;
650  unsigned int jpoin=0;
651  unsigned int nnofj=0;
652  unsigned int nface=0;
653 
654  DenseVector<unsigned int> lnofa; //number of nodes per face
655  DenseMatrix<unsigned int> lpofa; //points that define the faces
656 
657  Element::GeometryType& rGeometry = rElements.begin()->GetGeometry(); // the first element is taken as reference
658  unsigned int Nf= rGeometry.FacesNumber(); //number of faces
659 
660  //lnofa and lpofa defined in Geometry of the element (rGeometry): triangle, quadrilateral, tetrahedron ...
661  rGeometry.NumberNodesInFaces(lnofa);
662  rGeometry.NodesInFaces(lpofa);
663 
664  //Auxiliary vectors
665  DenseVector<unsigned int> lhelp (Nf-1); //can be only 2 or 3 nodes per face : Triangles(faces of 2 nodes) Tetrahedra(faces of 3 nodes)
666  lhelp.clear();
667  DenseVector<unsigned int> lpoin (Np+1);
668  lpoin.clear();
669 
670 
671  //Elements Surrounding Elements
672  int el;
673 #pragma omp parallel for reduction(+:nface) private(el,ipoin,nnofa,jelem,icoun,jpoin,nnofj) firstprivate(lhelp,lpoin)
674  for (el=1; el<(int)Ne+1; ++el) //ELEMENTS START FROM el=1
675  {
676 
677  for (unsigned int nf=0; nf<Nf; ++nf) //loop over faces
678  {
679  nnofa=lnofa(nf);
680 
681  //Initially assign the same element as a neighbour
682  rElements[el].GetValue(NEIGHBOUR_ELEMENTS)(nf) = rElements(el);
683 
684  //constant vector, depends on the element
685  for (unsigned int t=0; t<nnofa; ++t)
686  {
687  lhelp(t)=rElements[el].GetGeometry()[lpofa(t,nf)].Id(); //connections of the face
688  lpoin(lhelp(t))=1; //mark in lpoin
689  }
690 
691  ipoin=lhelp(1); //select a point
692 
693  auto& nElements = rNodes[ipoin].GetValue(NEIGHBOUR_ELEMENTS);
694 
695  for(auto& i_nelem : nElements) //loop over elements surronding a point
696  {
697  jelem=i_nelem.Id();
698  unsigned int ielem =rElements[el].Id();
699 
700  if(jelem!=ielem)
701  {
702 
703  for(unsigned int fel=0; fel<Nf; ++fel) //loop over the element faces
704  {
705  nnofj=lnofa(fel);
706 
707  if (nnofj==nnofa)
708  {
709 
710  icoun=0;
711  for (unsigned int jnofa=0; jnofa<nnofa; ++jnofa) //loop to count the number of equal points
712  {
713  jpoin= rElements[jelem].GetGeometry()[lpofa(jnofa,fel)].Id();
714  icoun= icoun+lpoin(jpoin);
715  }
716 
717  if(icoun==nnofa)
718  {
719  //store the element
720  rElements[el].GetValue(NEIGHBOUR_ELEMENTS)(nf) = rElements(jelem);
721  //std::cout<<" el "<<el<<" shared "<<jelem<<std::endl;
722  }
723  }
724  }
725  }
726  }
727 
728 
729  if (rElements[el].GetValue(NEIGHBOUR_ELEMENTS)[nf].Id() == rElements[el].Id()) // If there is no shared element in face nf (the Id coincides)
730  {
731 
732  rElements[el].Set(BOUNDARY);
733 
734  //unsigned int nfixed=0;
735  for (unsigned int t=0; t<nnofa; ++t) //loop on number of nodes per face
736  {
737  rNodes[lhelp(t)].Set(BOUNDARY); //set boundary particles
738  }
739 
740  nface+=1;
741 
742  }
743  //loop B is outside to parallelize with omp
744 
745 
746  for (unsigned int r=0; r<nnofa; ++r)
747  {
748  lpoin(lhelp(r))=0; //reset lpoin
749  }
750  }
751  }
752 
753 
754  //detection of the boundary elements with no face in the boundary and layer elements
755 
756  for(auto& i_elem : rElements)
757  {
758  Element::GeometryType& rGeometry = i_elem.GetGeometry();
759  for(unsigned int i = 0; i < rGeometry.size(); ++i)
760  {
761  if(rGeometry[i].Is(BOUNDARY))
762  {
763  i_elem.Set(BOUNDARY);
764  }
765  }
766 
767  }
768 
769  return true;
770 
771  KRATOS_CATCH( "" )
772  }
773 
777 
778 
782 
783 
787 
788 
792 
795 
797  //ElementalNeighboursSearchProcess(ElementalNeighboursSearchProcess const& rOther);
798 
799 
801 
802 }; // Class ElementalNeighboursSearchProcess
803 
805 
808 
809 
813 
814 
816 inline std::istream& operator >> (std::istream& rIStream,
818 
820 inline std::ostream& operator << (std::ostream& rOStream,
822 {
823  rThis.PrintInfo(rOStream);
824  rOStream << std::endl;
825  rThis.PrintData(rOStream);
826 
827  return rOStream;
828 }
830 
831 
832 } // namespace Kratos.
833 
834 #endif // KRATOS_ELEMENTAL_NEIGHBOURS_SEARCH_PROCESS_H_INCLUDED defined
Geometry< NodeType > GeometryType
definition of the geometry type with given NodeType
Definition: element.h:83
Short class definition.
Definition: elemental_neighbours_search_process.hpp:48
void ClearNeighbours()
Definition: elemental_neighbours_search_process.hpp:142
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: elemental_neighbours_search_process.hpp:105
std::string Info() const override
Turn back information as a string.
Definition: elemental_neighbours_search_process.hpp:171
GlobalPointersVector< Condition > ConditionWeakPtrVectorType
Definition: elemental_neighbours_search_process.hpp:64
KRATOS_CLASS_POINTER_DEFINITION(ElementalNeighboursSearchProcess)
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: elemental_neighbours_search_process.hpp:183
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: elemental_neighbours_search_process.hpp:177
virtual ~ElementalNeighboursSearchProcess()
Destructor.
Definition: elemental_neighbours_search_process.hpp:86
ElementalNeighboursSearchProcess(ModelPart &rModelPart, int Dimension, int EchoLevel=0, int AverageElements=10)
Definition: elemental_neighbours_search_process.hpp:74
Node::WeakPointer NodeWeakPtrType
Definition: elemental_neighbours_search_process.hpp:58
Element::WeakPointer ElementWeakPtrType
Definition: elemental_neighbours_search_process.hpp:59
GlobalPointersVector< Node > NodeWeakPtrVectorType
Definition: elemental_neighbours_search_process.hpp:62
void operator()()
Definition: elemental_neighbours_search_process.hpp:95
ModelPart::ElementsContainerType ElementsContainerType
Definition: elemental_neighbours_search_process.hpp:56
ModelPart::NodesContainerType NodesContainerType
Definition: elemental_neighbours_search_process.hpp:55
GlobalPointersVector< Element > ElementWeakPtrVectorType
Definition: elemental_neighbours_search_process.hpp:63
Condition::WeakPointer ConditionWeakPtrType
Definition: elemental_neighbours_search_process.hpp:60
bool Is(Flags const &rOther) const
Definition: flags.h:274
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
The base class for processes passed to the solution scheme.
Definition: mesher_process.hpp:37
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
#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
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
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
REACTION_CHECK_STIFFNESS_FACTOR int
Definition: contact_structural_mechanics_application_variables.h:75
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
v
Definition: generate_convection_diffusion_explicit_element.py:114
int t
Definition: ode_solve.py:392
el
Definition: read_stl.py:25
integer i
Definition: TensorModule.f:17