From 0954177dc68804fe28d9884603f87f5a4bf2dbac Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Fri, 4 Jun 2010 14:08:42 +0200 Subject: [PATCH] operator debug dumps: more console infos & check first if file can be created Signed-off-by: Thorsten Liebig --- FDTD/operator.cpp | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/FDTD/operator.cpp b/FDTD/operator.cpp index 0808471..cc1dd43 100644 --- a/FDTD/operator.cpp +++ b/FDTD/operator.cpp @@ -319,6 +319,8 @@ void Operator::DumpOperator2File(string filename) return; } + cout << "Dumping PEC information to vtk file: " << filename << " ..." ; + FDTD_FLOAT**** exc = Create_N_3DArray(numLines); if (Exc) { for (unsigned int n=0;nE_Count;++n) @@ -333,6 +335,8 @@ void Operator::DumpOperator2File(string filename) Delete_N_3DArray(exc,numLines); file.close(); + + cout << " done!" << endl; } //! \brief dump PEC (perfect electric conductor) information (into VTK-file) @@ -346,6 +350,8 @@ void Operator::DumpPEC2File( string filename ) return; } + cout << "Dumping PEC information to vtk file: " << filename << " ..." ; + FDTD_FLOAT**** pec = Create_N_3DArray( numLines ); unsigned int pos[3]; @@ -365,10 +371,21 @@ void Operator::DumpPEC2File( string filename ) ProcessFields::DumpVectorArray2VTK( file, "PEC", pec, discLines, numLines, 6, "PEC dump" , (ProcessFields::MeshType)m_MeshType ); file.close(); + + cout << " done!" << endl; } void Operator::DumpMaterial2File(string filename) { + ofstream file(filename.c_str(),ios_base::out); + if (file.is_open()==false) + { + cerr << "Operator::DumpMaterial2File: Can't open file: " << filename << endl; + return; + } + + cout << "Dumping material information to vtk file: " << filename << " ..." ; + FDTD_FLOAT*** epsilon; FDTD_FLOAT*** mue; FDTD_FLOAT*** kappa; @@ -402,13 +419,6 @@ void Operator::DumpMaterial2File(string filename) } } - ofstream file(filename.c_str(),ios_base::out); - if (file.is_open()==false) - { - cerr << "Operator::DumpMaterial2File: Can't open file: " << filename << endl; - return; - } - string names[] = {"epsilon","mue","kappa","sigma"}; FDTD_FLOAT*** array[] = {epsilon,mue,kappa,sigma}; ProcessFields::DumpMultiScalarArray2VTK(file, names, array, 4, discLines, numLines, 6, "Material dump" , (ProcessFields::MeshType)m_MeshType); @@ -417,6 +427,8 @@ void Operator::DumpMaterial2File(string filename) Delete3DArray(kappa,numLines); Delete3DArray(sigma,numLines); file.close(); + + cout << " done!" << endl; } bool Operator::SetGeometryCSX(ContinuousStructure* geo)