HG-MD
1
|
00001 00002 enum CG {HeavisideSphere, Gaussian, polynomial}; 00003 00004 template <StatType T> 00005 class StatisticsVector; 00006 00007 template <StatType T> 00008 struct StatisticsPoint; 00009 00010 template <StatType T> 00011 std::ostream& operator<<(std::ostream& os, const StatisticsPoint<T> &stat); 00012 00014 template <StatType T> 00015 struct StatisticsPoint { 00016 public: 00017 00018 //Constructors and Destructors 00019 00021 StatisticsPoint() { 00022 this->Position.set_zero(); 00023 mirrorParticle=-1; 00024 //~ this->set_zero(); 00025 } 00026 00028 StatisticsPoint(const StatisticsPoint &other) {*this = other; mirrorParticle=-1;} 00029 00030 //set and get access functions 00032 static void set_gb(StatisticsVector<T>* new_gb) {gb = new_gb;} 00034 void set_CG_type(const char* CG_type) {this->gb->set_CG_type(CG_type);} 00036 CG get_CG_type() const {return this->gb->get_CG_type();} 00038 00039 void set_w2(Mdouble new_) {this->gb->set_w2(new_);} 00041 Mdouble get_w2() const {return this->gb->get_w2();} 00043 Mdouble get_w() const {return this->gb->get_w();} 00045 Mdouble get_cutoff() {return this->gb->get_cutoff();} 00047 Mdouble get_cutoff2() {return this->gb->get_cutoff2();} 00049 Mdouble get_xmaxStat() {return this->gb->get_xmaxStat();} 00051 Mdouble get_ymaxStat() {return this->gb->get_ymaxStat();} 00053 Mdouble get_zmaxStat() {return this->gb->get_zmaxStat();} 00055 Mdouble get_xminStat() {return this->gb->get_xminStat();} 00057 Mdouble get_yminStat() {return this->gb->get_yminStat();} 00059 Mdouble get_zminStat() {return this->gb->get_zminStat();} 00061 void get_n(int& nx_, int& ny_, int& nz_) {this->gb->get_n(nx_,ny_,nz_);} 00063 Mdouble evaluatePolynomial(Mdouble r) {return gb->evaluatePolynomial(r);} 00065 Mdouble evaluateIntegral(Mdouble n1, Mdouble n2, Mdouble t) {return gb->evaluateIntegral(n1,n2,t);} 00066 00068 void set_CG_invvolume(); 00070 Mdouble get_CG_invvolume() {return this->CG_invvolume;} 00072 void set_Gaussian_invvolume(int dim); 00074 void set_Heaviside_invvolume(); 00075 00077 void set_Polynomial_invvolume(int dim); 00078 00080 void set_Position(Vec3D new_) {this->Position = new_;} 00082 Vec3D get_Position() const {return this->Position;} 00083 00085 friend std::ostream& operator<< <T>(std::ostream& os, const StatisticsPoint<T> &stat); 00086 00088 void set_zero(); 00089 00091 StatisticsPoint<T> getSquared(); 00092 00094 inline StatisticsPoint<T>& operator=(const StatisticsPoint<T> &P); 00095 00097 inline StatisticsPoint<T>& operator+=(const StatisticsPoint<T> &P); 00098 00100 inline StatisticsPoint<T>& operator-=(const StatisticsPoint<T> &P); 00101 00103 inline StatisticsPoint<T>& operator/=(const Mdouble a); 00104 00106 inline void timeAverage(const int n); 00107 00109 Mdouble get_distance2(Vec3D &P); 00110 00112 Mdouble dot(Vec3D &P, Vec3D &Q); 00113 00115 Mdouble CG_function(Vec3D &PI); 00116 00119 Mdouble CG_function_2D(Vec3D &PI); 00120 00123 Mdouble CG_function_1D(Vec3D &PI); 00124 00127 Vec3D CG_gradient(Vec3D &P, Mdouble phi); 00128 00131 Vec3D CG_integral_gradient(Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal); 00132 00134 Mdouble CG_integral(Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance); 00135 00138 Mdouble CG_integral_2D(Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance); 00139 Mdouble CG_integral_3D(Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance); 00140 00141 00144 Mdouble CG_integral_1D(Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance); 00145 00146 00148 string print() const; 00150 string print_sqrt() const; 00152 string write_variable_names(); 00154 string write() const; 00155 00156 00157 public: 00158 //Values of macroscopical fields at Position 00160 Mdouble Nu; 00162 Mdouble Density; 00164 Vec3D Momentum; 00166 Vec3D DisplacementMomentum; 00168 MatrixSymmetric3D Displacement; 00170 MatrixSymmetric3D MomentumFlux; 00172 MatrixSymmetric3D DisplacementMomentumFlux; 00174 Vec3D EnergyFlux; 00176 Matrix3D NormalStress; 00178 Matrix3D TangentialStress; 00180 Vec3D NormalTraction; 00182 Vec3D TangentialTraction; 00184 MatrixSymmetric3D Fabric; 00187 Vec3D CollisionalHeatFlux; 00190 Mdouble Dissipation; 00193 Mdouble Potential; 00194 00196 Mdouble CG_invvolume; 00197 00199 int mirrorParticle; 00200 00201 private: 00203 static StatisticsVector<T>* gb; 00205 Vec3D Position; 00206 00207 }; 00208