new command-line option: dump operator to vtk-file
This commit is contained in:
parent
a662c405f2
commit
1f20f7ae42
@ -186,21 +186,11 @@ void Operator::DumpOperator2File(string filename)
|
||||
cerr << "Operator::DumpOperator2File: Can't open file: " << filename << endl;
|
||||
return;
|
||||
}
|
||||
file << "########### Operator vv ###########" << endl;
|
||||
file << "ix\tiy\tiz\tvv_x\tvv_y\tvv_z" << endl;
|
||||
Dump_N_3DArray2File(file,vv,numLines);
|
||||
|
||||
file << "########### Operator vi ###########" << endl;
|
||||
file << "ix\tiy\tiz\tvi_x\tvi_y\tvi_z" << endl;
|
||||
Dump_N_3DArray2File(file,vi,numLines);
|
||||
string names[] = {"vv", "vi", "iv" , "ii"};
|
||||
FDTD_FLOAT**** array[] = {vv,vi,iv,ii};
|
||||
|
||||
file << "########### Operator iv ###########" << endl;
|
||||
file << "ix\tiy\tiz\tiv_x\tiv_y\tiv_z" << endl;
|
||||
Dump_N_3DArray2File(file,iv,numLines);
|
||||
|
||||
file << "########### Operator ii ###########" << endl;
|
||||
file << "ix\tiy\tiz\tii_x\tii_y\tii_z" << endl;
|
||||
Dump_N_3DArray2File(file,ii,numLines);
|
||||
ProcessFields::DumpMultiVectorArray2VTK(file, names , array , 4, discLines, numLines);
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
10
main.cpp
10
main.cpp
@ -34,7 +34,7 @@ int main(int argc, char *argv[])
|
||||
#ifdef STANDALONE
|
||||
if (argc<=1)
|
||||
{
|
||||
cout << " usage: openEMS FDTD_XML_FILE [--disable-dumps] [--debug-material]" << endl;
|
||||
cout << " usage: openEMS FDTD_XML_FILE [--disable-dumps] [--debug-material] [--debug-operator]" << endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@ -52,6 +52,11 @@ int main(int argc, char *argv[])
|
||||
cout << "openEMS - dumping material to 'material_dump.vtk'" << endl;
|
||||
FDTD.DebugMaterial();
|
||||
}
|
||||
else if (strcmp(argv[n],"--debug-operator")==0)
|
||||
{
|
||||
cout << "openEMS - dumping operator to 'operator_dump.vtk'" << endl;
|
||||
FDTD.DebugOperator();
|
||||
}
|
||||
else
|
||||
cout << "openEMS - unknown argument: " << argv[n] << endl;
|
||||
}
|
||||
@ -78,7 +83,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
const char* file=fileHelix;
|
||||
|
||||
FDTD.DebugMaterial();
|
||||
// FDTD.DebugMaterial();
|
||||
// FDTD.DebugOperator();
|
||||
#endif
|
||||
|
||||
int EC = FDTD.SetupFDTD(file);
|
||||
|
@ -35,6 +35,7 @@ openEMS::openEMS()
|
||||
PA=NULL;
|
||||
Enable_Dumps = true;
|
||||
DebugMat = false;
|
||||
DebugOp = false;
|
||||
endCrit = 1e-6;
|
||||
}
|
||||
|
||||
@ -145,6 +146,10 @@ int openEMS::SetupFDTD(const char* file)
|
||||
FDTD_Op->DumpMaterial2File("material_dump.vtk");
|
||||
}
|
||||
FDTD_Op->CalcECOperator();
|
||||
if (DebugOp)
|
||||
{
|
||||
FDTD_Op->DumpOperator2File("operator_dump.vtk");
|
||||
}
|
||||
|
||||
if (Excit_Type==0)
|
||||
FDTD_Op->CalcGaussianPulsExcitation(f0,fc);
|
||||
|
@ -38,12 +38,14 @@ public:
|
||||
void SetEndCriteria(double val) {endCrit=val;}
|
||||
|
||||
void DebugMaterial() {DebugMat=true;}
|
||||
void DebugOperator() {DebugOp=true;}
|
||||
|
||||
protected:
|
||||
//! Number of Timesteps
|
||||
int NrTS;
|
||||
bool Enable_Dumps;
|
||||
bool DebugMat;
|
||||
bool DebugOp;
|
||||
double endCrit;
|
||||
Operator* FDTD_Op;
|
||||
Engine* FDTD_Eng;
|
||||
|
Loading…
Reference in New Issue
Block a user