Add Probe-Box weighting (new in CSXCAD)

pull/1/head
Thorsten Liebig 2010-06-16 12:50:19 +02:00
parent 52b8a20104
commit 87b8e22bf7
5 changed files with 9 additions and 0 deletions

View File

@ -90,6 +90,7 @@ int ProcessCurrent::Process()
current-=Eng->GetCurr(2,start[0],start[1],i); current-=Eng->GetCurr(2,start[0],start[1],i);
// cerr << "ts: " << Eng->numTS << " i: " << current << endl; // cerr << "ts: " << Eng->numTS << " i: " << current << endl;
current*=m_weight;
v_current.push_back(current); v_current.push_back(current);
//current is sampled half a timestep later then the voltages //current is sampled half a timestep later then the voltages
file << setprecision(m_precision) << (0.5 + (double)Eng->GetNumberOfTimesteps())*Op->GetTimestep() << "\t" << current << endl; file << setprecision(m_precision) << (0.5 + (double)Eng->GetNumberOfTimesteps())*Op->GetTimestep() << "\t" << current << endl;

View File

@ -26,6 +26,7 @@ Processing::Processing(Operator* op, Engine* eng)
m_PS_pos = 0; m_PS_pos = 0;
SetPrecision(12); SetPrecision(12);
ProcessInterval=0; ProcessInterval=0;
m_weight=1;
} }
Processing::~Processing() Processing::~Processing()

View File

@ -46,6 +46,9 @@ public:
//! If Disabled Process() will do nothing... //! If Disabled Process() will do nothing...
virtual bool GetEnable() const {return Enabled;} virtual bool GetEnable() const {return Enabled;}
virtual void SetWeight(double weight) {m_weight=weight;}
virtual double GetWeight() {return m_weight;}
//! Set the dump precision //! Set the dump precision
void SetPrecision(unsigned int val) {m_precision = val;} void SetPrecision(unsigned int val) {m_precision = val;}
@ -57,6 +60,8 @@ protected:
Engine* Eng; Engine* Eng;
unsigned int m_precision; unsigned int m_precision;
double m_weight;
bool Enabled; bool Enabled;
int GetNextInterval() const; int GetNextInterval() const;

View File

@ -32,6 +32,7 @@ int ProcessVoltage::Process()
if (CheckTimestep()==false) return GetNextInterval(); if (CheckTimestep()==false) return GetNextInterval();
FDTD_FLOAT voltage=CalcLineIntegral(start,stop,0); FDTD_FLOAT voltage=CalcLineIntegral(start,stop,0);
// cerr << voltage << endl; // cerr << voltage << endl;
voltage*=m_weight;
voltages.push_back(voltage); voltages.push_back(voltage);
file << setprecision(m_precision) << (double)Eng->GetNumberOfTimesteps()*Op->GetTimestep() << "\t" << voltage << endl; file << setprecision(m_precision) << (double)Eng->GetNumberOfTimesteps()*Op->GetTimestep() << "\t" << voltage << endl;
return GetNextInterval(); return GetNextInterval();

View File

@ -326,6 +326,7 @@ int openEMS::SetupFDTD(const char* file)
} }
proc->SetProcessInterval(Nyquist/m_OverSampling); proc->SetProcessInterval(Nyquist/m_OverSampling);
proc->DefineStartStopCoord(start,stop); proc->DefineStartStopCoord(start,stop);
proc->SetWeight(pb->GetWeighting());
PA->AddProcessing(proc); PA->AddProcessing(proc);
prim->SetPrimitiveUsed(true); prim->SetPrimitiveUsed(true);
} }