parent
0b43416651
commit
026f12355f
|
@ -22,9 +22,9 @@
|
|||
|
||||
class Operator_Base;
|
||||
|
||||
//! This is the abstact base for all Engine Interface classes.
|
||||
//! This is the abstract base for all Engine Interface classes.
|
||||
/*!
|
||||
This is the abstact base for all Engine Interface classes. It will provide unified access to the field information of the corresponding engine.
|
||||
This is the abstract base for all Engine Interface classes. It will provide unified access to the field information of the corresponding engine.
|
||||
All processing methods should only access this base class.
|
||||
*/
|
||||
class Engine_Interface_Base
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
//! Get the length of an FDTD edge (unit is meter).
|
||||
virtual double GetEdgeLength(int ny, const unsigned int pos[3], bool dualMesh = false) const =0;
|
||||
|
||||
//! Get the area around an edge for a given direction \a n and a given mesh posisition \a pos
|
||||
//! Get the area around an edge for a given direction \a n and a given mesh position \a pos
|
||||
/*!
|
||||
This will return the area around an edge with a given direction, measured at the middle of the edge.
|
||||
In a cartesian mesh this is equal to the NodeArea, may be different in other coordinate systems.
|
||||
|
@ -81,7 +81,7 @@ public:
|
|||
//! Get the volume of an FDTD cell
|
||||
virtual double GetCellVolume(const unsigned int pos[3], bool dualMesh = false) const =0;
|
||||
|
||||
//! Snap the given coodinates to mesh indices, return box dimension
|
||||
//! Snap the given coordinates to mesh indices, return box dimension
|
||||
virtual bool SnapToMesh(const double* coord, unsigned int* uicoord, bool dualMesh=false, bool fullMesh=false, bool* inside=NULL) const =0;
|
||||
|
||||
//! Snap a given box to the operator mesh, uiStart will be always <= uiStop
|
||||
|
|
|
@ -60,9 +60,9 @@ public:
|
|||
|
||||
//! Define the Dump-Mode
|
||||
void SetDumpMode(Engine_Interface_Base::InterpolationType mode);
|
||||
//! This methode will dump all fields on a main cell node using 2 E-field and 4 H-fields per direction.
|
||||
//! This method will dump all fields on a main cell node using 2 E-field and 4 H-fields per direction.
|
||||
void SetDumpMode2Node() {SetDumpMode(Engine_Interface_Base::NODE_INTERPOLATE);}
|
||||
//! This methode will dump all fields in the center of a main cell (dual-node) using 4 E-field and 2 H-fields per direction.
|
||||
//! This method will dump all fields in the center of a main cell (dual-node) using 4 E-field and 2 H-fields per direction.
|
||||
void SetDumpMode2Cell() {SetDumpMode(Engine_Interface_Base::CELL_INTERPOLATE);}
|
||||
|
||||
//! Set dump type: 0 for E-fields, 1 for H-fields, 2 for D-fields, 3 for B-fields, 4 for J-fields, etc...
|
||||
|
|
|
@ -102,7 +102,7 @@ public:
|
|||
//! Set the dump precision
|
||||
void SetPrecision(unsigned int val) {m_precision = val;}
|
||||
|
||||
//! Dump probe geometry to file (will obay main or dual mesh property)
|
||||
//! Dump probe geometry to file (will obey main or dual mesh property)
|
||||
virtual void DumpBox2File(std::string vtkfilenameprefix) const {DumpBox2File(vtkfilenameprefix,m_dualMesh);}
|
||||
|
||||
//! Dump probe geometry to file
|
||||
|
@ -184,7 +184,7 @@ public:
|
|||
|
||||
void Reset();
|
||||
|
||||
//! Deletes all given processing's, can be helpful, but use carefull!!!
|
||||
//! Deletes all given processing's, can be helpful, but use carefully!!!
|
||||
void DeleteAll();
|
||||
|
||||
//! Invoke PreProcess() on all Processings.
|
||||
|
|
|
@ -74,7 +74,7 @@ void ProcessModeMatch::InitProcess()
|
|||
|
||||
if (m_Eng_Interface==NULL)
|
||||
{
|
||||
cerr << "ProcessModeMatch::InitProcess: Error, Engine_Interface is NULL, abort mode mathcing..." << endl;
|
||||
cerr << "ProcessModeMatch::InitProcess: Error, Engine_Interface is NULL, abort mode matching..." << endl;
|
||||
Enabled=false;
|
||||
return;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ void ProcessModeMatch::InitProcess()
|
|||
int res = m_ModeParser[n]->Parse(m_ModeFunction[ny], "x,y,z,rho,a,r,t");
|
||||
if (res >= 0)
|
||||
{
|
||||
cerr << "ProcessModeMatch::InitProcess(): Warning, an error occured parsing the mode matching function (see below) ..." << endl;
|
||||
cerr << "ProcessModeMatch::InitProcess(): Warning, an error occurred parsing the mode matching function (see below) ..." << endl;
|
||||
cerr << m_ModeFunction[ny] << "\n" << string(res, ' ') << "^\n" << m_ModeParser[n]->ErrorMsg() << "\n";
|
||||
SetEnable(false);
|
||||
Reset();
|
||||
|
@ -138,7 +138,7 @@ void ProcessModeMatch::InitProcess()
|
|||
bool dualMesh = m_ModeFieldType==1;
|
||||
unsigned int pos[3] = {0,0,0};
|
||||
double discLine[3] = {0,0,0};
|
||||
double gridDelta = 1; // 1 -> mode-matching function is definied in drawing units...
|
||||
double gridDelta = 1; // 1 -> mode-matching function is defined in drawing units...
|
||||
double var[7];
|
||||
pos[m_ny] = start[m_ny];
|
||||
discLine[m_ny] = Op->GetDiscLine(m_ny,pos[m_ny],dualMesh);
|
||||
|
|
|
@ -24,7 +24,7 @@ class CSFunctionParser;
|
|||
|
||||
//! Processing class to match a mode to a given analytic function and return the integral value.
|
||||
/*!
|
||||
The analytric function has to be definied in drawing units.
|
||||
The analytric function has to be defined in drawing units.
|
||||
It will return the integral value and the mode purity as a secondary value.
|
||||
*/
|
||||
class ProcessModeMatch : public ProcessIntegral
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
//! Get the length of the excitation signal
|
||||
unsigned int GetLength() const {return Length;}
|
||||
|
||||
//! Get the max frequeny excited by this signal
|
||||
//! Get the max frequency excited by this signal
|
||||
double GetMaxFrequency() const {return m_f_max;}
|
||||
|
||||
//! Get the frequency of interest
|
||||
|
|
|
@ -55,7 +55,7 @@ void Engine_Ext_CylinderMultiGrid::DoPreVoltageUpdates()
|
|||
if (!m_IsBase)
|
||||
{
|
||||
//cerr << "child: volt wait on base " << endl;
|
||||
m_WaitOnBase->wait(); //wait on base to finisch current sync and/or to finisch voltage updates, than start child voltage updates
|
||||
m_WaitOnBase->wait(); //wait on base to finish current sync and/or to finish voltage updates, than start child voltage updates
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,14 +69,14 @@ void Engine_Ext_CylinderMultiGrid::Apply2Voltages()
|
|||
if (m_IsBase)
|
||||
{
|
||||
m_WaitOnBase->wait(); //base voltage updates are done, tell child to start its voltage updates
|
||||
m_WaitOnChild->wait(); //wait for child to finisch its updates
|
||||
SyncVoltages(); //child is finisch, run sync and go to current updates next
|
||||
m_WaitOnChild->wait(); //wait for child to finish its updates
|
||||
SyncVoltages(); //child is finish, run sync and go to current updates next
|
||||
m_WaitOnSync->wait(); //sync is done... move on and tell child to move on...
|
||||
}
|
||||
else
|
||||
{
|
||||
m_WaitOnChild->wait(); //child is finished voltage updates, will tell base to run sync
|
||||
m_WaitOnSync->wait(); //wait for base to finisch sync before going to wait for current updates
|
||||
m_WaitOnSync->wait(); //wait for base to finish sync before going to wait for current updates
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ void Engine_Ext_CylinderMultiGrid::DoPreCurrentUpdates()
|
|||
if (!m_IsBase)
|
||||
{
|
||||
//cerr << "child: curr wait on base " << endl;
|
||||
m_WaitOnBase->wait(); //wait on base to finisch voltage sync and current updates, than start child current updates
|
||||
m_WaitOnBase->wait(); //wait on base to finish voltage sync and current updates, than start child current updates
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -140,14 +140,14 @@ void Engine_Ext_CylinderMultiGrid::Apply2Current()
|
|||
{
|
||||
//cerr << "Base: curr wait on base done, wait on sync" << endl;
|
||||
m_WaitOnBase->wait(); //base current updates are done, tell child to start its current updates
|
||||
m_WaitOnChild->wait(); //wait for child to finisch its updates
|
||||
SyncCurrents(); //child is finisch, run sync and go to voltage updates next
|
||||
m_WaitOnChild->wait(); //wait for child to finish its updates
|
||||
SyncCurrents(); //child is finish, run sync and go to voltage updates next
|
||||
m_WaitOnSync->wait(); //sync is done... move on and tell child to move on...
|
||||
}
|
||||
else
|
||||
{
|
||||
m_WaitOnChild->wait(); //child is finished current updates, will tell base to run sync...
|
||||
m_WaitOnSync->wait(); //wait for base to finisch sync before going to wait for next voltage updates
|
||||
m_WaitOnSync->wait(); //wait for base to finish sync before going to wait for next voltage updates
|
||||
//cerr << "Child: curr done, wait on sync" << endl;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,27 +41,27 @@ public:
|
|||
|
||||
virtual void SetNumberOfThreads(int nrThread);
|
||||
|
||||
//! This methode will be called __before__ the main engine does the usual voltage updates. This methode may __not__ change the engine voltages!!!
|
||||
//! This method will be called __before__ the main engine does the usual voltage updates. This method may __not__ change the engine voltages!!!
|
||||
virtual void DoPreVoltageUpdates() {}
|
||||
virtual void DoPreVoltageUpdates(int threadID);
|
||||
//! This methode will be called __after__ the main engine does the usual voltage updates. This methode may __not__ change the engine voltages!!!
|
||||
//! This method will be called __after__ the main engine does the usual voltage updates. This method may __not__ change the engine voltages!!!
|
||||
virtual void DoPostVoltageUpdates() {}
|
||||
virtual void DoPostVoltageUpdates(int threadID);
|
||||
//! This methode will be called __after__ all updates to the voltages and extensions and may add/set its results to the engine voltages, but may __not__ rely on the current value of the engine voltages!!!
|
||||
//! This method will be called __after__ all updates to the voltages and extensions and may add/set its results to the engine voltages, but may __not__ rely on the current value of the engine voltages!!!
|
||||
virtual void Apply2Voltages() {}
|
||||
virtual void Apply2Voltages(int threadID);
|
||||
|
||||
//! This methode will be called __before__ the main engine does the usual current updates. This methode may __not__ change the engine current!!!
|
||||
//! This method will be called __before__ the main engine does the usual current updates. This method may __not__ change the engine current!!!
|
||||
virtual void DoPreCurrentUpdates() {}
|
||||
virtual void DoPreCurrentUpdates(int threadID);
|
||||
//! This methode will be called __after__ the main engine does the usual current updates. This methode may __not__ change the engine current!!!
|
||||
//! This method will be called __after__ the main engine does the usual current updates. This method may __not__ change the engine current!!!
|
||||
virtual void DoPostCurrentUpdates() {}
|
||||
virtual void DoPostCurrentUpdates(int threadID);
|
||||
//! This methode will be called __after__ all updates to the current and extensions and may add/set its results to the engine current, but may __not__ rely on the current value of the engine current!!!
|
||||
//! This method will be called __after__ all updates to the current and extensions and may add/set its results to the engine current, but may __not__ rely on the current value of the engine current!!!
|
||||
virtual void Apply2Current() {}
|
||||
virtual void Apply2Current(int threadID);
|
||||
|
||||
//! Set the Engine to this extention. This will usually done automatically by Engine::AddExtension
|
||||
//! Set the Engine to this extension. This will usually done automatically by Engine::AddExtension
|
||||
virtual void SetEngine(Engine* eng) {m_Eng=eng;}
|
||||
|
||||
//! Get the priority for this extension
|
||||
|
|
|
@ -314,7 +314,7 @@ bool Operator_Ext_LorentzMaterial::BuildExtension()
|
|||
if (L_D[n]>0)
|
||||
{
|
||||
v_int[n].push_back((2.0*L_D[n]-dT*R_D[n])/(2.0*L_D[n]+dT*R_D[n]));
|
||||
// check for r==0 in clyindrical coords and get special VI cooefficient
|
||||
// check for r==0 in clyindrical coords and get special VI coefficient
|
||||
if (m_CC_R0_included && n==2 && pos[0]==0)
|
||||
v_ext[n].push_back(dT/(L_D[n]+dT*R_D[n]/2.0)*m_Op_Cyl->m_Cyl_Ext->vi_R0[pos[2]]);
|
||||
else
|
||||
|
|
|
@ -281,7 +281,7 @@ bool Operator_Ext_UPML::SetGradingFunction(string func)
|
|||
int res = m_GradingFunction->Parse(m_GradFunc.c_str(), "D,dl,W,Z,N");
|
||||
if (res < 0) return true;
|
||||
|
||||
cerr << "Operator_Ext_UPML::SetGradingFunction: Warning, an error occured parsing the pml grading function (see below) ..." << endl;
|
||||
cerr << "Operator_Ext_UPML::SetGradingFunction: Warning, an error occurred parsing the pml grading function (see below) ..." << endl;
|
||||
cerr << func << "\n" << string(res, ' ') << "^\n" << m_GradingFunction->ErrorMsg() << "\n";
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
|
||||
class FunctionParser;
|
||||
|
||||
//! Operator extension implemention an uniaxial perfectly matched layer (upml)
|
||||
//! Operator extension implementation an uniaxial perfectly matched layer (upml)
|
||||
/*
|
||||
The priority for this extension should be the highest of all extensions since this operator will use the main engine to perform vital parts in the upml implementation.
|
||||
Therefore the voltages and currents as well as the operator are replaced during these update process.
|
||||
This extension is propably incompatible with the most other extensions operating in the same regions.
|
||||
This extension is probably incompatible with the most other extensions operating in the same regions.
|
||||
*/
|
||||
class Operator_Ext_UPML : public Operator_Extension
|
||||
{
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
//! Create a clone of this extension, will return NULL if this is impossible
|
||||
/*!
|
||||
Create a clone of this extension, will return NULL if this is impossible (e.g. derived extension has no clone method and copy-constructor)...
|
||||
BuildExtension has to be called separatly!
|
||||
BuildExtension has to be called separately!
|
||||
*/
|
||||
virtual Operator_Extension* Clone(Operator* op) {UNUSED(op); return NULL;}
|
||||
|
||||
|
|
|
@ -334,7 +334,7 @@ unsigned int openEMS_FDTD_MPI::GetNextStep()
|
|||
|
||||
int local_step=step;
|
||||
|
||||
//find the smallest next step requestes by all processings
|
||||
//find the smallest next step requests by all processings
|
||||
MPI_Reduce(&local_step, &step, 1, MPI_INT, MPI_MIN, 0, MPI_COMM_WORLD);
|
||||
//send the smallest next step to all
|
||||
MPI_Bcast(&step, 1, MPI_INT, 0, MPI_COMM_WORLD);
|
||||
|
@ -397,7 +397,7 @@ bool openEMS_FDTD_MPI::SetupProcessing()
|
|||
if (dynamic_cast<ProcessIntegral*>(proc)!=NULL)
|
||||
{
|
||||
//type is integral processing --> disable! Needs to be fixed!
|
||||
cerr << "openEMS_FDTD_MPI::SetupProcessing(): Warning: Processing: " << proc->GetName() << " occures multiple times and is being deactivated..." << endl;
|
||||
cerr << "openEMS_FDTD_MPI::SetupProcessing(): Warning: Processing: " << proc->GetName() << " occurs multiple times and is being deactivated..." << endl;
|
||||
cerr << "openEMS_FDTD_MPI::SetupProcessing(): Note: Processing: Make sure that there are no splits inside probes or sources." << endl;
|
||||
deactivate = true;
|
||||
rename = false;
|
||||
|
@ -405,12 +405,12 @@ bool openEMS_FDTD_MPI::SetupProcessing()
|
|||
if (dynamic_cast<ProcessFields*>(proc)!=NULL)
|
||||
{
|
||||
//type is field processing --> renameing! Needs to be fixed!
|
||||
cerr << "openEMS_FDTD_MPI::SetupProcessing(): Warning: Processing: " << proc->GetName() << " occures multiple times and is being renamed..." << endl;
|
||||
cerr << "openEMS_FDTD_MPI::SetupProcessing(): Warning: Processing: " << proc->GetName() << " occurs multiple times and is being renamed..." << endl;
|
||||
deactivate = false;
|
||||
rename = true;
|
||||
}
|
||||
}
|
||||
//broadcast informations to all
|
||||
//broadcast information to all
|
||||
MPI_Bcast(&deactivate, 1, MPI::BOOL, 0, MPI_COMM_WORLD);
|
||||
MPI_Bcast(&rename, 1, MPI::BOOL, 0, MPI_COMM_WORLD);
|
||||
if (deactivate)
|
||||
|
|
|
@ -373,7 +373,7 @@ int Operator::SnapLine2Mesh(const double* start, const double* stop, unsigned in
|
|||
return ret;
|
||||
|
||||
//fixme, do we need to do something about start or stop being outside the field domain?
|
||||
//maybe caclulate the intersection point and snap to that?
|
||||
//maybe calculate the intersection point and snap to that?
|
||||
//it seems to work like this as well...
|
||||
|
||||
return ret;
|
||||
|
@ -450,7 +450,7 @@ Grid_Path Operator::FindPath(double start[], double stop[])
|
|||
currPos[minDir]+=-1;
|
||||
minPos[minDir]-=1;
|
||||
}
|
||||
//check validity of current postion
|
||||
//check validity of current position
|
||||
for (int n=0;n<3;++n)
|
||||
if (currPos[n]>=numLines[n])
|
||||
{
|
||||
|
@ -1397,7 +1397,7 @@ bool Operator::AverageMatCellCenter(int ny, const unsigned int* pos, double* Eff
|
|||
for (int n=0; n<4; ++n)
|
||||
if (std::isnan(EffMat[n]) || std::isinf(EffMat[n]))
|
||||
{
|
||||
cerr << "Operator::" << __func__ << ": Error, an effective material parameter is not a valid result, this should NOT have happend... exit..." << endl;
|
||||
cerr << "Operator::" << __func__ << ": Error, an effective material parameter is not a valid result, this should NOT have happened... exit..." << endl;
|
||||
cerr << ny << "@" << n << " : " << pos[0] << "," << pos[1] << "," << pos[2] << endl;
|
||||
exit(0);
|
||||
}
|
||||
|
@ -1510,7 +1510,7 @@ bool Operator::AverageMatQuarterCell(int ny, const unsigned int* pos, double* Ef
|
|||
for (int n=0; n<4; ++n)
|
||||
if (std::isnan(EffMat[n]) || std::isinf(EffMat[n]))
|
||||
{
|
||||
cerr << "Operator::" << __func__ << ": Error, An effective material parameter is not a valid result, this should NOT have happend... exit..." << endl;
|
||||
cerr << "Operator::" << __func__ << ": Error, An effective material parameter is not a valid result, this should NOT have happened... exit..." << endl;
|
||||
cerr << ny << "@" << n << " : " << pos[0] << "," << pos[1] << "," << pos[2] << endl;
|
||||
exit(0);
|
||||
}
|
||||
|
@ -1696,7 +1696,7 @@ bool Operator::Calc_LumpedElements()
|
|||
|
||||
}
|
||||
else
|
||||
cerr << "Operator::Calc_LumpedElements(): Warning: Primitves other than boxes are not supported for lumped elements! skipping "
|
||||
cerr << "Operator::Calc_LumpedElements(): Warning: Primitives other than boxes are not supported for lumped elements! skipping "
|
||||
<< prims.at(bn)->GetTypeName() << " ID: " << prims.at(bn)->GetID() << " @ Property: " << PLE->GetName() << endl;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ public:
|
|||
//! Get the volume of an FDTD cell
|
||||
virtual double GetCellVolume(const unsigned int pos[3], bool dualMesh = false) const;
|
||||
|
||||
//! Get the area around an edge for a given direction \a n and a given mesh posisition \a pos
|
||||
//! Get the area around an edge for a given direction \a n and a given mesh position \a pos
|
||||
/*!
|
||||
This will return the area around an edge with a given direction, measured at the middle of the edge.
|
||||
In a cartesian mesh this is equal to the NodeArea, may be different in other coordinate systems.
|
||||
|
@ -143,7 +143,7 @@ public:
|
|||
|
||||
virtual unsigned int SnapToMeshLine(int ny, double coord, bool &inside, bool dualMesh=false, bool fullMesh=false) const;
|
||||
|
||||
//! Snap the given coodinates to mesh indices
|
||||
//! Snap the given coordinates to mesh indices
|
||||
virtual bool SnapToMesh(const double* coord, unsigned int* uicoord, bool dualMesh=false, bool fullMesh=false, bool* inside=NULL) const;
|
||||
|
||||
//! Snap a given box to the FDTD mesh
|
||||
|
@ -223,7 +223,7 @@ protected:
|
|||
/*!
|
||||
Get the raw disc delta for a given position and direction.
|
||||
The result will be positive if a disc delta inside the simulation domain is requested.
|
||||
The result will be the negative value of the first or last disc delta respectivly if the position is outside the field domain.
|
||||
The result will be the negative value of the first or last disc delta respectively if the position is outside the field domain.
|
||||
*/
|
||||
virtual double GetRawDiscDelta(int ny, const int pos) const;
|
||||
|
||||
|
|
|
@ -48,14 +48,14 @@ public:
|
|||
//! Get the coordinates for a given node index and component, according to the cylindrical yee-algorithm. Returns true if inside the FDTD domain.
|
||||
virtual bool GetYeeCoords(int ny, unsigned int pos[3], double* coords, bool dualMesh) const;
|
||||
|
||||
//! Get the node width for a given direction \a n and a given mesh posisition \a pos
|
||||
//! Get the node width for a given direction \a n and a given mesh position \a pos
|
||||
virtual double GetNodeWidth(int ny, const unsigned int pos[3], bool dualMesh = false) const;
|
||||
//! Get the node width for a given direction \a n and a given mesh posisition \a pos
|
||||
//! Get the node width for a given direction \a n and a given mesh position \a pos
|
||||
virtual double GetNodeWidth(int ny, const int pos[3], bool dualMesh = false) const;
|
||||
|
||||
//! Get the node area for a given direction \a n and a given mesh posisition \a pos
|
||||
//! Get the node area for a given direction \a n and a given mesh position \a pos
|
||||
virtual double GetNodeArea(int n, const unsigned int* pos, bool dualMesh=false) const;
|
||||
//! Get the node area for a given direction \a n and a given mesh posisition \a pos
|
||||
//! Get the node area for a given direction \a n and a given mesh position \a pos
|
||||
virtual double GetNodeArea(int ny, const int pos[3], bool dualMesh = false) const;
|
||||
|
||||
//! Get the length of an FDTD edge, including radius corrected alpha-mesh width.
|
||||
|
@ -64,7 +64,7 @@ public:
|
|||
//! Get the volume of an FDTD cell
|
||||
virtual double GetCellVolume(const unsigned int pos[3], bool dualMesh = false) const;
|
||||
|
||||
//! Get the area around an edge for a given direction \a n and a given mesh posisition \a pos
|
||||
//! Get the area around an edge for a given direction \a n and a given mesh position \a pos
|
||||
/*!
|
||||
This will return the area around an edge with a given direction, measured at the middle of the edge.
|
||||
In a cartesian mesh this is equal to the NodeArea, may be different in other coordinate systems.
|
||||
|
|
|
@ -53,7 +53,7 @@ double Operator_MPI::CalcTimestep()
|
|||
return ret;
|
||||
|
||||
double local_dT = dT;
|
||||
//find the smallest time-step requestes by all processings
|
||||
//find the smallest time-step requests by all processings
|
||||
MPI_Reduce(&local_dT, &dT, 1, MPI_DOUBLE, MPI_MIN, 0, MPI_COMM_WORLD);
|
||||
//send the smallest time-step to all
|
||||
MPI_Bcast(&dT, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD);
|
||||
|
|
2
INSTALL
2
INSTALL
|
@ -22,6 +22,6 @@ Install instructions for openEMS:
|
|||
make install (may require root)
|
||||
|
||||
Note:
|
||||
- all path informations may be stored in a localConfig.cmake
|
||||
- all path information may be stored in a localConfig.cmake
|
||||
- the default "prefix" is /usr/local
|
||||
|
||||
|
|
4
TODO
4
TODO
|
@ -3,10 +3,10 @@
|
|||
|
||||
todo / mandatory for v0.1.0:
|
||||
- more examples and lots of testing...
|
||||
- improvments and testing for MPI engine
|
||||
- improvements and testing for MPI engine
|
||||
|
||||
wishes:
|
||||
- location dependend excitation given by a file (e.g. mode-profile simulated with comsol)
|
||||
- location dependent excitation given by a file (e.g. mode-profile simulated with comsol)
|
||||
- more import filter (e.g. gerber import)
|
||||
|
||||
outlook:
|
||||
|
|
|
@ -17,7 +17,7 @@ openems (0.0.25-4) stable; urgency=low
|
|||
* Upstream fixes
|
||||
-- Sebastian Held <sebastian.held@gmx.de> Sun, 25 Dec 2011 21:23:38 +0100
|
||||
openems (0.0.25-3) stable; urgency=low
|
||||
* Changed dependancy on boost to enable build on oneiric
|
||||
* Changed dependency on boost to enable build on oneiric
|
||||
-- Sebastian Held <sebastian.held@gmx.de> Sun, 18 Dec 2011 21:39:38 +0100
|
||||
openems (0.0.25-2) stable; urgency=low
|
||||
* New upstream release
|
||||
|
|
|
@ -20,7 +20,7 @@ function [val_ar t_ar f_val_ar EC] = AR_estimate( t, val, freq, nu, mu, expand_f
|
|||
% 0 --> no error
|
||||
% 1 --> input error: t and val mismatch
|
||||
% 2 --> input error: mu has to be larger than 2*nu
|
||||
% 3 --> inout error: expand_factor has to be larger than 1
|
||||
% 3 --> input error: expand_factor has to be larger than 1
|
||||
% 10 --> AR error: signal is to short for AR estimate --> decrease AR order
|
||||
% 11 --> AR error: estimated signal appears to be unstable --> use a different mu
|
||||
%
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function [queue] = Add2Queue(queue,func_name, func_args, varargin)
|
||||
% function [queue] = Add2Queue(queue,func_name, func_args, varargin)
|
||||
%
|
||||
% Use this function to add a funtion to the queue.
|
||||
% Use this function to add a function to the queue.
|
||||
%
|
||||
% For more details see: InitQueue
|
||||
%
|
||||
|
|
|
@ -68,7 +68,7 @@ evec0 = evec ./ sum(evec); % evec0 is a unit vector
|
|||
|
||||
%set defaults
|
||||
feed_shift = 0;
|
||||
feed_R = inf; %(default is open, no resitance)
|
||||
feed_R = inf; %(default is open, no resistance)
|
||||
excite = false;
|
||||
measplanepos = nan;
|
||||
PortNamePrefix = '';
|
||||
|
@ -277,7 +277,7 @@ if excite
|
|||
CSX = AddBox( CSX, [PortNamePrefix 'port_excite_2_' num2str(portnr)], prio, ex_start+width_add_start, ex_stop+width_add_stop );
|
||||
end
|
||||
|
||||
%% CPW resitance at start of CPW line
|
||||
%% CPW resistance at start of CPW line
|
||||
ex_start(idx_prop) = start(idx_prop);
|
||||
ex_stop(idx_prop) = ex_start(idx_prop);
|
||||
|
||||
|
@ -292,6 +292,6 @@ elseif feed_R == 0
|
|||
CSX = AddBox( CSX, materialname, prio, ex_start-width_add_start, ex_stop-width_add_stop );
|
||||
CSX = AddBox( CSX, materialname, prio, ex_start+width_add_start, ex_stop+width_add_stop );
|
||||
else
|
||||
error('openEMS:AddCPWPort','CPW port with resitance <= 0 it not possible');
|
||||
error('openEMS:AddCPWPort','CPW port with resistance <= 0 it not possible');
|
||||
end
|
||||
end
|
||||
|
|
|
@ -50,7 +50,7 @@ dir = DirChar2Int(dir);
|
|||
|
||||
%set defaults
|
||||
feed_shift = 0;
|
||||
feed_R = inf; %(default is open, no resitance)
|
||||
feed_R = inf; %(default is open, no resistance)
|
||||
excite_amp = 0;
|
||||
measplanepos = nan;
|
||||
PortNamePrefix = '';
|
||||
|
|
|
@ -69,7 +69,7 @@ evec0 = evec ./ sum(evec); % evec0 is a unit vector
|
|||
|
||||
%set defaults
|
||||
feed_shift = 0;
|
||||
feed_R = inf; %(default is open, no resitance)
|
||||
feed_R = inf; %(default is open, no resistance)
|
||||
excite = false;
|
||||
measplanepos = nan;
|
||||
PortNamePrefix = '';
|
||||
|
|
|
@ -17,7 +17,7 @@ function [CSX,port] = AddStripLinePort( CSX, prio, portnr, materialname, start,
|
|||
% is false)
|
||||
% 'FeedShift' shift to port from start by a given distance in drawing
|
||||
% units. Default is 0. Only active if 'ExcitePort' is set!
|
||||
% 'Feed_R' Specifiy a lumped port resistance. Default is no lumped
|
||||
% 'Feed_R' Specify a lumped port resistance. Default is no lumped
|
||||
% port resistance --> port has to end in an ABC.
|
||||
% 'MeasPlaneShift' Shift the measurement plane from start t a given distance
|
||||
% in drawing units. Default is the middle of start/stop.
|
||||
|
|
|
@ -74,7 +74,7 @@ for n=1:2:numel(varargin_tmp)
|
|||
end
|
||||
end
|
||||
|
||||
% matlab adressing
|
||||
% matlab addressing
|
||||
dir = dir + 1;
|
||||
dir_sign = sign(stop(dir) - start(dir));
|
||||
if (dir_sign==0)
|
||||
|
|
|
@ -14,7 +14,7 @@ function nf2ff = CalcNF2FF(nf2ff, Sim_Path, freq, theta, phi, varargin)
|
|||
% freq: array of frequencies to analyse
|
||||
% theta,phi: spherical coordinates to evaluate the far-field on (in radians)
|
||||
%
|
||||
% optional paramater:
|
||||
% optional parameter:
|
||||
% 'Center': nf2ff phase center, default is [0 0 0]
|
||||
% !! Make sure the center is never outside of your nf2ff box!!
|
||||
% Definition is the correct coordinate system necessary
|
||||
|
|
|
@ -56,7 +56,7 @@ end
|
|||
|
||||
if (do_FD_dump)
|
||||
if (~isfield(field,'FD'))
|
||||
warning('openEMS:ConvertHDF5_VTK','no FD data found skipping frequency domian vtk dump...');
|
||||
warning('openEMS:ConvertHDF5_VTK','no FD data found skipping frequency domain vtk dump...');
|
||||
else
|
||||
%set weighting
|
||||
if (numel(weight)~=numel(field.FD.frequency))
|
||||
|
@ -88,7 +88,7 @@ end
|
|||
|
||||
if (do_TD_dump)
|
||||
if (~isfield(field,'TD'))
|
||||
warning('openEMS:ConvertHDF5_VTK','no TD data found skipping time domian vtk dump...');
|
||||
warning('openEMS:ConvertHDF5_VTK','no TD data found skipping time domain vtk dump...');
|
||||
else
|
||||
disp('dumping time domain data...')
|
||||
acc = ['%0' int2str(ceil(log10(numel(field.TD.time)+1))) 'd'];
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Dump2VTK(filename, fields, mesh, fieldname, varargin)
|
||||
% Dump2VTK(filename, fields, mesh, fieldname, varargin)
|
||||
%
|
||||
% Dump fields extraced from an hdf5 file to a vtk file format
|
||||
% Dump fields extracted from an hdf5 file to a vtk file format
|
||||
%
|
||||
% possible arguments:
|
||||
% 'NativeDump': 0 (default) / 1, dump in native coordinate system
|
||||
|
|
|
@ -44,7 +44,7 @@ end
|
|||
if ischar(host_list)
|
||||
fid=fopen(host_list);
|
||||
if (fid==-1)
|
||||
error('FindFreeSSH: cant open host file');
|
||||
error('FindFreeSSH: cannot open host file');
|
||||
end
|
||||
clear host_list;
|
||||
host_list = {};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function FDTD = InitFDTD(varargin)
|
||||
% function FDTD = InitFDTD(varargin)
|
||||
%
|
||||
% Inititalize the FDTD data-structure.
|
||||
% Initialize the FDTD data-structure.
|
||||
%
|
||||
% optional field arguments for usage with openEMS:
|
||||
% NrTS: max. number of timesteps to simulate (e.g. default=1e9)
|
||||
|
|
|
@ -11,7 +11,7 @@ function FDTD = SetBoundaryCond(FDTD, BC, varargin)
|
|||
%
|
||||
% example:
|
||||
% BC = [ 1 1 0 0 2 3 ] %using numbers or
|
||||
% BC = {'PMC' 'PMC' 'PEC' 'PEC' 'MUR' 'PML_8'} %usign equivalent strings
|
||||
% BC = {'PMC' 'PMC' 'PEC' 'PEC' 'MUR' 'PML_8'} %using equivalent strings
|
||||
%
|
||||
% mur-abc definitions
|
||||
% define a phase-velocity to be used by the mur-abc
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Tutorials / bent patch antenna
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
% http://openems.de/index.php/Tutorial:_Bent_Patch_Antenna
|
||||
%
|
||||
% Tested with
|
||||
|
@ -76,7 +76,7 @@ start = [patch.radius+substrate.thickness -substr_ang_width/2 -substrate.length/
|
|||
stop = [patch.radius+substrate.thickness +substr_ang_width/2 substrate.length/2];
|
||||
CSX = AddBox( CSX, 'Jt_patch', 0, start, stop );
|
||||
|
||||
%% create ground (not really necessary, only for esthetic reasons)
|
||||
%% create ground (not really necessary, only for aesthetic reasons)
|
||||
CSX = AddMetal( CSX, 'gnd' ); % create a perfect electric conductor (PEC)
|
||||
start = [patch.radius -substr_ang_width/2 -substrate.length/2];
|
||||
stop = [patch.radius +substr_ang_width/2 +substrate.length/2];
|
||||
|
@ -158,7 +158,7 @@ ylabel( 'reflection coefficient |S_{11}|' );
|
|||
|
||||
drawnow
|
||||
|
||||
%find resonance frequncy from s11
|
||||
%find resonance frequency from s11
|
||||
f_res_ind = find(s11==min(s11));
|
||||
f_res = freq(f_res_ind);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Tutorials / CRLH_Extraction
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
% http://openems.de/index.php/Tutorial:_CRLH_Extraction
|
||||
%
|
||||
% Tested with
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Tutorials / CRLH_LeakyWaveAnt
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
% http://openems.de/index.php/Tutorial:_CRLH_Leaky_Wave_Antenna
|
||||
%
|
||||
% Tested with
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Tutorials / Circ_Waveguide
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
% http://openems.de/index.php/Tutorial:_Circular_Waveguide
|
||||
%
|
||||
% Tested with
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Tutorials / conical horn antenna
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
% http://openems.de/index.php/Tutorial:_Conical_Horn_Antenna
|
||||
%
|
||||
% Tested with
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Tutorials / CylindricalWave_CC
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
% http://openems.de/index.php/Tutorial:_2D_Cylindrical_Wave
|
||||
%
|
||||
% Tested with
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Tutorials / Dipole SAR + Power budget
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
% http://openems.de/index.php/Tutorial:_Dipole_SAR
|
||||
%
|
||||
% Tested with
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Tutorials / helical antenna
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
% http://openems.de/index.php/Tutorial:_Helical_Antenna
|
||||
%
|
||||
% Tested with
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Tutorials / horn antenna
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
% http://openems.de/index.php/Tutorial:_Horn_Antenna
|
||||
%
|
||||
% Tested with
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Tutorials / 3T MRI Low Pass Birdcage coil
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
% http://openems.de/index.php/Tutorial:_MRI_LP_Birdcage
|
||||
%
|
||||
% Estimated time to run: ~7h @ ~65MC/s
|
||||
|
@ -69,7 +69,7 @@ body_model_transform = {'Rotate_X',pi,'Rotate_Z',pi, ...
|
|||
'Translate',[0,5,-720]};
|
||||
|
||||
%% some internal parameter
|
||||
physical_constants % load important physical constans
|
||||
physical_constants % load important physical constants
|
||||
end_crit = 1e-5; %abort simulation at -50dB energy drop
|
||||
unit = 1e-3; %drawing unit used
|
||||
|
||||
|
@ -164,7 +164,7 @@ for n=1:BC.N_rungs
|
|||
stop = [BC.rad a0+da_Segs/2+da_Strip/2 -0.5*BC.portlength];
|
||||
CSX = AddBox(CSX,'metal',1, start, stop);
|
||||
|
||||
% some additonal mesh lines
|
||||
% some additional mesh lines
|
||||
mesh.a = [mesh.a a0+da_Segs/2];
|
||||
|
||||
a0 = a0 + da_Segs;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Tutorials / 7T MRI Loop Coil
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
% http://openems.de/index.php/Tutorial:_MRI_Loop_Coil
|
||||
%
|
||||
% Tested with
|
||||
|
@ -145,7 +145,7 @@ CSX = AddBox(CSX, 'body_model', 0, body_box.start, body_box.stop);
|
|||
% create loop mesh
|
||||
mesh = DetectEdges(CSX);
|
||||
|
||||
% add a dense homegeneous mesh inside the human body model
|
||||
% add a dense homogeneous mesh inside the human body model
|
||||
mesh.x = [mesh.x mesh_box.start(1) mesh_box.stop(1)];
|
||||
mesh.y = [mesh.y mesh_box.start(2) mesh_box.stop(2)];
|
||||
mesh.z = [mesh.z mesh_box.start(3) mesh_box.stop(3)];
|
||||
|
@ -178,7 +178,7 @@ CSX = AddBox(CSX,'SAR_xz',0, body_box.start.*[1 0 1], body_box.stop.*[1 0 1]);
|
|||
%% boundary conditions
|
||||
mesh = AddPML(mesh, 10);
|
||||
|
||||
%% finaly define the FDTD mesh grid
|
||||
%% finally define the FDTD mesh grid
|
||||
disp(['number of cells: ' num2str(1e-6*numel(mesh.x)*numel(mesh.y)*numel(mesh.z)) ' Mcells'])
|
||||
CSX = DefineRectGrid( CSX, unit, mesh );
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Tutorials / MSL_NotchFilter
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
% http://openems.de/index.php/Tutorial:_Microstrip_Notch_Filter
|
||||
%
|
||||
% Tested with
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Tutorials / Parallel_Plate_Waveguide
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
% http://openems.de/index.php/Tutorial:_Parallel_Plate_Waveguide
|
||||
%
|
||||
% Tested with
|
||||
|
|
|
@ -6,10 +6,10 @@ function [port nf2ff] = Patch_Antenna_Array(Sim_Path, postproc_only, show_struct
|
|||
%
|
||||
% Sim_Path: Simulation path
|
||||
% postproc_only: set to post process only 0/1
|
||||
% show_structure: show the strucuture in AppCSXCAD 0/1
|
||||
% show_structure: show the structure in AppCSXCAD 0/1
|
||||
% xpos: the x-position for each antenna is defined
|
||||
% caps: the port capacity (will override active port)
|
||||
% resist: port resitance
|
||||
% resist: port resistance
|
||||
% active: switch port active
|
||||
%
|
||||
% References:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Tutorials / Patch Antenna Phased Array
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
%
|
||||
% Tested with
|
||||
% - Matlab 2011a
|
||||
|
@ -122,7 +122,7 @@ disp(['I2/I1: Matlab: ' num2str(I_out(2)/I_out(1))])
|
|||
disp(['I3/I1: Matlab: ' num2str(I_out(3)/I_out(1))])
|
||||
|
||||
|
||||
%% do a referenc simulation for the given C2/C3 values
|
||||
%% do a reference simulation for the given C2/C3 values
|
||||
if (do_reference_simulation)
|
||||
active = [1 0 0];
|
||||
caps = [0 C2 C3];
|
||||
|
@ -132,7 +132,7 @@ if (do_reference_simulation)
|
|||
port_ref = calcPort( port_ref, Sim_Path, f, 'RefImpedance', 50);
|
||||
nf2ff_ref = CalcNF2FF(nf2ff_ref, Sim_Path, f0, [-180:2:180]*pi/180, 0);
|
||||
|
||||
% extract currents from referenc simulation
|
||||
% extract currents from reference simulation
|
||||
for p=1:3
|
||||
I_ref(p,1) = interp1(f, port_ref{p}.if.tot,f0);
|
||||
end
|
||||
|
@ -141,7 +141,7 @@ if (do_reference_simulation)
|
|||
disp(['I3/I1: openEMS: ' num2str(I_ref(3)/I_ref(1))])
|
||||
end
|
||||
|
||||
%% calculate and apply weighting cooefficients [3]
|
||||
%% calculate and apply weighting coefficients [3]
|
||||
% calculate
|
||||
coeff = I\I_out;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Tutorials / radar cross section of a metal sphere
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
% http://openems.de/index.php/Tutorial:_RCS_Sphere
|
||||
%
|
||||
% Tested with
|
||||
|
|
|
@ -27,7 +27,7 @@ physical_constants;
|
|||
% in different channels.
|
||||
%
|
||||
% The Gaussian excitation is set to the same 3dB bandwidth as the
|
||||
% channels of the IEEE 802.15.4 UWB PHY. One exeption is channel4twice
|
||||
% channels of the IEEE 802.15.4 UWB PHY. One exception is channel4twice
|
||||
% which has the double bandwidth of channel 4. It can be seen that the
|
||||
% delay is larger and the fidelity is smaller in the vicinity of the
|
||||
% (undesired) resonances of the antenna. Note that for a real UWB system
|
||||
|
@ -117,7 +117,7 @@ CSX = AddBox(CSX, 'Patch', 2, [-patchsize/2, gap, 0], [patchsize/2, gap + patchs
|
|||
mesh.x = [];
|
||||
mesh.y = [];
|
||||
|
||||
% two mesh lines for the metal coatings of teh substrate
|
||||
% two mesh lines for the metal coatings of the substrate
|
||||
mesh.z = linspace(-substrate.height, 0, substrate.cells +1);
|
||||
|
||||
% find optimal mesh lines for the patch and ground, not yes the microstrip line
|
||||
|
@ -228,7 +228,7 @@ figure %("visible", "off");
|
|||
polarFF(nf2ff, 'xaxis', 'theta', 'logscale', [minplot, maxplot]);
|
||||
title(["fidelity ", suffix, " / %"]);
|
||||
|
||||
% save the plots in order to compare them afer simulating the different channels
|
||||
% save the plots in order to compare them after simulating the different channels
|
||||
print(1, ["s11_", suffix, ".png"]);
|
||||
print(2, ["farfield_", suffix, ".png"]);
|
||||
print(3, ["delay_mm_", suffix, ".png"]);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Tutorials / Rect_Waveguide
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
% http://openems.de/index.php/Tutorial:_Rectangular_Waveguide
|
||||
%
|
||||
% Tested with
|
||||
|
@ -21,7 +21,7 @@ unit = 1e-6; %drawing unit in um
|
|||
% waveguide dimensions
|
||||
% WR42
|
||||
a = 10700; %waveguide width
|
||||
b = 4300; %waveguide heigth
|
||||
b = 4300; %waveguide height
|
||||
length = 50000;
|
||||
|
||||
% frequency range of interest
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
%% Simple Patch Antenna Tutorial
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
% <http://openems.de/index.php/Tutorial:_Simple_Patch_Antenna>
|
||||
%
|
||||
% Tested with
|
||||
|
@ -147,7 +147,7 @@ ylabel( 'reflection coefficient |S_{11}|' );
|
|||
drawnow
|
||||
|
||||
%% NFFF Plots
|
||||
%find resonance frequncy from s11
|
||||
%find resonance frequency from s11
|
||||
f_res_ind = find(s11==min(s11));
|
||||
f_res = freq(f_res_ind);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Stripline to Microstrip Line Transition
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
% <http://openems.de/index.php/Tutorial:_Stripline_to_MSL_Transition>
|
||||
%
|
||||
% Tested with
|
||||
|
@ -68,7 +68,7 @@ CSX = AddBox( CSX, 'RO4350B', 0, start, stop );
|
|||
CSX = AddMetal( CSX, 'gnd' );
|
||||
CSX = AddMetal( CSX, 'metal' );
|
||||
|
||||
% Create strip line port (incl. metal stip line)
|
||||
% Create strip line port (incl. metal strip line)
|
||||
start = [-line_length -strip_width/2 0];
|
||||
stop = [0 +strip_width/2 0];
|
||||
[CSX,port{1}] = AddStripLinePort( CSX, 100, 1, 'metal', start, stop, strip_substrate_thickness, 'x', [0 0 -1], 'ExcitePort', true, 'FeedShift', feed_shift, 'MeasPlaneShift', meas_shift );
|
||||
|
|
|
@ -1 +1 @@
|
|||
* Find the tutorial describtions at http://openems.de/index.php/Tutorials
|
||||
* Find the tutorial descriptions at http://openems.de/index.php/Tutorials
|
||||
|
|
|
@ -32,7 +32,7 @@ function [port] = calcPort( port, SimDir, f, varargin)
|
|||
% port.f the given frequency fector
|
||||
% port.uf.tot/inc/ref total, incoming and reflected voltage
|
||||
% port.if.tot/inc/ref total, incoming and reflected current
|
||||
% port.ZL_ref used refernce impedance
|
||||
% port.ZL_ref used reference impedance
|
||||
%
|
||||
% port.P_inc incoming power
|
||||
% port.P_ref reflected power
|
||||
|
|
|
@ -34,7 +34,7 @@ function [port] = calcTLPort( port, SimDir, f, varargin)
|
|||
% port.if.tot/inc/ref total, incoming and reflected current
|
||||
% port.beta: propagation constant
|
||||
% port.ZL: characteristic line impedance
|
||||
% port.ZL_ref used refernce impedance
|
||||
% port.ZL_ref used reference impedance
|
||||
%
|
||||
% example:
|
||||
% port{1} = calcTLPort( port{1}, Sim_Path, f, 'RefImpedance', 50);
|
||||
|
|
|
@ -184,7 +184,7 @@ ylabel( 'reflection coefficient |S_{11}|' );
|
|||
drawnow
|
||||
|
||||
%% NFFF contour plots %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%find resonance frequncy from s11
|
||||
%find resonance frequency from s11
|
||||
f_res_ind = find(s11==min(s11));
|
||||
f_res = freq(f_res_ind);
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ disp( ['DONE. L = ' num2str(L(1)/1e-6) ' uH'] );
|
|||
goal = 2e-6; % specify the goal: 2 uH
|
||||
result = abs(goal - L(1)); % costs must not be negative
|
||||
|
||||
% restore curent folder
|
||||
% restore current folder
|
||||
cd( oldpwd );
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ pic_size = round([1400 1400/4]); %define the animation picture size
|
|||
length = 500;
|
||||
width = 10;
|
||||
mesh_res = 0.5; % mesh resolution
|
||||
height = 3*mesh_res; % hight is ony 3 lines with PEC (top/bottom) --> quasi 2D
|
||||
height = 3*mesh_res; % height is only 3 lines with PEC (top/bottom) --> quasi 2D
|
||||
|
||||
%FDTD setup
|
||||
f0 = 5e9; %center frequency
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%
|
||||
% Tutorials / CPW_Line
|
||||
%
|
||||
% Describtion at:
|
||||
% Description at:
|
||||
%
|
||||
% Tested with
|
||||
% - Octave 3.8.1
|
||||
|
@ -33,7 +33,7 @@ if 1
|
|||
feed_shift_cells = 0;
|
||||
x_spacing = air_spacing;
|
||||
else % or use a waveguide with start/end in a pml
|
||||
feed_R = inf; % CPW ends in a pml --> disable termination resitance
|
||||
feed_R = inf; % CPW ends in a pml --> disable termination resistance
|
||||
feed_shift_cells = 10; % CPW ends in an 8 cells thick pml --> shift feed 10 cells
|
||||
pml_add_cells = [0 0 8 8 8 8]; % do not add air-space in x-direction
|
||||
x_spacing = 0; % do not add air-space in x-direction
|
||||
|
|
|
@ -88,7 +88,7 @@ CSX = SetMaterialWeight( CSX, 'fakepml', 'Sigma', ['pow(z-' num2str(length-abs_l
|
|||
start = [mesh.x(1) mesh.y(1) length-abs_length];
|
||||
stop = [mesh.x(end) mesh.y(end) length];
|
||||
% the geometric priority is set to 0, which is lower than the priority
|
||||
% of the MSL, thus the MSL (copper) has precendence
|
||||
% of the MSL, thus the MSL (copper) has precedence
|
||||
priority = 0;
|
||||
CSX = AddBox( CSX, 'fakepml', priority, start, stop );
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ numTS = 50000; %max. number of timesteps
|
|||
% waveguide dimensions
|
||||
length = 1000;
|
||||
a = 1000; %waveguide width
|
||||
b = 600; %waveguide heigth
|
||||
b = 600; %waveguide height
|
||||
|
||||
%waveguide TE-mode definition
|
||||
m = 1;
|
||||
|
|
|
@ -1218,7 +1218,7 @@ bool openEMS::DumpStatistics(const string& filename, double time)
|
|||
stat_file << FDTD_Op->GetNumberCells() << "\t% number of cells" << endl;
|
||||
stat_file << FDTD_Op->GetTimestep() << "\t% timestep (s)" << endl;
|
||||
stat_file << FDTD_Eng->GetNumberOfTimesteps() << "\t% number of iterations" << endl;
|
||||
stat_file << FDTD_Eng->GetNumberOfTimesteps()*FDTD_Op->GetTimestep() << "\t% total numercial time (s)" << endl;
|
||||
stat_file << FDTD_Eng->GetNumberOfTimesteps()*FDTD_Op->GetTimestep() << "\t% total numerical time (s)" << endl;
|
||||
stat_file << time << "\t% simulation time (s)" << endl;
|
||||
stat_file << (double)FDTD_Op->GetNumberCells()*(double)FDTD_Eng->GetNumberOfTimesteps()/time << "\t% speed (cells/s)" << endl;
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ public:
|
|||
int Get_PML_Size(int idx);
|
||||
void Set_Mur_PhaseVel(int idx, double val);
|
||||
|
||||
//! Get informations about external libs used by openEMS
|
||||
//! Get information about external libs used by openEMS
|
||||
static std::string GetExtLibsInfo(std::string prefix="\t");
|
||||
|
||||
//! Get welcome screen for openEMS
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"""
|
||||
Tutorials / CRLH_Extraction
|
||||
|
||||
Describtion at:
|
||||
Description at:
|
||||
http://openems.de/index.php/Tutorial:_CRLH_Extraction
|
||||
|
||||
Tested with
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"""
|
||||
Microstrip Notch Filter Tutorial
|
||||
|
||||
Describtion at:
|
||||
Description at:
|
||||
http://openems.de/doc/openEMS/Tutorials.html#microstrip-notch-filter
|
||||
|
||||
Tested with
|
||||
|
|
|
@ -86,7 +86,7 @@ if not post_proc_only:
|
|||
FDTD.Run(Sim_Path, verbose=3, cleanup=True)
|
||||
|
||||
### Postprocessing & plotting
|
||||
# get Gaussian pulse stength at frequency f0
|
||||
# get Gaussian pulse strength at frequency f0
|
||||
ef = UI_data('et', Sim_Path, freq=f0)
|
||||
|
||||
Pin = 0.5*norm(E_dir)**2/Z0 * abs(ef.ui_f_val[0])**2
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"""
|
||||
Rectangular Waveguide Tutorial
|
||||
|
||||
Describtion at:
|
||||
Description at:
|
||||
http://openems.de/doc/openEMS/Tutorials.html#rectangular-waveguide
|
||||
|
||||
Tested with
|
||||
|
@ -30,7 +30,7 @@ unit = 1e-6; #drawing unit in um
|
|||
# waveguide dimensions
|
||||
# WR42
|
||||
a = 10700; #waveguide width
|
||||
b = 4300; #waveguide heigth
|
||||
b = 4300; #waveguide height
|
||||
length = 50000;
|
||||
|
||||
# frequency range of interest
|
||||
|
|
|
@ -61,7 +61,7 @@ class nf2ff:
|
|||
self.dump_type = 0 # default Et/Ht
|
||||
self.dump_mode = 1 # default cell interpolated
|
||||
|
||||
self.freq = None # broadband recording by defualt
|
||||
self.freq = None # broadband recording by default
|
||||
if 'frequency' in kw:
|
||||
self.freq = kw['frequency']
|
||||
del kw['frequency']
|
||||
|
@ -147,13 +147,13 @@ class nf2ff:
|
|||
result = nf2ff_results(fn)
|
||||
if result.phi is not None:
|
||||
if not np.abs((result.r-radius)/radius)<1e-6:
|
||||
raise Exception('Radius does not match. Did you read an invalid chached result? Try "read_cached=False"')
|
||||
raise Exception('Radius does not match. Did you read an invalid cached result? Try "read_cached=False"')
|
||||
if not utilities.Check_Array_Equal(np.rad2deg(result.theta), self.theta, 1e-4):
|
||||
raise Exception('Theta array does not match. Did you read an invalid chached result? Try "read_cached=False"')
|
||||
raise Exception('Theta array does not match. Did you read an invalid cached result? Try "read_cached=False"')
|
||||
if not utilities.Check_Array_Equal(np.rad2deg(result.phi), self.phi, 1e-4):
|
||||
raise Exception('Phi array does not match. Did you read an invalid chached result? Try "read_cached=False"')
|
||||
raise Exception('Phi array does not match. Did you read an invalid cached result? Try "read_cached=False"')
|
||||
if not utilities.Check_Array_Equal(result.freq, self.freq, 1e-6, relative=True):
|
||||
raise Exception('Frequency array does not match. Did you read an invalid chached result? Try "read_cached=False"')
|
||||
raise Exception('Frequency array does not match. Did you read an invalid cached result? Try "read_cached=False"')
|
||||
return result
|
||||
|
||||
class nf2ff_results:
|
||||
|
|
|
@ -122,7 +122,7 @@ cdef class openEMS:
|
|||
def SetEndCriteria(self, val):
|
||||
""" SetEndCriteria(val)
|
||||
|
||||
Set the end critera value. E.g. 1e-6 for -60dB
|
||||
Set the end criteria value. E.g. 1e-6 for -60dB
|
||||
"""
|
||||
self.thisptr.SetEndCriteria(val)
|
||||
|
||||
|
@ -265,7 +265,7 @@ cdef class openEMS:
|
|||
def AddLumpedPort(self, port_nr, R, start, stop, p_dir, excite=0, **kw):
|
||||
""" AddLumpedPort(port_nr, R, start, stop, p_dir, excite=0, **kw)
|
||||
|
||||
Add a lumped port wit the given values and location.
|
||||
Add a lumped port with the given values and location.
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
@ -426,7 +426,7 @@ cdef class openEMS:
|
|||
Run the openEMS FDTD simulation.
|
||||
|
||||
:param sim_path: str -- path to run in and create result data
|
||||
:param cleanup: bool -- remove exisiting sim_path to cleanup old results
|
||||
:param cleanup: bool -- remove existing sim_path to cleanup old results
|
||||
:param setup_only: bool -- only perform FDTD setup, do not run simulation
|
||||
:param verbose: int -- set the openEMS verbosity level 0..3
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ class Port(object):
|
|||
:param excite: float -- port excitation amplitude
|
||||
:param priority: int -- priority of all contained primtives
|
||||
:param PortNamePrefix: str -- a prefix for all ports-names
|
||||
:param delay: float -- a positiv delay value to e.g. emulate a phase shift
|
||||
:param delay: float -- a positive delay value to e.g. emulate a phase shift
|
||||
"""
|
||||
def __init__(self, CSX, port_nr, start, stop, excite, **kw):
|
||||
self.CSX = CSX
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
///Deconstructor
|
||||
virtual ~AdrOp();
|
||||
///Set the current n-dim position, get 1-dim array position as return value
|
||||
/*!A position has to be set or all other methodes will case error! \n The methode will exit with error message if invalid position is set! \sa ErrorMsg */
|
||||
/*!A position has to be set or all other methods will case error! \n The method will exit with error message if invalid position is set! \sa ErrorMsg */
|
||||
unsigned int SetPos(unsigned int muiIpos, unsigned int muiJpos, unsigned int muiKpos=0, unsigned int muiLpos=0);
|
||||
|
||||
bool SetPosChecked(unsigned int muiIpos, unsigned int muiJpos, unsigned int muiKpos=0, unsigned int muiLpos=0);
|
||||
|
@ -60,25 +60,25 @@ public:
|
|||
|
||||
double GetIndexWidth(int ny, int index);
|
||||
double GetIndexCoord(int ny, int index);
|
||||
///Get the gird delta at the given index of direction ny. (if index<0 return negative value as index=0 would give, if index>=max-1 returns negative value as index=max-2 would give)
|
||||
///Get the grid delta at the given index of direction ny. (if index<0 return negative value as index=0 would give, if index>=max-1 returns negative value as index=max-2 would give)
|
||||
double GetIndexDelta(int ny, int index);
|
||||
|
||||
// double GetCellVolume(unsigned int uiCell);
|
||||
|
||||
unsigned int GetPosFromNode(int ny, unsigned int uiNode);
|
||||
///Set a shift in ny direction (e.g. 0 for i-direction)
|
||||
/*!Shift set by this methode will be ignored by methode GetPos*/
|
||||
/*!Shift set by this method will be ignored by method GetPos*/
|
||||
unsigned int Shift(int ny, int step);
|
||||
///Set a checked shift in ny direction (e.g. 0 for i-direction)
|
||||
/*!Shift set by this methode will be ignored by methode GetPos*/
|
||||
/*!Shift set by this method will be ignored by method GetPos*/
|
||||
bool CheckShift(int ny, int step);
|
||||
///Returns the current 1-dim position including shift by methode "Shift" + additional (transitory) shift
|
||||
///Returns the current 1-dim position including shift by method "Shift" + additional (transitory) shift
|
||||
unsigned int GetShiftedPos(int ny=-1, int step=0);
|
||||
///Reset shift set by "Shift"-methode
|
||||
///Reset shift set by "Shift"-method
|
||||
void ResetShift();
|
||||
///Iterates through AdrOp; --- obsolete ---
|
||||
unsigned int Iterate(int jump=1);
|
||||
///Retruns size of array
|
||||
///Returns size of array
|
||||
unsigned int GetSize();
|
||||
///Set mode to reflect by node
|
||||
/*!1D-example (6 nodes): \image html node_reflect.PNG order: 0,1,2,3,4,5,4,3,...*/
|
||||
|
|
|
@ -60,14 +60,14 @@ void ErrorMsg::Error(unsigned int nr,char *chAddMsg)
|
|||
if ((nr>0) && (nr<=NoMsg))
|
||||
{
|
||||
if (Msg[nr-1]!=NULL) fprintf(stderr,"%s",Msg[nr-1]);
|
||||
else fprintf(stderr,"unkown error occured!! Error code: %d exiting...",nr);
|
||||
else fprintf(stderr,"unknown error occurred!! Error code: %d exiting...",nr);
|
||||
if (chAddMsg!=NULL) fprintf(stderr,"%s",chAddMsg);
|
||||
getchar();
|
||||
exit(nr);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr,"unkown error occured!! Error code: %d exiting...",nr);
|
||||
fprintf(stderr,"unknown error occurred!! Error code: %d exiting...",nr);
|
||||
getchar();
|
||||
exit(nr);
|
||||
}
|
||||
|
@ -78,14 +78,14 @@ void ErrorMsg::Error(unsigned int nr,int addNr)
|
|||
if ((nr>0) && (nr<=NoMsg))
|
||||
{
|
||||
if (Msg[nr-1]!=NULL) fprintf(stderr,"%s",Msg[nr-1]);
|
||||
else fprintf(stderr,"unkown error occured!! Error code: %d exiting...",nr);
|
||||
else fprintf(stderr,"unknown error occurred!! Error code: %d exiting...",nr);
|
||||
fprintf(stderr,"%d",addNr);
|
||||
getchar();
|
||||
exit(nr);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr,"unkown error occured!! Error code: %d exiting...",nr);
|
||||
fprintf(stderr,"unknown error occurred!! Error code: %d exiting...",nr);
|
||||
getchar();
|
||||
exit(nr);
|
||||
}
|
||||
|
@ -93,6 +93,6 @@ void ErrorMsg::Error(unsigned int nr,int addNr)
|
|||
|
||||
void ErrorMsg::ownError(void)
|
||||
{
|
||||
fprintf(stdout," Error occured by using Error Message class!! ... exiting...");
|
||||
fprintf(stdout," Error occurred by using Error Message class!! ... exiting...");
|
||||
exit(-1);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
ErrorMsg(unsigned int NoMessage=0);
|
||||
///Deconstructor
|
||||
virtual ~ErrorMsg();
|
||||
///Methode for defining error messages
|
||||
///Method for defining error messages
|
||||
/*! \param nr Number of defining error message \param *Message Set error message string \sa Error */
|
||||
void SetMsg(unsigned int nr, const char *Message);
|
||||
///Call an error message. Will exit the program!
|
||||
|
|
|
@ -455,7 +455,7 @@ bool HDF5_File_Writer::WriteAtrribute(std::string locName, std::string attr_name
|
|||
hid_t attribute_id = H5Acreate(loc, attr_name.c_str(), mem_type, dataspace_id, H5P_DEFAULT, H5P_DEFAULT);
|
||||
if (attribute_id<0)
|
||||
{
|
||||
cerr << "HDF5_File_Writer::WriteAtrribute: Error, failed to create the attrbute" << endl;
|
||||
cerr << "HDF5_File_Writer::WriteAtrribute: Error, failed to create the attribute" << endl;
|
||||
H5Sclose(dataspace_id);
|
||||
H5Oclose(loc);
|
||||
H5Fclose(hdf5_file);
|
||||
|
@ -465,7 +465,7 @@ bool HDF5_File_Writer::WriteAtrribute(std::string locName, std::string attr_name
|
|||
/* Write the attribute data. */
|
||||
if (H5Awrite(attribute_id, mem_type, value)<0)
|
||||
{
|
||||
cerr << "HDF5_File_Writer::WriteAtrribute: Error, failed to write the attrbute" << endl;
|
||||
cerr << "HDF5_File_Writer::WriteAtrribute: Error, failed to write the attribute" << endl;
|
||||
H5Aclose(attribute_id);
|
||||
H5Sclose(dataspace_id);
|
||||
H5Oclose(loc);
|
||||
|
|
|
@ -267,16 +267,16 @@ int SAR_Calculation::FindFittingCubicalMass(unsigned int pos[3], float box_size,
|
|||
return 0;
|
||||
}
|
||||
|
||||
// if no valid or finally invalid cube is found, calculate an alternaive cube size
|
||||
// if no valid or finally invalid cube is found, calculate an alternative cube size
|
||||
if (mass_iterations==0)
|
||||
{
|
||||
// on first interation, try a relative resize
|
||||
// on first iteration, try a relative resize
|
||||
old_box_size=box_size;
|
||||
box_size*=pow(m_avg_mass/mass,1.0/3.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// on later interations, try a newton approach
|
||||
// on later iterations, try a newton approach
|
||||
float new_box_size = box_size - (mass-m_avg_mass)/(mass-old_mass)*(box_size-old_box_size);
|
||||
old_box_size = box_size;
|
||||
box_size = new_box_size;
|
||||
|
|
|
@ -63,7 +63,7 @@ std::vector<unsigned int> AssignJobs2Threads(unsigned int jobs, unsigned int nrT
|
|||
}
|
||||
|
||||
if (jobs>0)
|
||||
std::cerr << "AssignJobs2Threads: Error, " << jobs << " remain to be assigned, this should not have happend..." << std::endl;
|
||||
std::cerr << "AssignJobs2Threads: Error, " << jobs << " remain to be assigned, this should not have happened..." << std::endl;
|
||||
|
||||
if (RemoveEmpty)
|
||||
{
|
||||
|
|
|
@ -70,7 +70,7 @@ void VTK_File_Writer::SetMeshLines(double const* const* lines, unsigned int cons
|
|||
vtkRectilinearGrid* RectGrid = dynamic_cast<vtkRectilinearGrid*>(m_GridData);
|
||||
if (RectGrid==NULL)
|
||||
{
|
||||
cerr << "VTK_File_Writer::SetMeshLines: Error, grid invalid, this should not have happend! " << endl;
|
||||
cerr << "VTK_File_Writer::SetMeshLines: Error, grid invalid, this should not have happened! " << endl;
|
||||
exit(1);
|
||||
}
|
||||
RectGrid->SetDimensions(count[0],count[1],count[2]);
|
||||
|
@ -97,7 +97,7 @@ void VTK_File_Writer::SetMeshLines(double const* const* lines, unsigned int cons
|
|||
vtkStructuredGrid* StructGrid = dynamic_cast<vtkStructuredGrid*>(m_GridData);
|
||||
if (StructGrid==NULL)
|
||||
{
|
||||
cerr << "VTK_File_Writer::SetMeshLines: Error, grid invalid, this should not have happend! " << endl;
|
||||
cerr << "VTK_File_Writer::SetMeshLines: Error, grid invalid, this should not have happened! " << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue