operator debug dumps: more console infos & check first if file can be created
Signed-off-by: Thorsten Liebig <thorsten.liebig@gmx.de>
This commit is contained in:
parent
7172e9e53d
commit
0954177dc6
@ -319,6 +319,8 @@ void Operator::DumpOperator2File(string filename)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cout << "Dumping PEC information to vtk file: " << filename << " ..." ;
|
||||||
|
|
||||||
FDTD_FLOAT**** exc = Create_N_3DArray(numLines);
|
FDTD_FLOAT**** exc = Create_N_3DArray(numLines);
|
||||||
if (Exc) {
|
if (Exc) {
|
||||||
for (unsigned int n=0;n<Exc->E_Count;++n)
|
for (unsigned int n=0;n<Exc->E_Count;++n)
|
||||||
@ -333,6 +335,8 @@ void Operator::DumpOperator2File(string filename)
|
|||||||
Delete_N_3DArray(exc,numLines);
|
Delete_N_3DArray(exc,numLines);
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
cout << " done!" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! \brief dump PEC (perfect electric conductor) information (into VTK-file)
|
//! \brief dump PEC (perfect electric conductor) information (into VTK-file)
|
||||||
@ -346,6 +350,8 @@ void Operator::DumpPEC2File( string filename )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cout << "Dumping PEC information to vtk file: " << filename << " ..." ;
|
||||||
|
|
||||||
FDTD_FLOAT**** pec = Create_N_3DArray( numLines );
|
FDTD_FLOAT**** pec = Create_N_3DArray( numLines );
|
||||||
unsigned int pos[3];
|
unsigned int pos[3];
|
||||||
|
|
||||||
@ -365,10 +371,21 @@ void Operator::DumpPEC2File( string filename )
|
|||||||
ProcessFields::DumpVectorArray2VTK( file, "PEC", pec, discLines, numLines, 6, "PEC dump" , (ProcessFields::MeshType)m_MeshType );
|
ProcessFields::DumpVectorArray2VTK( file, "PEC", pec, discLines, numLines, 6, "PEC dump" , (ProcessFields::MeshType)m_MeshType );
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
cout << " done!" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Operator::DumpMaterial2File(string filename)
|
void Operator::DumpMaterial2File(string filename)
|
||||||
{
|
{
|
||||||
|
ofstream file(filename.c_str(),ios_base::out);
|
||||||
|
if (file.is_open()==false)
|
||||||
|
{
|
||||||
|
cerr << "Operator::DumpMaterial2File: Can't open file: " << filename << endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << "Dumping material information to vtk file: " << filename << " ..." ;
|
||||||
|
|
||||||
FDTD_FLOAT*** epsilon;
|
FDTD_FLOAT*** epsilon;
|
||||||
FDTD_FLOAT*** mue;
|
FDTD_FLOAT*** mue;
|
||||||
FDTD_FLOAT*** kappa;
|
FDTD_FLOAT*** kappa;
|
||||||
@ -402,13 +419,6 @@ void Operator::DumpMaterial2File(string filename)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ofstream file(filename.c_str(),ios_base::out);
|
|
||||||
if (file.is_open()==false)
|
|
||||||
{
|
|
||||||
cerr << "Operator::DumpMaterial2File: Can't open file: " << filename << endl;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
string names[] = {"epsilon","mue","kappa","sigma"};
|
string names[] = {"epsilon","mue","kappa","sigma"};
|
||||||
FDTD_FLOAT*** array[] = {epsilon,mue,kappa,sigma};
|
FDTD_FLOAT*** array[] = {epsilon,mue,kappa,sigma};
|
||||||
ProcessFields::DumpMultiScalarArray2VTK(file, names, array, 4, discLines, numLines, 6, "Material dump" , (ProcessFields::MeshType)m_MeshType);
|
ProcessFields::DumpMultiScalarArray2VTK(file, names, array, 4, discLines, numLines, 6, "Material dump" , (ProcessFields::MeshType)m_MeshType);
|
||||||
@ -417,6 +427,8 @@ void Operator::DumpMaterial2File(string filename)
|
|||||||
Delete3DArray(kappa,numLines);
|
Delete3DArray(kappa,numLines);
|
||||||
Delete3DArray(sigma,numLines);
|
Delete3DArray(sigma,numLines);
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
cout << " done!" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Operator::SetGeometryCSX(ContinuousStructure* geo)
|
bool Operator::SetGeometryCSX(ContinuousStructure* geo)
|
||||||
|
Loading…
Reference in New Issue
Block a user