Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
exporterensightgold.hpp
1 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2 
3  This file is part of the Feel library
4 
5  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
6  Date: 2004-11-09
7 
8  Copyright (C) 2004,2005 EPFL
9  Copyright (C) 2007-2012 Universite Joseph Fourier (Grenoble I)
10 
11  This library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU Lesser General Public
13  License as published by the Free Software Foundation; either
14  version 3.0 of the License, or (at your option) any later version.
15 
16  This library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  Lesser General Public License for more details.
20 
21  You should have received a copy of the GNU Lesser General Public
22  License along with this library; if not, write to the Free Software
23  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 */
30 #ifndef __ExporterEnsightGold_H
31 #define __ExporterEnsightGold_H 1
32 
33 #include <iostream>
34 #include <fstream>
35 
36 
37 #include <boost/lambda/lambda.hpp>
38 #include <boost/filesystem/path.hpp>
39 #include <boost/filesystem/operations.hpp>
40 
41 #include <feel/feelfilters/exporter.hpp>
43 
44 namespace Feel
45 {
46 namespace fs = boost::filesystem;
47 
55 template<typename MeshType, int N>
57  :
58 public Exporter<MeshType, N>
59 {
61 public:
62 
63 
67 
68  typedef MeshType mesh_type;
69 
70  typedef typename super::timeset_type timeset_type;
71  typedef typename super::timeset_ptrtype timeset_ptrtype;
72  typedef typename super::timeset_iterator timeset_iterator;
73  typedef typename super::timeset_const_iterator timeset_const_iterator;
74 
76 
123  ExporterEnsightGold( WorldComm const& worldComm = Environment::worldComm() );
124  ExporterEnsightGold( std::string const& __p = "default", int freq = 1, WorldComm const& worldComm = Environment::worldComm() );
125  ExporterEnsightGold( po::variables_map const& vm=Environment::vm(), std::string const& exp_prefix = "", WorldComm const& worldComm = Environment::worldComm() );
126 
128 
130 
131 
133 
137 
138 
140 
144 
148  std::string const& elementType() const
149  {
150  return M_element_type;
151  }
152 
153 
155 
159 
160  Exporter<MeshType,N>* setOptions( po::variables_map const& vm, std::string const& exp_prefix = "" ) FEELPP_DEPRECATED
161  {
162  super::setOptions( exp_prefix );
163 
164  return this;
165  }
166 
167  Exporter<MeshType,N>* setOptions( std::string const& exp_prefix = "" )
168  {
169  super::setOptions( exp_prefix );
170 
171  return this;
172  }
173 
174 
176 
180 
184  void save() const;
185 
186  void visit( mesh_type* mesh );
187 
189 
190 
191 
192 protected:
193 
194 private:
195 
199  void init();
200 
204  void writeSoSFile() const;
205 
209  void writeCaseFile() const;
210 
214  void writeGeoFiles() const;
215 
219  void writeVariableFiles() const;
220 
221  template<typename Iterator>
222  void saveNodal( typename timeset_type::step_ptrtype __step, Iterator __var, Iterator en ) const;
223 
224  template<typename Iterator>
225  void saveElement( typename timeset_type::step_ptrtype __step, Iterator __evar, Iterator __evaren ) const;
226 
227 private:
228 
229  mutable std::string M_filename;
230  std::string M_element_type;
231  std::string M_face_type;
232 };
233 
234 
235 } // Feel
236 
237 //#if !defined( FEELPP_INSTANTIATION_MODE )
238 # include <feel/feelfilters/exporterensightgold.cpp>
239 //#endif // FEELPP_INSTANTIATION_MODE
240 
241 #endif /* __ExporterEnsightGold_H */

Generated on Sun Oct 20 2013 08:24:57 for Feel++ by doxygen 1.8.4