File: coll_reader.hpp

package info (click to toggle)
glvis 4.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 7,780 kB
  • sloc: cpp: 35,217; ansic: 5,695; sh: 340; makefile: 301; python: 193
file content (55 lines) | stat: -rw-r--r-- 1,882 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright (c) 2010-2026, Lawrence Livermore National Security, LLC. Produced
// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
// LICENSE and NOTICE for details. LLNL-CODE-443271.
//
// This file is part of the GLVis visualization tool and library. For more
// information and source code availability see https://glvis.org.
//
// GLVis is free software; you can redistribute it and/or modify it under the
// terms of the BSD-3 license. We welcome feedback and contributions, see file
// CONTRIBUTING.md for details.

#ifndef GLVIS_COLL_READER_HPP
#define GLVIS_COLL_READER_HPP

#include "data_state.hpp"

class DataCollectionReader
{
   DataState &data;
   int pad_digits = 6;
   std::string protocol;

public:
   enum class CollType
   {
      VISIT,
      PARAVIEW, // not currently implemented
      SIDRE,
      FMS,
      CONDUIT,
      ADIOS2, // not currently implemented
   };

   DataCollectionReader(DataState &data_) : data(data_) { }

   /// Set the padding digits
   void SetPadDigits(int digits) { pad_digits = digits; }

   /// Set the I/O protocol to for loading of collections
   void SetProtocol(const char *protocol_) { protocol = protocol_; }

   /// Load the mesh and solution from a collection
   /** Loads the mesh and optionally a grid or quadrature function from the
       provided data collection.
       @param ct        collection type
       @param dc        data collection
       @param ti        cycle to load
       @param field     name of the (Q-)field to load (NULL for mesh only)
       @param quad      if true, Q-field is loaded, otherwise a regular field
       @param component component of the field (-1 means all components) */
   int ReadSerial(CollType ct, const char *dc, int ti,
                  const char *field = NULL, bool quad = false, int component = -1);
};

#endif // GLVIS_COLL_READER_HPP