Skip to content

Commit

Permalink
another way of prepping the data
Browse files Browse the repository at this point in the history
  • Loading branch information
wbailey committed Aug 11, 2014
1 parent 6f0f7ab commit b185c4f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 9 additions & 3 deletions C/molecular_dynamics/runner.c
Expand Up @@ -3,16 +3,18 @@
#include "md_iterator.h"
#include "md_systemenergy.h"
#include "md.h"
#include "dbg.h"

int main(void) {
LennardJonesPotential *ljp = new_LennardJonesPotential(3.40, 0.997);
MD_BoxParameters *mdb = new_MD_BoxParameters(10, 10, 10, 2.0 * ljp->sigma, 2.0);
MD_RunParameters *mdp = new_MD_RunParameters(0.0, 0.01, 2000, 500, 500);
int collection_size = mdb->Nx * mdb->Ny * mdb->Nz;
ParticleCollection *particle = new_ParticleCollection(collection_size);
MD_RunParameters *mdp = new_MD_RunParameters(0.0, 0.01, 1000, 200, 500);
MD_Report *report = new_Report();
double box_length;

int collection_size = mdb->Nx * mdb->Ny * mdb->Nz;
ParticleCollection *particle = new_ParticleCollection(collection_size);

int report_interval = (mdp->iterations - mdp->equilibrium)/mdp->report_count;

box_length = initialize_Collection(particle, mdb);
Expand Down Expand Up @@ -45,6 +47,10 @@ int main(void) {
destroy_SystemEnergy(energy);
}

for (int i = 0; i < collection_size; i++) {
DEBUG_PRINT("%9.6f %9.6f %9.6f ", particle[i]->x, particle[i]->y, particle[i]->z);
}

destroy_Report(report);
destroy_MD_BoxParameters(mdb);
destroy_MD_RunParameters(mdp);
Expand Down
3 changes: 3 additions & 0 deletions C/molecular_dynamics/src/md_report.c
Expand Up @@ -20,10 +20,13 @@ void print_Report(MD_Report *report) {
printf("%9.6f ", report->pe);
printf("%9.6f ", report->ke);
printf("%9.6f ", report->te);
printf("%9.6f %9.6f %9.6f ", c[10]->x, c[10]->y, c[10]->z);

/*
for (int i = 0; i < report->collection_size; i++) {
printf("%9.6f %9.6f ", c[i]->x, c[i]->y);
}
*/

printf("\n");
fflush(stdout);
Expand Down

0 comments on commit b185c4f

Please sign in to comment.