Skip to content

Commit fa4ae7a

Browse files
committed
add comments
1 parent bb5349b commit fa4ae7a

File tree

1 file changed

+48
-28
lines changed

1 file changed

+48
-28
lines changed

source/module_pw/pw_transform.cpp

Lines changed: 48 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
namespace ModulePW
1010
{
1111

12-
//
13-
//transform real space to reciprocal space
14-
//c(k,g)=\int dr*f(r)*exp(-ig*r)
15-
//c(k,g)=c_k(g)*exp(ik*r)
16-
//c_k(g)=\int dr*f(r)*exp(-i(g+k)*r)
17-
//Here we calculate c(k,g)
18-
//in: (nplane,nx,ny)
19-
//out: (nz, ns)
20-
//
12+
///
13+
/// transform real space to reciprocal space
14+
/// c(k,g)=\int dr*f(r)*exp(-ig*r)
15+
/// c(k,g)=c_k(g)*exp(ik*r)
16+
/// c_k(g)=\int dr*f(r)*exp(-i(g+k)*r)
17+
/// Here we calculate c(k,g)
18+
/// in: (nplane,ny,nx), complex<double> data
19+
/// out: (nz, ns), complex<double> data
20+
///
2121
void PW_Basis:: real2recip(std::complex<double> * in, std::complex<double> * out)
2222
{
2323
ModuleBase::timer::tick("PW_Basis", "real2recip");
@@ -41,11 +41,11 @@ void PW_Basis:: real2recip(std::complex<double> * in, std::complex<double> * out
4141
return;
4242
}
4343

44-
//
45-
//transform real space to reciprocal space
46-
//in: (nplane,nx,ny)
47-
//out: (nz, ns)
48-
//
44+
///
45+
/// transform real space to reciprocal space
46+
/// in: (nplane,ny,nx), double data
47+
/// out: (nz, ns), complex<double> data
48+
///
4949
void PW_Basis:: real2recip(double * in, std::complex<double> * out)
5050
{
5151
ModuleBase::timer::tick("PW_Basis", "real2recip_gamma_only");
@@ -78,15 +78,15 @@ void PW_Basis:: real2recip(double * in, std::complex<double> * out)
7878
return;
7979
}
8080

81-
//
82-
//transform real space to reciprocal space
83-
//f(r)=1/V * \sum_{g} c(k,g)*exp(ig*r)
84-
//c(k,g)=c_k(g)*exp(ik*r)
85-
//f(r)=1/V * \sum_{g} c_k(g)*exp(i(g+k)*r)
86-
//Here we use c(k,g)
87-
//in: (nz,ns)
88-
//out: (nplane, nx, ny)
89-
//
81+
///
82+
/// transform reciprocal space to real space
83+
/// f(r)=1/V * \sum_{g} c(k,g)*exp(ig*r)
84+
/// c(k,g)=c_k(g)*exp(ik*r)
85+
/// f(r)=1/V * \sum_{g} c_k(g)*exp(i(g+k)*r)
86+
/// Here we use c(k,g)
87+
/// in: (nz,ns), complex<double>
88+
/// out: (nplane, ny, nx), complex<double>
89+
///
9090
void PW_Basis:: recip2real(std::complex<double> * in, std::complex<double> * out)
9191
{
9292
ModuleBase::timer::tick("PW_Basis", "recip2real");
@@ -112,11 +112,11 @@ void PW_Basis:: recip2real(std::complex<double> * in, std::complex<double> * out
112112
return;
113113
}
114114

115-
//
116-
//transform real space to reciprocal space
117-
//in: (nz,ns)
118-
//out: (nplane, nx, ny)
119-
//
115+
///
116+
/// transform reciprocal space to real space
117+
/// in: (nz,ns), complex<double>
118+
/// out: (nplane, ny, nx), double
119+
///
120120
void PW_Basis:: recip2real(std::complex<double> * in, double * out)
121121
{
122122
ModuleBase::timer::tick("PW_Basis", "recip2real_gamma_only");
@@ -152,6 +152,11 @@ void PW_Basis:: recip2real(std::complex<double> * in, double * out)
152152
}
153153

154154
#ifdef __MIX_PRECISION
155+
///
156+
/// transform real space to reciprocal space
157+
/// in: (nplane,ny,nx), complex<float> data
158+
/// out: (nz, ns), complex<float> data
159+
///
155160
void PW_Basis:: real2recip(std::complex<float> * in, std::complex<float> * out)
156161
{
157162
assert(this->gamma_only == false);
@@ -172,6 +177,11 @@ void PW_Basis:: real2recip(std::complex<float> * in, std::complex<float> * out)
172177
return;
173178
}
174179

180+
///
181+
/// transform real space to reciprocal space
182+
/// in: (nplane,ny,nx), float data
183+
/// out: (nz, ns), complex<float> data
184+
///
175185
void PW_Basis:: real2recip(float * in, std::complex<float> * out)
176186
{
177187
assert(this->gamma_only == true);
@@ -197,6 +207,11 @@ void PW_Basis:: real2recip(float * in, std::complex<float> * out)
197207
return;
198208
}
199209

210+
///
211+
/// transform reciprocal space to real space
212+
/// in: (nz,ns), complex<float>
213+
/// out: (nplane, ny, nx), complex<float>
214+
///
200215
void PW_Basis:: recip2real(std::complex<float> * in, std::complex<float> * out)
201216
{
202217
assert(this->gamma_only == false);
@@ -220,6 +235,11 @@ void PW_Basis:: recip2real(std::complex<float> * in, std::complex<float> * out)
220235
return;
221236
}
222237

238+
///
239+
/// transform reciprocal space to real space
240+
/// in: (nz,ns), complex<float>
241+
/// out: (nplane, ny, nx), float
242+
///
223243
void PW_Basis:: recip2real(std::complex<float> * in, float * out)
224244
{
225245
assert(this->gamma_only == true);

0 commit comments

Comments
 (0)