From 1e78e5c2d65af87769a367c37dcf6ff8815f3cde Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Fri, 17 Sep 2010 14:48:32 +0200 Subject: [PATCH] fix vtk-dump: vector fields consider mesh type furthermore: - new argument: --nativeFieldDumps to dump original FDTD field components for debugging purposes - show global arguments on startup --- FDTD/processfields.cpp | 37 ++++++++++++++++++++++++++++--------- FDTD/processfields.h | 2 +- main.cpp | 2 ++ tools/global.cpp | 14 +++++++++++++- tools/global.h | 8 ++++++++ 5 files changed, 52 insertions(+), 11 deletions(-) diff --git a/FDTD/processfields.cpp b/FDTD/processfields.cpp index fc355e0..16c8b38 100644 --- a/FDTD/processfields.cpp +++ b/FDTD/processfields.cpp @@ -345,23 +345,42 @@ void ProcessFields::WriteVTKCylindricalGridHeader(ofstream &file, double const* } -void ProcessFields::WriteVTKVectorArray(ofstream &file, string name, FDTD_FLOAT const* const* const* const* array, unsigned int const* numLines, unsigned int precision) +void ProcessFields::WriteVTKVectorArray(ofstream &file, string name, FDTD_FLOAT const* const* const* const* array, double const* const* discLines, unsigned int const* numLines, unsigned int precision, MeshType meshT) { file << "VECTORS " << name << " float " << endl; + if (g_settings.NativeFieldDumps()) + meshT = CARTESIAN_MESH; //dump field components as they are... + unsigned int pos[3]; for (pos[2]=0;pos[2]\tForce use n threads for multithreaded engine (needs: --engine=multithreaded)" << endl; cout << "\t--no-simulation\tonly run preprocessing; do not simulate" << endl; + cout << "\n\t Additional global arguments " << endl; + g_settings.ShowArguments(cout,"\t"); cout << endl; exit(-1); } diff --git a/tools/global.cpp b/tools/global.cpp index bdbea54..d89d4f6 100644 --- a/tools/global.cpp +++ b/tools/global.cpp @@ -27,6 +27,13 @@ Global g_settings; Global::Global() { m_showProbeDiscretization = false; + m_nativeFieldDumps = false; +} + +void Global::ShowArguments(ostream& ostr, string front) +{ + ostr << front << "--showProbeDiscretization\tShow probe discretization information" << endl; + ostr << front << "--nativeFieldDumps\tDump all fields using the native field components" << endl; } //! \brief This function initializes the object @@ -41,6 +48,11 @@ bool Global::parseCommandLineArgument( const char *argv ) m_showProbeDiscretization = true; return true; } - + else if (strcmp(argv,"--nativeFieldDumps")==0) + { + cout << "openEMS - dumping all fields using the native field components" << endl; + m_nativeFieldDumps = true; + return true; + } return false; } diff --git a/tools/global.h b/tools/global.h index 10e5e34..cb6a133 100644 --- a/tools/global.h +++ b/tools/global.h @@ -18,6 +18,8 @@ #ifndef GLOBAL_H #define GLOBAL_H +#include + class Global { public: @@ -26,8 +28,14 @@ public: bool showProbeDiscretization() const {return m_showProbeDiscretization;} + //! Returns true if native field dumps are requested... + bool NativeFieldDumps() const {return m_nativeFieldDumps;} + + void ShowArguments(std::ostream& ostr, std::string front=std::string()); + protected: bool m_showProbeDiscretization; + bool m_nativeFieldDumps; }; extern Global g_settings;