-
Notifications
You must be signed in to change notification settings - Fork 12
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
Create a DPDintegrator class #35
Open
PabloPalaciosAlonso
wants to merge
16
commits into
RaulPPelaez:v2.x
Choose a base branch
from
PabloPalaciosAlonso:v2.x
base: v2.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
14c1be0
Create a DPD integrator
PabloPalaciosAlonso 2de0490
Replace ForceTransverser by Transverser
PabloPalaciosAlonso d073192
Add DPD integrator
PabloPalaciosAlonso 69ebe00
Add test for DPDinteractor
PabloPalaciosAlonso 2a70823
Update CMakeLists.txt
PabloPalaciosAlonso d427159
Add authorship and brief description to Integrator/DPD.cuh
PabloPalaciosAlonso f394f04
Ad CMakeLists.txt to DPD
PabloPalaciosAlonso ed45f8b
Update examples to use the DPDIntegrator module
PabloPalaciosAlonso 4959123
Use box as parameter instead of boxSize
PabloPalaciosAlonso 46e26ae
Small change in test
PabloPalaciosAlonso 09957f0
Test ci.yml
PabloPalaciosAlonso e5cde4b
Test ci.yml
PabloPalaciosAlonso 694c136
Test ci.yml
PabloPalaciosAlonso 8b3ffe9
Test ci.yml
PabloPalaciosAlonso c19b632
Merge branch 'RaulPPelaez:v2.x' into v2.x
PabloPalaciosAlonso e10d165
Create a SPHIntegrator that combines the VerletNVE integrator with th…
PabloPalaciosAlonso 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#pragma once | ||
|
||
#include "Integrator/VerletNVE.cuh" | ||
#include "Interactor/PairForces.cuh" | ||
#include "Interactor/Potential/DPD.cuh" | ||
|
||
namespace uammd{ | ||
class DPDIntegrator: public Integrator{ | ||
std::shared_ptr<VerletNVE> verlet; | ||
int steps; | ||
public: | ||
struct Parameters{ | ||
//VerletNVE | ||
real energy = 0; //Target energy, ignored if initVelocities is false | ||
real dt = 0; | ||
bool is2D = false; | ||
bool initVelocities = false; | ||
|
||
//DPD | ||
real cutOff; | ||
real gamma; | ||
real A; | ||
real temperature; | ||
real3 L; | ||
}; | ||
|
||
DPDIntegrator(shared_ptr<ParticleGroup> pg, Parameters par): | ||
Integrator(pg, "DPDIntgrator"), | ||
steps(0){ | ||
//Initialize verletNVE | ||
VerletNVE::Parameters verletpar; | ||
verletpar.energy = par.energy; | ||
verletpar.dt = par.dt; | ||
verletpar.is2D = par.is2D; | ||
verletpar.initVelocities = par.initVelocities; //=false? | ||
|
||
verlet = std::make_shared<VerletNVE>(pg, verletpar); | ||
|
||
//Initialize DPD and add to interactor list. | ||
Potential::DPD::Parameters dpdPar; | ||
dpdPar.temperature = par.temperature; | ||
dpdPar.cutOff = par.cutOff; | ||
dpdPar.gamma = par.gamma; | ||
dpdPar.A = par.A; | ||
dpdPar.dt = par.dt; | ||
auto dpd = std::make_shared<Potential::DPD>(dpdPar); | ||
using PF = PairForces<Potential::DPD>; | ||
typename PF::Parameters pfpar; | ||
pfpar.box = Box(par.L); | ||
//From the example in PairForces | ||
auto dpd_interactor = std::make_shared<PF>(pg, pfpar, dpd); | ||
verlet->addInteractor(dpd_interactor); | ||
} | ||
|
||
DPDIntegrator(shared_ptr<ParticleData> pd, Parameters par): | ||
DPDIntegrator(std::make_shared<ParticleGroup>(pd, "All"), par){} | ||
|
||
~DPDIntegrator(){} | ||
|
||
virtual void forwardTime() override { | ||
steps++; | ||
if (steps == 1){ | ||
for(auto forceComp: interactors){ | ||
verlet->addInteractor(forceComp); | ||
} | ||
} | ||
verlet->forwardTime(); | ||
} | ||
|
||
virtual real sumEnergy() override { | ||
return verlet->sumEnergy(); | ||
} | ||
|
||
}; | ||
} |
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.
Add attribution, etc.