From: Esteban Meneses Date: Mon, 21 Apr 2008 21:57:20 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: charm6_0~110 X-Git-Url: https://charm.cs.illinois.edu/gerrit/gitweb?p=charm.git;a=commitdiff_plain;h=01a6a0297b2bbeeef60dfdc0b8ef076f06297bba *** empty log message *** --- diff --git a/examples/charm++/Molecular/main.h b/examples/charm++/Molecular/main.h new file mode 100644 index 0000000000..395c8ad412 --- /dev/null +++ b/examples/charm++/Molecular/main.h @@ -0,0 +1,45 @@ +/* + University of Illinois at Urbana-Champaign + Department of Computer Science + Parallel Programming Lab + 2008 + Authors: Kumaresh Pattabiraman and Esteban Meneses +*/ + +#include "charm++.h" +#include "time.h" + +#define DEFAULT_MASS 1 + +// Class for keeping track of the properties for a particle +class Particle{ + public: + double mass; // mass of the particle + double x; // position in x axis + double y; // position in y axis + double fx; // total forces on x axis + double fy; // total forces on y axis + double ax; // acceleration on x axis + double ay; // acceleration on y axis + double vx; // velocity on x axis + double vy; // velocity on y axis + + // Default constructor + Particle(){ + fx = fy = 0.0; + } + + // Function for pupping properties + void pup(PUP::er &p) { + p | mass; + p | x; + p | y; + p | fx; + p | fy; + p | ax; + p | ay; + p | vx; + p | vy; + } + +};