forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test the correctness of the modified MD module #4248
Closed
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b363591
Update msst.cpp
Zjhjunhao f8ff07f
Update msst.cpp
Zjhjunhao 1e16f5b
Update msst.cpp
Zjhjunhao 56bb36d
Update msst.cpp
Zjhjunhao a1f9520
Update msst.cpp
Zjhjunhao fefb361
Update msst.cpp
Zjhjunhao ed9ddde
Update verlet.h
Zjhjunhao 685e343
Update md_base.h
Zjhjunhao 0976a8c
Update run_md.h
Zjhjunhao 84dc795
Update verlet.h
Zjhjunhao 074bcf5
Update verlet.h
Zjhjunhao aa0433e
Update verlet.cpp
Zjhjunhao 8fc018c
Update md_base.cpp
Zjhjunhao d4347af
Update verlet.h
Zjhjunhao fa00ca2
Update verlet.cpp
Zjhjunhao 3e30092
Update verlet.cpp
Zjhjunhao 9b86e07
Update verlet.h
Zjhjunhao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,21 +75,7 @@ void Verlet::apply_thermostat(void) | |
{ | ||
if (mdp.my_rank == 0) | ||
{ | ||
double deviation; | ||
for (int i = 0; i < ucell.nat; ++i) | ||
{ | ||
if (static_cast<double>(std::rand()) / RAND_MAX <= 1.0 / mdp.md_nraise) | ||
{ | ||
deviation = sqrt(mdp.md_tlast / allmass[i]); | ||
for (int k = 0; k < 3; ++k) | ||
{ | ||
if (ionmbl[i][k]) | ||
{ | ||
vel[i][k] = deviation * MD_func::gaussrand(); | ||
} | ||
} | ||
} | ||
} | ||
anderson_set_vel(); | ||
} | ||
#ifdef __MPI | ||
MPI_Bcast(vel, ucell.nat * 3, MPI_DOUBLE, 0, MPI_COMM_WORLD); | ||
|
@@ -145,3 +131,23 @@ void Verlet::restart(const std::string& global_readin_dir) | |
MD_base::restart(global_readin_dir); | ||
return; | ||
} | ||
|
||
void Verlet::anderson_set_vel(void) | ||
{ | ||
double deviation; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. initialize the variable |
||
for (int i = 0; i < ucell.nat; ++i) | ||
{ | ||
if (static_cast<double>(std::rand()) / RAND_MAX <= 1.0 / mdp.md_nraise) | ||
{ | ||
deviation = sqrt(mdp.md_tlast / allmass[i]); | ||
for (int k = 0; k < 3; ++k) | ||
{ | ||
if (ionmbl[i][k]) | ||
{ | ||
vel[i][k] = deviation * MD_func::gaussrand(); | ||
} | ||
} | ||
} | ||
} | ||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a better way to write "MPI" and "not MPI" codes?