$extrastylesheet
xdr_head.C
Go to the documentation of this file.
00001 // The libMesh Finite Element Library.
00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
00003 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 // Local includes
00019 #include "libmesh/xdr_head.h"
00020 
00021 namespace libMesh
00022 {
00023 
00024 // ------------------------------------------------------------
00025 // XdrHEAD members
00026 XdrHEAD::XdrHEAD()
00027 {
00028   m_wrtVar = 0;
00029   m_numvar = 0;
00030 
00031   m_meshCnt = 0;
00032   m_kstep = 0;
00033 
00034   m_numel = 0;
00035   m_numNodes = 0;
00036   m_sumWghts = 0;
00037   m_numBCs = 0;
00038   m_strSize = 0;
00039   mp_id = 0;
00040   mp_title = 0;
00041   mp_userTitle = 0;
00042   mp_varTitle = 0;
00043 
00044   m_time = 0;
00045 }
00046 
00047 
00048 
00049 XdrHEAD::~XdrHEAD()
00050 {
00051   delete [] mp_id;
00052   delete [] mp_title;
00053   delete [] mp_userTitle;
00054   delete [] mp_varTitle;
00055 }
00056 
00057 
00058 
00059 char* XdrHEAD::cpyString(const char* src, int len)
00060 {
00061   char* temp = NULL;
00062   int myLen = len;
00063   if(src)
00064     {
00065       if (myLen == -1)
00066         myLen = cast_int<int>(std::strlen(src))+1;
00067       temp = new char[myLen];
00068       temp = (char *) std::memcpy(temp, src, (myLen)*sizeof(char));
00069     }
00070   return temp;
00071 }
00072 
00073 } // namespace libMesh