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.
local_refine_tetrahedra_mesh.hpp
Go to the documentation of this file.
1 // KRATOS __ __ _____ ____ _ _ ___ _ _ ____
2 // | \/ | ____/ ___|| | | |_ _| \ | |/ ___|
3 // | |\/| | _| \___ \| |_| || || \| | | _
4 // | | | | |___ ___) | _ || || |\ | |_| |
5 // |_| |_|_____|____/|_| |_|___|_| \_|\____| APPLICATION
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Nelson Lafontaine
11 // Jordi Cotela Dalmau
12 // Riccardo Rossi
13 // Co-authors: Vicente Mataix Ferrandiz
14 //
15 
16 #pragma once
17 
18 #ifdef _OPENMP
19 #include <omp.h>
20 #endif
21 
22 // NOTE: Before compute the remeshing it is necessary to compute the neighbours
23 
24 // System includes
25 
26 /* Project includes */
31 
32 namespace Kratos
33 {
49 {
50 public:
51 
57 
60  {
61 
62  }
63 
66 
70 
74 
82  {
83  // Determine a new unique id
84  unsigned int new_id = (model_part.NodesEnd() - 1)->Id() + 1;
85 
86  if( model_part.Nodes().find(new_id) != model_part.NodesEnd() )
87  {
88  KRATOS_THROW_ERROR(std::logic_error, "adding a center node with an already existing id","");
89  }
90 
91  // Determine the coordinates of the new node
92  double X = (geom[0].X() + geom[1].X() + geom[2].X() + geom[3].X()) / 4.0;
93  double Y = (geom[0].Y() + geom[1].Y() + geom[2].Y() + geom[3].Y()) / 4.0;
94  double Z = (geom[0].Z() + geom[1].Z() + geom[2].Z() + geom[3].Z()) / 4.0;
95 
96  double X0 = (geom[0].X0() + geom[1].X0() + geom[2].X0() + geom[3].X0()) / 4.0;
97  double Y0 = (geom[0].Y0() + geom[1].Y0() + geom[2].Y0() + geom[3].Y0()) / 4.0;
98  double Z0 = (geom[0].Z0() + geom[1].Z0() + geom[2].Z0() + geom[3].Z0()) / 4.0;
99 
100  // Generate the new node
101  Node ::Pointer pnode = model_part.CreateNewNode(new_id, X, Y, Z);
102 
103  unsigned int buffer_size = model_part.NodesBegin()->GetBufferSize();
104  pnode->SetBufferSize(buffer_size);
105 
106  pnode->X0() = X0;
107  pnode->Y0() = Y0;
108  pnode->Z0() = Z0;
109 
110  // Add the dofs
111  Node::DofsContainerType& reference_dofs = (model_part.NodesBegin())->GetDofs();
112  unsigned int step_data_size = model_part.GetNodalSolutionStepDataSize();
113 
114  for (Node::DofsContainerType::iterator iii = reference_dofs.begin(); iii != reference_dofs.end(); ++iii)
115  {
116  Node::DofType& rDof = **iii;
117  Node::DofType::Pointer p_new_dof = pnode->pAddDof(rDof);
118 
119  // The variables are left as free for the internal node
120  (p_new_dof)->FreeDof();
121  }
122 
123  // Intepolating the data
124  for (unsigned int step = 0; step < buffer_size; step++)
125  {
126  double* new_step_data = pnode->SolutionStepData().Data(step);
127  double* step_data1 = geom[0].SolutionStepData().Data(step);
128  double* step_data2 = geom[1].SolutionStepData().Data(step);
129  double* step_data3 = geom[2].SolutionStepData().Data(step);
130  double* step_data4 = geom[3].SolutionStepData().Data(step);
131 
132  // Copying this data in the position of the vector we are interested in
133  for (unsigned int j = 0; j < step_data_size; j++)
134  {
135  new_step_data[j] = 0.25 * (step_data1[j] + step_data2[j] + step_data3[j] + step_data4[j]);
136  }
137  }
138 
139  pnode->GetValue(FATHER_NODES).resize(0);
140  pnode->GetValue(FATHER_NODES).push_back( Node::WeakPointer( geom(0) ) );
141  pnode->GetValue(FATHER_NODES).push_back( Node::WeakPointer( geom(1) ) );
142  pnode->GetValue(FATHER_NODES).push_back( Node::WeakPointer( geom(2) ) );
143  pnode->GetValue(FATHER_NODES).push_back( Node::WeakPointer( geom(3) ) );
144 
145  return new_id;
146  }
147 
148  /***********************************************************************************/
149  /***********************************************************************************/
150 
160  ModelPart& this_model_part,
161  const compressed_matrix<int>& Coord,
162  PointerVector< Element >& NewElements,
163  bool interpolate_internal_variables
164  ) override
165  {
166  ElementsArrayType& rElements = this_model_part.Elements();
167  ElementsArrayType::iterator it_begin = rElements.ptr_begin();
168  ElementsArrayType::iterator it_end = rElements.ptr_end();
169  unsigned int to_be_deleted = 0;
170  unsigned int large_id = (rElements.end() - 1)->Id() * 15;
171  unsigned int current_id = (rElements.end() - 1)->Id() + 1;
172  bool create_element = false;
173  int number_elem = 0;
174  int splitted_edges = 0;
175  int internal_node = 0;
176 
177  const ProcessInfo& rCurrentProcessInfo = this_model_part.GetProcessInfo();
178  int edge_ids[6];
179  int t[56];
180  std::vector<int> aux;
181 
182  std::cout << "****************** REFINING MESH ******************" << std::endl;
183  std::cout << "OLD NUMBER ELEMENTS: " << rElements.size() << std::endl;
184 
185  for (int & i : t)
186  {
187  i = -1;
188  }
189 
190  for (ElementsArrayType::iterator it = it_begin; it != it_end; ++it)
191  {
192  Element::GeometryType& geom = it->GetGeometry();
193  CalculateEdges(geom, Coord, edge_ids, aux);
194 
195  create_element = TetrahedraSplit::Split_Tetrahedra(edge_ids, t, &number_elem, &splitted_edges, &internal_node);
196 
197  if (internal_node == 1)
198  {
199  // Generate new internal node
200  aux[10] = CreateCenterNode(geom, this_model_part);
201 
202  bool verified = false;
203  for(int iii = 0; iii < number_elem*4; iii++)
204  {
205  if(t[iii] == 10)
206  {
207  verified = true;
208  }
209  }
210 
211  if(verified == false)
212  {
213  KRATOS_WATCH(number_elem);
214  for(int iii = 0; iii < number_elem * 4; iii++)
215  {
216  std::cout << t[iii] << std::endl;
217  }
218 
219  KRATOS_THROW_ERROR(std::logic_error,"internal node is created but not used","");
220  }
221 
222  }
223 
224  //TODO: CHANGE RESPECT TO BASE CLASS: ( FLUID SOLVER MIGHT HAVE CHANGED THIS)
225  //probably it'd be good to move this to github
226  it->SetValue(SPLIT_ELEMENT,false);
227 
228  if (create_element)
229  {
230  to_be_deleted++;
231 
232  GlobalPointersVector< Element >& rChildElements = it->GetValue(NEIGHBOUR_ELEMENTS);
233  // We will use this flag to identify the element later, when operating on
234  // SubModelParts. Note that fully refined elements already have this flag set
235  // to true, but this is not the case for partially refined element, so we set it here.
236  it->SetValue(SPLIT_ELEMENT,true);
237  rChildElements.resize(0);
238 
239  // Create the new connectivity
240  for (int i = 0; i < number_elem; i++)
241  {
242  unsigned int base = i * 4;
243  unsigned int i0 = aux[t[base]];
244  unsigned int i1 = aux[t[base + 1]];
245  unsigned int i2 = aux[t[base + 2]];
246  unsigned int i3 = aux[t[base + 3]];
247 
249  this_model_part.Nodes()(i0),
250  this_model_part.Nodes()(i1),
251  this_model_part.Nodes()(i2),
252  this_model_part.Nodes()(i3)
253  );
254 
255  // Generate new element by cloning the base one
256  Element::Pointer p_element;
257  p_element = it->Create(current_id, geom, it->pGetProperties());
258  p_element->Initialize(rCurrentProcessInfo);
259  p_element->InitializeSolutionStep(rCurrentProcessInfo);
260  p_element->FinalizeSolutionStep(rCurrentProcessInfo);
261 
262  // Setting the internal variables in the child elem
263  if (interpolate_internal_variables == true)
264  {
265  InterpolateInteralVariables(number_elem, *it.base(), p_element, rCurrentProcessInfo);
266  }
267 
268  // Transfer elemental variables
269  p_element->GetData() = it->GetData();
270  p_element->GetValue(SPLIT_ELEMENT) = false;
271  NewElements.push_back(p_element);
272 
273  rChildElements.push_back( Element::WeakPointer(p_element) );
274 
275  current_id++;
276  }
277  it->SetId(large_id);
278  large_id++;
279  }
280 
281  for (unsigned int i = 0; i < 32; i++)
282  {
283  t[i] = -1;
284  }
285  }
286 
287  /* Adding news elements to the model part */
288  for (PointerVector< Element >::iterator it_new = NewElements.begin(); it_new != NewElements.end(); it_new++)
289  {
290  rElements.push_back(*(it_new.base()));
291  }
292 
293  /* All of the elements to be erased are at the end */
294  rElements.Sort();
295 
296  /* Now remove all of the "old" elements */
297  rElements.erase(this_model_part.Elements().end() - to_be_deleted, this_model_part.Elements().end());
298 
299  std::cout << "NEW NUMBER ELEMENTS: " << rElements.size() << std::endl;
300 
301 
302  // Now update the elements in SubModelParts
303  if (NewElements.size() > 0)
304  {
305  UpdateSubModelPartElements(this_model_part, NewElements);
306  }
307 
308  }
309 
315  void UpdateSubModelPartElements(ModelPart& this_model_part, PointerVector< Element >& NewElements)
316  {
317  for (ModelPart::SubModelPartIterator iSubModelPart = this_model_part.SubModelPartsBegin();
318  iSubModelPart != this_model_part.SubModelPartsEnd(); iSubModelPart++)
319  {
320  unsigned int to_be_deleted = 0;
321  NewElements.clear();
322 
323  // Create list of new elements in SubModelPart
324  // Count how many elements will be removed
325  for (ModelPart::ElementIterator iElem = iSubModelPart->ElementsBegin();
326  iElem != iSubModelPart->ElementsEnd(); iElem++)
327  {
328  if( iElem->GetValue(SPLIT_ELEMENT) )
329  {
330  to_be_deleted++;
331  GlobalPointersVector< Element >& rChildElements = iElem->GetValue(NEIGHBOUR_ELEMENTS);
332 
333  for ( auto iChild = rChildElements.ptr_begin();
334  iChild != rChildElements.ptr_end(); iChild++ )
335  {
336  NewElements.push_back((*iChild)->shared_from_this());
337  }
338  }
339  }
340 
341  // Add new elements to SubModelPart
342  iSubModelPart->Elements().reserve( iSubModelPart->Elements().size() + NewElements.size() );
343  for (PointerVector< Element >::iterator it_new = NewElements.begin();
344  it_new != NewElements.end(); it_new++)
345  {
346  iSubModelPart->Elements().push_back(*(it_new.base()));
347  }
348 
349  // Delete old elements
350  iSubModelPart->Elements().Sort();
351  iSubModelPart->Elements().erase(iSubModelPart->Elements().end() - to_be_deleted, iSubModelPart->Elements().end());
352  /*
353  KRATOS_WATCH(iSubModelPart->Info());
354  KRATOS_WATCH(to_be_deleted);
355  KRATOS_WATCH(iSubModelPart->Elements().size());
356  KRATOS_WATCH(this_model_part.Elements().size());
357  */
358 
359  //NEXT LEVEL
360  if (NewElements.size() > 0)
361  {
362  ModelPart &rSubModelPart = *iSubModelPart;
363  UpdateSubModelPartElements(rSubModelPart,NewElements);
364  }
365 
366 
367  }
368  }
369  /***********************************************************************************/
370  /***********************************************************************************/
371 
379  ModelPart& this_model_part,
380  const compressed_matrix<int>& Coord
381  ) override
382  {
383  KRATOS_TRY;
384 
385  PointerVector< Condition > NewConditions;
386 
387  ConditionsArrayType& rConditions = this_model_part.Conditions();
388 
389  if(rConditions.size() > 0)
390  {
391  ConditionsArrayType::iterator it_begin = rConditions.ptr_begin();
392  ConditionsArrayType::iterator it_end = rConditions.ptr_end();
393  unsigned int to_be_deleted = 0;
394  unsigned int large_id = (rConditions.end() - 1)->Id() * 7;
395  int edge_ids[3];
396  int t[12];
397  int number_elem = 0;
398  int splitted_edges = 0;
399  int nint = 0;
400  array_1d<int, 6> aux;
401 
402  const ProcessInfo& rCurrentProcessInfo = this_model_part.GetProcessInfo();
403 
404  unsigned int current_id = (rConditions.end() - 1)->Id() + 1;
405  for (ConditionsArrayType::iterator it = it_begin; it != it_end; ++it)
406  {
407  Condition::GeometryType& geom = it->GetGeometry();
408 
409  if (geom.size() == 3)
410  {
411  CalculateEdgesFaces(geom, Coord, edge_ids, aux);
412 
413  // Create the new conditions
414  bool create_condition = TriangleSplit::Split_Triangle(edge_ids, t, &number_elem, &splitted_edges, &nint);
415 
416  if(create_condition==true)
417  {
418  GlobalPointersVector< Condition >& rChildConditions = it->GetValue(NEIGHBOUR_CONDITIONS);
419  // We will use this flag to identify the condition later, when operating on
420  // SubModelParts.
421  it->SetValue(SPLIT_ELEMENT,true);
422  rChildConditions.resize(0);
423  to_be_deleted++;
424 
425  for(int i = 0; i < number_elem; i++)
426  {
427  unsigned int base = i * 3;
428  unsigned int i0 = aux[t[base]];
429  unsigned int i1 = aux[t[base+1]];
430  unsigned int i2 = aux[t[base+2]];
431 
432  Triangle3D3<Node > newgeom(
433  this_model_part.Nodes()(i0),
434  this_model_part.Nodes()(i1),
435  this_model_part.Nodes()(i2)
436  );
437 
438  // Generate new condition by cloning the base one
439  Condition::Pointer pcond;
440  pcond = it->Create(current_id, newgeom, it->pGetProperties());
441  pcond ->Initialize(rCurrentProcessInfo);
442  pcond ->InitializeSolutionStep(rCurrentProcessInfo);
443  pcond ->FinalizeSolutionStep(rCurrentProcessInfo);
444 
445  // Transfer condition variables
446  pcond->GetData() = it->GetData();
447  pcond->GetValue(SPLIT_ELEMENT) = false;
448  NewConditions.push_back(pcond);
449 
450  rChildConditions.push_back( Condition::WeakPointer( pcond ) );
451 
452  current_id++;
453  }
454  it->SetId(large_id);
455  large_id++;
456  }
457  }
458  }
459 
460  /* All of the conditions to be erased are at the end */
461  this_model_part.Conditions().Sort();
462 
463  /* Now remove all of the "old" conditions*/
464  this_model_part.Conditions().erase(this_model_part.Conditions().end() - to_be_deleted, this_model_part.Conditions().end());
465 
466  unsigned int total_size = this_model_part.Conditions().size()+ NewConditions.size();
467  this_model_part.Conditions().reserve(total_size);
468 
470  for (auto iCond = NewConditions.ptr_begin();
471  iCond != NewConditions.ptr_end(); iCond++)
472  {
473  this_model_part.Conditions().push_back( *iCond );
474  }
475 
476 
477 
478  // Now update the conditions in SubModelParts
479  if (NewConditions.size() > 0)
480  {
481  UpdateSubModelPartConditions(this_model_part, NewConditions);
482  }
483  }
484  KRATOS_CATCH("");
485  }
486 
487 
494  for (auto it_sub_model_part = rModelPart.SubModelPartsBegin(); it_sub_model_part != rModelPart.SubModelPartsEnd(); it_sub_model_part++) {
495  unsigned int to_be_deleted = 0;
496  rNewConditions.clear();
497 
498  // Create list of new conditions in SubModelPart
499  // Count how many conditions will be removed
500  for (auto it_cond = it_sub_model_part->ConditionsBegin(); it_cond != it_sub_model_part->ConditionsEnd(); it_cond++) {
501  if( it_cond->GetValue(SPLIT_ELEMENT) ) {
502  to_be_deleted++;
503  auto& rChildConditions = it_cond->GetValue(NEIGHBOUR_CONDITIONS);
504  for ( auto iChild = rChildConditions.ptr_begin(); iChild != rChildConditions.ptr_end(); iChild++ ) {
505  rNewConditions.push_back((*iChild)->shared_from_this());
506  }
507  }
508  }
509 
510  // Add new conditions to SubModelPart
511  it_sub_model_part->Conditions().reserve( it_sub_model_part->Conditions().size() + rNewConditions.size() );
512  for (auto it_new = rNewConditions.begin(); it_new != rNewConditions.end(); it_new++) {
513  it_sub_model_part->Conditions().push_back(*(it_new.base()));
514  }
515 
516  // Delete old conditions
517  it_sub_model_part->Conditions().Sort();
518  it_sub_model_part->Conditions().erase(it_sub_model_part->Conditions().end() - to_be_deleted, it_sub_model_part->Conditions().end());
519  if (rNewConditions.size() > 0) {
520  ModelPart &rSubModelPart = *it_sub_model_part;
521  UpdateSubModelPartConditions(rSubModelPart, rNewConditions);
522  }
523  }
524  }
525 
526  /***********************************************************************************/
527  /***********************************************************************************/
528 
539  Element::GeometryType& geom,
540  const compressed_matrix<int>& Coord,
541  int* edge_ids,
542  std::vector<int> & aux
543  ) override
544  {
545  aux.resize(11, false);
546 
547  int index_0 = mMapNodeIdToPos[geom[0].Id()];
548  int index_1 = mMapNodeIdToPos[geom[1].Id()];
549  int index_2 = mMapNodeIdToPos[geom[2].Id()];
550  int index_3 = mMapNodeIdToPos[geom[3].Id()];
551 
552  // Put the global ids in aux
553  aux[0] = geom[0].Id();
554  aux[1] = geom[1].Id();
555  aux[2] = geom[2].Id();
556  aux[3] = geom[3].Id();
557 
558  if (index_0 > index_1)
559  {
560  aux[4] = Coord(index_1, index_0);
561  }
562  else
563  {
564  aux[4] = Coord(index_0, index_1);
565  }
566 
567  if (index_0 > index_2)
568  {
569  aux[5] = Coord(index_2, index_0);
570  }
571  else
572  {
573  aux[5] = Coord(index_0, index_2);
574  }
575 
576  if (index_0 > index_3)
577  {
578  aux[6] = Coord(index_3, index_0);
579  }
580  else
581  {
582  aux[6] = Coord(index_0, index_3);
583  }
584 
585  if (index_1 > index_2)
586  {
587  aux[7] = Coord(index_2, index_1);
588  }
589  else
590  {
591  aux[7] = Coord(index_1, index_2);
592  }
593 
594  if (index_1 > index_3)
595  {
596  aux[8] = Coord(index_3, index_1);
597  }
598  else
599  {
600  aux[8] = Coord(index_1, index_3);
601  }
602 
603  if (index_2 > index_3)
604  {
605  aux[9] = Coord(index_3, index_2);
606  }
607  else
608  {
609  aux[9] = Coord(index_2, index_3);
610  }
611 
613  aux.data(),
614  edge_ids);
615  }
616 
617  /***********************************************************************************/
618  /***********************************************************************************/
619 
630  const compressed_matrix<int>& Coord,
631  int* edge_ids,
632  array_1d<int, 6>& aux
633  )
634  {
635  int index_0 = mMapNodeIdToPos[geom[0].Id()];
636  int index_1 = mMapNodeIdToPos[geom[1].Id()];
637  int index_2 = mMapNodeIdToPos[geom[2].Id()];
638 
639  aux[0] = geom[0].Id();
640  aux[1] = geom[1].Id();
641  aux[2] = geom[2].Id();
642 
643  if (index_0 > index_1)
644  {
645  aux[3] = Coord(index_1, index_0);
646  }
647  else
648  {
649  aux[3] = Coord(index_0, index_1);
650  }
651 
652 
653  if (index_1 > index_2)
654  {
655  aux[4] = Coord(index_2, index_1);
656  }
657  else
658  {
659  aux[4] = Coord(index_1, index_2);
660  }
661 
662 
663  if (index_2 > index_0)
664  {
665  aux[5] = Coord(index_0, index_2);
666  }
667  else
668  {
669  aux[5] = Coord(index_2, index_0);
670  }
671 
672  // Edge 01
673  if (aux[3] < 0)
674  {
675  if (index_0 > index_1)
676  {
677  edge_ids[0] = 0;
678  }
679  else
680  {
681  edge_ids[0] = 1;
682  }
683  }
684  else
685  {
686  edge_ids[0] = 3;
687  }
688 
689  // Edge 12
690  if (aux[4] < 0)
691  {
692  if (index_1 > index_2)
693  {
694  edge_ids[1] = 1;
695  }
696  else
697  {
698  edge_ids[1] = 2;
699  }
700  }
701  else
702  {
703  edge_ids[1] = 4;
704  }
705 
706  // Edge 20
707  if (aux[5] < 0)
708  {
709  if (index_2 > index_0)
710  {
711  edge_ids[2] = 2;
712  }
713  else
714  {
715  edge_ids[2] = 0;
716  }
717  }
718  else
719  {
720  edge_ids[2] = 5;
721  }
722  }
723 
724 protected:
727 
731 
735 
739 
743 
747 
752 
753 private:
756 
760 
764 
768 
772 
776 
781 
782 };
783 
784 } // namespace Kratos.
Dof represents a degree of freedom (DoF).
Definition: dof.h:86
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
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: geometry.h:627
ptr_iterator ptr_begin()
Definition: global_pointers_vector.h:253
void push_back(TPointerType x)
Definition: global_pointers_vector.h:322
void resize(size_type new_dim) const
Definition: global_pointers_vector.h:366
ptr_iterator ptr_end()
Definition: global_pointers_vector.h:261
Definition: local_refine_geometry_mesh.hpp:49
std::unordered_map< std::size_t, unsigned int > mMapNodeIdToPos
The current refinement level.
Definition: local_refine_geometry_mesh.hpp:240
void InterpolateInteralVariables(const int &number_elem, const TGeometricalObjectPointerType father_elem, TGeometricalObjectPointerType child_elem, const ProcessInfo &rCurrentProcessInfo)
Definition: local_refine_geometry_mesh.hpp:213
ModelPart::ElementsContainerType ElementsArrayType
Definition: local_refine_geometry_mesh.hpp:55
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: local_refine_geometry_mesh.hpp:56
Definition: local_refine_tetrahedra_mesh.hpp:49
void CalculateEdges(Element::GeometryType &geom, const compressed_matrix< int > &Coord, int *edge_ids, std::vector< int > &aux) override
Definition: local_refine_tetrahedra_mesh.hpp:538
void UpdateSubModelPartConditions(ModelPart &rModelPart, PointerVector< Condition > &rNewConditions)
Definition: local_refine_tetrahedra_mesh.hpp:493
LocalRefineTetrahedraMesh(ModelPart &rModelPart)
Default constructors.
Definition: local_refine_tetrahedra_mesh.hpp:59
void EraseOldElementAndCreateNewElement(ModelPart &this_model_part, const compressed_matrix< int > &Coord, PointerVector< Element > &NewElements, bool interpolate_internal_variables) override
Definition: local_refine_tetrahedra_mesh.hpp:159
void CalculateEdgesFaces(Element::GeometryType &geom, const compressed_matrix< int > &Coord, int *edge_ids, array_1d< int, 6 > &aux)
Definition: local_refine_tetrahedra_mesh.hpp:629
unsigned int CreateCenterNode(Geometry< Node > &geom, ModelPart &model_part)
Definition: local_refine_tetrahedra_mesh.hpp:81
void EraseOldConditionsAndCreateNew(ModelPart &this_model_part, const compressed_matrix< int > &Coord) override
Definition: local_refine_tetrahedra_mesh.hpp:378
~LocalRefineTetrahedraMesh()=default
Destructor.
void UpdateSubModelPartElements(ModelPart &this_model_part, PointerVector< Element > &NewElements)
Definition: local_refine_tetrahedra_mesh.hpp:315
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
SubModelPartIterator SubModelPartsEnd()
Definition: model_part.h:1708
SubModelPartIterator SubModelPartsBegin()
Definition: model_part.h:1698
SubModelPartsContainerType::iterator SubModelPartIterator
Iterator over the sub model parts of this model part.
Definition: model_part.h:258
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
MeshType::ElementIterator ElementIterator
Definition: model_part.h:174
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
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 clear()
Definition: pointer_vector.h:309
size_type size() const
Definition: pointer_vector.h:255
ptr_iterator ptr_end()
Definition: pointer_vector.h:209
iterator end()
Definition: pointer_vector.h:177
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: pointer_vector.h:89
iterator begin()
Definition: pointer_vector.h:169
void push_back(const TPointerType &x)
Definition: pointer_vector.h:270
ptr_iterator ptr_begin()
Definition: pointer_vector.h:201
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
A four node tetrahedra geometry with linear shape functions.
Definition: tetrahedra_3d_4.h:59
static int Split_Tetrahedra(const int edges[6], int t[56], int *nel, int *splitted_edges, int *nint)
Function to split a tetrahedron For a given edges splitting pattern, this function computes the inter...
Definition: split_tetrahedra.h:177
static void TetrahedraSplitMode(int aux_ids[11], int edge_ids[6])
Returns the edges vector filled with the splitting pattern. Provided the array of nodal ids,...
Definition: split_tetrahedra.h:91
A three node 3D triangle geometry with linear shape functions.
Definition: triangle_3d_3.h:77
static int Split_Triangle(const int edges[3], int t[12], int *nel, int *splitted_edges, int *nint)
Utility to split triangles.
Definition: split_triangle.h:117
Short class definition.
Definition: array_1d.h:61
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_WATCH(variable)
Definition: define.h:806
#define KRATOS_TRY
Definition: define.h:109
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
int step
Definition: face_heat.py:88
model_part
Definition: face_heat.py:14
int t
Definition: ode_solve.py:392
int j
Definition: quadrature.py:648
int current_id
Output settings end ####.
Definition: script.py:194
integer i
Definition: TensorModule.f:17