Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

NDMaterial.cpp

Go to the documentation of this file.
00001 /* ****************************************************************** **
00002 **    OpenSees - Open System for Earthquake Engineering Simulation    **
00003 **          Pacific Earthquake Engineering Research Center            **
00004 **                                                                    **
00005 **                                                                    **
00006 ** (C) Copyright 1999, The Regents of the University of California    **
00007 ** All Rights Reserved.                                               **
00008 **                                                                    **
00009 ** Commercial use of this program without express permission of the   **
00010 ** University of California, Berkeley, is strictly prohibited.  See   **
00011 ** file 'COPYRIGHT'  in main directory for information on usage and   **
00012 ** redistribution,  and for a DISCLAIMER OF ALL WARRANTIES.           **
00013 **                                                                    **
00014 ** Developed by:                                                      **
00015 **   Frank McKenna (fmckenna@ce.berkeley.edu)                         **
00016 **   Gregory L. Fenves (fenves@ce.berkeley.edu)                       **
00017 **   Filip C. Filippou (filippou@ce.berkeley.edu)                     **
00018 **                                                                    **
00019 ** ****************************************************************** */
00020                                                                         
00021 // $Revision: 1.6 $                                                              
00022 // $Date: 2001/01/23 08:47:09 $                                                                  
00023 // $Source: /usr/local/cvs/OpenSees/SRC/material/nD/NDMaterial.cpp,v $                                                                
00024                                                                         
00025 // File: ~/material/NDMaterial.C
00026 //
00027 // Written: MHS 
00028 // Created: Feb 2000
00029 // Revision: A
00030 //
00031 // Description: This file contains the class implementation for NDMaterial.
00032 //
00033 // What: "@(#) NDMaterial.C, revA"
00034 
00035 #include <NDMaterial.h>
00036 #include <Information.h>
00037 #include <G3Globals.h>
00038 #include <Matrix.h>
00039 #include <Vector.h>
00040 #include <stresst.h>
00041 #include <MaterialResponse.h>
00042 
00043 Matrix NDMaterial::errMatrix(1,1);
00044 Vector NDMaterial::errVector(1);
00045 Tensor NDMaterial::errTensor(2, def_dim_2, 0.0 );
00046 stresstensor NDMaterial::errstresstensor;
00047 
00048 NDMaterial::NDMaterial(int tag, int classTag)
00049 :Material(tag,classTag)
00050 {
00051 
00052 }
00053 
00054 NDMaterial::NDMaterial()
00055 :Material(0, 0)
00056 {
00057 
00058 }
00059 
00060 NDMaterial::~NDMaterial()
00061 {
00062 
00063 }
00064 
00065 
00066 double
00067 NDMaterial::getRho(void)
00068 {
00069   return 0.0;
00070 }
00071 
00072 const Vector &
00073 NDMaterial::getCommittedStress(void) 
00074 {
00075   return this->getStress();
00076 }
00077 
00078 const Vector &
00079 NDMaterial::getCommittedStrain(void) 
00080 {
00081   return this->getStrain();
00082 }
00083 
00084 // methods to set and retrieve state.
00085 int 
00086 NDMaterial::setTrialStrain(const Vector &v)
00087 {
00088    g3ErrorHandler->fatal("NDMaterial::setTrialStrain -- subclass responsibility");
00089    return 0;    
00090 }
00091 
00092 int 
00093 NDMaterial::setTrialStrain(const Vector &v, const Vector &r)
00094 {
00095    g3ErrorHandler->fatal("NDMaterial::setTrialStrain -- subclass responsibility");
00096    return 0;    
00097 }
00098 
00099 int 
00100 NDMaterial::setTrialStrainIncr(const Vector &v)
00101 {
00102    g3ErrorHandler->fatal("NDMaterial::setTrialStrainIncr -- subclass responsibility");
00103    return 0;    
00104 }
00105 
00106 int 
00107 NDMaterial::setTrialStrainIncr(const Vector &v, const Vector &r)
00108 {
00109    g3ErrorHandler->fatal("NDMaterial::setTrialStrainIncr -- subclass responsibility");
00110    return 0;    
00111 }
00112 
00113 const Matrix &
00114 NDMaterial::getTangent(void)
00115 {
00116    g3ErrorHandler->fatal("NDMaterial::getTangent -- subclass responsibility");
00117    return errMatrix;    
00118 }
00119 
00120 const Vector &
00121 NDMaterial::getStress(void)
00122 {
00123    g3ErrorHandler->fatal("NDMaterial::getStress -- subclass responsibility");
00124    return errVector;    
00125 }
00126 
00127 const Vector &
00128 NDMaterial::getStrain(void)
00129 {
00130    g3ErrorHandler->fatal("NDMaterial::getStrain -- subclass responsibility");
00131    return errVector;    
00132 }
00133 
00134 int 
00135 NDMaterial::setTrialStrain(const Tensor &v)
00136 {
00137    g3ErrorHandler->fatal("NDMaterial::setTrialStrainIncr -- subclass responsibility");
00138    return 0;    
00139 }
00140 
00141 int 
00142 NDMaterial::setTrialStrain(const Tensor &v, const Tensor &r)    
00143 {
00144    g3ErrorHandler->fatal("NDMaterial::setTrialStrainIncr -- subclass responsibility");
00145    return 0;    
00146 }
00147 
00148 int 
00149 NDMaterial::setTrialStrainIncr(const Tensor &v)
00150 {
00151    g3ErrorHandler->fatal("NDMaterial::setTrialStrainIncr -- subclass responsibility");
00152    return 0;    
00153 }
00154 
00155 int 
00156 NDMaterial::setTrialStrainIncr(const Tensor &v, const Tensor &r)
00157 {
00158    g3ErrorHandler->fatal("NDMaterial::setTrialStrainIncr -- subclass responsibility");
00159    return 0;    
00160 }
00161 
00162 const Tensor &
00163 NDMaterial::getTangentTensor(void)
00164 {
00165    g3ErrorHandler->fatal("NDMaterial::getTangentTensor -- subclass responsibility");
00166    return errTensor;    
00167 }
00168 
00169 const stresstensor NDMaterial::getStressTensor(void)
00170 {
00171    g3ErrorHandler->fatal("NDMaterial::getStressTensor -- subclass responsibility");
00172    return errstresstensor;    
00173 }
00174 
00175 const Tensor &
00176 NDMaterial::getStrainTensor(void)
00177 {
00178    g3ErrorHandler->fatal("NDMaterial::getStrainTensor -- subclass responsibility");
00179    return errTensor;    
00180 }
00181 
00182 Response*
00183 NDMaterial::setResponse (char **argv, int argc, Information &matInfo)
00184 {
00185     if (strcmp(argv[0],"stress") == 0 || strcmp(argv[0],"stresses") == 0)
00186   return new MaterialResponse(this, 1, this->getStress());
00187 
00188     else if (strcmp(argv[0],"strain") == 0 || strcmp(argv[0],"strains") == 0)
00189   return new MaterialResponse(this, 2, this->getStrain());
00190     
00191  else if (strcmp(argv[0],"tangent") == 0)
00192   return new MaterialResponse(this, 3, this->getTangent());
00193     
00194  else
00195   return 0;
00196 }
00197 
00198 int 
00199 NDMaterial::getResponse (int responseID, Information &matInfo)
00200 {
00201  switch (responseID) {
00202   case 1:
00203    return matInfo.setVector(this->getStress());
00204 
00205   case 2:
00206    return matInfo.setVector(this->getStrain());
00207 
00208   case 3:
00209    return matInfo.setMatrix(this->getTangent());
00210    
00211   default:
00212    return -1;
00213  }
00214 }
Copyright Contact Us