mesh_generator.hpp
Go to the documentation of this file.
1 
5 #ifndef MESHGENERATOR_HPP
6 #define MESHGENERATOR_HPP 1
7 
8 #ifdef _MSC_VER
9 #define _USE_MATH_DEFINES
10 #endif // _MSC_VER
11 #include <vector>
12 #include <cmath>
13 #include "../tessellation/geometry.hpp"
14 #include <algorithm>
15 #include <boost/random/mersenne_twister.hpp>
16 #include <boost/random/uniform_real_distribution.hpp>
17 
25 std::vector<Vector2D> cartesian_mesh(int nx, int ny,
26  Vector2D const& lower_left,
27  Vector2D const& upper_right);
28 
42 std::vector<Vector2D> CirclePointsRmax(int PointNum,double Rmin,double Rmax,
43  double xmax, double ymax, double xmin, double ymin, double xc = 0, double yc = 0);
44 
58 std::vector<Vector2D> CirclePointsRmax_2(int PointNum,double Rmin,double Rmax,
59  double xc=0,double yc=0,double xmax=1,double ymax=1,double xmin=-1,
60  double ymin=1);
74 std::vector<Vector2D> CirclePointsRmax_1(int PointNum,double Rmin,double Rmax,
75  double xc=0,double yc=0,double xmax=1,double ymax=1,double xmin=-1,double ymin=-1);
76 
84 std::vector<Vector2D> circle_circumference(size_t point_number,
85  double radius,
86  Vector2D const& center, double angle_start = 0, double angle_end = 2 * M_PI);
87 
97 std::vector<Vector2D> Line(int PointNum,double xmin,double xmax,double ymin,double ymax);
98 
113 std::vector<Vector2D> CirclePointsRmax_a(int PointNum,double Rmin,double Rmax,
114  double xc,double yc,double xmax,double ymax,double xmin,double ymin,
115  double alpha, double angle_start = 0, double angle_end = 2 * M_PI);
116 
129 std::vector<Vector2D> RandPointsR(int PointNum,double xl=-0.5,double xr=0.5,
130  double yd=-0.5,double yu=0.5,double minR=0,double xc=0,
131  double yc=0);
132 
140 std::vector<Vector2D> RandSquare(int PointNum,Vector2D const& lowerleft, Vector2D const& upperright);
141 
142 
152 std::vector<Vector2D> RandSquare(int PointNum, double xl = -0.5, double xr = 0.5,
153  double yd = -0.5, double yu = 0.5);
154 
166 std::vector<Vector2D> RandSquare(int PointNum,boost::random::mt19937 &eng,
167  double xl=-0.5,double xr=0.5,double yd=-0.5,double yu=0.5);
168 
181 std::vector<Vector2D> RandPointsRa(int PointNum,double Rmin,double Rmax,double alpha,
182  Vector2D const& lowerleft,Vector2D const& upperright,Vector2D const& center=Vector2D(0,0));
183 
193 std::vector<Vector2D> RandPointsRmax(int PointNum,double Rmin,double Rmax,
194  double xc=0,double yc=0);
195 
196 #endif //MESHGENERATOR_HPP
std::vector< Vector2D > Line(int PointNum, double xmin, double xmax, double ymin, double ymax)
Creates a line of evenly spaced points y=slope*x+b.
std::vector< Vector2D > CirclePointsRmax_2(int PointNum, double Rmin, double Rmax, double xc=0, double yc=0, double xmax=1, double ymax=1, double xmin=-1, double ymin=1)
Generates a round grid with 1/r^2 point density confined to a rectangle given by xmin,xmax,ymin and ymax.
std::vector< Vector2D > circle_circumference(size_t point_number, double radius, Vector2D const &center, double angle_start=0, double angle_end=2 *M_PI)
Creates a circle of evenly spaced points.
std::vector< Vector2D > CirclePointsRmax_1(int PointNum, double Rmin, double Rmax, double xc=0, double yc=0, double xmax=1, double ymax=1, double xmin=-1, double ymin=-1)
Generates a round grid with 1/r point density confined to a rectangle given by xmin,xmax,ymin and ymax.
std::vector< Vector2D > RandPointsR(int PointNum, double xl=-0.5, double xr=0.5, double yd=-0.5, double yu=0.5, double minR=0, double xc=0, double yc=0)
Generates a rectangular grid with random 1/r point density.
std::vector< Vector2D > CirclePointsRmax_a(int PointNum, double Rmin, double Rmax, double xc, double yc, double xmax, double ymax, double xmin, double ymin, double alpha, double angle_start=0, double angle_end=2 *M_PI)
Generates a round grid with r^alpha point density confined to a rectangle given by xmin...
std::vector< Vector2D > RandPointsRa(int PointNum, double Rmin, double Rmax, double alpha, Vector2D const &lowerleft, Vector2D const &upperright, Vector2D const &center=Vector2D(0, 0))
Generates a random round grid with r^(1-a) point density.
std::vector< Vector2D > cartesian_mesh(int nx, int ny, Vector2D const &lower_left, Vector2D const &upper_right)
Generates a cartesian mesh.
std::vector< Vector2D > RandSquare(int PointNum, Vector2D const &lowerleft, Vector2D const &upperright)
Generates a random rectangular grid with uniform point density and a constant seed.
std::vector< Vector2D > RandPointsRmax(int PointNum, double Rmin, double Rmax, double xc=0, double yc=0)
Generates a random round grid with 1/r point density.
2D Mathematical vector
Definition: geometry.hpp:15
std::vector< Vector2D > CirclePointsRmax(int PointNum, double Rmin, double Rmax, double xmax, double ymax, double xmin, double ymin, double xc=0, double yc=0)
Generates a round grid with constant point density.