ucd_io.h
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 
19 
20 #ifndef LIBMESH_UCD_IO_H
21 #define LIBMESH_UCD_IO_H
22 
23 // C++ includes
24 
25 // Local includes
26 #include "libmesh/libmesh_common.h"
27 #include "libmesh/mesh_input.h"
28 #include "libmesh/mesh_output.h"
29 #include "libmesh/boundary_info.h"
30 
31 namespace libMesh
32 {
33 
34 // Forward declarations
35 class MeshBase;
36 
37 
38 
45 // ------------------------------------------------------------
46 // UCDIO class definition
47 class UCDIO : public MeshInput<MeshBase>,
48  public MeshOutput<MeshBase>
49 {
50  public:
51 
56  explicit
57  UCDIO (MeshBase&);
58 
63  explicit
64  UCDIO (const MeshBase&);
65 
70  virtual void read (const std::string& );
71 
76  virtual void write (const std::string& );
77 
82  virtual void write_nodal_data(const std::string& fname,
83  const std::vector<Number>&soln,
84  const std::vector<std::string>& names);
85 
86 
87  private:
88 
94  void read_implementation (std::istream& in_stream);
95 
101  void write_implementation (std::ostream& out_stream);
102 
106  void write_header(std::ostream& out, const MeshBase& mesh,
107  dof_id_type n_elems, unsigned int n_vars );
108 
112  void write_nodes(std::ostream& out, const MeshBase& mesh);
113 
117  void write_interior_elems(std::ostream& out, const MeshBase& mesh);
118 
122  void write_soln(std::ostream& out, const MeshBase& mesh,
123  const std::vector<std::string>& names,
124  const std::vector<Number>&soln);
125 
126  };
127 
128 
129 
130 // ------------------------------------------------------------
131 // UCDIO inline members
132 inline
134  MeshInput<MeshBase> (mesh),
135  MeshOutput<MeshBase>(mesh)
136 {
137 }
138 
139 
140 
141 inline
143  MeshOutput<MeshBase> (mesh)
144 {
145 }
146 
147 
148 } // namespace libMesh
149 
150 
151 #endif // LIBMESH_UCD_IO_H

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

Hosted By:
SourceForge.net Logo