NeoPZ
TPZThermoForceA.h
Go to the documentation of this file.
1 // $Id: TPZThermoForceA.h,v 1.9 2010-05-24 02:56:18 erick Exp $
2 
3 #ifndef TPZTHERMOFORCEA_H
4 #define TPZTHERMOFORCEA_H
5 
6 #include "pzvec.h"
7 #include "pzreal.h"
8 #include "TPZStream.h"
9 #include "TPZSavable.h"
10 
15 class TPZThermoForceA : public TPZSavable {
16 public:
17 
19  {
20  }
21 
22  public:
23 int ClassId() const override;
24 
25 
26  const char * Name() const
27  {
28  return "TPZThermoForceA";
29  }
30 
31  void Print(std::ostream & out) const
32  {
33  out << Name();
34  out << "\n fSigmaYield0 = " << fSigmaYield0;
35  out << "\n fK = " << fK;
36  }
37 
38  void SetUp(REAL yield, REAL k)
39  {
40  fSigmaYield0 = yield;
41  fK = k;
42  }
43 
47  template <class T>
48  T Compute(const T & alpha) const;
49 
53  template <class T>
54  T ComputeTangent(const T & alpha) const;
55 
56  void Write(TPZStream &buf, int withclassid) const override{
57  buf.Write(&fSigmaYield0);
58  buf.Write(&fK);
59  }
60 
61  void Read(TPZStream& buf, void* context) override {
62  buf.Read(&fSigmaYield0);
63  buf.Read(&fK);
64  }
65 
66 public:
67 
75  REAL fK;
76 };
77 
78 template < class T >
79 T TPZThermoForceA::Compute(const T & alpha) const
80 {
81  //coesao * exp^(-alpha/kc)^(p)
82  // T val = T(fSigmaYield0)*(exp(alpha/T(0.1))*exp(alpha/T(0.1)));
83  // T val2 = val;
84  // return val2;
85 // T var = T(fK) * alpha;
86 // return T(fSigmaYield0) + var;
87  return T(fSigmaYield0) + T(fK) * alpha;
88 }
89 
90 template < class T >
91 T TPZThermoForceA::ComputeTangent(const T & alpha) const
92 {
93  return fK;
94 }
95 
96 #endif //TPZTHERMOFORCEA_H
void Read(TPZStream &buf, void *context) override
read objects from the stream
Contains declaration of the TPZSavable class which defines the interface to save and restore objects ...
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
int ClassId() const override
Define the class id associated with the class.
Templated vector implementation.
T ComputeTangent(const T &alpha) const
void Print(std::ostream &out) const
virtual void Write(const bool val)
Definition: TPZStream.cpp:8
void SetUp(REAL yield, REAL k)
T Compute(const T &alpha) const
const char * Name() const
Contains declaration of the abstract TPZStream class. TPZStream defines the interface for saving and ...
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
This class defines the interface to save and restore objects from TPZStream objects. Persistency.
Definition: TPZSavable.h:67
virtual void Read(bool &val)
Definition: TPZStream.cpp:91