MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
bufferstream_out_elem.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/base/bufferstream_out_elem.h,v 1.5 2017/01/12 14:46:09 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 /*
33  * Author: Michele Attolico <attolico@aero.polimi.it>
34  */
35 
36 #ifndef BUFFERSTREAM_OUT_ELEM_H
37 #define BUFFERSTREAM_OUT_ELEM_H
38 
39 #include "streamoutelem.h"
40 
41 /* BufferStreamElem_base - begin */
42 
43 class BufferStreamElem_base : public StreamOutElem, virtual public Elem {
44 protected:
47 
48 public:
49  BufferStreamElem_base(unsigned int uL, unsigned int oe,
51 
52  virtual ~BufferStreamElem_base(void);
53 
54  const integer GetBufSize(void) const;
55  virtual const doublereal * GetBufRaw(void) const = 0;
56 
57  virtual void SetValue(DataManager *pDM,
59  SimulationEntity::Hints *ph = 0);
60  virtual void AfterConvergence(const VectorHandler& X,
61  const VectorHandler& XP);
62 
63  /* Inverse Dynamics */
64  virtual void AfterConvergence(const VectorHandler& X,
65  const VectorHandler& XP, const VectorHandler& XPP);
66 };
67 
68 /* BufferStreamElem_base - end */
69 
70 /* BufferStreamElem - begin */
71 
72 class BufferStreamElem : public BufferStreamElem_base, virtual public Elem {
73 protected:
74  std::vector<doublereal> buffer;
75 
76 public:
77  BufferStreamElem(unsigned int uL, unsigned int oe,
79 
80  virtual ~BufferStreamElem(void);
81 
82  virtual const doublereal * GetBufRaw(void) const;
83  const std::vector<doublereal>& GetBuf(void) const;
84 
85  virtual std::ostream& Restart(std::ostream& out) const;
86 };
87 
88 /* BufferStreamElem - end */
89 
90 /* BufferStreamElemRaw - begin */
91 
92 class BufferStreamElemRaw : public BufferStreamElem_base, virtual public Elem {
93 protected:
96 
97 public:
98  BufferStreamElemRaw(unsigned int uL, unsigned int oe,
100  bool bOwnsMemory);
101 
102  virtual ~BufferStreamElemRaw(void);
103 
104  bool bOwnsMemory(void) const;
105  virtual void SetBufRaw(integer n, const doublereal *p);
106  virtual const doublereal * GetBufRaw(void) const;
107 
108  virtual std::ostream& Restart(std::ostream& out) const;
109 };
110 
111 /* BufferStreamElem - end */
112 
113 class DataManager;
114 class MBDynParser;
115 
116 extern Elem *
118  unsigned int uLabel, StreamContent::Type type);
119 
120 /* BufferStreamElem - end */
121 
122 #endif /* BUFFERSTREAM_OUT_ELEM_H */
123 
virtual const doublereal * GetBufRaw(void) const
virtual void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
BufferStreamElemRaw(unsigned int uL, unsigned int oe, StreamContent *pSC, StreamOutEcho *pSOE, bool bOwnsMemory)
std::vector< doublereal > buffer
const integer GetBufSize(void) const
std::vector< Hint * > Hints
Definition: simentity.h:89
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
virtual const doublereal * GetBufRaw(void) const
DataManager * pDM
Definition: mbpar.h:252
virtual std::ostream & Restart(std::ostream &out) const
bool bOwnsMemory(void) const
Elem * ReadBufferStreamElem(DataManager *pDM, MBDynParser &HP, unsigned int uLabel, StreamContent::Type type)
virtual ~BufferStreamElemRaw(void)
virtual ~BufferStreamElem(void)
virtual std::ostream & Restart(std::ostream &out) const
virtual const doublereal * GetBufRaw(void) const =0
Definition: elem.h:75
BufferStreamElem_base(unsigned int uL, unsigned int oe, StreamContent *pSC, StreamOutEcho *pSOE)
virtual void SetBufRaw(integer n, const doublereal *p)
BufferStreamElem(unsigned int uL, unsigned int oe, StreamContent *pSC, StreamOutEcho *pSOE)
double doublereal
Definition: colamd.c:52
const std::vector< doublereal > & GetBuf(void) const
const doublereal * m_pBuffer
long int integer
Definition: colamd.c:51
virtual ~BufferStreamElem_base(void)