MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
modalforce.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/modalforce.h,v 1.14 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) 2007-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 /* Forza */
33 
34 #ifndef MODALFORCE_H
35 #define MODALFORCE_H
36 
37 #include <vector>
38 #include <string>
39 #include "extforce.h"
40 #include "modal.h"
41 
42 /* ModalForce - begin */
43 
44 class ModalForce : virtual public Elem, public Force {
45 protected:
46  const Modal *pModal;
47  std::vector<unsigned int> modeList;
48  std::vector<DriveCaller *> f;
49  const Mat3xN *Mt;
50  const Mat3xN *Mr;
51  Vec3 F, M;
52 
53 public:
54  /* Costruttore */
55  ModalForce(unsigned int uL,
56  const Modal *pmodal,
57  const std::vector<unsigned int>& modeList,
58  std::vector<DriveCaller *>& f,
59  const Mat3xN *Mt,
60  const Mat3xN *Mr,
61  flag fOut);
62 
63  virtual ~ModalForce(void);
64 
65  /* Tipo di forza */
66  virtual Force::Type GetForceType(void) const {
67  return Force::MODALFORCE;
68  };
69 
70  void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const {
71  *piNumRows = (pModal->pGetModalNode() ? 6 : 0) + modeList.size();
72  *piNumCols = 1;
73  };
74 
76  doublereal dCoef,
77  const VectorHandler& XCurr,
78  const VectorHandler& XPrimeCurr);
79 
80  virtual void Output(OutputHandler& OH) const;
81 
82  virtual void InitialWorkSpaceDim(integer* piNumRows, integer* piNumCols) const {
83  *piNumRows = 0;
84  *piNumCols = 0;
85  };
86 
87  /* Contributo allo jacobiano durante l'assemblaggio iniziale */
88  virtual VariableSubMatrixHandler&
90  const VectorHandler& XCurr)
91  {
92  WorkMat.SetNullMatrix();
93  return WorkMat;
94  };
95 
96  /* Contributo al residuo durante l'assemblaggio iniziale */
97  virtual SubVectorHandler&
99  const VectorHandler& XCurr)
100  {
101  WorkVec.ResizeReset(0);
102  return WorkVec;
103  };
104 
105  /* *******PER IL SOLUTORE PARALLELO******** */
106  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
107  * utile per l'assemblaggio della matrice di connessione fra i dofs */
108  virtual void
109  GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
110  if (pModal->pGetModalNode()) {
111  connectedNodes.resize(1);
112  connectedNodes[0] = pModal->pGetModalNode();
113  } else {
114  connectedNodes.resize(0);
115  }
116  };
117  /* ************************************************ */
118 };
119 
120 /* ModalForce - end */
121 
122 class DataManager;
123 class MBDynParser;
124 
126  MBDynParser& HP,
127  unsigned int uLabel);
128 
129 #endif /* MODALFORCE_H */
130 
const ModalNode * pGetModalNode(void) const
Definition: modal.h:395
long int flag
Definition: mbdyn.h:43
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
Type
Definition: force.h:50
std::vector< unsigned int > modeList
Definition: modalforce.h:47
const Modal * pModal
Definition: modalforce.h:46
Elem * ReadModalForce(DataManager *pDM, MBDynParser &HP, unsigned int uLabel)
Definition: modalforce.cc:145
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: modalforce.h:82
Definition: force.h:46
virtual Force::Type GetForceType(void) const
Definition: modalforce.h:66
const Mat3xN * Mt
Definition: modalforce.h:49
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: modalforce.h:98
Definition: modal.h:74
virtual void Output(OutputHandler &OH) const
Definition: modalforce.cc:126
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: modalforce.h:89
DataManager * pDM
Definition: mbpar.h:252
void SetNullMatrix(void)
Definition: submat.h:1159
std::vector< DriveCaller * > f
Definition: modalforce.h:48
const Mat3xN * Mr
Definition: modalforce.h:50
virtual ~ModalForce(void)
Definition: modalforce.cc:63
Definition: elem.h:75
ModalForce(unsigned int uL, const Modal *pmodal, const std::vector< unsigned int > &modeList, std::vector< DriveCaller * > &f, const Mat3xN *Mt, const Mat3xN *Mr, flag fOut)
Definition: modalforce.cc:43
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: modalforce.h:70
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: modalforce.cc:81
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: modalforce.h:109