From cc4ffd235fb9570762c64969aa69f9c840f7cf1f Mon Sep 17 00:00:00 2001 From: Sebastian Held Date: Fri, 17 Sep 2010 10:50:06 +0200 Subject: [PATCH] dump_PEC: get the scaling right --- FDTD/operator.cpp | 19 ++++++++++--------- FDTD/operator_sse_compressed.h | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/FDTD/operator.cpp b/FDTD/operator.cpp index c5b9d52..832b687 100644 --- a/FDTD/operator.cpp +++ b/FDTD/operator.cpp @@ -377,25 +377,26 @@ void Operator::DumpPEC2File( string filename ) FDTD_FLOAT**** pec = Create_N_3DArray( numLines ); unsigned int pos[3]; +#ifdef OUTPUT_IN_DRAWINGUNITS + double scaling = 1; +#else + double scaling = GetGridDelta(); +#endif + for (pos[0]=0; pos[0]GetIndexDelta( 0, pos[0] ); // PEC-x found + pec[0][pos[0]][pos[1]][pos[2]] = MainOp->GetIndexDelta( 0, pos[0] ) * scaling; // PEC-x found if ((GetVV(1,pos[0],pos[1],pos[2]) == 0) && (GetVI(1,pos[0],pos[1],pos[2]) == 0)) - pec[1][pos[0]][pos[1]][pos[2]] = MainOp->GetIndexDelta( 1, pos[1] ); // PEC-y found + pec[1][pos[0]][pos[1]][pos[2]] = MainOp->GetIndexDelta( 1, pos[1] ) * scaling; // PEC-y found if ((GetVV(2,pos[0],pos[1],pos[2]) == 0) && (GetVI(2,pos[0],pos[1],pos[2]) == 0)) - pec[2][pos[0]][pos[1]][pos[2]] = MainOp->GetIndexDelta( 2, pos[2] ); // PEC-z found + pec[2][pos[0]][pos[1]][pos[2]] = MainOp->GetIndexDelta( 2, pos[2] ) * scaling; // PEC-z found } } } -#ifdef OUTPUT_IN_DRAWINGUNITS - double discLines_scaling = 1; -#else - double discLines_scaling = GetGridDelta(); -#endif - ProcessFields::DumpVectorArray2VTK( file, "PEC", pec, discLines, numLines, 6, "PEC dump" , (ProcessFields::MeshType)m_MeshType, discLines_scaling ); + ProcessFields::DumpVectorArray2VTK( file, "PEC", pec, discLines, numLines, 6, "PEC dump" , (ProcessFields::MeshType)m_MeshType, scaling ); file.close(); diff --git a/FDTD/operator_sse_compressed.h b/FDTD/operator_sse_compressed.h index 5b9e4d2..73a36de 100644 --- a/FDTD/operator_sse_compressed.h +++ b/FDTD/operator_sse_compressed.h @@ -72,8 +72,8 @@ public: unsigned int*** m_Op_index; vector f4_vv_Compressed[3]; //!< coefficient: calc new voltage from old voltage vector f4_vi_Compressed[3]; //!< coefficient: calc new voltage from old current - vector f4_iv_Compressed[3]; //!< coefficient: calc new current from old current - vector f4_ii_Compressed[3]; //!< coefficient: calc new current from old voltage + vector f4_iv_Compressed[3]; //!< coefficient: calc new current from old voltage + vector f4_ii_Compressed[3]; //!< coefficient: calc new current from old current };