Add Probe-Box weighting (new in CSXCAD)
parent
52b8a20104
commit
87b8e22bf7
|
@ -90,6 +90,7 @@ int ProcessCurrent::Process()
|
|||
current-=Eng->GetCurr(2,start[0],start[1],i);
|
||||
|
||||
// cerr << "ts: " << Eng->numTS << " i: " << current << endl;
|
||||
current*=m_weight;
|
||||
v_current.push_back(current);
|
||||
//current is sampled half a timestep later then the voltages
|
||||
file << setprecision(m_precision) << (0.5 + (double)Eng->GetNumberOfTimesteps())*Op->GetTimestep() << "\t" << current << endl;
|
||||
|
|
|
@ -26,6 +26,7 @@ Processing::Processing(Operator* op, Engine* eng)
|
|||
m_PS_pos = 0;
|
||||
SetPrecision(12);
|
||||
ProcessInterval=0;
|
||||
m_weight=1;
|
||||
}
|
||||
|
||||
Processing::~Processing()
|
||||
|
|
|
@ -46,6 +46,9 @@ public:
|
|||
//! If Disabled Process() will do nothing...
|
||||
virtual bool GetEnable() const {return Enabled;}
|
||||
|
||||
virtual void SetWeight(double weight) {m_weight=weight;}
|
||||
virtual double GetWeight() {return m_weight;}
|
||||
|
||||
//! Set the dump precision
|
||||
void SetPrecision(unsigned int val) {m_precision = val;}
|
||||
|
||||
|
@ -57,6 +60,8 @@ protected:
|
|||
Engine* Eng;
|
||||
unsigned int m_precision;
|
||||
|
||||
double m_weight;
|
||||
|
||||
bool Enabled;
|
||||
|
||||
int GetNextInterval() const;
|
||||
|
|
|
@ -32,6 +32,7 @@ int ProcessVoltage::Process()
|
|||
if (CheckTimestep()==false) return GetNextInterval();
|
||||
FDTD_FLOAT voltage=CalcLineIntegral(start,stop,0);
|
||||
// cerr << voltage << endl;
|
||||
voltage*=m_weight;
|
||||
voltages.push_back(voltage);
|
||||
file << setprecision(m_precision) << (double)Eng->GetNumberOfTimesteps()*Op->GetTimestep() << "\t" << voltage << endl;
|
||||
return GetNextInterval();
|
||||
|
|
|
@ -326,6 +326,7 @@ int openEMS::SetupFDTD(const char* file)
|
|||
}
|
||||
proc->SetProcessInterval(Nyquist/m_OverSampling);
|
||||
proc->DefineStartStopCoord(start,stop);
|
||||
proc->SetWeight(pb->GetWeighting());
|
||||
PA->AddProcessing(proc);
|
||||
prim->SetPrimitiveUsed(true);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue