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