/* Applies subdivision along the y-axis. */ void verticalSubdivision() { count = count * 2 - 1; std::vector <double> temp_x (count, 0); std::vector <double> temp_y (count, 0); std::vector <double> temp_z (count, 0); for(int i = 0; i < points_x.size(); i ++) { temp_x[0] = points_x[i][0]; temp_x[1] = 1/8.0 * (4 * points_x[i][0] + 4 * points_x[i][1]); temp_y[0] = points_y[i][0]; temp_y[1] = 1/8.0 * (4 * points_y[i][0] + 4 * points_y[i][1]); temp_z[0] = points_z[i][0]; temp_z[1] = 1/8.0 * (4 * points_z[i][0] + 4 * points_z[i][1]); for(int j = 2; j < count-1; j+=2) { temp_x[j] = 1/8.0 * (points_x[i][j/2 - 1] + 6 * points_x[i][j/2] + points_x[i][j/2+1]); temp_x[j+1] = 1/8.0 * (4 * points_x[i][j/2] + 4 * points_x[i][j/2+1]); temp_y[j] = 1/8.0 * (points_y[i][j/2 - 1] + 6 * points_y[i][j/2] + points_y[i][j/2+1]); temp_y[j+1] = 1/8.0 * (4 * points_y[i][j/2] + 4 * points_y[i][j/2+1]); temp_z[j] = 1/8.0 * (points_z[i][j/2 - 1] + 6 * points_z[i][j/2] + points_z[i][j/2+1]); temp_z[j+1] = 1/8.0 * (4 * points_z[i][j/2] + 4 * points_z[i][j/2+1]); } temp_x[count - 1] = points_x[i][count/2]; temp_y[count - 1] = points_y[i][count/2]; temp_z[count - 1] = points_z[i][count/2]; points_x[i] = std::vector <double> (temp_x); points_y[i] = std::vector <double> (temp_y); points_z[i] = std::vector <double> (temp_z); } }
/// /// @par Detailed description /// ... /// @param [in, out] (param1) ... /// @return ... /// @note ... void sasio::Files:: resize_array() { int nf = _number_of_frames() ; Eigen::Array<float,Eigen::Dynamic,Eigen::Dynamic> temp_x(_natoms(),nf) ; Eigen::Array<float,Eigen::Dynamic,Eigen::Dynamic> temp_y(_natoms(),nf) ; Eigen::Array<float,Eigen::Dynamic,Eigen::Dynamic> temp_z(_natoms(),nf) ; temp_x = _x() ; temp_y = _y() ; temp_z = _z() ; _x().resize(_natoms(),_number_of_frames()+1) ; _y().resize(_natoms(),_number_of_frames()+1) ; _z().resize(_natoms(),_number_of_frames()+1) ; // see: slice.cpp in retired_ideas/play_with_eigen/ // mat1.block(i,j,rows,cols) // a.block(0, 0, 3, 1) = b.block(0,0,3,1) ; _x().block(0, 0, _natoms(), nf) = temp_x.block(0,0,_natoms(),nf) ; _y().block(0, 0, _natoms(), nf) = temp_y.block(0,0,_natoms(),nf) ; _z().block(0, 0, _natoms(), nf) = temp_z.block(0,0,_natoms(),nf) ; return ; }
void init() { std::vector< std::vector<double> > temp_x (divi, std::vector<double> (30, 0)); std::vector< std::vector<double> > temp_y (divi, std::vector<double> (30, 0)); std::vector< std::vector<double> > temp_z (divi, std::vector<double> (30, 0)); points_x = temp_x; points_y = temp_y; points_z = temp_z; glClearColor(0.0, 0.0, 0.0, 0.0); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(fleft, fright, fbottom, ftop, -zNear, -zFar); }
/* Applies subdivision along the x-axis. */ void horizontalSubdivision() { divi = divi * 2; std::vector < std::vector <double> > temp_x (divi, std::vector <double> (count, 0)); std::vector < std::vector <double> > temp_y (divi, std::vector <double> (count, 0)); std::vector < std::vector <double> > temp_z (divi, std::vector <double> (count, 0)); for(int j = 0; j < count; j++) { temp_x[0][j] = 1/8.0 * (points_x[divi/2 - 1][j] + 6 * points_x[0][j] + points_x[1][j]); temp_x[1][j] = 1/8.0 * (4 * points_x[0][j] + 4 * points_x[1][j]); temp_y[0][j] = 1/8.0 * (points_y[divi/2 - 1][j] + 6 * points_y[0][j] + points_y[1][j]); temp_y[1][j] = 1/8.0 * (4 * points_y[0][j] + 4 * points_y[1][j]); temp_z[0][j] = 1/8.0 * (points_z[divi/2 - 1][j] + 6 * points_z[0][j] + points_z[1][j]); temp_z[1][j] = 1/8.0 * (4 * points_z[0][j] + 4 * points_z[1][j]); for(int i = 2; i < divi-1; i+=2) { int l = i/2 + 1; int k = i/2; if(i == divi - 2) { l = 0; } if(i == divi - 1) { k = 0; l = 1; } temp_x[i][j] = 1/8.0 * (points_x[i/2 - 1][j] + 6 * points_x[k][j] + points_x[l][j]); temp_x[i+1][j] = 1/8.0 * (4 * points_x[k][j] + 4 * points_x[l][j]); temp_y[i][j] = 1/8.0 * (points_y[i/2 - 1][j] + 6 * points_y[k][j] + points_y[l][j]); temp_y[i+1][j] = 1/8.0 * (4 * points_y[k][j] + 4 * points_y[l][j]); temp_z[i][j] = 1/8.0 * (points_z[i/2 - 1][j] + 6 * points_z[k][j] + points_z[l][j]); temp_z[i+1][j] = 1/8.0 * (4 * points_z[k][j] + 4 * points_z[l][j]); } } points_x = temp_x; points_y = temp_y; points_z = temp_z; }