@@ -72,8 +72,8 @@ void Lattice_Change_Basic::change_lattice(UnitCell &ucell, double *move, double
72
72
{
73
73
ModuleBase::TITLE (" Lattice_Change_Basic" , " change_lattice" );
74
74
75
- assert (move != NULL );
76
- assert (lat != NULL );
75
+ assert (move != nullptr );
76
+ assert (lat != nullptr );
77
77
78
78
/*
79
79
std::cout<<" LATTICE CONSTANT OLD:"<<std::endl;
@@ -86,11 +86,15 @@ void Lattice_Change_Basic::change_lattice(UnitCell &ucell, double *move, double
86
86
if (ModuleSymmetry::Symmetry::symm_flag && ucell.symm .nrotk > 0 )
87
87
{
88
88
ModuleBase::matrix move_mat_t (3 , 3 );
89
- for (int i = 0 ;i < 3 ;++i)for (int j = 0 ;j < 3 ;++j)move_mat_t (j, i) = move[i * 3 + j] / ucell.lat0 ; // transpose
89
+ for (int i = 0 ;i < 3 ;++i) {for (int j = 0 ;j < 3 ;++j) {move_mat_t (j, i) = move[i * 3 + j] / ucell.lat0 ; // transpose
90
+ }
91
+ }
90
92
ModuleBase::matrix symm_move_mat_t = (move_mat_t * ucell.G .to_matrix ());// symmetrize (latvec^{-1} * move_mat)^T
91
93
ucell.symm .symmetrize_mat3 (symm_move_mat_t , ucell.lat );
92
94
move_mat_t = symm_move_mat_t * ucell.latvec .Transpose ().to_matrix ();// G^{-1}=latvec^T
93
- for (int i = 0 ;i < 3 ;++i)for (int j = 0 ;j < 3 ;++j)move[i * 3 + j] = move_mat_t (j, i) * ucell.lat0 ;// transpose back
95
+ for (int i = 0 ;i < 3 ;++i) {for (int j = 0 ;j < 3 ;++j) {move[i * 3 + j] = move_mat_t (j, i) * ucell.lat0 ;// transpose back
96
+ }
97
+ }
94
98
}
95
99
96
100
if (ucell.lc [0 ] != 0 )
@@ -167,8 +171,9 @@ void Lattice_Change_Basic::check_converged(const UnitCell &ucell, ModuleBase::ma
167
171
{
168
172
for (int i = 0 ; i < 3 ; i++)
169
173
{
170
- if (stress_ii_max < std::abs (stress (i, i)))
174
+ if (stress_ii_max < std::abs (stress (i, i))) {
171
175
stress_ii_max = std::abs (stress (i, i));
176
+ }
172
177
for (int j = 0 ; j < 3 ; j++)
173
178
{
174
179
if (Lattice_Change_Basic::largest_grad < std::abs (stress (i, j)))
@@ -244,7 +249,7 @@ void Lattice_Change_Basic::check_converged(const UnitCell &ucell, ModuleBase::ma
244
249
return ;
245
250
}
246
251
247
- void Lattice_Change_Basic::terminate (void )
252
+ void Lattice_Change_Basic::terminate ()
248
253
{
249
254
ModuleBase::TITLE (" Lattice_Change_Basic" , " terminate" );
250
255
if (Lattice_Change_Basic::converged)
0 commit comments