Chi-Tech
sldfe_sq_01a_diagonal_spacing.cc
Go to the documentation of this file.
1#include "sldfe_sq.h"
2
3//###################################################################
4/**Generates diagonal spacings.*/
6{
7 //======================================== Define constants
8 const int Ns = (level + 1); //Number of subdivisions
9 const int Np = Ns + 1; //Number of diagonal points
10
11 const auto ihat = chi_mesh::Vector3(1.0,0.0,0.0);
12
13 //======================================== Define rotation matrix
15 auto n = chi_mesh::Vector3(0.0,-1.0/sqrt(2),1.0/sqrt(2));
16 auto& t = ihat;
17 auto b = n.Cross(t).Normalized();
18
19 Rihat.SetColJVec(0,t);
20 Rihat.SetColJVec(1,b);
21 Rihat.SetColJVec(2,n);
22
23 //======================================== Generate p-points
24 std::vector<chi_mesh::Vector3> p_points(Np);
25 double dphi = acos(a)/Ns;
26 double alpha = 0.10005;
27 double beta = 1.0185;
28
29 for (int i=0; i<Np; ++i)
30 {
31 double phi = i*dphi*(1.0+alpha*(cos(beta*M_PI_2*i/Ns) - cos(beta*M_PI_2)));
32
33 p_points[i] = Rihat*chi_mesh::Vector3(cos(phi), sin(phi), 0.0);
34 }
35
36 //======================================== Compute tilde points
37 std::vector<chi_mesh::Vector3> tilde_points(Np);
38 for (int i=0; i<Np; ++i)
39 {
40 double R = a/p_points[i].x;
41 double x_tilde = p_points[i].y*R;
42 double y_tilde = p_points[i].z*R;
43
44 tilde_points[i] = chi_mesh::Vector3(x_tilde,y_tilde,0.0);
45 }
46
47 diagonal_vertices_ = tilde_points;
48}
std::vector< chi_mesh::Vector3 > diagonal_vertices_
Definition: sldfe_sq.h:72
static constexpr double a
Inscribed cude side length.
Definition: sldfe_sq.h:70
VectorN< 3 > Vector3
void SetColJVec(int j, Vector3 vec)