new debug option: dump PEC
command line parameter: --debug-PEC writes a file PEC_dump.vtk which can be visualized with paraview visualize one component (x,y,z) at a time using arrow glyphs
This commit is contained in:
parent
96144ed3a1
commit
82befba245
@ -334,6 +334,38 @@ void Operator::DumpOperator2File(string filename)
|
|||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! \brief dump PEC (perfect electric conductor) information (into VTK-file)
|
||||||
|
//! visualization via paraview
|
||||||
|
//! visualize only one component (x, y or z)
|
||||||
|
void Operator::DumpPEC2File( string filename )
|
||||||
|
{
|
||||||
|
ofstream file( filename.c_str() );
|
||||||
|
if (!file.is_open()) {
|
||||||
|
cerr << "Operator::DumpPEC2File: Can't open file: " << filename << endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
FDTD_FLOAT**** pec = Create_N_3DArray( numLines );
|
||||||
|
unsigned int pos[3];
|
||||||
|
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ProcessFields::DumpVectorArray2VTK( file, "PEC", pec, discLines, numLines );
|
||||||
|
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
|
||||||
void Operator::DumpMaterial2File(string filename)
|
void Operator::DumpMaterial2File(string filename)
|
||||||
{
|
{
|
||||||
FDTD_FLOAT*** epsilon;
|
FDTD_FLOAT*** epsilon;
|
||||||
|
@ -64,6 +64,7 @@ public:
|
|||||||
|
|
||||||
virtual void DumpOperator2File(string filename);
|
virtual void DumpOperator2File(string filename);
|
||||||
virtual void DumpMaterial2File(string filename);
|
virtual void DumpMaterial2File(string filename);
|
||||||
|
virtual void DumpPEC2File( string filename );
|
||||||
|
|
||||||
//! Get the name for the given direction: 0 -> x, 1 -> y, 2 -> z
|
//! Get the name for the given direction: 0 -> x, 1 -> y, 2 -> z
|
||||||
virtual string GetDirName(int ny) const;
|
virtual string GetDirName(int ny) const;
|
||||||
|
10
openems.cpp
10
openems.cpp
@ -48,7 +48,7 @@ openEMS::openEMS()
|
|||||||
Enable_Dumps = true;
|
Enable_Dumps = true;
|
||||||
DebugMat = false;
|
DebugMat = false;
|
||||||
DebugOp = false;
|
DebugOp = false;
|
||||||
m_debugBox = false;
|
m_debugBox = m_debugPEC = false;
|
||||||
endCrit = 1e-6;
|
endCrit = 1e-6;
|
||||||
m_OverSampling = 4;
|
m_OverSampling = 4;
|
||||||
|
|
||||||
@ -101,6 +101,12 @@ bool openEMS::parseCommandLineArgument( const char *argv )
|
|||||||
DebugBox();
|
DebugBox();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (strcmp(argv,"--debug-PEC")==0)
|
||||||
|
{
|
||||||
|
cout << "openEMS - dumping PEC info to 'PEC_dump.vtk'" << endl;
|
||||||
|
m_debugPEC = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
else if (strcmp(argv,"--engine=multithreaded")==0)
|
else if (strcmp(argv,"--engine=multithreaded")==0)
|
||||||
{
|
{
|
||||||
cout << "openEMS - enabled multithreading" << endl;
|
cout << "openEMS - enabled multithreading" << endl;
|
||||||
@ -268,6 +274,8 @@ int openEMS::SetupFDTD(const char* file)
|
|||||||
}
|
}
|
||||||
if (DebugOp)
|
if (DebugOp)
|
||||||
FDTD_Op->DumpOperator2File("operator_dump.vtk");
|
FDTD_Op->DumpOperator2File("operator_dump.vtk");
|
||||||
|
if (m_debugPEC)
|
||||||
|
FDTD_Op->DumpPEC2File("PEC_dump.vtk");
|
||||||
|
|
||||||
time_t OpDoneTime=time(NULL);
|
time_t OpDoneTime=time(NULL);
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ protected:
|
|||||||
bool Enable_Dumps;
|
bool Enable_Dumps;
|
||||||
bool DebugMat;
|
bool DebugMat;
|
||||||
bool DebugOp;
|
bool DebugOp;
|
||||||
bool m_debugBox;
|
bool m_debugBox, m_debugPEC;
|
||||||
double endCrit;
|
double endCrit;
|
||||||
int m_OverSampling;
|
int m_OverSampling;
|
||||||
Operator* FDTD_Op;
|
Operator* FDTD_Op;
|
||||||
|
Loading…
Reference in New Issue
Block a user