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.
visualization.h
Go to the documentation of this file.
1 
2 
3 #if !defined(KRATOS_ADD_VISUALIZATION_UTILITIES_INCLUDED )
4 #define KRATOS_ADD_VISUALIZATION_UTILITIES_INCLUDED
5 
6 // System includes
7 #include <string>
8 #include <iostream>
9 #include <algorithm>
10 
11 // Project includes
12 #include "includes/define.h"
14 #include "utilities/math_utils.h"
15 #include "utilities/geometry_utilities.h"
17 #include "includes/variables.h"
18 #include "includes/model_part.h"
19 #include "includes/node.h"
20 #include "includes/element.h"
21 #include "includes/condition.h"
22 #include "geometries/point_2d.h"
23 
24 
25 namespace Kratos
26 {
27  //this class is to be modified by the user to customize the interpolation process
28  //template< unsigned int TDim>
30  {
31  public:
32 
34 
36  {
37  KRATOS_TRY
38  std::cout << "Hello, I am the constructor of the Visualization 2d Utility" << std::endl;
39  KRATOS_CATCH("")
40  }
41 
42 
44  {}
45 
46 
47  //**********************************************************************************************
48  //**********************************************************************************************
49 
50 
51  void VisualizationModelPart(ModelPart& rCompleteModelPart, ModelPart& rEulerianModelPart, ModelPart & rLagrangianModelPart)
52  {
53  KRATOS_TRY;
54 
55  rCompleteModelPart.Elements() = rEulerianModelPart.Elements();
56  rCompleteModelPart.Nodes() = rEulerianModelPart.Nodes();
57 
58  KRATOS_WATCH("hola11")
59 
60  unsigned int id;
61  if(rEulerianModelPart.Nodes().size()!= 0)
62  id = (rEulerianModelPart.Nodes().end() - 1)->Id() + 1;
63  else
64  id = 1;
65 
66  //preallocate the memory needed
67  int tot_nodes = rEulerianModelPart.Nodes().size() + rLagrangianModelPart.Nodes().size();
68  rCompleteModelPart.Nodes().reserve( tot_nodes );
69 
70  KRATOS_WATCH("hola12")
71 
72  //note that here we renumber the nodes
73  KRATOS_WATCH(rLagrangianModelPart.Nodes().size())
74  for (ModelPart::NodesContainerType::iterator node_it = rLagrangianModelPart.NodesBegin();
75  node_it != rLagrangianModelPart.NodesEnd(); node_it++)
76  {
77  node_it->SetId(id++);
78  rCompleteModelPart.AddNode(*(node_it.base()));
79  }
80 
81  KRATOS_WATCH("hola13")
82 
83  KRATOS_CATCH("");
84  }
85 
86  //**********************************************************************************************
87  //**********************************************************************************************
88 
89 
90  protected:
91 
92 
93  private:
94 
95 
96  };
97 
98 } // namespace Kratos.
99 
100 #endif // KRATOS_ADD_VISUALIZATION_UTILITIES_INCLUDED defined
101 
102 
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
void AddNode(NodeType::Pointer pNewNode, IndexType ThisIndex=0)
Definition: model_part.cpp:211
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
Definition: visualization.h:30
~VisualizationUtilities()
Definition: visualization.h:43
void VisualizationModelPart(ModelPart &rCompleteModelPart, ModelPart &rEulerianModelPart, ModelPart &rLagrangianModelPart)
Definition: visualization.h:51
KRATOS_CLASS_POINTER_DEFINITION(VisualizationUtilities)
VisualizationUtilities()
Definition: visualization.h:35
#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