From 01a6a0297b2bbeeef60dfdc0b8ef076f06297bba Mon Sep 17 00:00:00 2001 From: Esteban Meneses Date: Mon, 21 Apr 2008 21:57:20 +0000 Subject: [PATCH] *** empty log message *** --- examples/charm++/Molecular/main.h | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 examples/charm++/Molecular/main.h 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; + } + +}; -- 2.33.0