libMesh
namebased_io.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 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 // C++ includes
20 #include <iomanip>
21 #include <fstream>
22 #include <vector>
23 
24 #include <sys/types.h> // getpid
25 #include <unistd.h>
26 
27 // Local includes
28 #include "libmesh/libmesh_logging.h"
29 #include "libmesh/mesh_base.h"
30 #include "libmesh/mesh_communication.h"
31 
32 #include "libmesh/namebased_io.h"
33 
34 #include "libmesh/exodusII_io.h"
35 #include "libmesh/gmv_io.h"
36 #include "libmesh/tecplot_io.h"
37 #include "libmesh/tetgen_io.h"
38 #include "libmesh/ucd_io.h"
39 #include "libmesh/unv_io.h"
40 #include "libmesh/matlab_io.h"
41 #include "libmesh/off_io.h"
42 #include "libmesh/medit_io.h"
43 #include "libmesh/nemesis_io.h"
44 #include "libmesh/gmsh_io.h"
45 #include "libmesh/fro_io.h"
46 #include "libmesh/xdr_io.h"
47 #include "libmesh/vtk_io.h"
48 #include "libmesh/abaqus_io.h"
49 #include "libmesh/checkpoint_io.h"
50 
51 #include "libmesh/equation_systems.h"
52 
53 
54 
55 namespace libMesh
56 {
57 
58 
59 
60 // ------------------------------------------------------------
61 // NameBasedIO members
62 void NameBasedIO::read (const std::string & name)
63 {
65 
66  // See if the file exists. Perform this check on all processors
67  // so that the code is terminated properly in the case that the
68  // file does not exist.
69 
70  // For Nemesis files, the name we try to read will have suffixes
71  // identifying processor rank
72  if (name.rfind(".nem") + 4 == name.size() ||
73  name.rfind(".n") + 2 == name.size())
74  {
75  std::ostringstream full_name;
76 
77  // Find the length of a string which represents the highest processor ID
78  full_name << (mymesh.n_processors());
79  int field_width = cast_int<int>(full_name.str().size());
80 
81  // reset the string stream
82  full_name.str("");
83 
84  // And build up the full filename
85  full_name << name
86  << '.' << mymesh.n_processors()
87  << '.' << std::setfill('0') << std::setw(field_width) << mymesh.processor_id();
88 
89  std::ifstream in (full_name.str().c_str());
90 
91  if (!in.good())
92  libmesh_error_msg("ERROR: cannot locate specified file:\n\t" << full_name.str());
93  }
94  else if (name.rfind(".cp")) {} // Do error checking in the reader
95  else
96  {
97  std::ifstream in (name.c_str());
98 
99  if (!in.good())
100  libmesh_error_msg("ERROR: cannot locate specified file:\n\t" << name);
101  }
102 
103  // Look for parallel formats first
104  if (is_parallel_file_format(name))
105  {
106  // no need to handle bz2 files here -- the Xdr class does that.
107  if ((name.rfind(".xda") < name.size()) ||
108  (name.rfind(".xdr") < name.size()))
109  {
110  XdrIO xdr_io(mymesh);
111 
112  // .xda* ==> bzip2/gzip/ASCII flavors
113  if (name.rfind(".xda") < name.size())
114  {
115  xdr_io.binary() = false;
116  xdr_io.read (name);
117  }
118  else // .xdr* ==> true binary XDR file
119  {
120  xdr_io.binary() = true;
121  xdr_io.read (name);
122  }
123 
124  // The xdr_io object gets constructed with legacy() == false.
125  // if legacy() == true then it means that a legacy file was detected and
126  // thus processor 0 performed the read. We therefore need to broadcast the
127  // mesh. Further, for this flavor of mesh solution data ordering is tied
128  // to the node ordering, so we better not reorder the nodes!
129  if (xdr_io.legacy())
130  {
131  mymesh.allow_renumbering(false);
132  MeshCommunication().broadcast(mymesh);
133  }
134 
135  // libHilbert-enabled libMesh builds should construct files
136  // with a canonical node ordering, which libHilbert-enabled
137  // builds will be able to read in again regardless of any
138  // renumbering. So in that case we're free to renumber.
139  // However, if either the writer or the reader of this file
140  // don't have libHilbert, then we'll have to skip
141  // renumbering because we need the numbering to remain
142  // consistent with any solution file we read in next.
143 #ifdef LIBMESH_HAVE_LIBHILBERT
144  // if (!xdr_io.libhilbert_ordering())
145  // skip_renumber_nodes_and_elements = true;
146 #else
147  mymesh.allow_renumbering(false);
148 #endif
149  }
150  else if (name.rfind(".nem") < name.size() ||
151  name.rfind(".n") < name.size())
152  Nemesis_IO(mymesh).read (name);
153  else if (name.rfind(".cp") < name.size())
154  {
155  if (name.rfind(".cpa") < name.size())
156  CheckpointIO(mymesh, false).read(name);
157  else
158  CheckpointIO(mymesh, true).read(name);
159  }
160  }
161 
162  // Serial mesh formats
163  else
164  {
165  // Read the file based on extension. Only processor 0
166  // needs to read the mesh. It will then broadcast it and
167  // the other processors will pick it up
168  if (mymesh.processor_id() == 0)
169  {
170  LOG_SCOPE("read()", "NameBasedIO");
171 
172  std::ostringstream pid_suffix;
173  pid_suffix << '_' << getpid();
174  // Nasty hack for reading/writing zipped files
175  std::string new_name = name;
176  if (name.size() - name.rfind(".bz2") == 4)
177  {
178 #ifdef LIBMESH_HAVE_BZIP
179  new_name.erase(new_name.end() - 4, new_name.end());
180  new_name += pid_suffix.str();
181  std::string system_string = "bunzip2 -f -k -c ";
182  system_string += name + " > " + new_name;
183  LOG_SCOPE("system(bunzip2)", "NameBasedIO");
184  if (std::system(system_string.c_str()))
185  libmesh_file_error(system_string);
186 #else
187  libmesh_error_msg("ERROR: need bzip2/bunzip2 to open .bz2 file " << name);
188 #endif
189  }
190  else if (name.size() - name.rfind(".xz") == 3)
191  {
192 #ifdef LIBMESH_HAVE_XZ
193  new_name.erase(new_name.end() - 3, new_name.end());
194  new_name += pid_suffix.str();
195  std::string system_string = "xz -f -d -k -c ";
196  system_string += name + " > " + new_name;
197  LOG_SCOPE("system(xz -d)", "XdrIO");
198  if (std::system(system_string.c_str()))
199  libmesh_file_error(system_string);
200 #else
201  libmesh_error_msg("ERROR: need xz to open .xz file " << name);
202 #endif
203  }
204 
205  if (new_name.rfind(".mat") < new_name.size())
206  MatlabIO(mymesh).read(new_name);
207 
208  else if (new_name.rfind(".ucd") < new_name.size())
209  UCDIO(mymesh).read (new_name);
210 
211  else if ((new_name.rfind(".off") < new_name.size()) ||
212  (new_name.rfind(".ogl") < new_name.size()) ||
213  (new_name.rfind(".oogl") < new_name.size()))
214  OFFIO(mymesh).read (new_name);
215 
216  else if (new_name.rfind(".unv") < new_name.size())
217  UNVIO(mymesh).read (new_name);
218 
219  else if ((new_name.rfind(".node") < new_name.size()) ||
220  (new_name.rfind(".ele") < new_name.size()))
221  TetGenIO(mymesh).read (new_name);
222 
223  else if (new_name.rfind(".exd") < new_name.size() ||
224  new_name.rfind(".e") < new_name.size())
225  ExodusII_IO(mymesh).read (new_name);
226 
227  else if (new_name.rfind(".msh") < new_name.size())
228  GmshIO(mymesh).read (new_name);
229 
230  else if (new_name.rfind(".gmv") < new_name.size())
231  GMVIO(mymesh).read (new_name);
232 
233  else if (new_name.rfind(".vtu") < new_name.size())
234  VTKIO(mymesh).read(new_name);
235 
236  else if (new_name.rfind(".inp") < new_name.size())
237  AbaqusIO(mymesh).read(new_name);
238 
239  else
240  {
241  libmesh_error_msg(" ERROR: Unrecognized file extension: " \
242  << name \
243  << "\n I understand the following:\n\n" \
244  << " *.e -- Sandia's ExodusII format\n" \
245  << " *.exd -- Sandia's ExodusII format\n" \
246  << " *.gmv -- LANL's General Mesh Viewer format\n" \
247  << " *.mat -- Matlab triangular ASCII file\n" \
248  << " *.n -- Sandia's Nemesis format\n" \
249  << " *.nem -- Sandia's Nemesis format\n" \
250  << " *.off -- OOGL OFF surface format\n" \
251  << " *.ucd -- AVS's ASCII UCD format\n" \
252  << " *.unv -- I-deas Universal format\n" \
253  << " *.vtu -- Paraview VTK format\n" \
254  << " *.inp -- Abaqus .inp format\n" \
255  << " *.xda -- libMesh ASCII format\n" \
256  << " *.xdr -- libMesh binary format\n" \
257  << " *.gz -- any above format gzipped\n" \
258  << " *.bz2 -- any above format bzip2'ed\n" \
259  << " *.xz -- any above format xzipped\n" \
260  << " *.cpa -- libMesh Checkpoint ASCII format\n" \
261  << " *.cpr -- libMesh Checkpoint binary format\n");
262  }
263 
264  // If we temporarily decompressed a file, remove the
265  // uncompressed version
266  if (name.size() - name.rfind(".bz2") == 4)
267  std::remove(new_name.c_str());
268  if (name.size() - name.rfind(".xz") == 3)
269  std::remove(new_name.c_str());
270  }
271 
272  // Send the mesh & bcs (which are now only on processor 0) to the other
273  // processors
274  MeshCommunication().broadcast (mymesh);
275  }
276 }
277 
278 
279 void NameBasedIO::write (const std::string & name)
280 {
281  MeshBase & mymesh = MeshInput<MeshBase>::mesh();
282 
283  // parallel formats are special -- they may choose to write
284  // separate files, let's not try to handle the zipping here.
285  if (is_parallel_file_format(name))
286  {
287  // no need to handle bz2 files here -- the Xdr class does that.
288  if (name.rfind(".xda") < name.size())
289  XdrIO(mymesh).write(name);
290 
291  else if (name.rfind(".xdr") < name.size())
292  XdrIO(mymesh,true).write(name);
293 
294  else if (name.rfind(".nem") < name.size() ||
295  name.rfind(".n") < name.size())
296  Nemesis_IO(mymesh).write(name);
297  }
298 
299  // serial file formats
300  else
301  {
302  // Nasty hack for reading/writing zipped files
303  std::string new_name = name;
304  pid_t pid_0 = 0;
305  if (mymesh.processor_id() == 0)
306  pid_0 = getpid();
307  mymesh.comm().broadcast(pid_0);
308  std::ostringstream pid_suffix;
309  pid_suffix << '_' << pid_0;
310 
311  if (name.size() - name.rfind(".bz2") == 4)
312  {
313  new_name.erase(new_name.end() - 4, new_name.end());
314  new_name += pid_suffix.str();
315  }
316  else if (name.size() - name.rfind(".xz") == 3)
317  {
318  new_name.erase(new_name.end() - 3, new_name.end());
319  new_name += pid_suffix.str();
320  }
321 
322  // New scope so that io will close before we try to zip the file
323  {
324  // Write the file based on extension
325  if (new_name.rfind(".dat") < new_name.size())
326  TecplotIO(mymesh).write (new_name);
327 
328  else if (new_name.rfind(".plt") < new_name.size())
329  TecplotIO(mymesh,true).write (new_name);
330 
331  else if (new_name.rfind(".ucd") < new_name.size())
332  UCDIO (mymesh).write (new_name);
333 
334  else if (new_name.rfind(".gmv") < new_name.size())
335  if (mymesh.n_partitions() > 1)
336  GMVIO(mymesh).write (new_name);
337  else
338  {
339  GMVIO io(mymesh);
340  io.partitioning() = false;
341  io.write (new_name);
342  }
343 
344  else if (new_name.rfind(".e") < new_name.size())
345  ExodusII_IO(mymesh).write(new_name);
346 
347  else if (new_name.rfind(".unv") < new_name.size())
348  UNVIO(mymesh).write (new_name);
349 
350  else if (new_name.rfind(".mesh") < new_name.size())
351  MEDITIO(mymesh).write (new_name);
352 
353  else if (new_name.rfind(".poly") < new_name.size())
354  TetGenIO(mymesh).write (new_name);
355 
356  else if (new_name.rfind(".msh") < new_name.size())
357  GmshIO(mymesh).write (new_name);
358 
359  else if (new_name.rfind(".fro") < new_name.size())
360  FroIO(mymesh).write (new_name);
361 
362  else if (new_name.rfind(".vtu") < new_name.size())
363  VTKIO(mymesh).write (new_name);
364 
365  else
366  {
368  << " ERROR: Unrecognized file extension: " << name
369  << "\n I understand the following:\n\n"
370  << " *.dat -- Tecplot ASCII file\n"
371  << " *.e -- Sandia's ExodusII format\n"
372  << " *.exd -- Sandia's ExodusII format\n"
373  << " *.fro -- ACDL's surface triangulation file\n"
374  << " *.gmv -- LANL's GMV (General Mesh Viewer) format\n"
375  << " *.mesh -- MEdit mesh format\n"
376  << " *.mgf -- MGF binary mesh format\n"
377  << " *.msh -- GMSH ASCII file\n"
378  << " *.n -- Sandia's Nemesis format\n"
379  << " *.nem -- Sandia's Nemesis format\n"
380  << " *.plt -- Tecplot binary file\n"
381  << " *.poly -- TetGen ASCII file\n"
382  << " *.ucd -- AVS's ASCII UCD format\n"
383  << " *.ugrid -- Kelly's DIVA ASCII format\n"
384  << " *.unv -- I-deas Universal format\n"
385  << " *.vtu -- VTK (paraview-readable) format\n"
386  << " *.xda -- libMesh ASCII format\n"
387  << " *.xdr -- libMesh binary format,\n"
388  << std::endl
389  << "\n Exiting without writing output\n";
390  }
391  }
392 
393  // Nasty hack for reading/writing zipped files
394  if (name.size() - name.rfind(".bz2") == 4)
395  {
396  LOG_SCOPE("system(bzip2)", "NameBasedIO");
397  if (mymesh.processor_id() == 0)
398  {
399  std::string system_string = "bzip2 -f -c ";
400  system_string += new_name + " > " + name;
401  if (std::system(system_string.c_str()))
402  libmesh_file_error(system_string);
403  std::remove(new_name.c_str());
404  }
405  mymesh.comm().barrier();
406  }
407  if (name.size() - name.rfind(".xz") == 3)
408  {
409  LOG_SCOPE("system(xz)", "NameBasedIO");
410  if (mymesh.processor_id() == 0)
411  {
412  std::string system_string = "xz -f -c ";
413  system_string += new_name + " > " + name;
414  if (std::system(system_string.c_str()))
415  libmesh_file_error(system_string);
416  std::remove(new_name.c_str());
417  }
418  mymesh.comm().barrier();
419  }
420  }
421 
422 }
423 
424 
425 void NameBasedIO::write_nodal_data (const std::string & name,
426  const std::vector<Number> & v,
427  const std::vector<std::string> & vn)
428 {
429  MeshBase & mymesh = MeshInput<MeshBase>::mesh();
430 
431  // Write the file based on extension
432  if (name.rfind(".dat") < name.size())
433  TecplotIO(mymesh).write_nodal_data (name, v, vn);
434 
435  else if (name.rfind(".e") < name.size())
436  ExodusII_IO(mymesh).write_nodal_data(name, v, vn);
437 
438  else if (name.rfind(".gmv") < name.size())
439  {
440  if (mymesh.n_subdomains() > 1)
441  GMVIO(mymesh).write_nodal_data (name, v, vn);
442  else
443  {
444  GMVIO io(mymesh);
445  io.partitioning() = false;
446  io.write_nodal_data (name, v, vn);
447  }
448  }
449 
450  else if (name.rfind(".mesh") < name.size())
451  MEDITIO(mymesh).write_nodal_data (name, v, vn);
452 
453  else if (name.rfind(".msh") < name.size())
454  GmshIO(mymesh).write_nodal_data (name, v, vn);
455 
456  else if (name.rfind(".nem") < name.size() ||
457  name.rfind(".n") < name.size())
458  Nemesis_IO(mymesh).write_nodal_data(name, v, vn);
459 
460  else if (name.rfind(".plt") < name.size())
461  TecplotIO(mymesh,true).write_nodal_data (name, v, vn);
462 
463  else if (name.rfind(".pvtu") < name.size())
464  VTKIO(mymesh).write_nodal_data (name, v, vn);
465 
466  else if (name.rfind(".ucd") < name.size())
467  UCDIO (mymesh).write_nodal_data (name, v, vn);
468 
469  else
470  {
472  << " ERROR: Unrecognized file extension: " << name
473  << "\n I understand the following:\n\n"
474  << " *.dat -- Tecplot ASCII file\n"
475  << " *.e -- Sandia's ExodusII format\n"
476  << " *.exd -- Sandia's ExodusII format\n"
477  << " *.gmv -- LANL's GMV (General Mesh Viewer) format\n"
478  << " *.mesh -- MEdit mesh format\n"
479  << " *.msh -- GMSH ASCII file\n"
480  << " *.n -- Sandia's Nemesis format\n"
481  << " *.nem -- Sandia's Nemesis format\n"
482  << " *.plt -- Tecplot binary file\n"
483  << " *.pvtu -- Paraview VTK file\n"
484  << " *.ucd -- AVS's ASCII UCD format\n"
485  << "\n Exiting without writing output\n";
486  }
487 }
488 
489 
490 void NameBasedIO::write_equation_systems (const std::string & filename,
491  const EquationSystems & es,
492  const std::set<std::string> * system_names)
493 {
494  // XDA/XDR require a separate code path, and currently only support
495  // writing complete restarts
496  if (!system_names)
497  {
498  if (filename.rfind(".xda") < filename.size())
499  {
500  es.write(filename,WRITE,
503  return;
504  }
505  else if (filename.rfind(".xdr") < filename.size())
506  {
507  es.write(filename,ENCODE,
510  return;
511  }
512  }
513 
514  // Other formats just use the default "write nodal values" path
516  (filename, es, system_names);
517 }
518 
519 
520 
521 } // namespace libMesh
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
OStreamProxy err
This class implements reading meshes in the Matlab PDE toolkit in a proprietary format.
Definition: matlab_io.h:83
virtual void read(const std::string &mesh_file) libmesh_override
This method implements reading a mesh from a specified file.
Definition: namebased_io.C:62
The CheckpointIO class can be used to write simplified restart files that can be used to restart simu...
Definition: checkpoint_io.h:50
virtual void write_nodal_data(const std::string &, const std::vector< Number > &, const std::vector< std::string > &) libmesh_override
This method implements writing a mesh with nodal data to a specified file where the nodal data and va...
Definition: tecplot_io.C:186
This is the EquationSystems class.
This class implements writing meshes in the Gmsh format.
Definition: gmsh_io.h:50
virtual void read(const std::string &) libmesh_override
This method implements reading a mesh from a specified file in UCD format.
Definition: ucd_io.C:78
bool binary() const
Get/Set the flag indicating if we should read/write binary.
Definition: xdr_io.h:103
void write(const std::string &name, const XdrMODE, const unsigned int write_flags=(WRITE_DATA), bool partition_agnostic=true) const
Write the systems to disk using the XDR data format.
The AbaqusIO class is a preliminary implementation for reading Abaqus mesh files in ASCII format...
Definition: abaqus_io.h:40
void allow_renumbering(bool allow)
If false is passed in then this mesh will no longer be renumbered when being prepared for use...
Definition: mesh_base.h:749
virtual void write_nodal_data(const std::string &, const std::vector< Number > &, const std::vector< std::string > &) libmesh_override
This method implements writing a mesh with nodal data to a specified file where the nodal data and va...
Definition: medit_io.C:46
virtual void read(const std::string &) libmesh_override
This method implements reading a mesh from a specified file.
Definition: unv_io.C:94
The ExodusII_IO class implements reading meshes in the ExodusII file format from Sandia National Labs...
Definition: exodusII_io.h:52
void broadcast(MeshBase &) const
Finds all the processors that may contain elements that neighbor my elements.
unsigned int n_partitions() const
Definition: mesh_base.h:833
virtual void read(const std::string &) libmesh_override
This method implements reading a mesh from a specified file.
Definition: xdr_io.C:1314
virtual void write(const std::string &) libmesh_override
This method implements writing a mesh to a specified ".poly" file.
Definition: tetgen_io.C:259
virtual void write_nodal_data(const std::string &, const std::vector< Number > &, const std::vector< std::string > &) libmesh_override
This method implements writing a mesh with nodal data to a specified file where the nodal data and va...
Definition: namebased_io.C:425
virtual void write_nodal_data(const std::string &fname, const std::vector< Number > &soln, const std::vector< std::string > &names) libmesh_override
Output a nodal solution.
Definition: nemesis_io.C:1363
processor_id_type n_processors() const
virtual void write(const std::string &) libmesh_override
This method implements writing a mesh to a specified file.
Definition: unv_io.C:258
This class implements writing meshes in the mesh format used by the MEdit visualization tool develope...
Definition: medit_io.h:47
This class implements reading and writing meshes in the TetGen format.
Definition: tetgen_io.h:47
The libMesh namespace provides an interface to certain functionality in the library.
This class implements writing meshes in the GMV format.
Definition: gmv_io.h:46
This class implements reading and writing meshes in the VTK format.
Definition: vtk_io.h:59
bool & partitioning()
Flag indicating whether or not to write the partitioning information for the mesh.
Definition: gmv_io.h:107
MeshIO class used for writing XDR (eXternal Data Representation) and XDA mesh files.
Definition: xdr_io.h:51
This is the MeshBase class.
Definition: mesh_base.h:68
virtual void write(const std::string &base_filename) libmesh_override
This method implements writing a mesh to a specified file.
Definition: nemesis_io.C:1180
virtual void read(const std::string &) libmesh_override
This method implements reading a mesh from a specified file in VTK format.
Definition: vtk_io.C:148
virtual void write_nodal_data(const std::string &, const std::vector< Number > &, const std::vector< std::string > &) libmesh_override
Write out a nodal solution.
Definition: exodusII_io.C:631
virtual void write(const std::string &) libmesh_override
This method implements writing a mesh to a specified file.
Definition: xdr_io.C:167
virtual void read(const std::string &) libmesh_override
This method implements reading a mesh from a specified file.
virtual void write(const std::string &) libmesh_override
This method implements writing a mesh to a specified ".mesh" file.
Definition: medit_io.C:37
This class implements writing meshes in the .fro format used by the MIT ACDL.
Definition: fro_io.h:42
virtual void write(const std::string &mesh_file) libmesh_override
This method implements writing a mesh to a specified file.
Definition: namebased_io.C:279
This class is responsible for reading an unstructured, triangulated surface in the standard OFF OOGL ...
Definition: off_io.h:39
This is the MeshCommunication class.
This class implements reading & writing meshes in the AVS&#39;s UCD format.
Definition: ucd_io.h:44
The Nemesis_IO class implements reading parallel meshes in the Nemesis file format from Sandia Nation...
Definition: nemesis_io.h:50
virtual void write_equation_systems(const std::string &filename, const EquationSystems &es, const std::set< std::string > *system_names=libmesh_nullptr) libmesh_override
This method implements writing a mesh with data to a specified file where the data is taken from the ...
Definition: namebased_io.C:490
virtual void write(const std::string &) libmesh_override
This method implements writing a mesh to a specified file.
Definition: fro_io.C:41
virtual void read(const std::string &name) libmesh_override
Reads in a matlab data file based on the string you pass it.
Definition: matlab_io.C:33
void barrier() const
Pause execution until all processors reach a certain point.
virtual void write(const std::string &) libmesh_override
This method implements writing a mesh to a specified file.
Definition: tecplot_io.C:173
virtual void write_nodal_data(const std::string &fname, const std::vector< Number > &soln, const std::vector< std::string > &names) libmesh_override
This method implements writing a mesh and solution to a specified file in UCD format.
Definition: ucd_io.C:320
void broadcast(T &data, const unsigned int root_id=0) const
Take a local value and broadcast it to all processors.
virtual void read(const std::string &name) libmesh_override
Reads in an OFF OOGL data file based on the string you pass it.
Definition: off_io.C:35
virtual void write(const std::string &) libmesh_override
This method implements writing a mesh to a specified file.
Definition: gmv_io.C:267
virtual void write_equation_systems(const std::string &, const EquationSystems &, const std::set< std::string > *system_names=libmesh_nullptr)
This method implements writing a mesh with data to a specified file where the data is taken from the ...
Definition: mesh_output.C:31
virtual void write(const std::string &) libmesh_override
Output the mesh without solutions to a .pvtu file.
virtual void write(const std::string &name) libmesh_override
This method implements writing a mesh to a specified file in the Gmsh *.msh format.
Definition: gmsh_io.C:615
virtual void read(const std::string &name) libmesh_override
This method implements reading a mesh from a specified file.
Definition: abaqus_io.C:205
virtual void read(const std::string &name) libmesh_override
This method implements reading a mesh from a specified file.
Definition: exodusII_io.C:116
virtual void write_nodal_data(const std::string &, const std::vector< Number > &, const std::vector< std::string > &) libmesh_override
This method implements writing a mesh with nodal data to a specified file where the nodal data and va...
Definition: gmv_io.C:277
virtual void write(const std::string &fname) libmesh_override
This method implements writing a mesh to a specified file.
Definition: exodusII_io.C:789
virtual void write_nodal_data(const std::string &, const std::vector< Number > &, const std::vector< std::string > &) libmesh_override
This method implements writing a mesh with nodal data to a specified file where the nodal data and va...
Definition: gmsh_io.C:632
const Parallel::Communicator & comm() const
virtual void read(const std::string &base_filename) libmesh_override
Implements reading the mesh from several different files.
Definition: nemesis_io.C:135
virtual void read(const std::string &name) libmesh_override
Reads in a mesh in the Gmsh *.msh format from the ASCII file given by name.
Definition: gmsh_io.C:144
This class implements writing meshes in the Tecplot format.
Definition: tecplot_io.h:43
virtual void write(const std::string &) libmesh_override
This method implements writing a mesh to a specified file in UCD format.
Definition: ucd_io.C:99
virtual void read(const std::string &mesh_file) libmesh_override
This method implements reading a mesh from a specified file.
Definition: gmv_io.C:1886
bool legacy() const
Get/Set the flag indicating if we should read/write legacy.
Definition: xdr_io.h:109
subdomain_id_type n_subdomains() const
Definition: mesh_base.C:334
virtual void write_nodal_data(const std::string &, const std::vector< Number > &, const std::vector< std::string > &) libmesh_override
This method implements writing a mesh with nodal data to a specified file where the nodal data and va...
Definition: vtk_io.C:242
virtual void read(const std::string &) libmesh_override
This method implements reading a mesh from a specified file in TetGen format.
Definition: tetgen_io.C:33
The UNVIO class implements the Ideas UNV universal file format.
Definition: unv_io.h:52
processor_id_type processor_id() const
bool is_parallel_file_format(const std::string &filename)
Definition: namebased_io.h:124