From 2a3e8dd20f49c48911cf2de2555ad5efcae9b826 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Fri, 30 Apr 2010 19:40:08 +0200 Subject: [PATCH] new: operator access functions --- FDTD/operator.cpp | 68 +++++++++++++++++++++++------------------------ FDTD/operator.h | 7 +++++ 2 files changed, 41 insertions(+), 34 deletions(-) diff --git a/FDTD/operator.cpp b/FDTD/operator.cpp index 88e85dc..032276a 100644 --- a/FDTD/operator.cpp +++ b/FDTD/operator.cpp @@ -560,11 +560,11 @@ void Operator::InitOperator() void Operator::Calc_ECOperatorPos(int n, unsigned int* pos) { unsigned int i = MainOp->SetPos(pos[0],pos[1],pos[2]); - vv[n][pos[0]][pos[1]][pos[2]] = (1-dT*EC_G[n][i]/2/EC_C[n][i])/(1+dT*EC_G[n][i]/2/EC_C[n][i]); - vi[n][pos[0]][pos[1]][pos[2]] = (dT/EC_C[n][i])/(1+dT*EC_G[n][i]/2/EC_C[n][i]); + GetVV(n,pos[0],pos[1],pos[2]) = (1-dT*EC_G[n][i]/2/EC_C[n][i])/(1+dT*EC_G[n][i]/2/EC_C[n][i]); + GetVI(n,pos[0],pos[1],pos[2]) = (dT/EC_C[n][i])/(1+dT*EC_G[n][i]/2/EC_C[n][i]); - ii[n][pos[0]][pos[1]][pos[2]] = (1-dT*EC_R[n][i]/2/EC_L[n][i])/(1+dT*EC_R[n][i]/2/EC_L[n][i]); - iv[n][pos[0]][pos[1]][pos[2]] = (dT/EC_L[n][i])/(1+dT*EC_R[n][i]/2/EC_L[n][i]); + GetII(n,pos[0],pos[1],pos[2]) = (1-dT*EC_R[n][i]/2/EC_L[n][i])/(1+dT*EC_R[n][i]/2/EC_L[n][i]); + GetIV(n,pos[0],pos[1],pos[2]) = (dT/EC_L[n][i])/(1+dT*EC_R[n][i]/2/EC_L[n][i]); } int Operator::CalcECOperator() @@ -633,17 +633,17 @@ void Operator::ApplyElectricBC(bool* dirs) for (pos[nPP]=0;pos[nPP]GetExcitType()==1) //hard excite { - vv[n][pos[0]][pos[1]][pos[2]] = 0; - vi[n][pos[0]][pos[1]][pos[2]] = 0; + GetVV(n,pos[0],pos[1],pos[2]) = 0; + GetVI(n,pos[0],pos[1],pos[2]) = 0; } } } @@ -1017,8 +1017,8 @@ bool Operator::CalcFieldExcitation() } if (elec->GetExcitType()==3) //hard excite { - ii[n][pos[0]][pos[1]][pos[2]] = 0; - iv[n][pos[0]][pos[1]][pos[2]] = 0; + GetII(n,pos[0],pos[1],pos[2]) = 0; + GetIV(n,pos[0],pos[1],pos[2]) = 0; } } } @@ -1081,8 +1081,8 @@ bool Operator::CalcFieldExcitation() } if (elec->GetExcitType()==1) //hard excite { - vv[n][pos[0]][pos[1]][pos[2]] = 0; - vi[n][pos[0]][pos[1]][pos[2]] = 0; + GetVV(n,pos[0],pos[1],pos[2]) = 0; + GetVI(n,pos[0],pos[1],pos[2]) = 0; } } } @@ -1172,8 +1172,8 @@ bool Operator::CalcPEC() { if (prop->GetType()==CSProperties::METAL) //set to PEC { - vv[n][pos[0]][pos[1]][pos[2]] = 0; - vi[n][pos[0]][pos[1]][pos[2]] = 0; + GetVV(n,pos[0],pos[1],pos[2]) = 0; + GetVI(n,pos[0],pos[1],pos[2]) = 0; // cerr << "CartOperator::CalcPEC: PEC found at " << pos[0] << " ; " << pos[1] << " ; " << pos[2] << endl; } } @@ -1204,8 +1204,8 @@ bool Operator::CalcPEC() for (size_t t=0;t