tecplot_io.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 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 // C++ includes
21 #include <fstream>
22 #include <iomanip>
23 #include <sstream>
24 
25 // Local includes
26 #include "libmesh/libmesh_config.h"
28 #include "libmesh/tecplot_io.h"
29 #include "libmesh/mesh_base.h"
30 #include "libmesh/elem.h"
31 #include "libmesh/parallel.h"
33 
34 #ifdef LIBMESH_HAVE_TECPLOT_API
35 extern "C" {
36 # include <TECIO.h>
37 }
38 #endif
39 
40 
41 namespace libMesh
42 {
43 
44 
45 //--------------------------------------------------------
46 // Macros for handling Tecplot API data
47 
48 #ifdef LIBMESH_HAVE_TECPLOT_API
49 
50 namespace
51 {
52 class TecplotMacros
53 {
54 public:
55  TecplotMacros(const dof_id_type n_nodes,
56  const unsigned int n_vars,
57  const dof_id_type n_cells,
58  const unsigned int n_vert);
59  float & nd(const std::size_t i, const std::size_t j);
60  int & cd(const std::size_t i, const std::size_t j);
61  std::vector<float> nodalData;
62  std::vector<int> connData;
63  //float* nodalData;
64  //int * connData;
65 
66  void set_n_cells (const dof_id_type nc);
67 
69  const unsigned int n_vars;
71  const unsigned int n_vert;
72 };
73 
74 
75 
76 inline
77 TecplotMacros::TecplotMacros(const dof_id_type nn,
78  const unsigned int nvar,
79  const dof_id_type nc,
80  const unsigned int nvrt) :
81  n_nodes(nn),
82  n_vars(nvar),
83  n_cells(nc),
84  n_vert(nvrt)
85 {
86  nodalData.resize(n_nodes*n_vars);
87  connData.resize(n_cells*n_vert);
88 }
89 
90 
91 
92 inline
93 float & TecplotMacros::nd(const std::size_t i, const std::size_t j)
94 {
95  return nodalData[(i)*(n_nodes) + (j)];
96 }
97 
98 
99 
100 inline
101 int & TecplotMacros::cd(const std::size_t i, const std::size_t j)
102 {
103  return connData[(i) + (j)*(n_vert)];
104 }
105 
106 
107 inline
108 void TecplotMacros::set_n_cells (const dof_id_type nc)
109 {
110  n_cells = nc;
111  connData.resize(n_cells*n_vert);
112 }
113 }
114 
115 #endif
116 //--------------------------------------------------------
117 
118 
119 
120 // ------------------------------------------------------------
121 // TecplotIO members
122 TecplotIO::TecplotIO (const MeshBase & mesh_in,
123  const bool binary_in,
124  const double time_in,
125  const int strand_offset_in) :
126  MeshOutput<MeshBase> (mesh_in),
127  _binary (binary_in),
128  _time (time_in),
129  _strand_offset (strand_offset_in),
130  _zone_title ("zone"),
131  _ascii_append(false)
132 {
133  // Gather a list of subdomain ids in the mesh.
134  // We must do this now, while we have every
135  // processor's attention
136  // (some of the write methods only execute on processor 0).
137  mesh_in.subdomain_ids (_subdomain_ids);
138 }
139 
140 
141 
143 {
144  return _binary;
145 }
146 
147 
148 
149 double & TecplotIO::time ()
150 {
151  return _time;
152 }
153 
154 
155 
157 {
158  return _strand_offset;
159 }
160 
161 
162 
163 std::string & TecplotIO::zone_title ()
164 {
165  return _zone_title;
166 }
167 
168 
170 {
171  return _ascii_append;
172 }
173 
174 
175 void TecplotIO::write (const std::string & fname)
176 {
177  if (this->mesh().processor_id() == 0)
178  {
179  if (this->binary())
180  this->write_binary (fname);
181  else
182  this->write_ascii (fname);
183  }
184 }
185 
186 
187 
188 void TecplotIO::write_nodal_data (const std::string & fname,
189  const std::vector<Number> & soln,
190  const std::vector<std::string> & names)
191 {
192  LOG_SCOPE("write_nodal_data()", "TecplotIO");
193 
194  if (this->mesh().processor_id() == 0)
195  {
196  if (this->binary())
197  this->write_binary (fname, &soln, &names);
198  else
199  this->write_ascii (fname, &soln, &names);
200  }
201 }
202 
203 
204 
206 {
207  // Get a constant reference to the mesh.
208  const MeshBase & the_mesh = MeshOutput<MeshBase>::mesh();
209 
210  std::vector<unsigned> elem_dims(3);
211 
212  // Loop over all the elements and mark the proper dimension entry in
213  // the elem_dims vector.
214  for (const auto & elem : the_mesh.active_element_ptr_range())
215  elem_dims[elem->dim() - 1] = 1;
216 
217  // Detect and disallow (for now) the writing of mixed dimension meshes.
218  if (std::count(elem_dims.begin(), elem_dims.end(), 1) > 1)
219  libmesh_error_msg("Error, cannot write Mesh with mixed element dimensions to Tecplot file!");
220 
221  if (elem_dims[0])
222  return 1;
223  else if (elem_dims[1])
224  return 2;
225  else if (elem_dims[2])
226  return 3;
227  else
228  libmesh_error_msg("No 1, 2, or 3D elements detected!");
229 }
230 
231 
232 
233 void TecplotIO::write_ascii (const std::string & fname,
234  const std::vector<Number> * v,
235  const std::vector<std::string> * solution_names)
236 {
237  // Should only do this on processor 0!
238  libmesh_assert_equal_to (this->mesh().processor_id(), 0);
239 
240  // Create an output stream, possibly in append mode.
241  std::ofstream out_stream(fname.c_str(), _ascii_append ? std::ofstream::app : std::ofstream::out);
242 
243  // Make sure it opened correctly
244  if (!out_stream.good())
245  libmesh_file_error(fname.c_str());
246 
247  // Get a constant reference to the mesh.
248  const MeshBase & the_mesh = MeshOutput<MeshBase>::mesh();
249 
250  // Write header to stream
251  {
252  {
253  // TODO: We used to print out the SVN revision here when we did keyword expansions...
254  out_stream << "# For a description of the Tecplot format see the Tecplot User's guide.\n"
255  << "#\n";
256  }
257 
258  out_stream << "Variables=x,y,z";
259 
260  if (solution_names != nullptr)
261  for (std::size_t n=0; n<solution_names->size(); n++)
262  {
263 #ifdef LIBMESH_USE_REAL_NUMBERS
264 
265  // Write variable names for real variables
266  out_stream << "," << (*solution_names)[n];
267 
268 #else
269 
270  // Write variable names for complex variables
271  out_stream << "," << "r_" << (*solution_names)[n]
272  << "," << "i_" << (*solution_names)[n]
273  << "," << "a_" << (*solution_names)[n];
274 
275 #endif
276  }
277 
278  out_stream << '\n';
279 
280  out_stream << "Zone f=fepoint, n=" << the_mesh.n_nodes() << ", e=" << the_mesh.n_active_sub_elem();
281 
282  // We cannot choose the element type simply based on the mesh
283  // dimension... there might be 1D elements living in a 3D mesh.
284  // So look at the elements which are actually in the Mesh, and
285  // choose either "lineseg", "quadrilateral", or "brick" depending
286  // on if the elements are 1, 2, or 3D.
287 
288  // Write the element type we've determined to the header.
289  out_stream << ", et=";
290 
291  switch (this->elem_dimension())
292  {
293  case 1:
294  out_stream << "lineseg";
295  break;
296  case 2:
297  out_stream << "quadrilateral";
298  break;
299  case 3:
300  out_stream << "brick";
301  break;
302  default:
303  libmesh_error_msg("Unsupported element dimension: " << this->elem_dimension());
304  }
305 
306  // Output the time in the header
307  out_stream << ", t=\"T " << _time << "\"";
308 
309  // Use default mesh color = black
310  out_stream << ", c=black\n";
311 
312  } // finished writing header
313 
314  for (unsigned int i=0; i<the_mesh.n_nodes(); i++)
315  {
316  // Print the point without a newline
317  the_mesh.point(i).write_unformatted(out_stream, false);
318 
319  if ((v != nullptr) && (solution_names != nullptr))
320  {
321  const std::size_t n_vars = solution_names->size();
322 
323 
324  for (std::size_t c=0; c<n_vars; c++)
325  {
326 #ifdef LIBMESH_USE_REAL_NUMBERS
327  // Write real data
328  out_stream << std::setprecision(this->ascii_precision())
329  << (*v)[i*n_vars + c] << " ";
330 
331 #else
332  // Write complex data
333  out_stream << std::setprecision(this->ascii_precision())
334  << (*v)[i*n_vars + c].real() << " "
335  << (*v)[i*n_vars + c].imag() << " "
336  << std::abs((*v)[i*n_vars + c]) << " ";
337 
338 #endif
339  }
340  }
341 
342  // Write a new line after the data for this node
343  out_stream << '\n';
344  }
345 
346  for (const auto & elem : the_mesh.active_element_ptr_range())
347  elem->write_connectivity(out_stream, TECPLOT);
348 }
349 
350 
351 
352 void TecplotIO::write_binary (const std::string & fname,
353  const std::vector<Number> * vec,
354  const std::vector<std::string> * solution_names)
355 {
356  //-----------------------------------------------------------
357  // Call the ASCII output function if configure did not detect
358  // the Tecplot binary API
359 #ifndef LIBMESH_HAVE_TECPLOT_API
360 
361  libMesh::err << "WARNING: Tecplot Binary files require the Tecplot API." << std::endl
362  << "Continuing with ASCII output."
363  << std::endl;
364 
365  if (this->mesh().processor_id() == 0)
366  this->write_ascii (fname, vec, solution_names);
367  return;
368 
369 
370 
371  //------------------------------------------------------------
372  // New binary formats, time aware and whatnot
373 #elif defined(LIBMESH_HAVE_TECPLOT_API_112)
374 
375  // Get a constant reference to the mesh.
376  const MeshBase & the_mesh = MeshOutput<MeshBase>::mesh();
377 
378  // Required variables
379  std::string tecplot_variable_names;
380  int
381  ierr = 0,
382  file_type = 0, // full
383  is_double = 0,
384 #ifdef DEBUG
385  tec_debug = 1,
386 #else
387  tec_debug = 0,
388 #endif
389  cell_type = -1,
390  nn_per_elem = -1;
391 
392  switch (this->elem_dimension())
393  {
394  case 1:
395  cell_type = 1; // FELINESEG
396  nn_per_elem = 2;
397  break;
398 
399  case 2:
400  cell_type = 3; // FEQUADRILATERAL
401  nn_per_elem = 4;
402  break;
403 
404  case 3:
405  cell_type = 5; // FEBRICK
406  nn_per_elem = 8;
407  break;
408 
409  default:
410  libmesh_error_msg("Unsupported element dimension: " << this->elem_dimension());
411  }
412 
413  // Build a string containing all the variable names to pass to Tecplot
414  {
415  tecplot_variable_names += "x, y, z";
416 
417  if (solution_names != nullptr)
418  {
419  for (std::size_t name=0; name<solution_names->size(); name++)
420  {
421 #ifdef LIBMESH_USE_REAL_NUMBERS
422 
423  tecplot_variable_names += ", ";
424  tecplot_variable_names += (*solution_names)[name];
425 
426 #else
427 
428  tecplot_variable_names += ", ";
429  tecplot_variable_names += "r_";
430  tecplot_variable_names += (*solution_names)[name];
431  tecplot_variable_names += ", ";
432  tecplot_variable_names += "i_";
433  tecplot_variable_names += (*solution_names)[name];
434  tecplot_variable_names += ", ";
435  tecplot_variable_names += "a_";
436  tecplot_variable_names += (*solution_names)[name];
437 
438 #endif
439  }
440  }
441  }
442 
443  // Instantiate a TecplotMacros interface. In 2D the most nodes per
444  // face should be 4, in 3D it's 8.
445 
446 
447  TecplotMacros tm(the_mesh.n_nodes(),
448 #ifdef LIBMESH_USE_REAL_NUMBERS
449  (3 + ((solution_names == nullptr) ? 0 :
450  cast_int<unsigned int>(solution_names->size()))),
451 #else
452  (3 + 3*((solution_names == nullptr) ? 0 :
453  cast_int<unsigned int>(solution_names->size()))),
454 #endif
455  the_mesh.n_active_sub_elem(),
456  nn_per_elem
457  );
458 
459 
460  // Copy the nodes and data to the TecplotMacros class. Note that we store
461  // everything as a float here since the eye doesn't require a double to
462  // understand what is going on
463  for (unsigned int v=0; v<the_mesh.n_nodes(); v++)
464  {
465  tm.nd(0,v) = static_cast<float>(the_mesh.point(v)(0));
466  tm.nd(1,v) = static_cast<float>(the_mesh.point(v)(1));
467  tm.nd(2,v) = static_cast<float>(the_mesh.point(v)(2));
468 
469  if ((vec != nullptr) &&
470  (solution_names != nullptr))
471  {
472  const std::size_t n_vars = solution_names->size();
473 
474  for (std::size_t c=0; c<n_vars; c++)
475  {
476 #ifdef LIBMESH_USE_REAL_NUMBERS
477 
478  tm.nd((3+c),v) = static_cast<float>((*vec)[v*n_vars + c]);
479 #else
480  tm.nd((3+3*c),v) = static_cast<float>((*vec)[v*n_vars + c].real());
481  tm.nd((3+3*c+1),v) = static_cast<float>((*vec)[v*n_vars + c].imag());
482  tm.nd((3+3*c+2),v) = static_cast<float>(std::abs((*vec)[v*n_vars + c]));
483 #endif
484  }
485  }
486  }
487 
488 
489  // Initialize the file
490  ierr = TECINI112 (nullptr,
491  const_cast<char *>(tecplot_variable_names.c_str()),
492  const_cast<char *>(fname.c_str()),
493  const_cast<char *>("."),
494  &file_type,
495  &tec_debug,
496  &is_double);
497 
498  if (ierr)
499  libmesh_file_error(fname);
500 
501  // A zone for each subdomain
502  bool firstzone=true;
503  for (const auto & sbd_id : _subdomain_ids)
504  {
505  // Copy the connectivity for this subdomain
506  {
507  unsigned int n_subcells_in_subdomain=0;
508 
509  for (const auto & elem :
510  as_range(the_mesh.active_subdomain_elements_begin(sbd_id),
511  the_mesh.active_subdomain_elements_end(sbd_id)))
512  n_subcells_in_subdomain += elem->n_sub_elem();
513 
514  // update the connectivity array to include only the elements in this subdomain
515  tm.set_n_cells (n_subcells_in_subdomain);
516 
517  unsigned int te = 0;
518 
519  for (const auto & elem :
520  as_range(the_mesh.active_subdomain_elements_begin(sbd_id),
521  the_mesh.active_subdomain_elements_end(sbd_id)))
522  {
523  std::vector<dof_id_type> conn;
524  for (unsigned int se=0; se<elem->n_sub_elem(); se++)
525  {
526  elem->connectivity(se, TECPLOT, conn);
527 
528  for (std::size_t node=0; node<conn.size(); node++)
529  tm.cd(node,te) = conn[node];
530 
531  te++;
532  }
533  }
534  }
535 
536 
537  // Ready to call the Tecplot API for this subdomain
538  {
539  int
540  num_nodes = static_cast<int>(the_mesh.n_nodes()),
541  num_cells = static_cast<int>(tm.n_cells),
542  num_faces = 0,
543  i_cell_max = 0,
544  j_cell_max = 0,
545  k_cell_max = 0,
546  strand_id = std::max(sbd_id, static_cast<subdomain_id_type>(1)) + this->strand_offset(),
547  parent_zone = 0,
548  is_block = 1,
549  num_face_connect = 0,
550  face_neighbor_mode = 0,
551  tot_num_face_nodes = 0,
552  num_connect_boundary_faces = 0,
553  tot_num_boundary_connect = 0,
554  share_connect_from_zone=0;
555 
556  std::vector<int>
557  passive_var_list (tm.n_vars, 0),
558  share_var_from_zone (tm.n_vars, 1); // We only write data for the first zone, all other
559  // zones will share from this one.
560 
561  // get the subdomain name from libMesh, if there is one.
562  std::string subdomain_name = the_mesh.subdomain_name(sbd_id);
563  std::ostringstream zone_name;
564  zone_name << this->zone_title();
565 
566  // We will title this
567  // "{zone_title()}_{subdomain_name}", or
568  // "{zone_title()}_{subdomain_id}", or
569  // "{zone_title()}"
570  if (subdomain_name.size())
571  {
572  zone_name << "_";
573  zone_name << subdomain_name;
574  }
575  else if (_subdomain_ids.size() > 1)
576  {
577  zone_name << "_";
578  zone_name << sbd_id;
579  }
580 
581  ierr = TECZNE112 (const_cast<char *>(zone_name.str().c_str()),
582  &cell_type,
583  &num_nodes,
584  &num_cells,
585  &num_faces,
586  &i_cell_max,
587  &j_cell_max,
588  &k_cell_max,
589  &_time,
590  &strand_id,
591  &parent_zone,
592  &is_block,
593  &num_face_connect,
594  &face_neighbor_mode,
595  &tot_num_face_nodes,
596  &num_connect_boundary_faces,
597  &tot_num_boundary_connect,
598  passive_var_list.data(),
599  nullptr, // = all are node centered
600  (firstzone) ? nullptr : share_var_from_zone.data(),
601  &share_connect_from_zone);
602 
603  if (ierr)
604  libmesh_file_error(fname);
605 
606  // Write *all* the data for the first zone, then share it with the others
607  if (firstzone)
608  {
609  int total = cast_int<int>
610 #ifdef LIBMESH_USE_REAL_NUMBERS
611  ((3 + ((solution_names == nullptr) ? 0 : solution_names->size()))*num_nodes);
612 #else
613  ((3 + 3*((solution_names == nullptr) ? 0 : solution_names->size()))*num_nodes);
614 #endif
615 
616 
617  ierr = TECDAT112 (&total,
618  tm.nodalData.data(),
619  &is_double);
620 
621  if (ierr)
622  libmesh_file_error(fname);
623  }
624 
625  // Write the connectivity
626  ierr = TECNOD112 (tm.connData.data());
627 
628  if (ierr)
629  libmesh_file_error(fname);
630  }
631 
632  firstzone = false;
633  }
634 
635  // Done, close the file.
636  ierr = TECEND112 ();
637 
638  if (ierr)
639  libmesh_file_error(fname);
640 
641 
642 
643 
644  //------------------------------------------------------------
645  // Legacy binary format
646 #else
647 
648  // Get a constant reference to the mesh.
649  const MeshBase & the_mesh = MeshOutput<MeshBase>::mesh();
650 
651  // Tecplot binary output only good for dim=2,3
652  if (the_mesh.mesh_dimension() == 1)
653  {
654  this->write_ascii (fname, vec, solution_names);
655 
656  return;
657  }
658 
659  // Required variables
660  std::string tecplot_variable_names;
661  int is_double = 0,
662  tec_debug = 0,
663  cell_type = ((the_mesh.mesh_dimension()==2) ? (1) : (3));
664 
665  // Build a string containing all the variable names to pass to Tecplot
666  {
667  tecplot_variable_names += "x, y, z";
668 
669  if (solution_names != nullptr)
670  {
671  for (std::size_t name=0; name<solution_names->size(); name++)
672  {
673 #ifdef LIBMESH_USE_REAL_NUMBERS
674 
675  tecplot_variable_names += ", ";
676  tecplot_variable_names += (*solution_names)[name];
677 
678 #else
679 
680  tecplot_variable_names += ", ";
681  tecplot_variable_names += "r_";
682  tecplot_variable_names += (*solution_names)[name];
683  tecplot_variable_names += ", ";
684  tecplot_variable_names += "i_";
685  tecplot_variable_names += (*solution_names)[name];
686  tecplot_variable_names += ", ";
687  tecplot_variable_names += "a_";
688  tecplot_variable_names += (*solution_names)[name];
689 
690 #endif
691  }
692  }
693  }
694 
695  // Instantiate a TecplotMacros interface. In 2D the most nodes per
696  // face should be 4, in 3D it's 8.
697 
698 
699  TecplotMacros tm(cast_int<unsigned int>(the_mesh.n_nodes()),
700  cast_int<unsigned int>
701 #ifdef LIBMESH_USE_REAL_NUMBERS
702  (3 + ((solution_names == nullptr) ? 0 : solution_names->size())),
703 #else
704  (3 + 3*((solution_names == nullptr) ? 0 : solution_names->size())),
705 #endif
706  cast_int<unsigned int>
707  (the_mesh.n_active_sub_elem()),
708  ((the_mesh.mesh_dimension() == 2) ? 4 : 8)
709  );
710 
711 
712  // Copy the nodes and data to the TecplotMacros class. Note that we store
713  // everything as a float here since the eye doesn't require a double to
714  // understand what is going on
715  for (unsigned int v=0; v<the_mesh.n_nodes(); v++)
716  {
717  tm.nd(0,v) = static_cast<float>(the_mesh.point(v)(0));
718  tm.nd(1,v) = static_cast<float>(the_mesh.point(v)(1));
719  tm.nd(2,v) = static_cast<float>(the_mesh.point(v)(2));
720 
721  if ((vec != nullptr) &&
722  (solution_names != nullptr))
723  {
724  const std::size_t n_vars = solution_names->size();
725 
726  for (std::size_t c=0; c<n_vars; c++)
727  {
728 #ifdef LIBMESH_USE_REAL_NUMBERS
729 
730  tm.nd((3+c),v) = static_cast<float>((*vec)[v*n_vars + c]);
731 #else
732  tm.nd((3+3*c),v) = static_cast<float>((*vec)[v*n_vars + c].real());
733  tm.nd((3+3*c+1),v) = static_cast<float>((*vec)[v*n_vars + c].imag());
734  tm.nd((3+3*c+2),v) = static_cast<float>(std::abs((*vec)[v*n_vars + c]));
735 #endif
736  }
737  }
738  }
739 
740 
741  // Copy the connectivity
742  {
743  unsigned int te = 0;
744 
745  for (const auto & elem : the_mesh.active_element_ptr_range())
746  {
747  std::vector<dof_id_type> conn;
748  for (unsigned int se=0; se<elem->n_sub_elem(); se++)
749  {
750  elem->connectivity(se, TECPLOT, conn);
751 
752  for (std::size_t node=0; node<conn.size(); node++)
753  tm.cd(node,te) = conn[node];
754 
755  te++;
756  }
757  }
758  }
759 
760 
761  // Ready to call the Tecplot API
762  {
763  int ierr = 0,
764  num_nodes = static_cast<int>(the_mesh.n_nodes()),
765  num_cells = static_cast<int>(the_mesh.n_active_sub_elem());
766 
767 
768  ierr = TECINI (nullptr,
769  (char *) tecplot_variable_names.c_str(),
770  (char *) fname.c_str(),
771  (char *) ".",
772  &tec_debug,
773  &is_double);
774 
775  if (ierr)
776  libmesh_file_error(fname);
777 
778 
779  ierr = TECZNE (nullptr,
780  &num_nodes,
781  &num_cells,
782  &cell_type,
783  (char *) "FEBLOCK",
784  nullptr);
785 
786  if (ierr)
787  libmesh_file_error(fname);
788 
789 
790  int total =
791 #ifdef LIBMESH_USE_REAL_NUMBERS
792  ((3 + ((solution_names == nullptr) ? 0 : solution_names->size()))*num_nodes);
793 #else
794  ((3 + 3*((solution_names == nullptr) ? 0 : solution_names->size()))*num_nodes);
795 #endif
796 
797 
798  ierr = TECDAT (&total,
799  tm.nodalData.data(),
800  &is_double);
801 
802  if (ierr)
803  libmesh_file_error(fname);
804 
805  ierr = TECNOD (tm.connData.data());
806 
807  if (ierr)
808  libmesh_file_error(fname);
809 
810  ierr = TECEND ();
811 
812  if (ierr)
813  libmesh_file_error(fname);
814  }
815 
816 #endif
817 }
818 
819 } // namespace libMesh
std::string name(const ElemQuality q)
Definition: elem_quality.C:42
const MeshBase & mesh() const
Definition: mesh_output.h:234
double abs(double a)
int & strand_offset()
Definition: tecplot_io.C:156
std::vector< int > connData
Definition: tecplot_io.C:62
virtual element_iterator active_subdomain_elements_end(subdomain_id_type subdomain_id)=0
unsigned int & ascii_precision()
Definition: mesh_output.h:244
virtual SimpleRange< element_iterator > active_element_ptr_range()=0
const unsigned int n_vars
Definition: tecplot_io.C:69
long double max(long double a, double b)
Base class for Mesh.
Definition: mesh_base.h:77
void subdomain_ids(std::set< subdomain_id_type > &ids) const
Definition: mesh_base.C:288
std::set< subdomain_id_type > _subdomain_ids
Definition: tecplot_io.h:172
virtual element_iterator active_subdomain_elements_begin(subdomain_id_type subdomain_id)=0
void write_ascii(const std::string &, const std::vector< Number > *=nullptr, const std::vector< std::string > *=nullptr)
Definition: tecplot_io.C:233
const dof_id_type n_nodes
Definition: tecplot_io.C:68
void write_unformatted(std::ostream &out, const bool newline=true) const
Definition: type_vector.C:92
SimpleRange< I > as_range(const std::pair< I, I > &p)
Definition: simple_range.h:57
void write_binary(const std::string &, const std::vector< Number > *=nullptr, const std::vector< std::string > *=nullptr)
Definition: tecplot_io.C:352
std::string & subdomain_name(subdomain_id_type id)
Definition: mesh_base.C:538
OStreamProxy err(std::cerr)
virtual void write(const std::string &) override
Definition: tecplot_io.C:175
unsigned elem_dimension()
Definition: tecplot_io.C:205
PetscErrorCode ierr
dof_id_type n_active_sub_elem() const
Definition: mesh_base.C:366
unsigned int mesh_dimension() const
Definition: mesh_base.C:126
virtual const Point & point(const dof_id_type i) const =0
virtual void write_nodal_data(const std::string &, const std::vector< Number > &, const std::vector< std::string > &) override
Definition: tecplot_io.C:188
dof_id_type n_cells
Definition: tecplot_io.C:70
OStreamProxy out(std::cout)
const unsigned int n_vert
Definition: tecplot_io.C:71
std::vector< float > nodalData
Definition: tecplot_io.C:61
virtual dof_id_type n_nodes() const =0
bool & ascii_append()
Definition: tecplot_io.C:169
std::string & zone_title()
Definition: tecplot_io.C:163
std::string _zone_title
Definition: tecplot_io.h:161
uint8_t dof_id_type
Definition: id_types.h:64
double & time()
Definition: tecplot_io.C:149