getfem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getfem-commits] (no subject)


From: Tetsuo Koyama
Subject: [Getfem-commits] (no subject)
Date: Wed, 6 May 2020 19:59:31 -0400 (EDT)

branch: devel-tetsuo-xml
commit 4455909c48ca0c5c5bef182498fcaf5c25c64b87
Author: Tetsuo Koyama <address@hidden>
AuthorDate: Sat Apr 25 16:15:06 2020 +0000

    :heavy_plus_sign: VTU export
---
 src/getfem/getfem_export.h | 16 ++++++++++++++++
 src/getfem_export.cc       | 16 ++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/src/getfem/getfem_export.h b/src/getfem/getfem_export.h
index de1a654..f7b601b 100644
--- a/src/getfem/getfem_export.h
+++ b/src/getfem/getfem_export.h
@@ -286,6 +286,22 @@ namespace getfem {
     write_separ();
   }
 
+  /** @brief VTU export.
+
+      export class to VTU file format
+      (Serial vtkUnstructuredGrid (unstructured))
+  */
+  class vtu_export {
+  protected:
+    std::ostream &os;
+    bool ascii;
+    std::ofstream real_os;
+  public:
+    vtu_export(const std::string& fname, bool ascii_= false);
+    vtu_export(std::ostream &os_, bool ascii_ = false);
+    void exporting(const mesh& m);
+    void write_mesh();
+  };
 
   /** @brief A (quite large) class for exportation of data to IBM OpenDX.
 
diff --git a/src/getfem_export.cc b/src/getfem_export.cc
index f3de086..e3ae7ba 100644
--- a/src/getfem_export.cc
+++ b/src/getfem_export.cc
@@ -449,6 +449,22 @@ namespace getfem
     }
   }
 
+  vtu_export::vtu_export(std::ostream &os_, bool ascii_)
+    : os(os_), ascii(ascii_) {  }
+
+  vtu_export::vtu_export(const std::string& fname, bool ascii_)
+    : os(real_os), ascii(ascii_),
+    real_os(fname.c_str(), !ascii ? std::ios_base::binary | std::ios_base::out 
:
+                                    std::ios_base::out) {
+    GMM_ASSERT1(real_os, "impossible to write to vtu file '" << fname << "'");
+  }
+
+  void vtu_export::exporting(const mesh& m) {
+     (void) m;
+  }
+
+  void vtu_export::write_mesh() {
+  }
 
   /* -------------------------------------------------------------
    * OPENDX export



reply via email to

[Prev in Thread] Current Thread [Next in Thread]