Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
qbox-public
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
qbox
qbox-public
Commits
58547ce8
Commit
58547ce8
authored
Aug 08, 2018
by
Francois Gygi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add basis_fits_in_grid function
parent
e66b7c0d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
0 deletions
+14
-0
Basis.C
src/Basis.C
+8
-0
Basis.h
src/Basis.h
+1
-0
FourierTransform.C
src/FourierTransform.C
+4
-0
FourierTransform.h
src/FourierTransform.h
+1
-0
No files found.
src/Basis.C
View file @
58547ce8
...
...
@@ -136,6 +136,14 @@ bool Basis::factorizable(int n) const
int
Basis
::
np
(
int
i
)
const
{
return
np_
[
i
];
}
////////////////////////////////////////////////////////////////////////////////
bool
Basis
::
fits_in_grid
(
int
np0
,
int
np1
,
int
np2
)
const
{
return
(
idxmax_
[
0
]
<
np0
/
2
)
&&
(
idxmin_
[
0
]
>=
-
np0
/
2
)
&&
(
idxmax_
[
1
]
<
np1
/
2
)
&&
(
idxmin_
[
1
]
>=
-
np1
/
2
)
&&
(
idxmax_
[
2
]
<
np2
/
2
)
&&
(
idxmin_
[
2
]
>=
-
np2
/
2
);
}
////////////////////////////////////////////////////////////////////////////////
const
D3vector
Basis
::
kpoint
(
void
)
const
{
return
kpoint_
;
}
////////////////////////////////////////////////////////////////////////////////
...
...
src/Basis.h
View file @
58547ce8
...
...
@@ -80,6 +80,7 @@ class Basis
const
UnitCell
&
refcell
()
const
;
// reference cell dimensions
const
D3vector
kpoint
()
const
;
// k-point in units of b0,b1,b2
int
np
(
int
i
)
const
;
// good size of FFT grid in direction i
bool
fits_in_grid
(
int
np0
,
int
np1
,
int
np2
)
const
;
bool
factorizable
(
int
n
)
const
;
// check if n is factorizable with low factors
int
idxmin
(
int
i
)
const
;
// smallest index in direction i
int
idxmax
(
int
i
)
const
;
// largest index in direction i
...
...
src/FourierTransform.C
View file @
58547ce8
...
...
@@ -248,6 +248,10 @@ FourierTransform::FourierTransform (const Basis &basis,
rdispl
[
iproc
]
=
rdispl
[
iproc
-
1
]
+
rcounts
[
iproc
-
1
];
}
// check if the basis_ fits in the grid np0, np1, np2
basis_fits_in_grid_
=
basis_
.
fits_in_grid
(
np0
,
np1
,
np2
);
assert
(
basis_fits_in_grid_
);
if
(
basis_
.
real
()
)
{
// compute index arrays ifftp_ and ifftm_ for mapping vector->zvec
...
...
src/FourierTransform.h
View file @
58547ce8
...
...
@@ -65,6 +65,7 @@ class FourierTransform
int
ntrans0_
,
ntrans1_
,
ntrans2_
;
int
nvec_
;
bool
basis_fits_in_grid_
;
std
::
vector
<
int
>
np2_loc_
;
// np2_loc_[iproc], iproc=0, nprocs_-1
std
::
vector
<
int
>
np2_first_
;
// np2_first_[iproc], iproc=0, nprocs_-1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment