@@ -70,13 +70,16 @@ void Grid::setMemberVariables(
7070 AdjacentSet::call_times = 0 ;
7171
7272 this ->natom = input.getAmount ();
73- if (test_grid)ModuleBase::GlobalFunc::OUT (ofs_in, " natom" , natom);
73+ if (test_grid) {ModuleBase::GlobalFunc::OUT (ofs_in, " natom" , natom);
74+ }
7475
7576 this ->pbc = input.getBoundary ();
76- if (test_grid)ModuleBase::GlobalFunc::OUT (ofs_in, " PeriodicBoundary" , this ->pbc );
77+ if (test_grid) {ModuleBase::GlobalFunc::OUT (ofs_in, " PeriodicBoundary" , this ->pbc );
78+ }
7779
7880 this ->sradius = input.getRadius ();
79- if (test_grid)ModuleBase::GlobalFunc::OUT (ofs_in, " Radius(unit:lat0)" , sradius);
81+ if (test_grid) {ModuleBase::GlobalFunc::OUT (ofs_in, " Radius(unit:lat0)" , sradius);
82+ }
8083
8184 for (int i = 0 ;i < 3 ;i++)
8285 {
@@ -86,44 +89,53 @@ void Grid::setMemberVariables(
8689 }
8790
8891 this ->lat_now = input.getLatNow ();
89- if (test_grid)ModuleBase::GlobalFunc::OUT (ofs_in," lat0(unit:Bohr)" , lat_now);
92+ if (test_grid) {ModuleBase::GlobalFunc::OUT (ofs_in," lat0(unit:Bohr)" , lat_now);
93+ }
9094
9195 this ->expand_flag = input.getExpandFlag ();
92- if (test_grid)ModuleBase::GlobalFunc::OUT (ofs_in," Expand_flag" , expand_flag);
96+ if (test_grid) {ModuleBase::GlobalFunc::OUT (ofs_in," Expand_flag" , expand_flag);
97+ }
9398
9499 // output std::vector
95- if (test_grid)ModuleBase::GlobalFunc::OUT (ofs_in," Vec1" ,vec1[0 ],vec1[1 ],vec1[2 ]);
96- if (test_grid)ModuleBase::GlobalFunc::OUT (ofs_in," Vec2" ,vec2[0 ],vec2[1 ],vec2[2 ]);
97- if (test_grid)ModuleBase::GlobalFunc::OUT (ofs_in," Vec3" ,vec3[0 ],vec3[1 ],vec3[2 ]);
100+ if (test_grid) {ModuleBase::GlobalFunc::OUT (ofs_in," Vec1" ,vec1[0 ],vec1[1 ],vec1[2 ]);
101+ }
102+ if (test_grid) {ModuleBase::GlobalFunc::OUT (ofs_in," Vec2" ,vec2[0 ],vec2[1 ],vec2[2 ]);
103+ }
104+ if (test_grid) {ModuleBase::GlobalFunc::OUT (ofs_in," Vec3" ,vec3[0 ],vec3[1 ],vec3[2 ]);
105+ }
98106
99107 // output grid length
100108 this ->grid_length [0 ] = input.Clength0 ();
101109 this ->grid_length [1 ] = input.Clength1 ();
102110 this ->grid_length [2 ] = input.Clength2 ();
103111
104- if (test_grid)ModuleBase::GlobalFunc::OUT (ofs_in," Grid_length" ,grid_length[0 ],grid_length[1 ],grid_length[2 ]);
112+ if (test_grid) {ModuleBase::GlobalFunc::OUT (ofs_in," Grid_length" ,grid_length[0 ],grid_length[1 ],grid_length[2 ]);
113+ }
105114// ----------------------------------------------------------
106115// EXPLAIN : (d_minX,d_minY,d_minZ)minimal value of
107116// x[] ,y[] , z[]
108117// ----------------------------------------------------------
109118 this ->d_minX = input.minX ();
110119 this ->d_minY = input.minY ();
111120 this ->d_minZ = input.minZ ();
112- if (test_grid)ModuleBase::GlobalFunc::OUT (ofs_in," MinCoordinate" ,d_minX,d_minY,d_minZ);
121+ if (test_grid) {ModuleBase::GlobalFunc::OUT (ofs_in," MinCoordinate" ,d_minX,d_minY,d_minZ);
122+ }
113123// ----------------------------------------------------------
114124// layer: grid layer after expand
115125// ----------------------------------------------------------
116126 this ->cell_x_length = input.getCellXLength ();
117127 this ->cell_y_length = input.getCellYLength ();
118128 this ->cell_z_length = input.getCellZLength ();
119- if (test_grid)ModuleBase::GlobalFunc::OUT (ofs_in," CellLength(unit: lat0)" ,cell_x_length,cell_y_length,cell_z_length);
129+ if (test_grid) {ModuleBase::GlobalFunc::OUT (ofs_in," CellLength(unit: lat0)" ,cell_x_length,cell_y_length,cell_z_length);
130+ }
120131// ----------------------------------------------------------
121132// set dx, dy, dz
122133// ----------------------------------------------------------
123134 this ->dx = input.getCellX ();
124135 this ->dy = input.getCellY ();
125136 this ->dz = input.getCellZ ();
126- if (test_grid)ModuleBase::GlobalFunc::OUT (ofs_in," CellNumber" ,dx,dy,dz);
137+ if (test_grid) {ModuleBase::GlobalFunc::OUT (ofs_in," CellNumber" ,dx,dy,dz);
138+ }
127139
128140
129141 Cell = new CellSet**[dx];
@@ -149,7 +161,8 @@ void Grid::setBoundaryAdjacent(
149161 std::ofstream &ofs_in,
150162 const Atom_input &input)
151163{
152- if (test_grid) ModuleBase::TITLE (ofs_in, " Grid" , " setBoundaryAdjacent" );
164+ if (test_grid) { ModuleBase::TITLE (ofs_in, " Grid" , " setBoundaryAdjacent" );
165+ }
153166
154167 if (expand_flag)
155168 {
@@ -163,7 +176,8 @@ void Grid::setBoundaryAdjacent(
163176 this ->Construct_Adjacent_begin ();
164177 }
165178
166- if (test_grid)ModuleBase::GlobalFunc::OUT (ofs_in," Adjacent_set call times" ,AdjacentSet::call_times);
179+ if (test_grid) {ModuleBase::GlobalFunc::OUT (ofs_in," Adjacent_set call times" ,AdjacentSet::call_times);
180+ }
167181
168182 // if (test_grid)ModuleBase::GlobalFunc::DONE(ofs_in, "Construct_Adjacent");
169183
@@ -333,7 +347,7 @@ void Grid::Construct_Adjacent_expand_periodic(const int true_i,
333347
334348}
335349
336- void Grid::Construct_Adjacent_begin (void )
350+ void Grid::Construct_Adjacent_begin ()
337351{
338352// if (test_grid)ModuleBase::TITLE(ofs_running, "Grid", "Construct_Adjacent_begin");
339353
0 commit comments