MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
thermalcapacitance.cc
Go to the documentation of this file.
1 
2 #include "mbconfig.h" /* This goes first in every *.c,*.cc file */
3 #include "thermalcapacitance.h"
4 
6  const DofOwner* pDO,
7  const ThermalNode* p1,
8  doublereal c, flag fOut) :
9 Elem(uL, fOut),
10 Thermal(uL, pDO, fOut),
11 pNode1(p1),
12 thermalcapacitance(c) {
13  NO_OP;
14 };
15 
17 
18 /* Tipo di elemento idraulico (usato solo per debug ecc.) */
20  return THERMALCAPACITANCE;
21 };
22 
23 void ThermalCapacitance::WorkSpaceDim(integer* piNumRows, integer* piNumCols) const {
24  *piNumRows = 1;
25  *piNumCols = 1;
26 };
27 
28 
30  doublereal dCoef,
31  const VectorHandler& XCurr,
32  const VectorHandler& XPrimeCurr) {
33  /* Setta la sottomatrice come piena (e' un po' dispersivo, ma lo jacobiano
34  * e' complicato */
35  FullSubMatrixHandler& WM = WorkMat.SetFull();
36 
37  /* Ridimensiona la sottomatrice in base alle esigenze */
38  integer iNumRows = 0;
39  integer iNumCols = 0;
40 
41  WorkSpaceDim(&iNumRows, &iNumCols);
42  WM.ResizeReset(iNumRows, iNumCols);
43 
44  integer iNode1RowIndex = pNode1->iGetFirstRowIndex() + 1;
45  integer iNode1ColIndex = pNode1->iGetFirstColIndex() + 1;
46 
47  WM.PutRowIndex(1, iNode1RowIndex);
48  WM.PutColIndex(1, iNode1ColIndex);
49 
50  WM.IncCoef(1, 1, thermalcapacitance);
51  return WorkMat;
52 };
53 
55  doublereal dCoef,
56  const VectorHandler& XCurr,
57  const VectorHandler& XPrimeCurr) {
58  integer iNumRows = 0;
59  integer iNumCols = 0;
60  WorkSpaceDim(&iNumRows, &iNumCols);
61  WorkVec.ResizeReset(iNumRows);
62 
63  /* Indici */
64  integer iNode1RowIndex = pNode1->iGetFirstRowIndex() + 1;
65 
66  WorkVec.PutRowIndex(1, iNode1RowIndex);
67 
68  double tp = pNode1->dGetXPrime();
69  WorkVec.IncCoef(1, -thermalcapacitance * tp);
70 
71  return WorkVec;
72 };
73 
74 // virtual void AfterConvergence(const VectorHandler& X,
75 // const VectorHandler& XP);
76 // virtual void Output(OutputHandler& OH) const;
77 //
78 // virtual void SetValue(DataManager *pDM,
79 // VectorHandler& X, VectorHandler& XP,
80 // SimulationEntity::Hints *ph = 0);
81 //
82 // /* *******PER IL SOLUTORE PARALLELO******** */
83 // /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
84 // utile per l'assemblaggio della matrice di connessione fra i dofs */
85 void ThermalCapacitance::GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
86  connectedNodes.resize(1);
87  connectedNodes[0] = pNode1;
88 };
89 // /* ************************************************ */
90 // };
91 
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
const ThermalNode * pNode1
long int flag
Definition: mbdyn.h:43
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
ThermalCapacitance(unsigned int uL, const DofOwner *pDO, const ThermalNode *p1, doublereal c, flag fOut)
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const doublereal & dGetXPrime(void) const
Definition: node.h:393
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
virtual void IncCoef(integer iRow, const doublereal &dCoef)=0
Definition: therm.h:40
#define NO_OP
Definition: myassert.h:74
void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:683
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
Type
Definition: therm.h:43
virtual integer iGetFirstRowIndex(void) const
Definition: node.cc:82
doublereal thermalcapacitance
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
static std::stack< cleanup * > c
Definition: cleanup.cc:59
Definition: elem.h:75
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
virtual Thermal::Type GetThermalType(void) const
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
virtual integer iGetFirstColIndex(void) const
Definition: node.cc:88