GLVis  v4.2
Accurate and flexible finite element visualization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
stream_reader.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
2 // at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3 // LICENSE and NOTICE for details. LLNL-CODE-443271.
4 //
5 // This file is part of the GLVis visualization tool and library. For more
6 // information and source code availability see https://glvis.org.
7 //
8 // GLVis is free software; you can redistribute it and/or modify it under the
9 // terms of the BSD-3 license. We welcome feedback and contributions, see file
10 // CONTRIBUTING.md for details.
11 
12 #ifndef GLVIS_STREAM_READER_HPP
13 #define GLVIS_STREAM_READER_HPP
14 
15 #include <string>
16 #include <memory>
17 #include "mfem.hpp"
18 #include "openglvis.hpp"
19 
21 {
22  mfem::Vector sol, solu, solv, solw, normals;
23  std::string keys;
24  std::unique_ptr<mfem::Mesh> mesh;
25  std::unique_ptr<mfem::GridFunction> grid_f;
26  int is_gf{0};
27  bool fix_elem_orient{false};
28  bool save_coloring{false};
29 
32 
34  void SetMeshSolution();
35 
36  int ReadStream(std::istream &is, const std::string &data_type);
37 
45  bool SetNewMeshAndSolution(StreamState new_state,
47 };
48 
49 // Replace a given VectorFiniteElement-based grid function (e.g. from a Nedelec
50 // or Raviart-Thomas space) with a discontinuous piece-wise polynomial Cartesian
51 // product vector grid function of the same order.
52 std::unique_ptr<mfem::GridFunction>
53 ProjectVectorFEGridFunction(std::unique_ptr<mfem::GridFunction> gf);
54 
55 #endif // GLVIS_STREAM_READER_HPP
std::unique_ptr< GridFunction > ProjectVectorFEGridFunction(std::unique_ptr< GridFunction > gf)
void Extrude1DMeshAndSolution()
Helper function for visualizing 1D data.
mfem::Vector solv
std::unique_ptr< mfem::GridFunction > grid_f
mfem::Vector solu
thread_local VisualizationSceneScalarData * vs
Definition: glvis.cpp:67
mfem::Vector solw
void SetMeshSolution()
Set a (checkerboard) solution when only the mesh is given.
std::string keys
bool SetNewMeshAndSolution(StreamState new_state, VisualizationScene *vs)
std::unique_ptr< mfem::Mesh > mesh
bool fix_elem_orient
mfem::Vector normals
int ReadStream(std::istream &is, const std::string &data_type)
mfem::Vector sol