dump_PEC: get the scaling right

pull/1/head
Sebastian Held 2010-09-17 10:50:06 +02:00
parent ab701c4a7f
commit cc4ffd235f
2 changed files with 12 additions and 11 deletions

View File

@ -377,25 +377,26 @@ void Operator::DumpPEC2File( string filename )
FDTD_FLOAT**** pec = Create_N_3DArray<FDTD_FLOAT>( numLines );
unsigned int pos[3];
#ifdef OUTPUT_IN_DRAWINGUNITS
double scaling = 1;
#else
double scaling = GetGridDelta();
#endif
for (pos[0]=0; pos[0]<numLines[0]; pos[0]++) {
for (pos[1]=0; pos[1]<numLines[1]; pos[1]++) {
for (pos[2]=0; pos[2]<numLines[2]; pos[2]++) {
if ((GetVV(0,pos[0],pos[1],pos[2]) == 0) && (GetVI(0,pos[0],pos[1],pos[2]) == 0))
pec[0][pos[0]][pos[1]][pos[2]] = MainOp->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();

View File

@ -72,8 +72,8 @@ public:
unsigned int*** m_Op_index;
vector<f4vector> f4_vv_Compressed[3]; //!< coefficient: calc new voltage from old voltage
vector<f4vector> f4_vi_Compressed[3]; //!< coefficient: calc new voltage from old current
vector<f4vector> f4_iv_Compressed[3]; //!< coefficient: calc new current from old current
vector<f4vector> f4_ii_Compressed[3]; //!< coefficient: calc new current from old voltage
vector<f4vector> f4_iv_Compressed[3]; //!< coefficient: calc new current from old voltage
vector<f4vector> f4_ii_Compressed[3]; //!< coefficient: calc new current from old current
};