xdr_head.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 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 // Local includes
19 #include "libmesh/xdr_head.h"
20 
21 namespace libMesh
22 {
23 
24 // ------------------------------------------------------------
25 // XdrHEAD members
27 {
28  m_wrtVar = 0;
29  m_numvar = 0;
30 
31  m_meshCnt = 0;
32  m_kstep = 0;
33 
34  m_numel = 0;
35  m_numNodes = 0;
36  m_sumWghts = 0;
37  m_numBCs = 0;
38  m_strSize = 0;
39  mp_id = 0;
40  mp_title = 0;
41  mp_userTitle = 0;
42  mp_varTitle = 0;
43 
44  m_time = 0;
45 }
46 
47 
48 
50 {
51  delete [] mp_id;
52  delete [] mp_title;
53  delete [] mp_userTitle;
54  delete [] mp_varTitle;
55 }
56 
57 
58 
59 char* XdrHEAD::cpyString(const char* src, int len)
60 {
61  char* temp = NULL;
62  int myLen = len;
63  if(src)
64  {
65  if (myLen == -1)
66  myLen = libmesh_cast_int<int>(std::strlen(src))+1;
67  temp = new char[myLen];
68  temp = (char *) std::memcpy(temp, src, (myLen)*sizeof(char));
69  }
70  return temp;
71 }
72 
73 } // namespace libMesh

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:07 UTC

Hosted By:
SourceForge.net Logo