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.
cad_json_output.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 
11 #if !defined(KRATOS_CAD_JSON_OUTPUT_INCLUDED )
12 #define KRATOS_CAD_JSON_OUTPUT_INCLUDED
13 
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
20 #include "includes/io.h"
22 #include "includes/model_part.h"
23 
24 // Geometries
26 
30 
33 #include "geometries/brep_curve.h"
34 
35 namespace Kratos
36 {
37 
41 
43 class KRATOS_API(KRATOS_CORE) CadJsonOutput
44 {
45  public:
46 
50 
53 
54  typedef std::size_t SizeType;
55  typedef std::size_t IndexType;
56 
57  typedef Node NodeType;
59 
61  typedef typename GeometryType::Pointer GeometryPointerType;
62 
65 
67 
70 
71  typedef typename NurbsSurfaceType::Pointer NurbsSurfacePointerType;
72  typedef typename NurbsTrimmingCurveType::Pointer NurbsTrimmingCurvePointerType;
73 
77 
81 
85 
87  static void GetCadJsonOutput(
88  ModelPart& rModelPart,
89  std::string& rGeometryFile,
90  SizeType EchoLevel = 0)
91  {
92  Parameters cad_geometry_parameters;
93 
94  GetParameters(rModelPart, cad_geometry_parameters, EchoLevel);
95 
96  rGeometryFile = cad_geometry_parameters.PrettyPrintJsonString();
97  }
98 
102 
104  static void GetParameters(
105  ModelPart& rModelPart, Parameters& rCadGeometry, IndexType EchoLevel);
106 
108  static void GetBrepSurfaceParameters(
109  const typename ModelPart::GeometryIterator& rGeometryIterator, Parameters& rBrepsParameters, IndexType EchoLevel);
110 
112  static void GetBoundaryLoopParameters(
113  const BrepCurveOnSurfaceArrayType& rCurveOnSurfaceArray, Parameters& rCadGeometry, IndexType EchoLevel);
114 
116 }; // Class CadJsonOutput
117 } // namespace Kratos.
118 
119 #endif // KRATOS_CAD_JSON_OUTPUT_INCLUDED defined
The BrepCurve acts as topology for curves. Those can be enclosed by a certain set of points.
Definition: brep_curve.h:37
The BrepCurveOnSurface acts as topology for curves on surfaces.
Definition: brep_curve_on_surface.h:44
The BrepSurface acts as topology for faces. Those can be enclosed by a certain set of brep face curve...
Definition: brep_surface.h:45
Definition: cad_json_output.h:44
BrepSurface< ContainerNodeType, ContainerEmbeddedNodeType > BrepSurfaceType
Definition: cad_json_output.h:74
NurbsSurfaceType::Pointer NurbsSurfacePointerType
Definition: cad_json_output.h:71
NurbsTrimmingCurveType::Pointer NurbsTrimmingCurvePointerType
Definition: cad_json_output.h:72
NurbsCurveGeometry< 2, ContainerEmbeddedNodeType > NurbsTrimmingCurveType
Definition: cad_json_output.h:69
std::size_t SizeType
Definition: cad_json_output.h:54
NurbsSurfaceGeometry< 3, ContainerNodeType > NurbsSurfaceType
Definition: cad_json_output.h:68
GeometryType::Pointer GeometryPointerType
Definition: cad_json_output.h:61
Point EmbeddedNodeType
Definition: cad_json_output.h:58
std::size_t IndexType
Definition: cad_json_output.h:55
PointerVector< EmbeddedNodeType > ContainerEmbeddedNodeType
Definition: cad_json_output.h:64
BrepCurveOnSurface< ContainerNodeType, ContainerEmbeddedNodeType > BrepCurveOnSurfaceType
Definition: cad_json_output.h:75
PointerVector< NodeType > ContainerNodeType
Definition: cad_json_output.h:63
static void GetCadJsonOutput(ModelPart &rModelPart, std::string &rGeometryFile, SizeType EchoLevel=0)
Constructor with path to input file.
Definition: cad_json_output.h:87
DenseVector< DenseVector< typename BrepCurveOnSurfaceType::Pointer > > BrepCurveOnSurfaceLoopArrayType
Definition: cad_json_output.h:80
KRATOS_CLASS_POINTER_DEFINITION(CadJsonOutput)
Pointer definition of CadJsonOutput.
Node NodeType
Definition: cad_json_output.h:57
DenseVector< typename BrepCurveOnSurfaceType::Pointer > BrepCurveOnSurfaceArrayType
Definition: cad_json_output.h:78
CouplingGeometry< NodeType > CouplingGeometryType
Definition: cad_json_output.h:66
BrepCurve< ContainerNodeType, ContainerEmbeddedNodeType > BrepCurveType
Definition: cad_json_output.h:76
DenseVector< typename BrepCurveOnSurfaceType::Pointer > BrepCurveOnSurfaceLoopType
Definition: cad_json_output.h:79
Geometry< NodeType > GeometryType
Definition: cad_json_output.h:60
The CouplingGeometry connects two or more geometries of different types and entities.
Definition: coupling_geometry.h:41
Geometry base class.
Definition: geometry.h:71
Definition: amatrix_interface.h:41
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
GeometryContainerType::GeometryIterator GeometryIterator
Geometry Iterator.
Definition: model_part.h:240
This class defines the node.
Definition: node.h:65
Definition: nurbs_curve_geometry.h:33
Definition: nurbs_surface_geometry.h:38
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
const std::string PrettyPrintJsonString() const
This method returns a string with the corresponding text to the equivalent *.json file (this version ...
Definition: kratos_parameters.cpp:415
Point class.
Definition: point.h:59
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
static int EchoLevel
Definition: co_sim_EMPIRE_API.h:42
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21