Isotropic_Elastic.cpp

Go to the documentation of this file.
00001 
00002 //   COPYLEFT (C): Woody's viral GPL-like license (by BJ):
00003 //                 ``This    source  code is Copyrighted in
00004 //                 U.S.,  for  an  indefinite  period,  and anybody
00005 //                 caught  using it without our permission, will be
00006 //                 mighty good friends of ourn, cause we don't give
00007 //                 a  darn.  Hack it. Compile it. Debug it. Run it.
00008 //                 Yodel  it.  Enjoy it. We wrote it, that's all we
00009 //                 wanted to do.''
00010 //
00011 //
00012 // COPYRIGHT (C):     :-))
00013 // PROJECT:           Object Oriented Finite Element Program
00014 // FILE:              
00015 // CLASS:             
00016 // MEMBER FUNCTIONS:
00017 //
00018 // MEMBER VARIABLES
00019 //
00020 // PURPOSE:           
00021 //
00022 // RETURN:
00023 // VERSION:
00024 // LANGUAGE:          C++
00025 // TARGET OS:         
00026 // DESIGNER:          Zhao Cheng, Boris Jeremic
00027 // PROGRAMMER:        Zhao Cheng, 
00028 // DATE:              Fall 2005
00029 // UPDATE HISTORY:    
00030 //
00032 //
00033 
00034 #ifndef Isotropic_Elastic_CPP
00035 #define Isotropic_Elastic_CPP
00036 
00037 #include "Isotropic_Elastic.h"
00038 
00039 Isotropic_Elastic::Isotropic_Elastic(int E_in,
00040                                int v_in,
00041                                const stresstensor& initialStress, 
00042                                const straintensor& initialStrain)
00043 : ElasticState(initialStress, initialStrain),
00044   E_index(E_in),
00045   v_index(v_in)
00046 {
00047 
00048 }
00049 
00050 // Create a new 
00051 ElasticState* Isotropic_Elastic::newObj() 
00052 {
00053     ElasticState *Els = new  Isotropic_Elastic(this->E_index, 
00054                                                this->v_index,
00055                                                this->Stress,
00056                                                this->Strain);
00057     return Els;
00058 }
00059 
00060 // Get Stiffness Tensor
00061 const BJtensor& Isotropic_Elastic::getElasticStiffness(const MaterialParameter &MaterialParameter_in) const
00062 {
00063     // Kronecker delta tensor
00064     BJtensor I2("I", 2, def_dim_2);
00065 
00066     BJtensor I_ijkl = I2("ij")*I2("kl");
00067     I_ijkl.null_indices();
00068     BJtensor I_ikjl = I_ijkl.transpose0110();
00069     BJtensor I_iljk = I_ijkl.transpose0111();
00070     BJtensor I4s = (I_ikjl+I_iljk)*0.5;
00071     
00072     double E = getE(MaterialParameter_in);
00073     double v = getv(MaterialParameter_in);
00074     
00075     if (E< 0.0 || v < -1.0 || v >= 0.5) {
00076       opserr << "Isotropic_Elastic: Invalid Input. " << endln;
00077       exit (1);
00078     }
00079         
00080     // Building elasticity tensor
00081     ElasticState::ElasticStiffness = I_ijkl*( E*v / ( (1.0+v)*(1.0 - 2.0*v) ) ) + I4s*( E / (1.0 + v) );
00082 
00083     return ElasticState::ElasticStiffness;
00084 }
00085 
00086 // Get Young's modulus
00087 double Isotropic_Elastic::getE(const MaterialParameter &MaterialParameter_in) const
00088 {
00089     if ( E_index > MaterialParameter_in.getNum_Material_Parameter() || E_index < 1) {
00090       opserr << "Isotropic_Elastic: Invalid Input. " << endln;
00091       exit (1);
00092     }
00093     else    
00094       return MaterialParameter_in.getMaterial_Parameter(E_index - 1);
00095 }
00096 
00097 
00098 // Get Poisson's ratio
00099 double Isotropic_Elastic::getv(const MaterialParameter &MaterialParameter_in) const
00100 {
00101     if ( v_index > MaterialParameter_in.getNum_Material_Parameter() || v_index  < 1) { 
00102       opserr << "Isotropic_Elastic: Invalid Input. " << endln;
00103       exit (1);
00104     }
00105     else
00106       return MaterialParameter_in.getMaterial_Parameter(v_index - 1);  
00107 }
00108 
00109 #endif
00110 

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