1 /*
2  *_________________________________________________________________________*
3  *      POEMS: PARALLELIZABLE OPEN SOURCE EFFICIENT MULTIBODY SOFTWARE     *
4  *      DESCRIPTION: SEE READ-ME                                           *
5  *      FILE NAME: system.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 SYSTEM_H
20 #define SYSTEM_H
21 
22 
23 #include <iostream>
24 #include <fstream>
25 #include <string>
26 #include <stdio.h>
27 #include <iomanip>
28 
29 #include "poemslist.h"
30 #include "matrices.h"
31 #include "workspace.h"
32 #include "matrixfun.h"
33 #include "onsolver.h"
34 #include "system.h"
35 #include "inertialframe.h"
36 #include "rigidbody.h"
37 #include "revolutejoint.h"
38 #include "fixedpoint.h"
39 #include "freebodyjoint.h"
40 #include "sphericaljoint.h"
41 #include "body23joint.h"
42 #include "mixedjoint.h"
43 #include "eulerparameters.h"
44 #include "matrices.h"
45 #include "norm.h"
46 #include "sphericalFlexiblejoint.h"
47 
48 
49      class Body;
50      class Joint;
51 
52      class System{
53 	 private:
54 		int * mappings;
55 
56      public:
57        double time;
58        List<Body> bodies;
59        List<Joint> joints;
60 
61        System();
62        ~System();
63        void Delete();
64 
65        int GetNumBodies();
66 
67 	   int * GetMappings();
68 
69        void AddBody(Body* body);
70 
71        void AddJoint(Joint* joint);
72 
73        void SetTime(double t);
74 
75        double GetTime();
76 
77        void ComputeForces();
78 
79        bool ReadIn(std::istream& in);
80 
81        void WriteOut(std::ostream& out);
82 
83        void ClearBodyIDs();
84 
85        void ClearJointIDs();
86 
87        void Create_System_LAMMPS(int numbodies, double *mass,double **inertia, double ** xcm, double ** xjoint,double **vh1,double **omega,double **ex_space, double **ey_space, double **ez_space, int b, int * mapping, int count, int flag);
88 
89        void Create_DegenerateSystem(int& nfree, int*freelist, double *&masstotal, double **&inertia, double **&xcm, double **&vcm, double **&omega, double **&ex_space, double **&ey_space, double **&ez_space);
90 
91 };
92 
93 #endif
94