vtudata.hpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef _SCTL_VTUDATA_
  2. #define _SCTL_VTUDATA_
  3. #include <sctl/common.hpp>
  4. #include SCTL_INCLUDE(comm.hpp)
  5. #include SCTL_INCLUDE(vector.hpp)
  6. #include SCTL_INCLUDE(mem_mgr.hpp)
  7. namespace SCTL_NAMESPACE {
  8. class Comm;
  9. template <class ValueType> class Vector;
  10. template <class ValueType> class Matrix;
  11. struct VTUData {
  12. typedef float VTKReal;
  13. // Point data
  14. Vector<VTKReal> coord; // always 3D
  15. Vector<VTKReal> value;
  16. // Cell data
  17. Vector<int32_t> connect;
  18. Vector<int32_t> offset;
  19. Vector<uint8_t> types;
  20. void WriteVTK(const std::string& fname, const Comm& comm) const;
  21. template <class ElemLst> void AddElems(const ElemLst elem_lst, Integer order, const Comm& comm = Comm::Self());
  22. template <class ElemLst, class ValueBasis> void AddElems(const ElemLst elem_lst, const Vector<ValueBasis>& elem_value, Integer order, const Comm& comm = Comm::Self());
  23. private:
  24. template <class CoordType, Integer ELEM_DIM> static Matrix<CoordType> VTK_Nodes(Integer order);
  25. };
  26. }
  27. #include SCTL_INCLUDE(vtudata.txx)
  28. #endif //_SCTL_VTUDATA_