1 /* 2 *_________________________________________________________________________* 3 * POEMS: PARALLELIZABLE OPEN SOURCE EFFICIENT MULTIBODY SOFTWARE * 4 * DESCRIPTION: SEE READ-ME * 5 * FILE NAME: body.h * 6 * AUTHORS: See Author List * 7 * GRANTS: See Grants List * 8 * COPYRIGHT: (C) 2005 by Authors as listed in Author's List * 9 * LICENSE: Please see License Agreement * 10 * DOWNLOAD: Free at www.rpi.edu/~anderk5 * 11 * ADMINISTRATOR: Prof. Kurt Anderson * 12 * Computational Dynamics Lab * 13 * Rensselaer Polytechnic Institute * 14 * 110 8th St. Troy NY 12180 * 15 * CONTACT: anderk5@rpi.edu * 16 *_________________________________________________________________________*/ 17 18 19 #ifndef BODY_H 20 #define BODY_H 21 22 #include "poemslist.h" 23 #include <iostream> 24 #include "poemsobject.h" 25 26 #include "matrices.h" 27 28 29 30 // emumerated type 31 enum BodyType { 32 INERTIALFRAME = 0, 33 PARTICLE = 1, 34 RIGIDBODY = 2 35 }; 36 37 class Point; 38 class Joint; 39 class CompBody; 40 41 class Body : public POEMSObject { 42 public: 43 double mass; 44 Mat3x3 inertia; 45 46 Vect3 r; 47 Vect3 v; 48 Vect3 v_k; 49 Vect3 a; 50 Vect3 a_t; 51 Mat3x3 n_C_k; 52 Vect3 omega; 53 Vect3 omega_k; 54 Vect3 alpha; 55 Vect3 alpha_t; 56 double KE; 57 58 59 List<Joint> joints; 60 List<Point> points; 61 62 Body(); 63 64 bool ReadIn(std::istream& in); 65 void WriteOut(std::ostream& out); 66 bool ReadInPoints(std::istream& in); 67 void WriteOutPoints(std::ostream& out); 68 Point* GetPoint(int p); 69 void AddJoint(Joint* joint); 70 void AddPoint(Point* point); 71 72 virtual bool ReadInBodyData(std::istream& in) = 0; 73 virtual void WriteOutBodyData(std::ostream& out) = 0; 74 virtual ~Body(); 75 virtual BodyType GetType() = 0; 76 }; 77 78 // global body functions 79 Body* NewBody(int type); 80 81 #endif 82