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.
msuite_pfem_refine.h
Go to the documentation of this file.
1 // KRATOS __ __ _____ ____ _ _ ___ _ _ ____
2 // | \/ | ____/ ___|| | | |_ _| \ | |/ ___|
3 // | |\/| | _| \___ \| |_| || || \| | | _
4 // | | | | |___ ___) | _ || || |\ | |_| |
5 // |_| |_|_____|____/|_| |_|___|_| \_|\____| APPLICATION
6 //
7 // License: BSD License
8 // license: MeshingApplication/license.txt
9 //
10 // Main authors: Riccardo Rossi
11 //
12 
13 #if !defined(KRATOS_MSUITE_PFEM_MODELER_H_INCLUDED )
14 #define KRATOS_MSUITE_PFEM_MODELER_H_INCLUDED
15 
16 
17 
18 // System includes
19 #include <string>
20 #include <iostream>
21 #include <cstdlib>
22 
23 
24 #include <boost/timer.hpp>
25 
26 // Project includes
27 #include "includes/define.h"
28 #include "includes/model_part.h"
30 #include "geometries/line_2d_2.h"
34 
35 //includes of the msuite
36 #include "utiles.h"
37 #include "malla.h"
38 
39 
40 
41 namespace Kratos
42 {
43 
44 
47 
51 
55 
59 
63 
65 
69 {
70 public:
73  typedef Node PointType;
74  typedef Node ::Pointer PointPointerType;
75  typedef std::vector<PointType::Pointer> PointVector;
76  typedef PointVector::iterator PointIterator;
77  typedef std::vector<double> DistanceVector;
78  typedef std::vector<double>::iterator DistanceIterator;
81 
82 
85 
89 
91 
93  {
94  }
95  //mpNodeEraseProcess(NULL){} //dimension = number of nodes
96 
98 
100  {
101  }
102 
103 
107 
108 
112 
113 
114  //*******************************************************************************************
115  //*******************************************************************************************
116 
118  ModelPart& ThisModelPart,
119  Element const& rReferenceElement,
120  Condition const& rReferenceBoundaryCondition,
121  EntitiesEraseProcess<Node>& node_erase, bool rem_nodes = true, bool add_nodes = true,
122  double my_alpha = 1.4, double h_factor = 0.5)
123  {
124 
125  KRATOS_TRY
126  if (ThisModelPart.NodesBegin()->SolutionStepsDataHas(IS_FREE_SURFACE) == false)
127  KRATOS_THROW_ERROR(std::logic_error, "Add ----IS_FREE_SURFACE---- variable!!!!!! ERROR", "");
128  if (ThisModelPart.NodesBegin()->SolutionStepsDataHas(IS_STRUCTURE) == false)
129  KRATOS_THROW_ERROR(std::logic_error, "Add ----IS_STRUCTURE---- variable!!!!!! ERROR", "");
130  if (ThisModelPart.NodesBegin()->SolutionStepsDataHas(IS_BOUNDARY) == false)
131  KRATOS_THROW_ERROR(std::logic_error, "Add ----IS_BOUNDARY---- variable!!!!!! ERROR", "");
132  if (ThisModelPart.NodesBegin()->SolutionStepsDataHas(IS_FLUID) == false)
133  KRATOS_THROW_ERROR(std::logic_error, "Add ----IS_FLUID---- variable!!!!!! ERROR", "");
134 
135  KRATOS_WATCH("Msuite PFEM Refining Mesher")
136  boost::timer auxiliary;
137 
138  //clean up the cloud of nodes prior to meshing
139  CleanCloudOfNodes(ThisModelPart,node_erase,h_factor);
140 
141  KRATOS_WATCH(ThisModelPart.Nodes().size());
142  KRATOS_WATCH("just after cleaning the cloud of nodes");
143 
144  // ThisModelPart.Elements().clear();
145  // ThisModelPart.Conditions().clear();
146 
147  //interface with mesh suite
148  ::malla m;
149 
150  int i, j;
151 
152  //ensure that the numeration of the nodes in Kratos is consecutive
153  unsigned int index_I = 1;
154  for (ModelPart::NodesContainerType::iterator in = ThisModelPart.NodesBegin(); in != ThisModelPart.NodesEnd(); in++)
155  {
156  in->SetId(index_I++);
157 // in->Id() = index_I++;
158  Node::DofsContainerType& node_dofs = in->GetDofs();
159  for(Node::DofsContainerType::iterator iii = node_dofs.begin(); iii != node_dofs.end(); iii++)
160  {
161  iii->SetId(in->Id());
162  }
163  }
164 
165  //creating array of new h values
166  array1<double> new_h( ThisModelPart.Nodes().size() );
167 
168 
169  // nodos, bounding box y h minimo
170  int nlen = int(ThisModelPart.Nodes().size());
171  m.n.resize(nlen);
172  nodo p(&(ThisModelPart.NodesBegin()->X()));
173  m.pmin = m.pmax = p;
174  m.hayh = true;
175  new_h[0] = (ThisModelPart.NodesBegin())->FastGetSolutionStepValue(NODAL_H);
176 
177  if (m.hayh)
178  m.hmin = p.h = ThisModelPart.NodesBegin()->FastGetSolutionStepValue(NODAL_H,1); //h at the old step (before refinement)
179  m.n += p;
180  for (i = 1; i < nlen; i++)
181  {
182  new_h[i] = (ThisModelPart.NodesBegin() + i)->FastGetSolutionStepValue(NODAL_H);
183  p.setpos(punto(&((ThisModelPart.NodesBegin() + i)->X())));
184  p.set_min_max(m.pmin, m.pmax);
185  if (m.hayh)
186  {
187  double hi = (ThisModelPart.NodesBegin() + i)->FastGetSolutionStepValue(NODAL_H,1); //h at the old step (before refinement)
188  set_min(m.hmin, hi);
189  p.h = hi;
190  }
191  m.n += p;
192  }
193 
194  // hay z?
195  bool es3D = m.pmax[2] - m.pmin[2] > ERRADM;
196  if (!es3D) m.tipo.set(m_planaxy);
197 
198  // epsilon (para varios usos)
199  if (m.hayh)
200  m.epsilon = m.hmin / 1000;
201  else
202  m.epsilon_bb();
203 
204  m.o = new octree(m.n, m.pmin, m.pmax, es3D ? 3 : 2); // octree
205  for (i = 0; i < nlen; i++) m.o->add(i);
206 
207  // elementos y elementos de cada nodo
208  bool pasa_elementos = false;
209  if (pasa_elementos)
210  {
211  int nv = int( (ThisModelPart.ElementsBegin())->GetGeometry().size());
212  elemento ei((nv == 2) ? e_segmento : ((nv == 3) ? e_triangulo : e_tetraedro));
213  int elen = int(ThisModelPart.Elements().size());
214  m.e.resize(elen);
215  for (i = 0; i < elen; i++)
216  {
217  Geometry< Node >& geom = (ThisModelPart.ElementsBegin() + i)->GetGeometry();
218  for (j = 0; j < nv; j++)
219  {
220  int ix = int(geom[j].Id());
221  ei[j] = ix;
222  m.n[ix].e += i;
223  }
224  m.e += ei; // presupongo que es e.len-1
225  }
226  m.tipo.set((nv == 2) ? m_lin : ((nv == 3) ? m_sup : m_vol));
227  }
228  else m.tipo.set(m_nodos);
229 
230  ThisModelPart.Elements().clear();
231  ThisModelPart.Conditions().clear();
232 
233  KRATOS_WATCH((ThisModelPart.NodesEnd() -1 )->Id());
234 
235  //pass delaunay with alpha shape
236 // bool elimina_sliver = true;
237 // m.delaunay(elimina_sliver); //use "old h nodal"
238 // m.alpha_shape(my_alpha);
239 
240  pline nodes_from;
241  array1<double> shape_functions;
242  m.delaunay_refinado(my_alpha, new_h, nodes_from, shape_functions ); //use "old h nodal"
243 
244  int added_nodes = m.n.len - ThisModelPart.Nodes().size();
245 
246  KRATOS_WATCH(ThisModelPart.Nodes().size());
247 
248  //create the new nodes
249  Node::DofsContainerType& reference_dofs = (ThisModelPart.NodesBegin())->GetDofs();
250  int old_size = ThisModelPart.Nodes().size();
251  for(int iii=old_size; iii<m.n.len; iii++)
252  {
253  unsigned int id=iii+1;
254  Node::Pointer pnode = ThisModelPart.CreateNewNode(id,m.n[iii][0],m.n[iii][1],m.n[iii][2]);
255  pnode->SetBufferSize(ThisModelPart.NodesBegin()->GetBufferSize() );
256  for(Node::DofsContainerType::iterator iii = reference_dofs.begin(); iii != reference_dofs.end(); iii++)
257  {
258  Node::DofType& rDof = *iii;
259  Node::DofType::Pointer p_new_dof = pnode->pAddDof( rDof );
260  (p_new_dof)->FreeDof();
261  }
262  }
263 
264  //interpolate the new nodes
265  int step_data_size = ThisModelPart.GetNodalSolutionStepDataSize();
266  unsigned int buffer_size = ThisModelPart.NodesBegin()->GetBufferSize();
267  unsigned int dim = 2;
268  for(int iii=0; iii<added_nodes; iii++)
269  {
270  int base = iii * (dim+1);
271 
272  Node::Pointer pnode = *(ThisModelPart.NodesBegin() + old_size + iii).base();
273 
274  for(unsigned int step=0; step<buffer_size; step++)
275  {
276  double* step_data = (pnode)->SolutionStepData().Data(step);
277 // KRATOS_WATCH(pnode->Id());
278 
279 
280  double* node0_data = (ThisModelPart.NodesBegin() + nodes_from[base + 0] )->SolutionStepData().Data(step);
281  double* node1_data = (ThisModelPart.NodesBegin() + nodes_from[base + 1] )->SolutionStepData().Data(step);
282  double* node2_data = (ThisModelPart.NodesBegin() + nodes_from[base + 2] )->SolutionStepData().Data(step);
283 //
284 // KRATOS_WATCH((ThisModelPart.NodesBegin() + nodes_from[base + 0] )->Id());
285 // KRATOS_WATCH((ThisModelPart.NodesBegin() + nodes_from[base + 0] )->FastGetSolutionStepValue(NODAL_H));
286 // KRATOS_WATCH((ThisModelPart.NodesBegin() + nodes_from[base + 1] )->Id());
287 // KRATOS_WATCH((ThisModelPart.NodesBegin() + nodes_from[base + 1] )->FastGetSolutionStepValue(NODAL_H));
288 // KRATOS_WATCH((ThisModelPart.NodesBegin() + nodes_from[base + 2] )->Id());
289 // KRATOS_WATCH((ThisModelPart.NodesBegin() + nodes_from[base + 2] )->FastGetSolutionStepValue(NODAL_H));
290 
291  //copying this data in the position of the vector we are interested in
292  for (int j = 0; j < step_data_size; j++)
293  step_data[j] = shape_functions[base + 0] * node0_data[j]
294  + shape_functions[base + 1] * node1_data[j]
295  + shape_functions[base + 2] * node2_data[j];
296 
297 // KRATOS_WATCH((ThisModelPart.NodesBegin() + old_size + iii)->FastGetSolutionStepValue(NODAL_H));
298 
299  }
300 
301 
302 
303 
304  }
305 
306 
307 
308 
309  //m.e[1000][1] //segundio nodo del elemento 1000
310  //m.e[1000].n[1] //exactamente lo mismo de antes
311  //m.e[1000].n //todo el array
312 
313  //loop over all elements -> copy them to kratos data structure
314  Properties::Pointer properties = ThisModelPart.GetMesh().pGetProperties(1);
315  ModelPart::NodesContainerType::iterator nodes_begin = ThisModelPart.NodesBegin();
316  array1< elemento >& el_list = m.e;
317  (ThisModelPart.Elements()).reserve(el_list.len);
318  for (int i = 0; i < el_list.len; i++)
319  {
320  int id = i + 1;
321  const elemento& ei = el_list[i];
322 
323  Triangle2D3<Node > geom(
324  *((nodes_begin + ei[0]).base()),
325  *((nodes_begin + ei[1]).base()),
326  *((nodes_begin + ei[2]).base())
327  );
328 
329  Element::Pointer p_element = rReferenceElement.Create(id, geom, properties);
330  (ThisModelPart.Elements()).push_back(p_element);
331  }
332 
333  //generate the "faces" of the new discretization
334  m.mk_frontera();
335  int counter = 1;
336  for (int k = 0; k < m.frontera.len; k++) //take care! there is AN ARRAY of meshes //exterior boundary k=0
337  {
338  const array1< elemento >& el_list_fk = m.frontera[k].e;
339  for (int i = 0; i < el_list_fk.len; i++)
340  {
341  int id = counter++;
342  const elemento& ei = el_list_fk[i];
343 
344 // Line2D2<Node > geom(
345 // *((nodes_begin + ei[0]).base()),
346 // *((nodes_begin + ei[1]).base())
347 // );
348  Line2D2<Node > geom(
349  *((nodes_begin + ei[1]).base()),
350  *((nodes_begin + ei[0]).base())
351  );
352  Condition::Pointer p_cond = rReferenceBoundaryCondition.Create(id, geom, properties);
353  (ThisModelPart.Conditions()).push_back(p_cond);
354 
355  }
356  }
357 
358 
359 
360  //put a flag on all the nodes of boundary
361  for (ModelPart::NodesContainerType::iterator in = ThisModelPart.NodesBegin(); in != ThisModelPart.NodesEnd(); in++)
362  in->FastGetSolutionStepValue(IS_BOUNDARY) = 0;
363  for (int k = 0; k < m.frontera.len; k++) //take care! there is AN ARRAY of meshes //exterior boundary k=0
364  {
365  const pline& n_list_fk = m.frontera[k].n;
366  for (int i = 0; i < n_list_fk.len; i++)
367  (nodes_begin + n_list_fk[i])->FastGetSolutionStepValue(IS_BOUNDARY) = 1;
368  }
369 
370  //give to kratos the nodal neighbours
371  // m.mk_nn(); //create list of nodal neighbours
372  // for(int i=0; i<m.nn.len; i++)
373  // {
374  // //cpline es una lista cerrada
375  // const cpline& nni= m.nn[i];
376  // for(int j=0; j<nni.len; j++)
377  // nni[j] //es el indice
378  // }
379 
380  //give to kratos the elemental neighbours
381  // m.mk_vecino();
382  // for(int i=0; i<m.e.len; i++)
383  // {
384  // pline& vi = m.vecino[i];
385  // for(int j=0; j<2; j++)
386  // vi[j] //if there is no neighbour it returns <0
387  // }
388 
389 
390 
391 
392 
393 
394 
395 
396  //now use updated information to construct the Kratos Mesh
397 
398  // //assign new h to the nodes
399  // for(int i =0; i<m.n.len; i++)
400  // m.n[i].h = (ThisModelPart.NodesBegin() + i)->FastGetSolutionStepValue(NODAL_H);
401  //
402  //
403  // malla vieja(m);
404  // bool elimina_sliver = true;
405  // m.delaunay_refinado(vieja,my_alpha,elimina_sliver);
406 
407 
408 
409 
410  KRATOS_WATCH("Finished remeshing with Msuite_PFEM_Refine")
411 
412  KRATOS_CATCH("")
413  }
414 
415 
419 
420 
424 
425 
429 
431 
432  virtual std::string Info() const
433  {
434  return "";
435  }
436 
438 
439  virtual void PrintInfo(std::ostream& rOStream) const
440  {
441  }
442 
444 
445  virtual void PrintData(std::ostream& rOStream) const
446  {
447  }
448 
449 
453 
454 
456 
457 protected:
460 
461 
465 
466 
470 
471 
475 
476 
480 
481 
485 
486 
490 
491 
493 
494 private:
497 
498 
502 
503 
507 
508  void CleanCloudOfNodes(
509  ModelPart& ThisModelPart,
510  EntitiesEraseProcess<Node>& node_erase,
511  double h_factor)
512  {
513  KRATOS_TRY
514  //remove nodes that are too close to the boundary in a elementwise sense
515 
516  //put all nodes into an octtree
517  unsigned int bucket_size = 20;
518  unsigned int max_results = 100;
519  PointVector res(max_results);
520  DistanceVector res_distances(max_results);
521 
522  PointVector list_of_nodes;
523  list_of_nodes.reserve(ThisModelPart.Nodes().size());
524  for (ModelPart::NodesContainerType::iterator i_node = ThisModelPart.NodesBegin(); i_node != ThisModelPart.NodesEnd(); i_node++)
525  {
526  (list_of_nodes).push_back(*(i_node.base()));
527  }
528 
529  kd_tree nodes_tree1(list_of_nodes.begin(), list_of_nodes.end(), bucket_size);
530 
531  unsigned int n_points_in_radius;
532  double radius; //radius means the distance, closer than which no node shall be allowd. if closer -> mark for erasing
533  Node work_point(0,0.0,0.0,0.0);
534  for (ModelPart::NodesContainerType::iterator in = ThisModelPart.NodesBegin();
535  in != ThisModelPart.NodesEnd(); in++)
536  {
537  radius = h_factor * in->FastGetSolutionStepValue(NODAL_H,1);
538 
539  work_point[0] = in->X();
540  work_point[1] = in->Y();
541  work_point[2] = in->Z();
542 
543  n_points_in_radius = nodes_tree1.SearchInRadius(work_point, radius, res.begin(), res_distances.begin(), max_results);
544  if (n_points_in_radius > 1)
545  {
546  if (in->FastGetSolutionStepValue(IS_BOUNDARY,1) == 0.0 && in->FastGetSolutionStepValue(IS_STRUCTURE) == 0.0)
547  {
548  //look if we are already erasing any of the other nodes
549  unsigned int erased_nodes = 0;
550  for (PointIterator i = res.begin(); i != res.begin() + n_points_in_radius; i++)
551  erased_nodes += (*i)->Is(TO_ERASE);
552 
553  if (erased_nodes < 1) //we cancel the node if no other nodes are being erased
554  in->Set(TO_ERASE, true);
555 
556  }
557  else if ((in)->FastGetSolutionStepValue(IS_STRUCTURE) != 1.0) //boundary nodes will be removed if they get REALLY close to another boundary node (0.2 * h_factor)
558  {
559  //here we loop over the neighbouring nodes and if there are nodes
560  //with IS_BOUNDARY=1 which are closer than 0.2*nodal_h from our we remove the node we are considering
561  unsigned int k = 0;
562  unsigned int counter = 0;
563  for (PointIterator i = res.begin(); i != res.begin() + n_points_in_radius; i++)
564  {
565  if ((*i)->FastGetSolutionStepValue(IS_BOUNDARY,1) == 1.0 && res_distances[k] < 0.2 * radius && res_distances[k] > 0.0)
566  {
567  counter += 1;
568  }
569  k++;
570  }
571  if (counter > 0)
572  in->Set(TO_ERASE, true);
573  }
574  }
575 
576  //perform the clean
577  }
578 
579  //now loop on all elements, identify the nodes which are too close to the boundary and mark them for removal
580  boost::numeric::ublas::bounded_matrix<double,3,2> DN_DX;
581  array_1d<double,3> N;
582 // for (ModelPart::ElementsContainerType::iterator ie = ThisModelPart.ElementsBegin();
583 // ie != ThisModelPart.ElementsEnd(); ie++)
584 // {
585 // Geometry<Node >& geom = ie->GetGeometry();
586 // for(unsigned int i=0; i<geom.size(); i++)
587 // {
588 // if(geom[i].FastGetSolutionStepValue(IS_STRUCTURE) == 0) //we identify the node that is "free" to move
589 // { geom[i].Set(TO_ERASE, true);}
590 // }
591 // }
592 
593  for (ModelPart::ElementsContainerType::iterator ie = ThisModelPart.ElementsBegin();
594  ie != ThisModelPart.ElementsEnd(); ie++)
595  {
596  Geometry<Node >& geom = ie->GetGeometry();
597 
598  unsigned int nstructure = 0;
599  for(unsigned int i=0; i<geom.size(); i++)
600  nstructure += int(geom[i].FastGetSolutionStepValue(IS_STRUCTURE) );
601 
602  if(nstructure == 2)
603  {
604  //calculate shape function derivatives
605  double Volume;
606  GeometryUtils::CalculateGeometryData(geom,DN_DX,N,Volume);
607 
608  //calculate avg h
609  double havg = geom[0].FastGetSolutionStepValue(NODAL_H) +
610  geom[1].FastGetSolutionStepValue(NODAL_H) +
611  geom[2].FastGetSolutionStepValue(NODAL_H);
612  havg *= 0.333333333333333;
613 
614  for(unsigned int iii=0; iii<geom.size(); iii++)
615  {
616  if(geom[iii].FastGetSolutionStepValue(IS_STRUCTURE) != 1.0) //we identify the node that is "free" to move
617  {
618  double DNnorm = sqrt( DN_DX(iii,0)*DN_DX(iii,0) + DN_DX(iii,1)*DN_DX(iii,1) );
619  double h = 1.0 / DNnorm;
620 
621  if(h < havg * 0.4) //cancel it if it gets too close
622  {
623  KRATOS_WATCH(geom[iii].Id());
624  geom[iii].Set(TO_ERASE, true);
625  }
626  }
627 
628  }
629  }
630  }
631 
632 // ThisModelPart.Elements().clear();
633 // ThisModelPart.Conditions().clear();
634 
635 
636 // Node::Pointer temp = ThisModelPart.Nodes()(807);
637 
638 // KRATOS_WATCH(temp->Is(TO_ERASE));
639 // KRATOS_WATCH(temp->Id());
640 
641 // KRATOS_WATCH(ThisModelPart.Nodes().size());
642 
643  //perform the removal
644  node_erase.Execute();
645 // KRATOS_WATCH(temp->Id());
646 //
647 // KRATOS_WATCH(ThisModelPart.Nodes().size());
648 // KRATOS_WATCH(*temp)
649 
650  KRATOS_CATCH("");
651  }
652 
653 // void Interpolate(ModelPart::NodesContainerType& old_list_of_elements, PointerVector< Node >& list_of_new_nodes)
654 // {
655 // KRATOS_TRY
656 //
657 // //put the new nodes in an octtree
658 // PointVector aux_list;
659 // aux_list.reserve(list_of_new_nodes.size());
660 // for (ModelPart::NodesContainerType::iterator i_node = list_of_new_nodes.begin(); i_node != list_of_new_nodes.end(); i_node++) {
661 // (aux_list).push_back(*(i_node.base()));
662 // }
663 //
664 // //loop over the existing elements to find where they fall --> if not found throw an error
665 //
666 // KRATOS_CATCH("");
667 // }
668 
669 
670 
674 
675 
679 
680 
684 
685 
689 
691  MSuitePFEMModeler & operator=(MSuitePFEMModeler const& rOther);
692 
693 
695 
696 }; // Class MSuitePFEMModeler
697 
699 
702 
703 
707 
708 
710 inline std::istream & operator >>(std::istream& rIStream,
711  MSuitePFEMModeler& rThis);
712 
714 
715 inline std::ostream & operator <<(std::ostream& rOStream,
716  const MSuitePFEMModeler& rThis)
717 {
718  rThis.PrintInfo(rOStream);
719  rOStream << std::endl;
720  rThis.PrintData(rOStream);
721 
722  return rOStream;
723 }
725 
726 
727 } // namespace Kratos.
728 
729 #endif // KRATOS_MSUITE_EXTERNAL_H_INCLUDED defined
730 
731 
732 
Short class definition.
Definition: bucket.h:57
Base class for all Conditions.
Definition: condition.h:59
virtual Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const
It creates a new condition pointer.
Definition: condition.h:205
Dof represents a degree of freedom (DoF).
Definition: dof.h:86
Base class for all Elements.
Definition: element.h:60
virtual Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const
It creates a new element pointer.
Definition: element.h:202
This process removes the entities from a model part with the flag TO_ERASE.
Definition: entity_erase_process.h:70
void Execute() override
Execute method is used to execute the Process algorithms.
Geometry base class.
Definition: geometry.h:71
static void CalculateGeometryData(const GeometryType &rGeometry, BoundedMatrix< double, 4, 3 > &rDN_DX, array_1d< double, 4 > &rN, double &rVolume)
This function is designed to compute the shape function derivatives, shape functions and volume in 3D...
Definition: geometry_utilities.h:176
An two node 2D line geometry with linear shape functions.
Definition: line_2d_2.h:65
Short class definition.
Definition: msuite_pfem_refine.h:69
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: msuite_pfem_refine.h:445
std::vector< PointType::Pointer > PointVector
Definition: msuite_pfem_refine.h:75
PointVector::iterator PointIterator
Definition: msuite_pfem_refine.h:76
Tree< KDTreePartition< BucketType > > kd_tree
Definition: msuite_pfem_refine.h:80
std::vector< double > DistanceVector
Definition: msuite_pfem_refine.h:77
virtual std::string Info() const
Turn back information as a string.
Definition: msuite_pfem_refine.h:432
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: msuite_pfem_refine.h:439
Node PointType
Definition: msuite_pfem_refine.h:73
MSuitePFEMModeler()
Default constructor.
Definition: msuite_pfem_refine.h:92
virtual ~MSuitePFEMModeler()
Destructor.
Definition: msuite_pfem_refine.h:99
KRATOS_CLASS_POINTER_DEFINITION(MSuitePFEMModeler)
Pointer definition of TriGenModeler.
std::vector< double >::iterator DistanceIterator
Definition: msuite_pfem_refine.h:78
Node ::Pointer PointPointerType
Definition: msuite_pfem_refine.h:74
Bucket< 3, PointType, PointVector, PointPointerType, PointIterator, DistanceIterator > BucketType
Definition: msuite_pfem_refine.h:79
void ReGenerateMesh(ModelPart &ThisModelPart, Element const &rReferenceElement, Condition const &rReferenceBoundaryCondition, EntitiesEraseProcess< Node > &node_erase, bool rem_nodes=true, bool add_nodes=true, double my_alpha=1.4, double h_factor=0.5)
Definition: msuite_pfem_refine.h:117
PropertiesType::Pointer pGetProperties(IndexType PropertiesId)
Definition: mesh.h:394
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementIterator ElementsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1169
NodeType::Pointer CreateNewNode(int Id, double x, double y, double z, VariablesList::Pointer pNewVariablesList, IndexType ThisIndex=0)
Definition: model_part.cpp:270
SizeType GetNodalSolutionStepDataSize()
Definition: model_part.h:571
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
ElementIterator ElementsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1179
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
MeshType & GetMesh(IndexType ThisIndex=0)
Definition: model_part.h:1791
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
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
A generic tree data structure for spatial partitioning.
Definition: tree.h:190
A three node 2D triangle geometry with linear shape functions.
Definition: triangle_2d_3.h:74
#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
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::vector< PointTypePointer > PointVector
Definition: internal_variables_interpolation_process.h:53
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
std::vector< double > DistanceVector
Definition: internal_variables_interpolation_process.h:55
int step
Definition: face_heat.py:88
res
Definition: generate_convection_diffusion_explicit_element.py:211
h
Definition: generate_droplet_dynamics.py:91
float radius
Definition: mesh_to_mdpa_converter.py:18
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
int m
Definition: run_marine_rain_substepping.py:8
int counter
Definition: script_THERMAL_CORRECT.py:218
add_nodes
Definition: script.py:96
p
Definition: sensitivityMatrix.py:52
N
Definition: sensitivityMatrix.py:29
int dim
Definition: sensitivityMatrix.py:25
integer i
Definition: TensorModule.f:17