MatPoint3D.cpp

Go to the documentation of this file.
00001 //=============================================================================
00002 //
00003 // COPYRIGHT (C):     :-))
00004 // PROJECT:           Object Oriented Finite Element Program
00005 // FILE:              MatPoint3D.cpp
00006 // CLASS:             MatPoint3D
00007 // MEMBER FUNCTIONS:
00008 //
00009 // MEMBER VARIABLES
00010 //
00011 // PURPOSE:           Material Point
00012 // RETURN:
00013 // VERSION:
00014 // LANGUAGE:          C++.ver >= 3.0 (Borland.C++.ver=3.1||SUN.C++.ver=3.0.1)
00015 // TARGET OS:         DOS || UNIX || . . .
00016 // DESIGNER:          Boris Jeremic
00017 // PROGRAMMER:        Boris Jeremic
00018 // DATE:              17 October 1994.
00019 // UPDATE HISTORY:
00020 //
00021 //
00022 //#                    Aug 2000 porting to OpenSees                            #
00023 //
00024 //=============================================================================
00025 //
00026 #ifndef MATPOINT3D_CPP
00027 #define MATPOINT3D_CPP
00028 
00029 #include "MatPoint3D.h"
00030 
00031 //=============================================================================
00032 // Constructor
00033 MatPoint3D::MatPoint3D(short int INr_direction_point_number,
00034                        short int INs_direction_point_number,
00035                        short int INt_direction_point_number,
00036                        double r_coord,
00037                        double s_coord,
00038                        double t_coord,
00039                        double r_weight,
00040                        double s_weight,
00041                        double t_weight,
00042                        NDMaterial * p_INmatmodel
00043                        //stresstensor * p_INstress,
00044                        //stresstensor * p_INiterative_stress,
00045                        //double         IN_q_ast_iterative,
00046                        //straintensor * p_INstrain,
00047                        //tensor * p_Tangent_E_tensor,
00048                       )
00049   {
00050     r_direction_point_number = INr_direction_point_number;
00051     s_direction_point_number = INs_direction_point_number;
00052     t_direction_point_number = INt_direction_point_number;
00053     r = r_coord;
00054     s = s_coord;
00055     t = t_coord;
00056     rw = r_weight;
00057     sw = s_weight;
00058     tw = t_weight;
00059 
00060     //if ( eps ) {
00061     //    gpEPS = eps->newObj();  // Elasto-plastic 3D
00062     //}
00063     //else 
00064     //    gpEPS = 0;
00065     
00066     if (p_INmatmodel)
00067         matmodel = p_INmatmodel->getCopy();
00068     else 
00069         matmodel = 0;           
00070 
00071     //p_stress   = p_INstress; 
00072     //p_iterative_stress   = p_INiterative_stress;
00073     //q_ast_iterative      = IN_q_ast_iterative;
00074     //p_strain   = p_INstrain;
00075     //TangentE   = p_Tangent_E_tensor;
00076 
00077   }
00078 
00080 MatPoint3D::~MatPoint3D() 
00081 {
00082     if ( matmodel )
00083       //delete [] matmodel; //bug found: Inconsistent delete
00084       delete matmodel;
00085 
00086     //if ( GP )
00087     //  delete [] GP;
00088 
00089 }
00090 
00092 //MatPoint3D::MatPoint3D(EPState *eps) {
00093 //
00094 //    this->r_direction_point_number = 0;
00095 //    this->s_direction_point_number = 0;
00096 //    this->t_direction_point_number = 0;
00097 //    this->r = 0;
00098 //    this->s = 0;
00099 //    this->t = 0;
00100 //    this->rw = 0;
00101 //    this->sw = 0;
00102 //    this->tw = 0;
00103 //           
00104 //    if ( eps ) 
00105 //        gpEPS = eps->newObj();      
00106 //    else
00107 //        //gpEPS = new EPState();  //otherwise use default EPState __Zhaohui 09-30-2000
00108 //        gpEPS = 0;  //otherwise use default EPState __Zhaohui 09-30-2000
00109 //    
00110 //}
00111 
00112 //=============================================================================
00113 void MatPoint3D::Initialize( short int INr_direction_point_number,
00114                              short int INs_direction_point_number,
00115                              short int INt_direction_point_number,
00116                              double r_coord,
00117                              double s_coord,
00118                              double t_coord,
00119                              double r_weight,
00120                              double s_weight,
00121                              double t_weight,
00122                              //EPState *EPS,
00123                              //stresstensor * p_INstress,
00124                              //stresstensor * p_INiterative_stress,
00125                              //double         IN_q_ast_iterative,
00126                              //straintensor * p_INstrain,
00127                              //tensor *       p_Tangent_E_tensor,
00128                              NDMaterial * p_INmmodel
00129                            )
00130   {
00131     this->r_direction_point_number = INr_direction_point_number;
00132     this->s_direction_point_number = INs_direction_point_number;
00133     this->t_direction_point_number = INt_direction_point_number;
00134 
00135     this->r = r_coord;
00136     this->s = s_coord;
00137     this->t = t_coord;
00138     this->rw = r_weight;
00139     this->sw = s_weight;
00140     this->tw = t_weight;
00141 
00142     //if (EPS)
00143     //   this->gpEPS = EPS->newObj();
00144     //else 
00145     //   this->gpEPS = 0;
00146 
00147     if ( p_INmmodel )
00148        this->matmodel = p_INmmodel;
00149     else 
00150        this->matmodel = 0;
00151 
00152     //this->p_stress   = p_INstress;
00153     //this->p_iterative_stress   = p_INiterative_stress;
00154     //q_ast_iterative       = IN_q_ast_iterative;
00155     //this->p_strain   = p_INstrain;
00156     //this->TangentE   = p_Tangent_E_tensor;
00157   }
00158 
00159 
00160 //=============================================================================
00161 //return MatPoint
00162 MatPoint3D * MatPoint3D::GP(void) 
00163      {
00164        return this;
00165      }
00166 
00167 //=============================================================================
00168 short int MatPoint3D::GP_number_r(void) const {
00169     return r_direction_point_number; 
00170 }
00171 
00172 
00173 //=============================================================================
00174 short int MatPoint3D::GP_number_s(void) const { 
00175     return s_direction_point_number; 
00176 }
00177 
00178 //=============================================================================
00179 short int MatPoint3D::GP_number_t(void) const {
00180     return t_direction_point_number; 
00181 }
00182 
00183 //=============================================================================
00184 double MatPoint3D::r_coordinate() const {
00185     return r; 
00186 }
00187 
00188 //=============================================================================
00189 double MatPoint3D::s_coordinate() const {
00190     return s; 
00191 }
00192 
00193 //=============================================================================
00194 double MatPoint3D::t_coordinate() const {
00195     return t; 
00196 }
00197 
00198 //=============================================================================
00199 double MatPoint3D::r_weight() const {
00200     return rw; 
00201 }
00202 
00203 //=============================================================================
00204 double MatPoint3D::s_weight() const {
00205     return sw; 
00206 }
00207 
00208 //=============================================================================
00209 double MatPoint3D::t_weight() const {
00210     return tw; 
00211 }
00212 
00214 //void MatPoint3D::setEPS(EPState *eps) {
00215 //
00216 //    if ( eps ) 
00217 //        gpEPS = eps->newObj();  
00218 //    else 
00219 //        gpEPS = 0;
00220 //      //g3ErrorHandler->warning("MatPoint3D::setEPS  No initial values for EPState, using default");
00221 //
00222 //}
00223 
00224 
00226 //EPState* MatPoint3D::getEPS() const {
00227 //
00228 //    return gpEPS;
00229 //}
00230 //
00231 
00232 
00233 //=============================================================================
00234 NDMaterial* MatPoint3D::getNDMat() const {
00235 
00236     return matmodel;
00237 }
00238 
00239 //=============================================================================
00240 double MatPoint3D::getrho() const 
00241 {
00242     return matmodel->getRho(); 
00243 }
00244 
00245 const char* MatPoint3D::getType (void) const
00246 {
00247         return matmodel->getType();
00248 }
00249 
00250 int MatPoint3D::getTag (void) const
00251 {
00252         return matmodel->getTag();
00253 }
00254 
00255 //=============================================================================
00256 const stresstensor MatPoint3D::getStressTensor() const {
00257 
00258     return matmodel->getStressTensor();
00259 }
00260 
00261 
00262 //=============================================================================
00263 const straintensor MatPoint3D::getStrainTensor() const {
00264 
00265     return matmodel->getStrainTensor();
00266 }
00267 
00268 //=============================================================================
00269 const straintensor MatPoint3D::getPlasticStrainTensor() const {
00270 
00271     return matmodel->getPlasticStrainTensor();
00272 }
00273 
00275 //double MatPoint3D::getpsi() const 
00276 //{
00277 //    return matmodel->getpsi();
00278 //}
00279 
00280 
00281 //================================================================================
00282 int MatPoint3D::commitState(void)
00283 {
00284         int err;
00285         err = matmodel->commitState();
00286         return err;
00287 }
00288 
00289 //================================================================================
00290 int MatPoint3D::revertToLastCommit(void)
00291 {
00292         int err;
00293         err = matmodel->revertToLastCommit();
00294         return err;
00295 }
00296 
00297 //================================================================================
00298 int MatPoint3D::revertToStart(void)
00299 {
00300         int err;
00301         err = matmodel->revertToStart();
00302         return err;
00303 }
00304 
00305 //=============================================================================
00306 void MatPoint3D::report(char *msg) const
00307   {
00308     //if ( msg ) ::printf("%s",msg);
00309     if ( msg )  opserr << msg;
00310     
00311     ::printf("\n\n\n---------------------------------------------------- \n");
00312     ::printf("Gauss point #r %d #s %d  #t %d \n",
00313                                  GP_number_r(), GP_number_s(), GP_number_t());
00314 
00315     ::printf("\tr->%.8e   s->%.8e   t->%.8e  \n",
00316      r_coordinate(),s_coordinate(),t_coordinate());
00317 
00318     ::printf("\tr_weight->%.8e   s_weight->%.8e   t_weight->%.8e  \n",
00319      r_weight(),s_weight(),t_weight());
00320 
00321 
00322     if ( matmodel ) 
00323       {
00324         opserr << (*matmodel);
00325 
00326         stresstensor tmpstress = matmodel->getStressTensor();
00327         tmpstress.report("stress at this Gauss-Legendre point\n");
00328 
00329         straintensor tmpstrain = matmodel->getStrainTensor();
00330         tmpstrain.report("strain at this Gauss-Legendre point\n");
00331       }
00332     else
00333       opserr << "Empty Material Model\n"; 
00334 
00335     //p_stress->report("stress at this Gauss-Legendre point\n");
00336     //p_iterative_stress->reportshortpqtheta("ITERATIVE stress at this Gauss-Legendre point\n");
00337     //::printf("ITERATIVE q_ast_iterative = %.8e  \n",q_ast_iterative);
00338     //p_strain->report("strain at this Gauss-Legendre point\n");
00339     //matmodel->report("material model at this Gauss-Legendre point\n");
00340     
00341     //if (gpEPS) 
00342     //  opserr << (*gpEPS);
00343     //else
00344     //  opserr << "Empty EPState\n"; 
00345     
00346   }
00347 
00348 //=============================================================================
00349 void MatPoint3D::reportpqtheta(char *msg) const
00350   {
00351     //if ( msg ) ::printf("%s",msg);
00352     //p_stress->reportshortpqtheta("");
00353     //p_stress->reportshortpqtheta("");
00354     if ( msg )  opserr << msg;
00355     
00356     //if ( gpEPS ) {
00357     //   ( gpEPS->getStress() ).reportshortpqtheta("");
00358     //   ( gpEPS->getStress() ).reportSHORTs1s2s3("");
00359     //}
00360    
00361     if ( matmodel ) {
00362        stresstensor tmp = matmodel->getStressTensor();
00363        tmp.reportshortpqtheta("");
00364        tmp.reportSHORTs1s2s3("");
00365     }
00366 
00367   }
00368 
00369 //=============================================================================
00370 void MatPoint3D::reportTensor(char *msg) const
00371   {
00372     //if ( msg ) ::printf("%s",msg);
00373     //p_stress->reportTensor("");
00374 
00375     if ( msg )  opserr << msg;
00376     
00377     //if (gpEPS )
00378     //   ( gpEPS->getStress() ).reportTensor("");
00379 
00380     if ( matmodel ) {
00381        stresstensor tmp = matmodel->getStressTensor();
00382        tmp.reportTensor("");
00383     }
00384 
00385   }
00386 
00387 
00388 #endif
00389 
00390 
00391 
00392 

Generated on Mon Oct 23 15:05:16 2006 for OpenSees by doxygen 1.5.0