Itasca C++ Interface
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
contactmodelthermal.h
1 #pragma once
2 // contactmodelthermal.h
3 
4 #include "contactmodel.h"
5 #include "contactmodel/interface/icontactmodelthermal.h"
6 
7 #pragma warning(push)
8 #pragma warning(disable:4251)
9 
10 namespace itascaxd
11 {
12  class IContactThermal;
13  class IContactMechanical;
14 }
15 
16 namespace cmodelsxd
17 {
18  using namespace itasca;
19  using namespace itascaxd;
20 
22  {
23  public:
24  ContactModelThermalState() : power_(0.0), length_(0.0),
25  end1Temperature_(0.0), end2Temperature_(0.0), tempInc_(0.0), gapInc_(0.0)
26  { };
27 
28  virtual ~ContactModelThermalState() { };
29 
30  virtual const IContactThermal *getThermalContact() const=0;
31  virtual const IContactMechanical *getMechanicalContact() const=0;
32  virtual const IProgram * getProgram() const=0;
33 
34  double power_; // current total power (from 1 to 2) at this contact (computed by the contact model)
35  double length_; // length of the pipe
36  double end1Temperature_; // temperature in reservoir 1
37  double end2Temperature_; // temperature in reservoir 2
38  double tempInc_; // temperature increment in contact
39  double gapInc_; // gap increment in contact since last coupling step
40  };
41 
42  class CONTACTMODEL_EXPORT ContactModelThermal : public IContactModelThermal
43  ,public ContactModel
44  {
45  public:
47  virtual ~ContactModelThermal();
48 
49  static const char * getPluginPrefix() { return "contactmodelthermal"; }
50  static const char * getPluginDirectory() { return "contactmodels/thermal"; }
51 
52  // IContactModelThermal functions.
53 
54  virtual IContactModel * getContactModel() {return this;}
55  virtual const IContactModel * getContactModel() const {return this;}
56 
57  // Returns true if the property was actually updated in the contact model.
58  virtual bool endPropertyUpdated(const QString &name,const IContactThermal *c)=0;
59 
60  // For the contact model state
61  virtual bool validate(ContactModelThermalState *state,const double &timestep)=0;
62  virtual bool checkActivity(ContactModelThermalState *d) const=0;
63 
64  // Returns Activity Distance (defaults to 0.0) -- distance between objects that contact is considered active.
65  virtual double getActivityDistance() const {return 0.0;}
66 
67  // Updates power from end1 to end2.
68  // Returns true if contact is active
69  virtual bool updatePower(ContactModelThermalState *state,const double &timestep)=0;
70 
71  // Returns timestep limits (defaults to (0.0,infinity))
72  // These are further timestep restrictions that the contact model can place on the simulation, over and above those implied by stiffness.
73  virtual DVect2 getTimestepLimits(ContactModelThermalState *,const double &) const { return DVect2(0.0,limits<double>::max());}
74 
75  // Returns the Resistance per unit length
76  virtual double getEffectiveResistance() const {return 0.0;}
77 
78  // For contact specific plotting
79  virtual void getSphereList(const IContact *con,std::vector<DVect> *pos,std::vector<double> *rad,std::vector<double> *val) { con; pos; rad; val; }
80 #ifdef THREED
81  virtual void getDiskList(const IContact *con,std::vector<DVect> *pos,std::vector<DVect> *normal,std::vector<double> *radius,std::vector<double> *val) { con; pos; normal; radius; val; }
82 #endif
83  virtual void getCylinderList(const IContact *con,std::vector<DVect> *bot,std::vector<DVect> *top,std::vector<double> *radlow,std::vector<double> *radhi,std::vector<double> *val) { con; bot; top; radlow; radhi; val; }
84 
85 
86  };
87 } // namespace cmodel
88 
89 #pragma warning(pop)
90 
91 
92 // EoF
ContactThermal class.
Definition: icontactthermal.h:37
Contact model class.
namespace Itasca
Definition: basememory.cpp:9
The ContactModelState class holds necessary information to communicate back and forth between the cod...
Definition: contactmodel.h:43
Definition: contactmodelthermal.h:42
debug checked shorthand for std::numeric_limits<T>::
Definition: limit.h:25
ContactMechanical class.
Definition: icontactmechanical.h:37
Itasca Library standard namespace, specific to 2D or 3D.
Definition: icontactmodule.h:4
Definition: contactmodelthermal.h:21
virtual IContactModel * getContactModel()
Return the IContactModel pointer.
Definition: contactmodelthermal.h:54
Contact class.
Definition: icontact.h:34
Contact model implementation.
Definition: contactmodel.h:74
The main program access point.
Definition: iprogram.h:37
virtual void getSphereList(const IContact *con, std::vector< DVect > *pos, std::vector< double > *rad, std::vector< double > *val)
For contact specific plotting.
Definition: contactmodelthermal.h:79
virtual const IContactModel * getContactModel() const
Return the const IContactModel pointer.
Definition: contactmodelthermal.h:55
virtual void getCylinderList(const IContact *con, std::vector< DVect > *bot, std::vector< DVect > *top, std::vector< double > *radlow, std::vector< double > *radhi, std::vector< double > *val)
For contact specific plotting.
Definition: contactmodelthermal.h:83