Dump material as a vector instead of averaged.

pull/1/head
Thorsten Liebig 2010-09-02 15:35:57 +02:00
parent df3e7c0c12
commit f7360cbdc1
1 changed files with 18 additions and 22 deletions

View File

@ -413,17 +413,17 @@ void Operator::DumpMaterial2File(string filename)
cout << "Dumping material information to vtk file: " << filename << " ..." << flush; cout << "Dumping material information to vtk file: " << filename << " ..." << flush;
FDTD_FLOAT*** epsilon; FDTD_FLOAT**** epsilon;
FDTD_FLOAT*** mue; FDTD_FLOAT**** mue;
FDTD_FLOAT*** kappa; FDTD_FLOAT**** kappa;
FDTD_FLOAT*** sigma; FDTD_FLOAT**** sigma;
unsigned int pos[3]; unsigned int pos[3];
double inMat[4]; double inMat[4];
epsilon = Create3DArray<FDTD_FLOAT>( numLines); epsilon = Create_N_3DArray<FDTD_FLOAT>( numLines);
mue = Create3DArray<FDTD_FLOAT>( numLines); mue = Create_N_3DArray<FDTD_FLOAT>( numLines);
kappa = Create3DArray<FDTD_FLOAT>( numLines); kappa = Create_N_3DArray<FDTD_FLOAT>( numLines);
sigma = Create3DArray<FDTD_FLOAT>( numLines); sigma = Create_N_3DArray<FDTD_FLOAT>( numLines);
for (pos[0]=0;pos[0]<numLines[0];++pos[0]) for (pos[0]=0;pos[0]<numLines[0];++pos[0])
{ {
for (pos[1]=0;pos[1]<numLines[1];++pos[1]) for (pos[1]=0;pos[1]<numLines[1];++pos[1])
@ -433,26 +433,22 @@ void Operator::DumpMaterial2File(string filename)
for (int n=0;n<3;++n) for (int n=0;n<3;++n)
{ {
Calc_EffMatPos(n, pos, inMat); Calc_EffMatPos(n, pos, inMat);
epsilon[pos[0]][pos[1]][pos[2]]+=inMat[0]/__EPS0__; epsilon[n][pos[0]][pos[1]][pos[2]] =inMat[0]/__EPS0__;
mue[pos[0]][pos[1]][pos[2]]+=inMat[2]/__MUE0__; mue[n][pos[0]][pos[1]][pos[2]] =inMat[2]/__MUE0__;
kappa[pos[0]][pos[1]][pos[2]]+=inMat[1]; kappa[n][pos[0]][pos[1]][pos[2]] =inMat[1];
sigma[pos[0]][pos[1]][pos[2]]+=inMat[3]; sigma[n][pos[0]][pos[1]][pos[2]] =inMat[3];
} }
epsilon[pos[0]][pos[1]][pos[2]]/=3;
mue[pos[0]][pos[1]][pos[2]]/=3;
kappa[pos[0]][pos[1]][pos[2]]/=3;
sigma[pos[0]][pos[1]][pos[2]]/=3;
} }
} }
} }
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, discLines_scaling); ProcessFields::DumpMultiVectorArray2VTK(file, names, array, 4, discLines, numLines, 6, "Material dump" , (ProcessFields::MeshType)m_MeshType, discLines_scaling);
Delete3DArray(epsilon,numLines); Delete_N_3DArray(epsilon,numLines);
Delete3DArray(mue,numLines); Delete_N_3DArray(mue,numLines);
Delete3DArray(kappa,numLines); Delete_N_3DArray(kappa,numLines);
Delete3DArray(sigma,numLines); Delete_N_3DArray(sigma,numLines);
file.close(); file.close();
cout << " done!" << endl; cout << " done!" << endl;