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.
tetgen_cdt.h
Go to the documentation of this file.
1 //
2 // Project Name: Kratos
3 // Last Modified by: $Author: anonymous $
4 // Date: $Date: 2009-01-15 14:50:34 $
5 // Revision: $Revision: 1.8 $
6 //
7 
8 
9 
10 
11 #if !defined(KRATOS_TETGEN_CDT_H_INCLUDED )
12 #define KRATOS_TETGEN_CDT_H_INCLUDED
13 
14 
15 
16 // System includes
17 #include <string>
18 #include <iostream>
19 #include <cstdlib>
20 #include <boost/timer.hpp>
21 
22 
23 
24 #include "tetgen.h" // Defined tetgenio, tetrahedralize().
25 
26 // Project includes
27 #include "includes/define.h"
28 #include "utilities/geometry_utilities.h"
29 #include "containers/model.h"
30 #include "includes/model_part.h"
35 
37 
38 
39 namespace Kratos
40 {
41 
42 
45 
49 
53 
57 
61 
63 
65  class TetGenCDT
66  {
67  public:
70 
73 
74 
78 
81  {}
82 
84  virtual ~TetGenCDT() = default;
85 
86 
90 
91 
95 
96 
97  //*******************************************************************************************
98  //*******************************************************************************************
116  tetgenio out , outnew;
117  void addNodes(ModelPart& ThisModelPart , Element const& rReferenceElement,
118  bool apply_volume_constraints, unsigned int property_id , BinBasedFastPointLocator<3> element_finder)
119  {
120  //creating a new mesh
121  boost::timer mesh_recreation_time;
122 
123  out.tetrahedronvolumelist = new double[out.numberoftetrahedra];
124 
125  int el_number = out.numberoftetrahedra;
126 
127  int counter = 0;
128  for (int el = 0; el< el_number; el++)
129  {
130  int old_base = el*4;
131  //calculate the prescribed h
132 
133  ModelPart::NodesContainerType& rNodes = ThisModelPart.Nodes();
134  ModelPart::NodesContainerType::iterator it1 = (rNodes).find( out.tetrahedronlist[old_base]);
135  ModelPart::NodesContainerType::iterator it2 = (rNodes).find( out.tetrahedronlist[old_base+1]);
136  ModelPart::NodesContainerType::iterator it3 = (rNodes).find( out.tetrahedronlist[old_base+2]);
137  ModelPart::NodesContainerType::iterator it4 = (rNodes).find( out.tetrahedronlist[old_base+3]);
138 
139  if ( it1 == ThisModelPart.Nodes().end() )
140  KRATOS_THROW_ERROR(std::logic_error,"trying to use an inexisting node with id ",it1->Id());
141  if ( it2 == ThisModelPart.Nodes().end() )
142  KRATOS_THROW_ERROR(std::logic_error,"trying to use an inexisting node with id ",it2->Id());
143  if ( it3 == ThisModelPart.Nodes().end() )
144  KRATOS_THROW_ERROR(std::logic_error,"trying to use an inexisting node with id ",it3->Id());
145  if ( it4 == ThisModelPart.Nodes().end() )
146  KRATOS_THROW_ERROR(std::logic_error,"trying to use an inexisting node with id ",it4->Id());
147 
148  Node::Pointer pn1 = *it1.base();
149  Node::Pointer pn2 = *it2.base();
150  Node::Pointer pn3 = *it3.base();
151  Node::Pointer pn4 = *it4.base();
152 
153  double prescribed_h = (pn1)->FastGetSolutionStepValue(NODAL_H);
154  prescribed_h += (pn2)->FastGetSolutionStepValue(NODAL_H);
155  prescribed_h += (pn3)->FastGetSolutionStepValue(NODAL_H);
156  prescribed_h += (pn4)->FastGetSolutionStepValue(NODAL_H);
157  prescribed_h *= 0.25;
158 
159 
160  //if h is the height of a perfect tetrahedra, the edge size is edge = sqrt(3/2) h
161  //filling in the list of "IDEAL" tetrahedron volumes=1/12 * (edge)^3 * sqrt(2)~0.11785* h^3=
162  //0.2165063509*h^3
163  out.tetrahedronvolumelist[counter] = 0.217*prescribed_h*prescribed_h*prescribed_h;
164 
165  counter += 1;
166  }
167 
168  //char mesh_regen_opts[] = "u0MrqYYnSJCC";
169  char mesh_regen_opts[] = "u0MrqYYnSJQ";
170  tetrahedralize(mesh_regen_opts, &out, &outnew);
171  KRATOS_WATCH("Adaptive remeshing executed")
172 
173  //cleaning unnecessary data
174  out.deinitialize();
175  out.initialize();
176 
177  std::cout << "mesh recreation time" << mesh_recreation_time.elapsed() << std::endl;
178 
179  /******************************************************************************/
180  /******************************************************************************/
181  /******************************************************************************/
182  //here we create and interpolate the new kratos nodes
183  ModelPart::NodesContainerType list_of_new_nodes;
184 
185  //Node::DofsContainerType& reference_dofs = (ThisModelPart.NodesBegin())->GetDofs();
186 
187  int n_points_before_refinement = ThisModelPart.Nodes().size();
188 
189  KRATOS_WATCH(n_points_before_refinement)
190  KRATOS_WATCH(outnew.numberofpoints)
191 
192  //
193  InterpolateAndAddNewNodes(ThisModelPart, outnew,element_finder);
194 
195  //set the coordinates to the original value
196  if (ThisModelPart.NodesBegin()->SolutionStepsDataHas(DISPLACEMENT)==true )
197  {
198  for ( ModelPart::NodesContainerType::iterator it = list_of_new_nodes.begin(); it!=list_of_new_nodes.end(); it++)
199  {
200  const array_1d<double,3>& disp = (it)->FastGetSolutionStepValue(DISPLACEMENT);
201  (it)->X0() = (it)->X() - disp[0];
202  (it)->Y0() = (it)->Y() - disp[1];
203  (it)->Z0() = (it)->Z() - disp[2];
204  }
205  }
206 
207  //now add the elements
208  AddElementsToModelPart(ThisModelPart,outnew,property_id,rReferenceElement);
209  return ;
210  }
211 
212 
214  ModelPart& ThisModelPart ,
215  Element const& rReferenceElement,
216  bool apply_volume_constraints,
217  unsigned int property_id)
218  {
219 
220  KRATOS_TRY
221 
222  if (apply_volume_constraints==true && ThisModelPart.NodesBegin()->SolutionStepsDataHas(NODAL_H)==false )
223  KRATOS_THROW_ERROR(std::logic_error,"Add ----NODAL_H---- variable!!!!!! ERROR","");
224  if (ThisModelPart.NodesBegin()->SolutionStepsDataHas(IS_BOUNDARY)==false )
225  KRATOS_THROW_ERROR(std::logic_error,"Add ----IS_BOUNDARY---- variable!!!!!! ERROR","");
226 
227  //mark as IS_BOUNDARY the nodes on the "skin". This nodes will be mantained even if they were marked for erase by the user
228  for (ModelPart::NodesContainerType::iterator inode = ThisModelPart.NodesBegin(); inode!=ThisModelPart.NodesEnd(); inode++)
229  inode->FastGetSolutionStepValue(IS_BOUNDARY) = 1.0;
230  for (ModelPart::ConditionsContainerType::iterator icond = ThisModelPart.ConditionsBegin(); icond!=ThisModelPart.ConditionsEnd(); icond++)
231  {
232  Geometry<Node >& geom = icond->GetGeometry();
233  for (unsigned int i=0; i<geom.size(); i++)
234  geom[i].FastGetSolutionStepValue(IS_BOUNDARY) = 1.0;
235  }
236 
237  //generate a temporary model part with the original list of nodes and the original list of elements
238  ModelPart& AuxModelPart = ThisModelPart.GetModel().CreateModelPart("auxiliary");
239  /* AuxModelPart.Nodes().reserve(ThisModelPart.Nodes().size());
240  for (ModelPart::NodesContainerType::iterator i_node = ThisModelPart.NodesBegin() ; i_node != ThisModelPart.NodesEnd() ; i_node++)
241  (AuxModelPart.Nodes()).push_back(*(i_node.base()));*/
242  AuxModelPart.Elements().reserve(ThisModelPart.Elements().size());
243  for (ModelPart::ElementsContainerType::iterator i_el = ThisModelPart.ElementsBegin() ; i_el != ThisModelPart.ElementsEnd() ; i_el++)
244  (AuxModelPart.Elements()).push_back(*(i_el.base()));
245 
246  //erase the elements from the model part
247  ThisModelPart.Elements().clear();
248 
249  //clean up the list of nodes removing the nodes that should be erased
250  //note that some of this nodes will be pointed to by some of the elements
251  //and thus they will not be erased until no element points to them
252  ModelPart::NodesContainerType temp_nodes_container;
253  temp_nodes_container.reserve(ThisModelPart.Nodes().size());
254  temp_nodes_container.swap(ThisModelPart.Nodes());
255  for (ModelPart::NodesContainerType::iterator i_node = temp_nodes_container.begin() ; i_node != temp_nodes_container.end() ; i_node++)
256  {
257  if ( static_cast<bool>(i_node->FastGetSolutionStepValue(IS_BOUNDARY)) == true)
258  i_node->Set(TO_ERASE, false);
259  if ( static_cast<bool>(i_node->Is(TO_ERASE)) == false)
260  (ThisModelPart.Nodes()).push_back(*(i_node.base()));
261  }
262 
263  //reorder node Ids consecutively
264  unsigned int id=1;
265  for (ModelPart::NodesContainerType::iterator i_node = temp_nodes_container.begin() ; i_node != temp_nodes_container.end() ; i_node++)
266  i_node->SetId(id++);
267 
268  //construct spatial structure with an auxiliary model part
269  BinBasedFastPointLocator<3> element_finder(AuxModelPart);
270  element_finder.UpdateSearchDatabase();
271 
272  //clearing the elements in the model part (note that some nodes will not be erased until the rInterpolationElements will be actually erased
273  ThisModelPart.Elements().clear();
274 
275  /******************************************************************************/
276  /******************************************************************************/
277  /******************************************************************************/
278  //prepare for meshing the CDT, passing the list of faces and the list of nodes
279  //in this phase we simply use the nodes without adding anything
280  tetgenio in;
281 
282  // All indices start from 1.
283  in.firstnumber = 1;
284  in.numberofpoints = ThisModelPart.Nodes().size();
285  in.pointlist = new REAL[in.numberofpoints * 3];
286 
287  //writing the point coordinates in a vector
288  ModelPart::NodesContainerType::iterator nodes_begin = ThisModelPart.NodesBegin();
289  for (unsigned int i = 0; i<ThisModelPart.Nodes().size(); i++)
290  {
291  int base = i*3;
292  in.pointlist[base] = (nodes_begin + i)->X();
293  in.pointlist[base+1] = (nodes_begin + i)->Y();
294  in.pointlist[base+2] = (nodes_begin + i)->Z();
295  }
296 
297 
298  in.numberoffacets = ThisModelPart.Conditions().size();;
299  in.facetmarkerlist = new int[in.numberoffacets];
300  in.facetlist = new tetgenio::facet[in.numberoffacets];
301  ModelPart::ConditionsContainerType::iterator it = ThisModelPart.ConditionsBegin();
302  tetgenio::facet *f;
303  tetgenio::polygon *p;
304  for (int ii=0; ii<in.numberoffacets ; ++ii)
305  {
306  f = &in.facetlist[ii];
307  f->numberofpolygons = 1;
308  f->polygonlist = new tetgenio::polygon[f->numberofpolygons];
309  f->numberofholes = 0;
310  f->holelist = nullptr;
311 
312  Geometry<Node >& geom = (it)->GetGeometry();
313 
314  p = &f->polygonlist[0];
315  p->numberofvertices = 3;
316  p->vertexlist = new int[p->numberofvertices];
317  p->vertexlist[0] = geom[0].Id();
318  p->vertexlist[1] = geom[1].Id();
319  p->vertexlist[2] = geom[2].Id();
320 
321  //increase counter
322  it++;
323  }
324 
325  // char tetgen_options[] = "pqYYfnJu0MCC";
326  char tetgen_options[] = "pqYYfnJu0MQ";
327  tetrahedralize(tetgen_options, &in, &out);
328  //freeing unnecessary memory
329  in.deinitialize();
330  in.initialize();
331 
332  InterpolateAndAddNewNodes(ThisModelPart, out,element_finder);
333 
334  /******************************************************************************/
335  /******************************************************************************/
336  /******************************************************************************/
337  //in this second phase, take as input the "out" of the first phase
338  //and improve it
339  //HERE WE ADD THE VOLUME CONSTRAINT -the desired volume of the equidistant tertrahedra
340  //based upon average nodal_h (that is the "a" switch
341  //char regeneration_options[] = "rQJYq1.8anS";
342  if (apply_volume_constraints==true)
343  {
344  addNodes(ThisModelPart, rReferenceElement, true,property_id, element_finder);
345  }
346  else //do not add nodes
347  {
348  //now add the elements
349  AddElementsToModelPart(ThisModelPart,out,property_id,rReferenceElement);
350  }
351 
352 
353  std::vector<unsigned int> el_per_node( outnew.numberofpoints, 0 );
354  for (int iii = 0; iii< outnew.numberoftetrahedra*4; iii++)
355  el_per_node[ outnew.tetrahedronlist[iii]-1 ] += 1;
356 
357  //mark for erasal nodes with no element attached
358  for(unsigned int i=0; i< static_cast<unsigned int>(outnew.numberofpoints); i++)
359  {
360  if(el_per_node[i] == 0) //node is alone
361  ThisModelPart.Nodes().find( i+1 )->Set(TO_ERASE,true);
362  }
363 
364  //do erasing
365  ModelPart::NodesContainerType aux_nodes_container;
366  aux_nodes_container.reserve(ThisModelPart.Nodes().size());
367  aux_nodes_container.swap(ThisModelPart.Nodes());
368  for (ModelPart::NodesContainerType::iterator i_node = aux_nodes_container.begin() ; i_node != aux_nodes_container.end() ; i_node++)
369  {
370  if ( static_cast<bool>(i_node->Is(TO_ERASE)) == false)
371  (ThisModelPart.Nodes()).push_back(*(i_node.base()));
372  }
373 
374  // Remove auxiliar model part
375  ThisModelPart.GetModel().DeleteModelPart("auxiliary");
376 
377  KRATOS_CATCH("")
378  }
379 
383 
384 
388 
389 
393 
395  virtual std::string Info() const
396  {
397  return "";
398  }
399 
401  virtual void PrintInfo(std::ostream& rOStream) const {}
402 
404  virtual void PrintData(std::ostream& rOStream) const {}
405 
406 
410 
411 
413 
414  protected:
417 
418 
422 
423 
427 
428 
432 
433 
437 
438 
442 
443 
447 
448 
450 
451  private:
454 
455 
459  void AddElementsToModelPart(ModelPart& rModelPart, tetgenio& tet, unsigned int property_id,Element const& rReferenceElement)
460  {
461  KRATOS_TRY
462 
463  //***********************************************************************************
464  //***********************************************************************************
465  boost::timer adding_elems;
466  //add preserved elements to the kratos
467  Properties::Pointer properties = rModelPart.GetMesh().pGetProperties(property_id);
468  //ModelPart::NodesContainerType::iterator nodes_begin = rModelPart.NodesBegin();
469  (rModelPart.Elements()).reserve(tet.numberoftetrahedra);
470 
471  for (int iii = 0; iii< tet.numberoftetrahedra; iii++)
472  {
473  int id = iii + 1;
474  int base = iii * 4;
475 
476  ModelPart::NodesContainerType& ModelNodes = rModelPart.Nodes();
477  ModelPart::NodesContainerType::iterator it1 = (ModelNodes).find( tet.tetrahedronlist[base]);
478  ModelPart::NodesContainerType::iterator it2 = (ModelNodes).find( tet.tetrahedronlist[base+1]);
479  ModelPart::NodesContainerType::iterator it3 = (ModelNodes).find( tet.tetrahedronlist[base+2]);
480  ModelPart::NodesContainerType::iterator it4 = (ModelNodes).find( tet.tetrahedronlist[base+3]);
481 
482  if ( it1 == rModelPart.Nodes().end() )
483  KRATOS_THROW_ERROR(std::logic_error,"trying to use an inexisting node with id ",it1->Id());
484  if ( it2 == rModelPart.Nodes().end() )
485  KRATOS_THROW_ERROR(std::logic_error,"trying to use an inexisting node with id ",it2->Id());
486  if ( it3 == rModelPart.Nodes().end() )
487  KRATOS_THROW_ERROR(std::logic_error,"trying to use an inexisting node with id ",it3->Id());
488  if ( it4 == rModelPart.Nodes().end() )
489  KRATOS_THROW_ERROR(std::logic_error,"trying to use an inexisting node with id ",it4->Id());
490 
491  Node::Pointer pn1 = *it1.base();
492  Node::Pointer pn2 = *it2.base();
493  Node::Pointer pn3 = *it3.base();
494  Node::Pointer pn4 = *it4.base();
495 
496  Tetrahedra3D4<Node > geom( pn1,pn2,pn3,pn4 );
497 
498  Element::Pointer p_element = rReferenceElement.Create(id, geom, properties);
499  (rModelPart.Elements()).push_back(p_element);
500 
501  }
502  std::cout << "time for adding elems" << adding_elems.elapsed() << std::endl;;
503  rModelPart.Elements().Sort();
504 
505  KRATOS_CATCH("")
506  }
507 
508  void InterpolateAndAddNewNodes(ModelPart& rModelPart, tetgenio& tet, BinBasedFastPointLocator<3>& element_finder)
509  {
510  unsigned int n_points_before_refinement = rModelPart.Nodes().size();
511 
512  //if the refinement was performed, we need to add it to the model part.
513  if (static_cast<unsigned int>(tet.numberofpoints)>n_points_before_refinement)
514  {
515  //defintions for spatial search
516 // typedef Node PointType;
517 // typedef Node ::Pointer PointTypePointer;
518  array_1d<double, 4 > N;
519  const int max_results = 10000;
521 
522  Node::DofsContainerType& reference_dofs = (rModelPart.NodesBegin())->GetDofs();
523 
524  int step_data_size = rModelPart.GetNodalSolutionStepDataSize();
525 
526  //TODO: parallelize this loop
527  for (int i = n_points_before_refinement; i<tet.numberofpoints; i++)
528  {
529  int id=i+1;
530  int base = i*3;
531  double& x= tet.pointlist[base];
532  double& y= tet.pointlist[base+1];
533  double& z= tet.pointlist[base+2];
534 
535  Node::Pointer pnode = rModelPart.CreateNewNode(id,x,y,z);
536 
537  //putting the new node also in an auxiliary list
538  //KRATOS_WATCH("adding nodes to list")
539  //list_of_new_nodes.push_back( pnode );
540 
541  //std::cout << "new node id = " << pnode->Id() << std::endl;
542  //generating the dofs
543  for (Node::DofsContainerType::iterator iii = reference_dofs.begin(); iii != reference_dofs.end(); iii++)
544  {
545  Node::DofType &rDof = **iii;
546  Node::DofType::Pointer p_new_dof = pnode->pAddDof( rDof );
547 
548  (p_new_dof)->FreeDof();
549  }
550 
551  //do interpolation
552  auto result_begin = results.begin();
553  Element::Pointer pelement;
554 
555  bool is_found = element_finder.FindPointOnMesh(pnode->Coordinates(), N, pelement, result_begin, max_results);
556 
557 
558  if (is_found == true)
559  {
560  Geometry<Node >& geom = pelement->GetGeometry();
561 
562  Interpolate( geom, N, step_data_size, pnode);
563  }
564 
565 
566  }
567  }
568  std::cout << "During refinement we added " << tet.numberofpoints-n_points_before_refinement<< "nodes " <<std::endl;
569  }
570 
571 
574  void Interpolate( Geometry<Node >& geom, const array_1d<double,4>& N,
575  unsigned int step_data_size,
576  Node::Pointer pnode)
577  {
578  unsigned int buffer_size = pnode->GetBufferSize();
579 
580 
581  for (unsigned int step = 0; step<buffer_size; step++)
582  {
583 
584  //getting the data of the solution step
585  double* step_data = (pnode)->SolutionStepData().Data(step);
586 
587 
588  double* node0_data = geom[0].SolutionStepData().Data(step);
589  double* node1_data = geom[1].SolutionStepData().Data(step);
590  double* node2_data = geom[2].SolutionStepData().Data(step);
591  double* node3_data = geom[3].SolutionStepData().Data(step);
592 
593  //copying this data in the position of the vector we are interested in
594  for (unsigned int j= 0; j<step_data_size; j++)
595  {
596 
597  step_data[j] = N[0]*node0_data[j] + N[1]*node1_data[j] + N[2]*node2_data[j] + N[3]*node3_data[j];
598 
599 
600  }
601  }
602  pnode->FastGetSolutionStepValue(IS_BOUNDARY)=0.0;
603  }
604 
605 
606 
607  template< class T, std::size_t dim >
608  class PointDistance
609  {
610  public:
611  double operator()( T const& p1, T const& p2 )
612  {
613  double dist = 0.0;
614  for ( std::size_t i = 0 ; i < dim ; i++)
615  {
616  double tmp = p1[i] - p2[i];
617  dist += tmp*tmp;
618  }
619  return sqrt(dist);
620  }
621  };
622 
623  template< class T, std::size_t dim >
624  class DistanceCalculator
625  {
626  public:
627  double operator()( T const& p1, T const& p2 )
628  {
629  double dist = 0.0;
630  for ( std::size_t i = 0 ; i < dim ; i++)
631  {
632  double tmp = p1[i] - p2[i];
633  dist += tmp*tmp;
634  }
635  return dist;
636  }
637  };
638 
642 
646 
647 
651 
652 
656 
657 
661 
663  TetGenCDT& operator=(TetGenCDT const& rOther);
664 
665 
667 
668  }; // Class TetGenCDT
669 
671 
674 
675 
679 
680 
682  inline std::istream& operator >> (std::istream& rIStream,
683  TetGenCDT& rThis);
684 
686  inline std::ostream& operator << (std::ostream& rOStream,
687  const TetGenCDT& rThis)
688  {
689  rThis.PrintInfo(rOStream);
690  rOStream << std::endl;
691  rThis.PrintData(rOStream);
692 
693  return rOStream;
694  }
696 
697 
698 } // namespace Kratos.
699 
700 #endif // KRATOS_TETGEN_CDT_H_INCLUDED defined
This class is designed to allow the fast location of MANY points on the top of a 3D mesh.
Definition: binbased_fast_point_locator.h:68
void UpdateSearchDatabase()
Function to construct or update the search database.
Definition: binbased_fast_point_locator.h:139
ConfigureType::ResultContainerType ResultContainerType
Definition: binbased_fast_point_locator.h:81
Dof * Pointer
Pointer definition of Dof.
Definition: dof.h:93
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
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
PropertiesType::Pointer pGetProperties(IndexType PropertiesId)
Definition: mesh.h:394
ModelPart & CreateModelPart(const std::string &ModelPartName, IndexType NewBufferSize=1)
This method creates a new model part contained in the current Model with a given name and buffer size...
Definition: model.cpp:37
void DeleteModelPart(const std::string &ModelPartName)
This method deletes a modelpart with a given name.
Definition: model.cpp:64
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
ConditionIterator ConditionsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1361
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
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
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
Model & GetModel()
Definition: model_part.h:323
ConditionIterator ConditionsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1371
Dof< double > DofType
Dof type.
Definition: node.h:83
std::vector< std::unique_ptr< Dof< double > >> DofsContainerType
The DoF container type definition.
Definition: node.h:92
Short class definition.
Definition: tetgen_cdt.h:66
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: tetgen_cdt.h:404
void addNodes(ModelPart &ThisModelPart, Element const &rReferenceElement, bool apply_volume_constraints, unsigned int property_id, BinBasedFastPointLocator< 3 > element_finder)
Definition: tetgen_cdt.h:117
KRATOS_CLASS_POINTER_DEFINITION(TetGenCDT)
Pointer definition of TetGenCDT.
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: tetgen_cdt.h:401
tetgenio outnew
Definition: tetgen_cdt.h:116
void GenerateCDT(ModelPart &ThisModelPart, Element const &rReferenceElement, bool apply_volume_constraints, unsigned int property_id)
Definition: tetgen_cdt.h:213
virtual ~TetGenCDT()=default
Destructor.
TetGenCDT()
Default constructor.
Definition: tetgen_cdt.h:80
tetgenio out
Definition: tetgen_cdt.h:116
virtual std::string Info() const
Turn back information as a string.
Definition: tetgen_cdt.h:395
A four node tetrahedra geometry with linear shape functions.
Definition: tetrahedra_3d_4.h:59
#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
#define REAL
Definition: delaunator_utilities.cpp:16
z
Definition: GenerateWind.py:163
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::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
float dist
Definition: edgebased_PureConvection.py:89
int step
Definition: face_heat.py:88
y
Other simbols definition.
Definition: generate_axisymmetric_navier_stokes_element.py:54
f
Definition: generate_convection_diffusion_explicit_element.py:112
tuple tmp
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:98
int j
Definition: quadrature.py:648
el
Definition: read_stl.py:25
int counter
Definition: script_THERMAL_CORRECT.py:218
p
Definition: sensitivityMatrix.py:52
N
Definition: sensitivityMatrix.py:29
x
Definition: sensitivityMatrix.py:49
int dim
Definition: sensitivityMatrix.py:25
integer i
Definition: TensorModule.f:17