gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
VoroMetal.h
Go to the documentation of this file.
1 // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
2 //
3 // See the LICENSE.txt file in the Gmsh root directory for license information.
4 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
5 
6 #ifndef VOROMETAL_H
7 #define VOROMETAL_H
8 
9 #include <vector>
10 #include "Plugin.h"
11 
12 class geo_cell {
13 public:
14  std::vector<std::pair<int, int> > lines;
15  std::vector<std::vector<int> > line_loops;
16  std::vector<std::vector<int> > orientations;
17  std::vector<int> points2;
18  std::vector<int> lines2;
19  std::vector<int> line_loops2;
20  std::vector<int> faces2;
22  geo_cell() {}
23  ~geo_cell() {}
24  int search_line(std::pair<int, int> line)
25  {
26  std::size_t i;
27  for(i = 0; i < lines.size(); i++) {
28  if(lines[i].first == line.first && lines[i].second == line.second)
29  return i;
30  if(lines[i].first == line.second && lines[i].second == line.first)
31  return i;
32  }
33  return -1;
34  }
35 };
36 
37 class voroMetal3D {
38 private:
39  int counter;
40 
41 public:
44  void execute(double);
45  void execute(GRegion *, double);
46  void execute(std::vector<SPoint3> &, std::vector<double> &, int, double,
47  double, double, double);
48  void execute(std::vector<double> &, int, double, double, double, double);
49  void print_segment(SPoint3, SPoint3, std::ofstream &);
52  int get_counter();
53  void print_geo_point(int, double, double, double, std::ofstream &);
54  void print_geo_line(int, int, int, std::ofstream &);
55  void print_geo_face(int, int, std::ofstream &);
56  void print_geo_physical_face(int, int, std::ofstream &);
57  void print_geo_volume(int, int, std::ofstream &);
58  void print_geo_physical_volume(int, int, std::ofstream &);
59  void print_geo_line_loop(int, std::vector<int> &, std::vector<int> &,
60  std::ofstream &);
61  void print_geo_face_loop(int, std::vector<int> &, std::ofstream &);
62  void correspondence(double, double, double, double);
63  bool correspondence(double, double, double, double, int &, double, double,
64  double);
65  void correspondence(double, double, double, double, int, bool &, double,
66  double, double);
67  bool equal(double, double, double);
68 };
69 
70 extern "C" {
72 }
73 
75 public:
77  std::string getName() const { return "VoroMetal"; }
78  std::string getShortHelp() const { return "Voronoi microstructures"; }
79  std::string getHelp() const;
80  std::string getAuthor() const { return "Tristan Carrier & Maxime Melchior"; }
81  int getNbOptions() const;
82  StringXNumber *getOption(int iopt);
83  int getNbOptionsStr() const;
84  StringXString *getOptionStr(int iopt);
85  PView *execute(PView *);
86 };
87 
88 #endif
StringXString
Definition: Options.h:910
GMSH_VoroMetalPlugin::getShortHelp
std::string getShortHelp() const
Definition: VoroMetal.h:78
PView
Definition: PView.h:27
voroMetal3D::print_geo_physical_face
void print_geo_physical_face(int, int, std::ofstream &)
geo_cell::lines
std::vector< std::pair< int, int > > lines
Definition: VoroMetal.h:14
voroMetal3D::execute
void execute(std::vector< SPoint3 > &, std::vector< double > &, int, double, double, double, double)
Plugin.h
geo_cell::line_loops
std::vector< std::vector< int > > line_loops
Definition: VoroMetal.h:15
GMSH_Plugin
Definition: Plugin.h:26
geo_cell::search_line
int search_line(std::pair< int, int > line)
Definition: VoroMetal.h:24
geo_cell::lines2
std::vector< int > lines2
Definition: VoroMetal.h:18
GMSH_VoroMetalPlugin::getOptionStr
StringXString * getOptionStr(int iopt)
Definition: VoroMetal.cpp:54
GMSH_VoroMetalPlugin
Definition: VoroMetal.h:74
SPoint3
Definition: SPoint3.h:14
voroMetal3D::voroMetal3D
voroMetal3D()
Definition: VoroMetal.h:42
StringXNumber
Definition: Options.h:918
GMSH_VoroMetalPlugin::getNbOptionsStr
int getNbOptionsStr() const
Definition: VoroMetal.cpp:44
voroMetal3D::execute
void execute(GRegion *, double)
geo_cell::orientations
std::vector< std::vector< int > > orientations
Definition: VoroMetal.h:16
voroMetal3D::correspondence
void correspondence(double, double, double, double)
GMSH_RegisterVoroMetalPlugin
GMSH_Plugin * GMSH_RegisterVoroMetalPlugin()
Definition: VoroMetal.cpp:27
voroMetal3D::print_geo_physical_volume
void print_geo_physical_volume(int, int, std::ofstream &)
voroMetal3D::correspondence
void correspondence(double, double, double, double, int, bool &, double, double, double)
voroMetal3D::print_geo_point
void print_geo_point(int, double, double, double, std::ofstream &)
geo_cell::geo_cell
geo_cell()
Definition: VoroMetal.h:22
voroMetal3D::execute
void execute(double)
GMSH_VoroMetalPlugin::getNbOptions
int getNbOptions() const
Definition: VoroMetal.cpp:39
geo_cell::line_loops2
std::vector< int > line_loops2
Definition: VoroMetal.h:19
GMSH_VoroMetalPlugin::execute
PView * execute(PView *)
Definition: VoroMetal.cpp:1378
voroMetal3D
Definition: VoroMetal.h:37
GMSH_VoroMetalPlugin::getOption
StringXNumber * getOption(int iopt)
Definition: VoroMetal.cpp:49
geo_cell::faces2
std::vector< int > faces2
Definition: VoroMetal.h:20
GRegion
Definition: GRegion.h:28
geo_cell::~geo_cell
~geo_cell()
Definition: VoroMetal.h:23
voroMetal3D::print_geo_volume
void print_geo_volume(int, int, std::ofstream &)
voroMetal3D::counter
int counter
Definition: VoroMetal.h:39
GMSH_PostPlugin
Definition: Plugin.h:83
voroMetal3D::increase_counter
void increase_counter()
geo_cell
Definition: VoroMetal.h:12
voroMetal3D::~voroMetal3D
~voroMetal3D()
Definition: VoroMetal.h:43
voroMetal3D::get_counter
int get_counter()
voroMetal3D::print_segment
void print_segment(SPoint3, SPoint3, std::ofstream &)
voroMetal3D::execute
void execute(std::vector< double > &, int, double, double, double, double)
voroMetal3D::correspondence
bool correspondence(double, double, double, double, int &, double, double, double)
GMSH_VoroMetalPlugin::getHelp
std::string getHelp() const
Definition: VoroMetal.cpp:33
geo_cell::face_loops2
int face_loops2
Definition: VoroMetal.h:21
line
Definition: shapeFunctions.h:342
voroMetal3D::print_geo_line_loop
void print_geo_line_loop(int, std::vector< int > &, std::vector< int > &, std::ofstream &)
GMSH_VoroMetalPlugin::GMSH_VoroMetalPlugin
GMSH_VoroMetalPlugin()
Definition: VoroMetal.h:76
voroMetal3D::print_geo_face_loop
void print_geo_face_loop(int, std::vector< int > &, std::ofstream &)
voroMetal3D::print_geo_face
void print_geo_face(int, int, std::ofstream &)
voroMetal3D::print_geo_line
void print_geo_line(int, int, int, std::ofstream &)
voroMetal3D::equal
bool equal(double, double, double)
geo_cell::points2
std::vector< int > points2
Definition: VoroMetal.h:17
GMSH_VoroMetalPlugin::getName
std::string getName() const
Definition: VoroMetal.h:77
voroMetal3D::initialize_counter
void initialize_counter()
GMSH_VoroMetalPlugin::getAuthor
std::string getAuthor() const
Definition: VoroMetal.h:80