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
b65e2c0d
Commit
b65e2c0d
authored
Aug 13, 2018
by
Francois Gygi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test_vext.C to generate test potentials
parent
4a9ee3eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
2 deletions
+66
-2
Makefile
src/Makefile
+5
-2
test_vext.C
src/test_vext.C
+61
-0
No files found.
src/Makefile
View file @
b65e2c0d
...
...
@@ -136,6 +136,9 @@ CXXFLAGS += -DTARGET='"$(TARGET)"'
testFunction3d
:
testFunction3d.o Function3d.o Function3dHandler.o
\
Base64Transcoder.o qbox_xmlns.o $(PLTOBJECTS)
$(LD)
$(DFLAGS)
-o
$@
$^
$(LDFLAGS)
test_vext
:
test_vext.o Function3d.o Function3dHandler.o
\
Base64Transcoder.o qbox_xmlns.o $(PLTOBJECTS)
$(LD)
$(DFLAGS)
-o
$@
$^
$(LDFLAGS)
#------------------------------------------------------------------------------
# generate dependencies in makefile: use -Y to avoid library header files
# that are likely to be different on other platforms.
...
...
@@ -579,8 +582,7 @@ ResponseCmd.o: blacs.h D3vector.h Wavefunction.h UnitCell.h SlaterDet.h
ResponseCmd.o
:
Basis.h Sample.h AtomSet.h Atom.h D3tensor.h blas.h
ResponseCmd.o
:
ConstraintSet.h ExtForceSet.h Control.h ChargeDensity.h
ResponseCmd.o
:
ExternalPotential.h FourierTransform.h ResponseCmd.h
ResponseCmd.o
:
UserInterface.h release.h isodate.h Species.h
ResponseCmd.o
:
Base64Transcoder.h qbox_xmlns.h
ResponseCmd.o
:
UserInterface.h release.h isodate.h Species.h Function3d.h
ResponseCmd.o
:
UserInterface.h
RseedCmd.o
:
UserInterface.h Sample.h AtomSet.h Context.h blacs.h Atom.h
RseedCmd.o
:
D3vector.h UnitCell.h D3tensor.h blas.h ConstraintSet.h
...
...
@@ -820,6 +822,7 @@ testWavefunction.o: SlaterDet.h Basis.h Matrix.h Timer.h
testXCFunctional.o
:
LDAFunctional.h XCFunctional.h PBEFunctional.h Timer.h
testXMLGFPreprocessor.o
:
Context.h blacs.h Matrix.h XMLGFPreprocessor.h
test_fftw.o
:
Timer.h readTSC.h
test_vext.o
:
Function3d.h D3vector.h
testjacobi.o
:
Timer.h Context.h blacs.h Matrix.h jacobi.h
testjade.o
:
Timer.h Context.h blacs.h Matrix.h jade.h
uuid_str.o
:
uuid_str.h
src/test_vext.C
0 → 100644
View file @
b65e2c0d
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2018 The Regents of the University of California
//
// This file is part of Qbox
//
// Qbox is distributed under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 2 of
// the License, or (at your option) any later version.
// See the file COPYING in the root directory of this distribution
// or <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////////////
//
// test_vext.C:
//
// Generate an external potential in XML format for input to the response
// command.
// vext = sine wave in the x direction
// use: test_vext a b c np0 np1 np2
//
////////////////////////////////////////////////////////////////////////////////
#include "Function3d.h"
#include<cassert>
#include<vector>
#include<string>
using
namespace
std
;
////////////////////////////////////////////////////////////////////////////////
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
==
1
)
{
cerr
<<
"use: test_vext a b c np0 np1 np2"
<<
endl
;
return
1
;
}
double
a
=
atof
(
argv
[
1
]);
double
b
=
atof
(
argv
[
2
]);
double
c
=
atof
(
argv
[
3
]);
Function3d
f
;
f
.
a
=
D3vector
(
a
,
0
,
0
);
f
.
b
=
D3vector
(
0
,
b
,
0
);
f
.
c
=
D3vector
(
0
,
0
,
c
);
f
.
nx
=
atoi
(
argv
[
4
]);
f
.
ny
=
atoi
(
argv
[
5
]);
f
.
nz
=
atoi
(
argv
[
6
]);
f
.
val
.
resize
(
f
.
nx
*
f
.
ny
*
f
.
nz
);
f
.
name
=
"delta_v"
;
for
(
int
i
=
0
;
i
<
f
.
nx
;
i
++
)
for
(
int
j
=
0
;
j
<
f
.
ny
;
j
++
)
for
(
int
k
=
0
;
k
<
f
.
nz
;
k
++
)
{
double
x
=
(
a
*
i
)
/
f
.
nx
;
double
y
=
(
b
*
j
)
/
f
.
ny
;
double
z
=
(
c
*
k
)
/
f
.
nz
;
f
.
val
[
i
+
f
.
nx
*
(
j
+
f
.
ny
*
k
)]
=
sin
(
2
*
M_PI
*
x
/
a
);
}
cout
<<
f
;
return
0
;
}
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