MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
prismj.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/prismj.h,v 1.29 2017/01/12 14:46:43 masarati Exp $ */
2 /*
3  * MBDyn (C) is a multibody analysis code.
4  * http://www.mbdyn.org
5  *
6  * Copyright (C) 1996-2017
7  *
8  * Pierangelo Masarati <masarati@aero.polimi.it>
9  * Paolo Mantegazza <mantegazza@aero.polimi.it>
10  *
11  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
12  * via La Masa, 34 - 20156 Milano, Italy
13  * http://www.aero.polimi.it
14  *
15  * Changing this copyright notice is forbidden.
16  *
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation (version 2 of the License).
20  *
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */
31 
32 /* Giunti prismatici */
33 
34 #ifndef PRISMJ_H
35 #define PRISMJ_H
36 
37 #include "joint.h"
38 #include "drive.h"
39 
40 /* PrismaticJoint - begin */
41 
42 class PrismaticJoint : virtual public Elem, public Joint {
43  private:
44  /* Giunto prismatico - vincola due corpi alla traslazione
45  * l'uno rispetto all'altro. Il sistema di riferimento del prisma e' dato
46  * rispetto a quelli dei nodi associati ai corpi.
47  * In particolare rispetto al nodo 1 la trasformazione dal sistema
48  * di riferimento del prisma al sistema globale e': R1*R1h, mentre per
49  * il nodo 2 la medesima trasformazion e': R2*R2h.
50  * Il vettore M esprie le reazioni vincolari di coppia. */
56 
57  public:
58  /* Costruttore non banale */
59  PrismaticJoint(unsigned int uL, const DofOwner* pDO,
60  const StructNode* pN1, const StructNode* pN2,
61  const Mat3x3& R1hTmp, const Mat3x3& R2hTmp, flag fOut);
62 
63  /* Distruttore */
64  ~PrismaticJoint(void);
65 
66  /* Contributo al file di restart */
67  virtual std::ostream& Restart(std::ostream& out) const;
68 
69  /* Tipo di Joint */
70  virtual Joint::Type GetJointType(void) const {
71  return Joint::PRISMATIC;
72  };
73 
74  virtual unsigned int iGetNumDof(void) const {
75  return 3;
76  };
77 
78  DofOrder::Order GetDofType(unsigned int i) const {
79  ASSERT(i >= 0 && i < 5);
80  return DofOrder::ALGEBRAIC;
81  };
82 
83  DofOrder::Order GetEqType(unsigned int i) const;
84 
85  void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const {
86  *piNumRows = 9;
87  *piNumCols = 9;
88  };
89 
90 
92  doublereal dCoef,
93  const VectorHandler& XCurr,
94  const VectorHandler& XPrimeCurr);
96  doublereal dCoef,
97  const VectorHandler& XCurr,
98  const VectorHandler& XPrimeCurr);
99 
100  void OutputPrepare(OutputHandler &OH);
101  void Output(OutputHandler& OH) const;
102 
103  void SetValue(DataManager *pDM,
105  SimulationEntity::Hints *ph = 0);
106 
107  virtual Hint *
108  ParseHint(DataManager *pDM, const char *s) const;
109 
110  /* funzioni usate nell'assemblaggio iniziale */
111 
112  virtual unsigned int iGetInitialNumDof(void) const {
113  return 6;
114  };
115  virtual void InitialWorkSpaceDim(integer* piNumRows,
116  integer* piNumCols) const {
117  *piNumRows = 18;
118  *piNumCols = 18;
119  };
120 
121  /* Contributo allo jacobiano durante l'assemblaggio iniziale */
123  const VectorHandler& XCurr);
124 
125  /* Contributo al residuo durante l'assemblaggio iniziale */
127  const VectorHandler& XCurr);
128 
129 #ifdef DEBUG
130  virtual const char* sClassName(void) const {
131  return "PrismaticJoint";
132  };
133 #endif
134 
135 
136  /* *******PER IL SOLUTORE PARALLELO******** */
137  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
138  utile per l'assemblaggio della matrice di connessione fra i dofs */
139  virtual void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
140  connectedNodes.resize(2);
141  connectedNodes[0] = pNode1;
142  connectedNodes[1] = pNode2;
143  };
144  /* ************************************************ */
145 };
146 
147 /* PrismaticJoint - end */
148 
149 #endif
Definition: hint.h:38
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: prismj.cc:92
Type
Definition: joint.h:66
virtual unsigned int iGetInitialNumDof(void) const
Definition: prismj.h:112
long int flag
Definition: mbdyn.h:43
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: prismj.h:85
PrismaticJoint(unsigned int uL, const DofOwner *pDO, const StructNode *pN1, const StructNode *pN2, const Mat3x3 &R1hTmp, const Mat3x3 &R2hTmp, flag fOut)
Definition: prismj.cc:43
Definition: matvec3.h:98
const StructNode * pNode1
Definition: prismj.h:51
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: prismj.h:139
DofOrder::Order GetDofType(unsigned int i) const
Definition: prismj.h:78
SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: prismj.cc:535
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: prismj.h:115
virtual Joint::Type GetJointType(void) const
Definition: prismj.h:70
Mat3x3 R2h
Definition: prismj.h:54
std::vector< Hint * > Hints
Definition: simentity.h:89
void Output(OutputHandler &OH) const
Definition: prismj.cc:275
virtual std::ostream & Restart(std::ostream &out) const
Definition: prismj.cc:76
virtual unsigned int iGetNumDof(void) const
Definition: prismj.h:74
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: prismj.cc:202
~PrismaticJoint(void)
Definition: prismj.cc:60
#define ASSERT(expression)
Definition: colamd.c:977
virtual Hint * ParseHint(DataManager *pDM, const char *s) const
Definition: prismj.cc:324
VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: prismj.cc:347
void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
Definition: prismj.cc:298
Definition: elem.h:75
Mat3x3 R1h
Definition: prismj.h:53
DofOrder::Order GetEqType(unsigned int i) const
Definition: prismj.cc:67
Definition: joint.h:50
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
const StructNode * pNode2
Definition: prismj.h:52
void OutputPrepare(OutputHandler &OH)
Definition: prismj.cc:262