xdr_mhead.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2016 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 #ifndef LIBMESH_XDR_MHEAD_H
19 #define LIBMESH_XDR_MHEAD_H
20 
21 // Local includes
22 #include "libmesh/xdr_head.h" // for base class
23 #include "libmesh/enum_elem_type.h" // for ElemType
24 
25 // C++ includes
26 #include <vector>
27 
28 namespace libMesh
29 {
30 
31 // Forward declarations
32 class XdrMESH;
33 
44 class XdrMHEAD : public XdrHEAD
45 {
46  friend class XdrMESH;
47 public:
52  XdrMHEAD() : _n_blocks(1) {}
53 
57  ~XdrMHEAD() {}
58 
63  void setNumEl(int numel) { m_numel = numel; }
64 
69  int getNumEl() const { return m_numel; }
70 
76  void setSumWghts(int sumWghts) { m_sumWghts = sumWghts; }
77 
83  int getSumWghts() const { return m_sumWghts; }
84 
91  unsigned int get_n_blocks() const { return _n_blocks; }
92 
96  void set_n_blocks(const unsigned int nb) { this->_n_blocks = nb; }
97 
104  void get_block_elt_types(std::vector<ElemType> & bet) const { bet = block_elt_types; }
105 
109  void set_block_elt_types(const std::vector<ElemType> & bet) { block_elt_types = bet; }
110 
118  void get_num_elem_each_block(std::vector<unsigned int> & neeb) const { neeb = num_elem_each_block; }
119 
123  void set_num_elem_each_block(const std::vector<unsigned int> & neeb) { num_elem_each_block = neeb; }
124 
125 
126 private:
127 
137  unsigned int _n_blocks;
138 
139 
149  std::vector<ElemType> block_elt_types;
150 
156  std::vector<unsigned int> num_elem_each_block;
157 
158 };
159 
160 } // namespace libMesh
161 
162 #endif // LIBMESH_XDR_MHEAD_H
int getSumWghts() const
Definition: xdr_mhead.h:83
void get_num_elem_each_block(std::vector< unsigned int > &neeb) const
Definition: xdr_mhead.h:118
void set_num_elem_each_block(const std::vector< unsigned int > &neeb)
Definition: xdr_mhead.h:123
void setNumEl(int numel)
Definition: xdr_mhead.h:63
void get_block_elt_types(std::vector< ElemType > &bet) const
Definition: xdr_mhead.h:104
unsigned int _n_blocks
Definition: xdr_mhead.h:137
void setSumWghts(int sumWghts)
Definition: xdr_mhead.h:76
void set_n_blocks(const unsigned int nb)
Definition: xdr_mhead.h:96
int getNumEl() const
Definition: xdr_mhead.h:69
unsigned int get_n_blocks() const
Definition: xdr_mhead.h:91
void set_block_elt_types(const std::vector< ElemType > &bet)
Definition: xdr_mhead.h:109
std::vector< unsigned int > num_elem_each_block
Definition: xdr_mhead.h:156
std::vector< ElemType > block_elt_types
Definition: xdr_mhead.h:149