diff --git a/FDTD/operator.cpp b/FDTD/operator.cpp index 832b687..35ceae1 100644 --- a/FDTD/operator.cpp +++ b/FDTD/operator.cpp @@ -378,24 +378,29 @@ void Operator::DumpPEC2File( string filename ) unsigned int pos[3]; #ifdef OUTPUT_IN_DRAWINGUNITS - double scaling = 1; + double scaling = 1.0/GetGridDelta(); #else - double scaling = GetGridDelta(); + double scaling = 1; #endif for (pos[0]=0; pos[0]GetIndexDelta( 0, pos[0] ) * scaling; // PEC-x found + pec[0][pos[0]][pos[1]][pos[2]] = GetEdgeLength( 0, pos ) * 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] ) * scaling; // PEC-y found + pec[1][pos[0]][pos[1]][pos[2]] = GetEdgeLength( 1, pos ) * 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] ) * scaling; // PEC-z found + pec[2][pos[0]][pos[1]][pos[2]] = GetEdgeLength( 2, pos ) * scaling; // PEC-z found } } } +#ifdef OUTPUT_IN_DRAWINGUNITS + scaling = 1; +#else + scaling = GetGridDelta(); +#endif ProcessFields::DumpVectorArray2VTK( file, "PEC", pec, discLines, numLines, 6, "PEC dump" , (ProcessFields::MeshType)m_MeshType, scaling ); file.close(); diff --git a/FDTD/operator.h b/FDTD/operator.h index a0ef41e..5ad4e75 100644 --- a/FDTD/operator.h +++ b/FDTD/operator.h @@ -95,19 +95,19 @@ public: //! Get the disc line in \a n direction (in drawing units) virtual double GetDiscLine(int n, unsigned int pos, bool dualMesh=false) const; - //! Get the node width for a given direction \a n and a given mesh posisition \a pos + //! Get the node width for a given direction \a n and a given mesh position \a pos virtual double GetNodeWidth(int ny, const unsigned int pos[3], bool dualMesh = false) const {return GetNodeWidth(ny,(const int*)pos,dualMesh);} - //! Get the node width for a given direction \a n and a given mesh posisition \a pos + //! Get the node width for a given direction \a n and a given mesh position \a pos virtual double GetNodeWidth(int ny, const int pos[3], bool dualMesh = false) const {return GetMeshDelta(ny,pos,!dualMesh);} - //! Get the node area for a given direction \a n and a given mesh posisition \a pos + //! Get the node area for a given direction \a n and a given mesh position \a pos virtual double GetNodeArea(int ny, const unsigned int pos[3], bool dualMesh = false) const {return GetNodeArea(ny,(const int*)pos,dualMesh);} - //! Get the node area for a given direction \a n and a given mesh posisition \a pos + //! Get the node area for a given direction \a n and a given mesh position \a pos virtual double GetNodeArea(int ny, const int pos[3], bool dualMesh = false) const; - //! Get the length of an FDTD edge. + //! Get the length of an FDTD edge (unit is meter). virtual double GetEdgeLength(int ny, const unsigned int pos[3], bool dualMesh = false) const {return GetEdgeLength(ny,(const int*)pos,dualMesh);} - //! Get the length of an FDTD edge. + //! Get the length of an FDTD edge (unit is meter). virtual double GetEdgeLength(int ny, const int pos[3], bool dualMesh = false) const {return GetMeshDelta(ny,pos,dualMesh);} //! Get the area around an edge for a given direction \a n and a given mesh posisition \a pos