From f06cc293dc88ec6b39c991c319e2d633a81d8db2 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Thu, 18 Jun 2015 21:45:22 +0200 Subject: [PATCH] remove using namespace std from header files Signed-off-by: Thorsten Liebig --- Common/operator_base.cpp | 2 ++ Common/operator_base.h | 6 ++-- Common/processcurrent.h | 4 +-- Common/processfieldprobe.cpp | 2 ++ Common/processfieldprobe.h | 4 +-- Common/processfields.h | 8 ++--- Common/processfields_fd.cpp | 2 ++ Common/processfields_fd.h | 4 +-- Common/processfields_sar.cpp | 2 ++ Common/processfields_sar.h | 10 +++--- Common/processfields_td.cpp | 2 ++ Common/processfields_td.h | 2 +- Common/processing.cpp | 2 ++ Common/processing.h | 36 +++++++++---------- Common/processintegral.cpp | 2 ++ Common/processintegral.h | 8 ++--- Common/processmodematch.cpp | 2 ++ Common/processmodematch.h | 8 ++--- Common/processvoltage.cpp | 2 +- Common/processvoltage.h | 4 +-- FDTD/excitation.cpp | 2 ++ FDTD/excitation.h | 6 ++-- FDTD/extensions/operator_ext_dispersive.cpp | 2 ++ FDTD/extensions/operator_ext_dispersive.h | 6 ++-- FDTD/extensions/operator_ext_upml.cpp | 2 ++ FDTD/extensions/operator_extension.cpp | 2 ++ FDTD/extensions/operator_extension.h | 6 ++-- nf2ff/nf2ff.cpp | 2 ++ nf2ff/nf2ff_calc.cpp | 2 ++ nf2ff/nf2ff_calc.h | 38 ++++++++++----------- openems.cpp | 2 ++ openems.h | 12 +++---- tools/AdrOp.cpp | 2 ++ tools/AdrOp.h | 2 -- tools/array_ops.cpp | 2 ++ tools/array_ops.h | 6 ++-- tools/sar_calculation.cpp | 2 ++ 37 files changed, 116 insertions(+), 92 deletions(-) diff --git a/Common/operator_base.cpp b/Common/operator_base.cpp index 37a3d20..e5d26f5 100644 --- a/Common/operator_base.cpp +++ b/Common/operator_base.cpp @@ -17,6 +17,8 @@ #include "operator_base.h" +using namespace std; + Operator_Base::Operator_Base() { Init(); diff --git a/Common/operator_base.h b/Common/operator_base.h index 41d3844..cfbd40b 100644 --- a/Common/operator_base.h +++ b/Common/operator_base.h @@ -25,8 +25,8 @@ typedef struct { - vector posPath[3]; - vector dir; + std::vector posPath[3]; + std::vector dir; } Grid_Path; //! Abstract base-class for a common operator @@ -114,7 +114,7 @@ public: //! Get the cell center coordinate usable for material averaging (Warning, may not be the yee cell center) virtual bool GetCellCenterMaterialAvgCoord(const int pos[3], double coord[3]) const = 0; - virtual vector GetPrimitivesBoundBox(int posX, int posY, int posZ, CSProperties::PropertyType type=CSProperties::ANY) const = 0; + virtual std::vector GetPrimitivesBoundBox(int posX, int posY, int posZ, CSProperties::PropertyType type=CSProperties::ANY) const = 0; //! Set the background material (default is vacuum) virtual void SetBackgroundMaterial(double epsR=0, double mueR=0, double kappa=0, double sigma=0, double density=0); diff --git a/Common/processcurrent.h b/Common/processcurrent.h index 0606531..5152b92 100644 --- a/Common/processcurrent.h +++ b/Common/processcurrent.h @@ -26,9 +26,9 @@ public: ProcessCurrent(Engine_Interface_Base* eng_if); virtual ~ProcessCurrent(); - virtual string GetProcessingName() const {return "current integration";} + virtual std::string GetProcessingName() const {return "current integration";} - virtual string GetIntegralName(int row) const; + virtual std::string GetIntegralName(int row) const; virtual void DefineStartStopCoord(double* dstart, double* dstop); diff --git a/Common/processfieldprobe.cpp b/Common/processfieldprobe.cpp index 7ba5f2b..c456a22 100644 --- a/Common/processfieldprobe.cpp +++ b/Common/processfieldprobe.cpp @@ -17,6 +17,8 @@ #include "processfieldprobe.h" +using namespace std; + ProcessFieldProbe::ProcessFieldProbe(Engine_Interface_Base* eng_if, int type) : ProcessIntegral(eng_if) { SetFieldType(type); diff --git a/Common/processfieldprobe.h b/Common/processfieldprobe.h index d14b965..342eba4 100644 --- a/Common/processfieldprobe.h +++ b/Common/processfieldprobe.h @@ -26,9 +26,9 @@ public: ProcessFieldProbe(Engine_Interface_Base* eng_if, int type=0); virtual ~ProcessFieldProbe(); - virtual string GetProcessingName() const; + virtual std::string GetProcessingName() const; - virtual string GetIntegralName(int row) const; + virtual std::string GetIntegralName(int row) const; //! Set the field type (0 electric field, 1 magnetic field) void SetFieldType(int type); diff --git a/Common/processfields.h b/Common/processfields.h index b628d4f..3d4085b 100644 --- a/Common/processfields.h +++ b/Common/processfields.h @@ -42,7 +42,7 @@ public: */ enum DumpType { E_FIELD_DUMP=0, H_FIELD_DUMP=1, J_FIELD_DUMP=2, ROTH_FIELD_DUMP=3, SAR_LOCAL_DUMP=20, SAR_1G_DUMP=21, SAR_10G_DUMP=22, SAR_RAW_DATA=29}; - virtual string GetProcessingName() const {return "common field processing";} + virtual std::string GetProcessingName() const {return "common field processing";} virtual void InitProcess(); @@ -55,8 +55,8 @@ public: virtual void SetOptResolution(double optRes, int dir=-1); //! Set the filename for a hdf5 data group file (HDF5 FileType only) \sa SetFileType() - void SetFileName(string fn) {m_filename=fn;} - string SetFileName() const {return m_filename;} + void SetFileName(std::string fn) {m_filename=fn;} + std::string SetFileName() const {return m_filename;} //! Define the Dump-Mode void SetDumpMode(Engine_Interface_Base::InterpolationType mode); @@ -72,7 +72,7 @@ public: void SetFileType(FileType fileType) {m_fileType=fileType;} - static string GetFieldNameByType(DumpType type); + static std::string GetFieldNameByType(DumpType type); virtual bool NeedConductivity() const; diff --git a/Common/processfields_fd.cpp b/Common/processfields_fd.cpp index 75bbffc..ca59b2b 100644 --- a/Common/processfields_fd.cpp +++ b/Common/processfields_fd.cpp @@ -23,6 +23,8 @@ #include #include +using namespace std; + ProcessFieldsFD::ProcessFieldsFD(Engine_Interface_Base* eng_if) : ProcessFields(eng_if) { } diff --git a/Common/processfields_fd.h b/Common/processfields_fd.h index d078137..2049cc3 100644 --- a/Common/processfields_fd.h +++ b/Common/processfields_fd.h @@ -26,7 +26,7 @@ public: ProcessFieldsFD(Engine_Interface_Base* eng_if); virtual ~ProcessFieldsFD(); - virtual string GetProcessingName() const {return "frequency domain field dump";} + virtual std::string GetProcessingName() const {return "frequency domain field dump";} virtual void InitProcess(); @@ -37,7 +37,7 @@ protected: virtual void DumpFDData(); //! frequency domain field storage - vector****> m_FD_Fields; + std::vector****> m_FD_Fields; }; #endif // PROCESSFIELDS_FD_H diff --git a/Common/processfields_sar.cpp b/Common/processfields_sar.cpp index 79a9f6d..9bbdab2 100644 --- a/Common/processfields_sar.cpp +++ b/Common/processfields_sar.cpp @@ -23,6 +23,8 @@ #include "CSPropMaterial.h" +using namespace std; + ProcessFieldsSAR::ProcessFieldsSAR(Engine_Interface_Base* eng_if) : ProcessFieldsFD(eng_if) { m_UseCellKappa = true; diff --git a/Common/processfields_sar.h b/Common/processfields_sar.h index 8e4c353..289100d 100644 --- a/Common/processfields_sar.h +++ b/Common/processfields_sar.h @@ -30,7 +30,7 @@ public: virtual bool NeedConductivity() const; - virtual string GetProcessingName() const {return "SAR dump";} + virtual std::string GetProcessingName() const {return "SAR dump";} virtual void InitProcess(); @@ -43,19 +43,19 @@ public: //! Set to true for using the conductivity found at the center of a cell, or false for E*J instead virtual void SetUseCellConductivity(bool val) {m_UseCellKappa=val;} - virtual void SetSARAveragingMethod(string method) {m_SAR_method=method;} + virtual void SetSARAveragingMethod(std::string method) {m_SAR_method=method;} protected: virtual void DumpFDData(); bool m_UseCellKappa; - string m_SAR_method; + std::string m_SAR_method; //! frequency domain electric field storage - vector****> m_E_FD_Fields; + std::vector****> m_E_FD_Fields; //! frequency domain current density storage - vector****> m_J_FD_Fields; + std::vector****> m_J_FD_Fields; }; #endif // PROCESSFIELDS_SAR_H diff --git a/Common/processfields_td.cpp b/Common/processfields_td.cpp index e17ea6a..d67e48b 100644 --- a/Common/processfields_td.cpp +++ b/Common/processfields_td.cpp @@ -23,6 +23,8 @@ #include #include +using namespace std; + ProcessFieldsTD::ProcessFieldsTD(Engine_Interface_Base* eng_if) : ProcessFields(eng_if) { pad_length = 8; diff --git a/Common/processfields_td.h b/Common/processfields_td.h index 02345b6..91c4c04 100644 --- a/Common/processfields_td.h +++ b/Common/processfields_td.h @@ -26,7 +26,7 @@ public: ProcessFieldsTD(Engine_Interface_Base* eng_if); virtual ~ProcessFieldsTD(); - virtual string GetProcessingName() const {return "time domain field dump";} + virtual std::string GetProcessingName() const {return "time domain field dump";} virtual void InitProcess(); diff --git a/Common/processing.cpp b/Common/processing.cpp index 686f3be..a444d9d 100644 --- a/Common/processing.cpp +++ b/Common/processing.cpp @@ -22,6 +22,8 @@ #include "processing.h" #include +using namespace std; + Processing::Processing(Engine_Interface_Base* eng_if) { m_Eng_Interface = NULL; diff --git a/Common/processing.h b/Common/processing.h index e6c37fb..2042706 100644 --- a/Common/processing.h +++ b/Common/processing.h @@ -35,8 +35,6 @@ typedef std::complex double_complex; class Operator_Base; -using namespace std; - class Processing { public: @@ -47,12 +45,12 @@ public: //! Set the interface to the engine. Each processing needs its own engine interface. This class will take ownership and cleanup the interface on deletion! void SetEngineInterface(Engine_Interface_Base* eng_if); - virtual void SetName(string val) {m_Name=val;} - virtual void SetName(string val, int number); - virtual string GetName() const {return m_Name;} + virtual void SetName(std::string val) {m_Name=val;} + virtual void SetName(std::string val, int number); + virtual std::string GetName() const {return m_Name;} //! Get the name for this processing, will be used in file description. - virtual string GetProcessingName() const = 0; + virtual std::string GetProcessingName() const = 0; virtual void InitProcess() {}; virtual void Reset(); @@ -61,14 +59,14 @@ public: virtual void ShowSnappedCoords(); - void SetProcessInterval(unsigned int interval) {ProcessInterval=max((unsigned int)1,interval);} + void SetProcessInterval(unsigned int interval) {ProcessInterval=std::max((unsigned int)1,interval);} void SetProcessStartStopTime(double start, double stop); void AddStep(unsigned int step); - void AddSteps(vector steps); + void AddSteps(std::vector steps); void AddFrequency(double freq); - void AddFrequency(vector *freqs); + void AddFrequency(std::vector *freqs); bool CheckTimestep(); @@ -99,10 +97,10 @@ public: void SetPrecision(unsigned int val) {m_precision = val;} //! Dump probe geometry to file (will obay main or dual mesh property) - virtual void DumpBox2File( string vtkfilenameprefix) const {DumpBox2File(vtkfilenameprefix,m_dualMesh);} + virtual void DumpBox2File(std::string vtkfilenameprefix) const {DumpBox2File(vtkfilenameprefix,m_dualMesh);} //! Dump probe geometry to file - virtual void DumpBox2File( string vtkfilenameprefix, bool dualMesh) const; + virtual void DumpBox2File(std::string vtkfilenameprefix, bool dualMesh) const; virtual void SetDualMesh(bool val) {m_dualMesh=val;} virtual void SetDualTime(bool val) {m_dualTime=val;} @@ -115,7 +113,7 @@ protected: unsigned int m_precision; - string m_Name; + std::string m_Name; bool m_Flush; @@ -127,10 +125,10 @@ protected: unsigned int ProcessInterval; size_t m_PS_pos; //! current position in list of processing steps - vector m_ProcessSteps; //! list of processing steps + std::vector m_ProcessSteps; //! list of processing steps //! Vector of frequency samples - vector m_FD_Samples; + std::vector m_FD_Samples; //! Number of samples already processed unsigned int m_FD_SampleCount; //! Sampling interval needed for the FD_Samples @@ -159,10 +157,10 @@ protected: bool m_start_inside[3]; bool m_stop_inside[3]; - ofstream file; - string m_filename; + std::ofstream file; + std::string m_filename; - virtual void OpenFile(string outfile); + virtual void OpenFile(std::string outfile); }; class ProcessingArray @@ -192,7 +190,7 @@ public: //! Invoke PostProcess() on all Processings. void PostProcess(); - void DumpBoxes2File( string vtkfilenameprefix ) const; + void DumpBoxes2File(std::string vtkfilenameprefix ) const; size_t GetNumberOfProcessings() const {return ProcessArray.size();} @@ -200,7 +198,7 @@ public: protected: unsigned int maxInterval; - vector ProcessArray; + std::vector ProcessArray; }; #endif // PROCESSING_H diff --git a/Common/processintegral.cpp b/Common/processintegral.cpp index 6010e0f..b64b479 100644 --- a/Common/processintegral.cpp +++ b/Common/processintegral.cpp @@ -20,6 +20,8 @@ #include "time.h" #include +using namespace std; + ProcessIntegral::ProcessIntegral(Engine_Interface_Base* eng_if) : Processing(eng_if) { m_Results=NULL; diff --git a/Common/processintegral.h b/Common/processintegral.h index d7d611d..1bddfd6 100644 --- a/Common/processintegral.h +++ b/Common/processintegral.h @@ -31,7 +31,7 @@ public: virtual void InitProcess(); - virtual string GetProcessingName() const = 0; + virtual std::string GetProcessingName() const = 0; virtual void GetNormalDir(int nd) {m_normDir=nd;} @@ -46,7 +46,7 @@ public: virtual double* CalcMultipleIntegrals(); //! Get the name of the integral for the given row. The names will be used in the file header. - virtual string GetIntegralName(int row) const = 0; + virtual std::string GetIntegralName(int row) const = 0; //! Number of calculated results produced by this integral processing. \sa CalcMultipleIntegrals virtual int GetNumberOfIntegrals() const {return 1;} @@ -60,9 +60,9 @@ public: protected: ProcessIntegral(Engine_Interface_Base* eng_if); - void Dump_FD_Data(double factor, string filename); + void Dump_FD_Data(double factor, std::string filename); - vector *m_FD_Results; + std::vector *m_FD_Results; double *m_Results; int m_normDir; // normal direction as required by some integral processings diff --git a/Common/processmodematch.cpp b/Common/processmodematch.cpp index bce1435..9c71c7a 100644 --- a/Common/processmodematch.cpp +++ b/Common/processmodematch.cpp @@ -20,6 +20,8 @@ #include "Common/operator_base.h" #include "tools/array_ops.h" +using namespace std; + ProcessModeMatch::ProcessModeMatch(Engine_Interface_Base* eng_if) : ProcessIntegral(eng_if) { for (int n=0; n<2; ++n) diff --git a/Common/processmodematch.h b/Common/processmodematch.h index 1f95a1a..0bb03b7 100644 --- a/Common/processmodematch.h +++ b/Common/processmodematch.h @@ -33,9 +33,9 @@ public: ProcessModeMatch(Engine_Interface_Base* eng_if); virtual ~ProcessModeMatch(); - virtual string GetProcessingName() const; + virtual std::string GetProcessingName() const; - virtual string GetIntegralName(int row) const; + virtual std::string GetIntegralName(int row) const; virtual void InitProcess(); virtual void Reset(); @@ -43,7 +43,7 @@ public: //! Set the field type (0 electric field, 1 magnetic field) void SetFieldType(int type); //! Set the mode function in the given direction ny. For example: SetModeFunction(0,"cos(pi/1000*x)*sin(pi/500*y)"); - void SetModeFunction(int ny, string function); + void SetModeFunction(int ny, std::string function); virtual int GetNumberOfIntegrals() const {return 2;} virtual double* CalcMultipleIntegrals(); @@ -58,7 +58,7 @@ protected: double GetEField(int ny, const unsigned int pos[3]); double GetHField(int ny, const unsigned int pos[3]); - string m_ModeFunction[3]; + std::string m_ModeFunction[3]; CSFunctionParser* m_ModeParser[2]; unsigned int m_numLines[2]; diff --git a/Common/processvoltage.cpp b/Common/processvoltage.cpp index 27d731f..6875b03 100644 --- a/Common/processvoltage.cpp +++ b/Common/processvoltage.cpp @@ -26,7 +26,7 @@ ProcessVoltage::~ProcessVoltage() { } -string ProcessVoltage::GetIntegralName(int row) const +std::string ProcessVoltage::GetIntegralName(int row) const { if (row==0) return "voltage"; diff --git a/Common/processvoltage.h b/Common/processvoltage.h index 7539db0..509ddbf 100644 --- a/Common/processvoltage.h +++ b/Common/processvoltage.h @@ -27,9 +27,9 @@ public: ProcessVoltage(Engine_Interface_Base* eng_if); virtual ~ProcessVoltage(); - virtual string GetProcessingName() const {return "voltage integration";} + virtual std::string GetProcessingName() const {return "voltage integration";} - virtual string GetIntegralName(int row) const; + virtual std::string GetIntegralName(int row) const; virtual double CalcIntegral(); diff --git a/FDTD/excitation.cpp b/FDTD/excitation.cpp index 8b0ceb6..c2a0c8f 100644 --- a/FDTD/excitation.cpp +++ b/FDTD/excitation.cpp @@ -23,6 +23,8 @@ #include "tinyxml.h" #include "excitation.h" +using namespace std; + Excitation::Excitation() { Signal_volt = 0; diff --git a/FDTD/excitation.h b/FDTD/excitation.h index 8ab99d7..d851fa8 100644 --- a/FDTD/excitation.h +++ b/FDTD/excitation.h @@ -42,10 +42,10 @@ public: unsigned int GetNyquistNum() const {return m_nyquistTS;} //! Dump voltage excitation signal to ASCII file - void DumpVoltageExcite(string filename); + void DumpVoltageExcite(std::string filename); //! Dump current excitation signal to ASCII file - void DumpCurrentExcite(string filename); + void DumpCurrentExcite(std::string filename); //! Get the used timestep double GetTimestep() const {return dT;} @@ -87,7 +87,7 @@ protected: double m_foi; //! Calculate a custom signal - virtual void CalcCustomExcitation(double f0, int nTS, string signal); + virtual void CalcCustomExcitation(double f0, int nTS, std::string signal); //! Calculate an excitation with center of \a f0 and the half bandwidth \a fc virtual void CalcGaussianPulsExcitation(double f0, double fc, int nTS); //! Calculate a sinusoidal excitation with frequency \a f0 and a duration of \a nTS number of timesteps diff --git a/FDTD/extensions/operator_ext_dispersive.cpp b/FDTD/extensions/operator_ext_dispersive.cpp index ffc4c01..ed01f1d 100644 --- a/FDTD/extensions/operator_ext_dispersive.cpp +++ b/FDTD/extensions/operator_ext_dispersive.cpp @@ -19,6 +19,8 @@ #include "tools/array_ops.h" +using namespace std; + Operator_Ext_Dispersive::Operator_Ext_Dispersive(Operator* op) : Operator_Extension(op) { m_curr_ADE_On = NULL; diff --git a/FDTD/extensions/operator_ext_dispersive.h b/FDTD/extensions/operator_ext_dispersive.h index 476d647..fab354c 100644 --- a/FDTD/extensions/operator_ext_dispersive.h +++ b/FDTD/extensions/operator_ext_dispersive.h @@ -31,9 +31,9 @@ public: virtual int GetDispersionOrder() {return m_Order;} - virtual string GetExtensionName() const {return string("Dispersive Material Abstract Base class");} + virtual std::string GetExtensionName() const {return std::string("Dispersive Material Abstract Base class");} - virtual void ShowStat(ostream &ostr) const; + virtual void ShowStat(std::ostream &ostr) const; protected: Operator_Ext_Dispersive(Operator* op); @@ -44,7 +44,7 @@ protected: int m_Order; //! Dispersive material count - vector m_LM_Count; + std::vector m_LM_Count; //! Index with dispersive material // Array setup: m_LM_pos[N_order][direction][mesh_pos] unsigned int ***m_LM_pos; diff --git a/FDTD/extensions/operator_ext_upml.cpp b/FDTD/extensions/operator_ext_upml.cpp index 756abcd..fc46d85 100644 --- a/FDTD/extensions/operator_ext_upml.cpp +++ b/FDTD/extensions/operator_ext_upml.cpp @@ -21,6 +21,8 @@ #include "tools/array_ops.h" #include "fparser.hh" +using namespace std; + Operator_Ext_UPML::Operator_Ext_UPML(Operator* op) : Operator_Extension(op) { m_GradingFunction = new FunctionParser(); diff --git a/FDTD/extensions/operator_extension.cpp b/FDTD/extensions/operator_extension.cpp index 27b2b93..50e7068 100644 --- a/FDTD/extensions/operator_extension.cpp +++ b/FDTD/extensions/operator_extension.cpp @@ -19,6 +19,8 @@ #include "FDTD/operator.h" #include "FDTD/operator_cylinder.h" +using namespace std; + Operator_Extension::Operator_Extension(Operator* op) { m_Op = op; diff --git a/FDTD/extensions/operator_extension.h b/FDTD/extensions/operator_extension.h index eea7193..21e42af 100644 --- a/FDTD/extensions/operator_extension.h +++ b/FDTD/extensions/operator_extension.h @@ -26,8 +26,6 @@ #include "tools/global.h" -using namespace std; - class Operator; class Operator_Cylinder; class Engine_Extension; @@ -60,9 +58,9 @@ public: //! The MPI operator (if enabled) will check whether the extension is compatible with MPI. Default is false. Derive this method to override. virtual bool IsMPISave() const {return false;} - virtual string GetExtensionName() const {return string("Abstract Operator Extension Base Class");} + virtual std::string GetExtensionName() const {return std::string("Abstract Operator Extension Base Class");} - virtual void ShowStat(ostream &ostr) const; + virtual void ShowStat(std::ostream &ostr) const; virtual bool IsActive() const {return m_Active;} virtual void SetActive(bool active=true) {m_Active=active;} diff --git a/nf2ff/nf2ff.cpp b/nf2ff/nf2ff.cpp index 6455727..62c9238 100644 --- a/nf2ff/nf2ff.cpp +++ b/nf2ff/nf2ff.cpp @@ -34,6 +34,8 @@ //external libs #include "tinyxml.h" +using namespace std; + nf2ff::nf2ff(vector freq, vector theta, vector phi, vector center, unsigned int numThreads) { m_freq = freq; diff --git a/nf2ff/nf2ff_calc.cpp b/nf2ff/nf2ff_calc.cpp index 5b17f51..335dd9a 100644 --- a/nf2ff/nf2ff_calc.cpp +++ b/nf2ff/nf2ff_calc.cpp @@ -27,6 +27,8 @@ #include #include +using namespace std; + nf2ff_calc_thread::nf2ff_calc_thread(nf2ff_calc* nfc, unsigned int start, unsigned int stop, unsigned int threadID, nf2ff_data &data) { m_nf_calc = nfc; diff --git a/nf2ff/nf2ff_calc.h b/nf2ff/nf2ff_calc.h index e231f24..ab46e5e 100644 --- a/nf2ff/nf2ff_calc.h +++ b/nf2ff/nf2ff_calc.h @@ -25,8 +25,6 @@ #include #include -using namespace std; - class nf2ff_calc; #define MIRROR_OFF 0 @@ -45,16 +43,16 @@ typedef struct float* edge_length_P; float* edge_length_PP; - complex**** E_field; - complex**** H_field; - complex**** Js; - complex**** Ms; + std::complex**** E_field; + std::complex**** H_field; + std::complex**** Js; + std::complex**** Ms; //local working data OUT - complex** m_Nt; - complex** m_Np; - complex** m_Lt; - complex** m_Lp; + std::complex** m_Nt; + std::complex** m_Np; + std::complex** m_Lt; + std::complex** m_Lp; } nf2ff_data; @@ -76,7 +74,7 @@ class nf2ff_calc // allow full data access to nf2ff_calc_thread class friend class nf2ff_calc_thread; public: - nf2ff_calc(float freq, vector theta, vector phi, vector center); + nf2ff_calc(float freq, std::vector theta, std::vector phi, std::vector center); ~nf2ff_calc(); void SetRadius(float radius) {m_radius=radius;} @@ -86,8 +84,8 @@ public: double GetTotalRadPower() const {return m_radPower;} double GetMaxDirectivity() const {return m_maxDir;} - complex** GetETheta() const {return m_E_theta;} - complex** GetEPhi() const {return m_E_phi;} + std::complex** GetETheta() const {return m_E_theta;} + std::complex** GetEPhi() const {return m_E_phi;} double** GetRadPower() const {return m_P_rad;} unsigned int GetNumThreads() const {return m_numThreads;} @@ -95,7 +93,7 @@ public: void SetMirror(int type, int dir, float pos); - bool AddPlane(float **lines, unsigned int* numLines, complex**** E_field, complex**** H_field, int MeshType=0); + bool AddPlane(float **lines, unsigned int* numLines, std::complex**** E_field, std::complex**** H_field, int MeshType=0); protected: float m_freq; @@ -107,10 +105,10 @@ protected: double m_radPower; double m_maxDir; - complex** m_E_theta; - complex** m_E_phi; - complex** m_H_theta; - complex** m_H_phi; + std::complex** m_E_theta; + std::complex** m_E_phi; + std::complex** m_H_theta; + std::complex** m_H_phi; double** m_P_rad; float m_centerCoord[3]; @@ -125,8 +123,8 @@ protected: float m_MirrorPos[3]; int GetNormalDir(unsigned int* numLines); - bool AddSinglePlane(float **lines, unsigned int* numLines, complex**** E_field, complex**** H_field, int MeshType=0); - bool AddMirrorPlane(int n, float **lines, unsigned int* numLines, complex**** E_field, complex**** H_field, int MeshType=0); + bool AddSinglePlane(float **lines, unsigned int* numLines, std::complex**** E_field, std::complex**** H_field, int MeshType=0); + bool AddMirrorPlane(int n, float **lines, unsigned int* numLines, std::complex**** E_field, std::complex**** H_field, int MeshType=0); //boost multi-threading unsigned int m_numThreads; diff --git a/openems.cpp b/openems.cpp index 39a6ee2..90a3fec 100644 --- a/openems.cpp +++ b/openems.cpp @@ -52,6 +52,8 @@ #include "CSPropProbeBox.h" #include "CSPropDumpBox.h" +using namespace std; + double CalcDiffTime(timeval t1, timeval t2) { double s_diff = t1.tv_sec - t2.tv_sec; diff --git a/openems.h b/openems.h index f1433d0..d368e49 100644 --- a/openems.h +++ b/openems.h @@ -25,8 +25,6 @@ #define __OPENEMS_STAT_FILE__ "openEMS_stats.txt" #define __OPENEMS_RUN_STAT_FILE__ "openEMS_run_stats.txt" -using namespace std; - class Operator; class Engine; class Engine_Interface_FDTD; @@ -38,7 +36,7 @@ class Excitation; class Engine_Ext_SteadyState; double CalcDiffTime(timeval t1, timeval t2); -string FormatTime(int sec); +std::string FormatTime(int sec); class openEMS { @@ -62,7 +60,7 @@ public: void DebugBox() {m_debugBox=true;} //! Get informations about external libs used by openEMS - static string GetExtLibsInfo(); + static std::string GetExtLibsInfo(); //! Set this to about FDTD iteration process void SetAbort(bool val) {m_Abort=val;} @@ -120,11 +118,11 @@ protected: virtual bool SetupProcessing(); //! Dump statistics to file - virtual bool DumpStatistics(const string& filename, double time); + virtual bool DumpStatistics(const std::string& filename, double time); //! Dump run statistivs to file - virtual bool InitRunStatistics(const string& filename); - virtual bool DumpRunStatistics(const string& filename, double time, unsigned int ts, double speed, double energy); + virtual bool InitRunStatistics(const std::string& filename); + virtual bool DumpRunStatistics(const std::string& filename, double time, unsigned int ts, double speed, double energy); }; #endif // OPENEMS_H diff --git a/tools/AdrOp.cpp b/tools/AdrOp.cpp index 1940b61..228f8de 100644 --- a/tools/AdrOp.cpp +++ b/tools/AdrOp.cpp @@ -17,6 +17,8 @@ #include "AdrOp.h" +using namespace std; + AdrOp::AdrOp(unsigned int muiImax, unsigned int muiJmax, unsigned int muiKmax, unsigned int muiLmax) { //error-handling... diff --git a/tools/AdrOp.h b/tools/AdrOp.h index 683c0c8..e4a690b 100644 --- a/tools/AdrOp.h +++ b/tools/AdrOp.h @@ -32,8 +32,6 @@ #include "ExpenseLog.h" #include "ErrorMsg.h" -using namespace std; - class AdrOp { public: diff --git a/tools/array_ops.cpp b/tools/array_ops.cpp index 2b7c2b4..8710b3c 100644 --- a/tools/array_ops.cpp +++ b/tools/array_ops.cpp @@ -18,6 +18,8 @@ #include "array_ops.h" #include +using namespace std; + #ifdef WIN32 #define __MSVCRT_VERSION__ 0x0700 #include diff --git a/tools/array_ops.h b/tools/array_ops.h index 035f0d7..5c2fd7f 100644 --- a/tools/array_ops.h +++ b/tools/array_ops.h @@ -31,8 +31,6 @@ #include #include "constants.h" -using namespace std; - typedef float v4sf __attribute__ ((vector_size (16))); // vector of four single floats typedef int v4si __attribute__ ((vector_size (4*sizeof(int)))); // vector of four single ints @@ -177,7 +175,7 @@ void Delete_N_3DArray(T**** array, const unsigned int* numLines) } template -void Dump_N_3DArray2File(ostream &file, T**** array, const unsigned int* numLines) +void Dump_N_3DArray2File(std::ostream &file, T**** array, const unsigned int* numLines) { unsigned int pos[3]; for (pos[0]=0; pos[0]