28 PolarGenerator(
double _r_min,
double _r_max) : r_min(_r_min), r_max(_r_max) {}
32 virtual void do_generate(
33 const thrust::host_vector<double>& zeta1d,
34 const thrust::host_vector<double>& eta1d,
35 thrust::host_vector<double>& x,
36 thrust::host_vector<double>& y,
37 thrust::host_vector<double>& zetaX,
38 thrust::host_vector<double>& zetaY,
39 thrust::host_vector<double>& etaX,
40 thrust::host_vector<double>& etaY)
const override final {
42 int size_r = zeta1d.size();
43 int size_phi = eta1d.size();
44 int size = size_r*size_phi;
46 x.resize(size);
y.resize(size);
47 zetaX.resize(size); zetaY.resize(size);
48 etaX.resize(size); etaY.resize(size);
51 for(
int j=0;j<size_phi;j++)
52 for(
int i=0;i<size_r;i++) {
53 double r = zeta1d[i] + r_min;
54 double phi = eta1d[j];
56 x[i+size_r*j] = r*cos(phi);
57 y[i+size_r*j] = r*sin(phi);
59 zetaX[i+size_r*j] = cos(phi);
60 zetaY[i+size_r*j] = sin(phi);
61 etaX[i+size_r*j] = -sin(phi)/r;
62 etaY[i+size_r*j] = cos(phi)/r;
67 virtual double do_width() const override final{
return r_max-r_min;}
68 virtual double do_height() const override final{
return 2*
M_PI;}
69 virtual bool do_isOrthogonal() const override final{
return true;}
98 virtual void do_generate(
99 const thrust::host_vector<double>& zeta1d,
100 const thrust::host_vector<double>& eta1d,
101 thrust::host_vector<double>& x,
102 thrust::host_vector<double>& y,
103 thrust::host_vector<double>& zetaX,
104 thrust::host_vector<double>& zetaY,
105 thrust::host_vector<double>& etaX,
106 thrust::host_vector<double>& etaY)
const override final{
108 int size_r = zeta1d.size();
109 int size_phi = eta1d.size();
110 int size = size_r*size_phi;
112 x.resize(size);
y.resize(size);
113 zetaX.resize(size); zetaY.resize(size);
114 etaX.resize(size); etaY.resize(size);
117 for(
int j=0;j<size_phi;j++)
118 for(
int i=0;i<size_r;i++) {
119 double l = zeta1d[i] + log(r_min);
120 double phi = eta1d[j];
122 x[i+size_r*j] = exp(l)*cos(phi);
123 y[i+size_r*j] = exp(l)*sin(phi);
125 zetaX[i+size_r*j] = cos(phi)*exp(-l);
126 zetaY[i+size_r*j] = sin(phi)*exp(-l);
127 etaX[i+size_r*j] = -sin(phi)*exp(-l);
128 etaY[i+size_r*j] = cos(phi)*exp(-l);
133 virtual double do_width() const override final{
return log(r_max)-log(r_min);}
134 virtual double do_height() const override final{
return 2*
M_PI;}
135 virtual bool do_isOrthogonal() const override final{
return true;}
Log Polar coordinates (conformal)
Definition: polar.h:82
LogPolarGenerator(double _r_min, double _r_max)
Construct a ring with minimal and maximal radius.
Definition: polar.h:94
virtual LogPolarGenerator * clone() const override final
Abstract clone method that returns a copy on the heap.
Definition: polar.h:95
Polar coordinates.
Definition: polar.h:16
virtual PolarGenerator * clone() const override final
Abstract clone method that returns a copy on the heap.
Definition: polar.h:29
PolarGenerator(double _r_min, double _r_max)
Construct a ring with minimal and maximal radius.
Definition: polar.h:28
The abstract generator base class.
Definition: generator.h:20