BilinearCyclic.cpp

Go to the documentation of this file.
00001 #include "BilinearCyclic.h"
00002 #include <math.h>
00003 
00004 BilinearCyclic::BilinearCyclic(int tag, double weight)
00005 :CyclicModel(tag, -1), weightFactor(weight)
00006 {
00007 
00008 }
00009 
00010 
00011 BilinearCyclic::~BilinearCyclic()
00012 {
00013   // does nothing
00014 }
00015 
00016 
00017 CyclicModel *BilinearCyclic::getCopy()
00018 {
00019 CyclicModel *newModel = new BilinearCyclic(getTag(), weightFactor);     
00020         return newModel;
00021 }
00022 
00023 double BilinearCyclic::getTaskFactor()
00024 {
00025 double tfactor;
00026         // redundant - only for print
00027         if(d_curr >= 0 && !initYieldPos)
00028                 return 1.0;
00029         if(d_curr  < 0 && !initYieldNeg)
00030                 return 1.0;
00031         // end redundant
00032 
00033         if(yielding /* && fabs(d_curr) >= fabs(d_end) */)
00034 //              return resFactor; // will eventually unload
00035                 tfactor = cycFactor_hist;
00036     else
00037     {
00038         if(f_bgn*f_end < 0) // full-cycle
00039         {
00040                 if(contains(0.0, f_bgn, f_curr))
00041                         tfactor=resFactor;
00042                 else
00043                           {
00044                                   tfactor=rationalize(d_curr, f_curr, d_end, f_end); // actually with (x0, 0.0)
00045                                   tfactor = weightFactor*tfactor + (1 - weightFactor)*resFactor;
00046                           }
00047                                   
00048         }
00049         else // half-cycle
00050                  {
00051                          tfactor = rationalize(d_bgn, f_bgn, d_end, f_end);
00052                          tfactor = weightFactor*tfactor + (1 - weightFactor)*resFactor;
00053          }
00054     }
00055 
00056     // opserr << *this; opserr << "\a";
00057         // opserr << "tFactor = " << tfactor << endln;
00058         // if(yielding) {cout << "-yielding-" << endl;cin.get();}
00059 
00060         return tfactor;
00061 }
00062 
00063 void BilinearCyclic::Print (OPS_Stream &s, int flag)
00064 {
00065         this->CyclicModel::Print (s, flag);
00066         s << "+BilinearCyclic\n";
00067         //s << "   taskFactor = " << getTaskFactor() << endln;
00068         s << "----------------------------------------"
00069       << "----------------------------------------"
00070           << endln;
00071 }
00072 
00073 
00074 

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